| The electric power industry is the most important source of energy for social life.Accurate load forecasting is a powerful guarantee for the dynamic balance between power generation and power consumption,and it is also the premise to ensure the efficient operation of power generation,transmission and distribution.A good prediction model is an important foundation to ensure the accuracy of the model.Based on historical data and related factors such as meteorology and date,this paper introduces self-attention mechanism(Self Attention Mechanism,SA)on the basis of(Temporal Convolutional Network,TCN)to quantify the influence of meteorological factors on load,highlight the role of key meteorological factors,and capture the internal correlation of data.A power load forecasting method based on improved Transformer and Temporal Convolutional Network is proposed.First of all,in order to solve the problem that abnormal data affect the prediction accuracy,a multi-distance fusion local abnormal factor(Local Outlier Factor,LOF)outlier detection algorithm is proposed.In view of the limitation of insufficient single distance in LOF algorithm,the comprehensive influence of multiple distances is introduced,and the exponential function is used to map the distance between samples to prevent the problem of infinity of local reachable density region.In order to fully consider the periodic characteristics and holiday characteristics of load series,the influence of date coding description characteristics is introduced.The influence of different nearest neighbor K value is verified by two actual data experiments,and the optimal K value is determined to construct an anomaly detection model for load data.Secondly,the introduction of window coding based on the original Transformer model can not only solve the problem of long time series processing,but also make better use of the contextual relationship of data,and reduce the running time of the model.At the same time,an efficient two-stage confrontation training method is added,and two decoders are used to reconstruct the output.In the second stage,the deviation produced in the first stage is magnified,the input with larger deviation is given a higher degree of activation,and a more accurate preliminary prediction result is obtained.The prediction advantage of the improved Transformer model is confirmed by comparing with TCN on two data sets.Finally,the TCN-SA error correction model is constructed to correct the errors caused by the improved Transformer model to pay attention to the key influencing factors such as meteorology and date.The final prediction value is obtained by adding the preliminary prediction results produced by the improved Transformer model and the error correction results produced by the TCN-SA model.Through the forecasting experiments on the actual load data of the above two areas,the analysis of the experimental results shows that the model proposed in this paper has high accuracy of short-term load forecasting. |