With the gradual development of consumer behavior analysis, abnormal electricity consumption analysis has become a hot Topic in the analysis of mining data. At present, the abnormal power analysis method based on manual verification and judgment is inefficient and has a low hit rate. In this paper, the mean shift clustering algorithm is adopted to cluster the electricity consumption and the fluctuation of electricity consumption respectively and the residents with large electricity consumption and large fluctuation of electricity consumption are selected as suspected abnormal electricity consumption. Then, based on the decision tree model of xgboost, the users suspected of abnormal electricity consumption are filtered twice to realize the automatic study and judgment of electricity consumption behavior and make full use of the massive data resources of the power grid. The value of the source greatly improves the efficiency of verification and helps power enterprises to recover considerable economic losses.