Firstly, the influence of user behavior on the distribution network at different time scales is analyzed, and the multi-temporal and spatial variation law and probability estimation method of user habit volatility are used to establish a distribution network loss model based on seasonal changes. Then, according to the influence of power quality problem on distribution network loss, the calculation methods of three-phase unbalance, voltage deviation and harmonic parameters of distribution network are studied, and a distribution network loss model considering power quality is established. Finally, according to the time series and nonlinear characteristics of power quality data in a long time span, a power quality prediction method for distribution network based on clustering and long short-term memory network is proposed. Algorithms are used to predict distribution network losses and quantify the impact of electricity consumption habits on distribution network losses.