With the proposal of the dual-carbon economy, smart grids are developing in the direction of energy conservation and emission reduction, and the abnormal power consumption of users has caused serious loss of power resources. Aiming at the problems of low accuracy and slow operation efficiency of traditional abnormal power consumption detection methods, a lightGBM model combined with an improved long short-term memory network model is proposed for abnormal power consumption detection. Anomaly detection is carried out by combining sampling and lightGBM model, and abnormal electricity consumption category is given by improving long short-term memory network model. The advantages of the proposed method are analyzed through experiments. The results show that, compared with traditional detection methods, the proposed method can detect abnormal users quickly and effectively, with a detection accuracy of 98.64%, meanwhile, the abnormal data is effectively classified, and the comprehensive classification accuracy rate is 96.60%, which provides a certain reference for the development of anomaly detection technology.