Intelligent lightning protection for power grid equipment is a good combination of artificial intelligence and power work.This paper uses a single lightning detection data to establish a lightning prediction model based on the XGBoost algorithm and gridding ideas.The main conclusions are as follows:① The model only relies on lightning detection data to achieve non-fixed-point lightning hierarchical early warning for each grid around the detector.The time advance is 30 minutes,the grid size is 5km*5km,and the prediction effect is good.②The prediction accuracy of the model can reach 78.6%,the prediction recall rate can reach 65.6%,and the F1 value can reach 71.5%.③ Reducing the grid can improve the prediction accuracy to a certain extent,but the false negative rate will also increase.The two indicators are contradictory and unified;when the grid is expanded to 25 grids,a large number of unnecessary feature values are added,resulting in model prediction effect reduced.The model in this paper improves the limitations of fixed-point prediction of the current lightning prediction model and adds hierarchical early warning,which has practical significance in active lightning protection mode.