Short-term load prediction method based on self-attention encoder and time convolutional network

By using self-attention encoders and temporal convolutional networks in short-term power load forecasting, combined with feature screening and fusion modules, the problem of multi-dimensional input data correlation processing in the existing technology is solved, and higher prediction accuracy and efficiency are achieved. Especially, information loss and structural disorder are avoided when processing long time series.

CN118554422APending Publication Date: 2024-08-27HARBIN UNIV OF SCI & TECH

Patent Information

Application Number
CN202410556800.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-05-07
Publication Date
2024-08-27

AI Technical Summary

Technical Problem

Existing short-term power load forecasting methods have limitations in processing the correlation of multi-dimensional input data. It is difficult to use multi-dimensional load-related information to optimize the accuracy of time series feature extraction of load data. Especially when processing long time series, sequence feature information is prone to be lost. and the problem of structural information disorder among data.

Method used

A short-term power load forecasting method based on self-attention encoder and temporal convolutional network is used to analyze the correlation between load sequence and auxiliary features through the maximum information number index, select strong correlation features as input, and use the TCN module to extract load trends and cycles characteristics, combined with the multi-head self-attention mechanism to mine auxiliary information features, map different features to the same dimension through the feature fusion module, and input them into the Bi-LSTM model for prediction.

Benefits of technology

The accuracy of short-term power load forecasting is improved. The input features are optimized through feature screening and fusion, which improves the model's ability to handle multi-dimensional influencing factors and achieves higher forecast accuracy and training efficiency. The experimental results show that in the load data of an Australian city It has higher prediction accuracy than other models.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118554422A
    Figure CN118554422A
Patent Text Reader

Abstract

The invention discloses a short-term load prediction method based on a self-attention encoder and a time convolution network, and the method comprises the steps: selecting a high-correlation feature vector as input through the optimization screening of multi-dimensional input parameters, and constructing a short-term power load prediction model. According to the model, a load feature encoder is designed based on a TCN and used for extracting trend and periodic features contained in a load, and an auxiliary information encoder is constructed based on a multi-head self-attention mechanism to mine potential coupling among auxiliary information of all dimensions. Meanwhile, a feature fusion module is constructed, the feature fusion module is utilized to establish a relation between auxiliary information features and load features in a high-dimensional space, feature vectors of a time sequence are constructed and input into a prediction decoder, a prediction decoder module based on a Bi-Lstm unit is designed, and a load prediction value is output by training a prediction decoder network. And performing short-term power load prediction. The short-term prediction precision of the power load data can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to a short-term load forecasting method, and in particular to a short-term power load forecasting method based on a temporal convolutional network (TCN) and a self-attention encoder based on feature screening. Background Art

[0002] Load forecasting is an important guarantee for the safe operation and accurate planning of power systems, and an important support for building efficient, flexible and robust power systems. In particular, short-term power load forecasting with a forecasting step of several hours to one week can not only provide a basis for the daily production and operation and maintenance plans of power grid companies, but also contribute to the efficient dispatch and allocation of power resources. However, due to the diversity of factors affecting power load, power load has strong randomness and volatility while having trends and periodicity, which increases the difficulty of short-term power load forecasting.

[0003] At present, the methods used for short-term power load forecasting can be divided into two categories: traditional forecasting methods and machine learning methods. Traditional forecasting methods include multivariate linear regression, Kalman filtering, seasonal autoregressive differential moving average, etc. These methods have simple structures and fast forecasting speeds, and can predict the changing trends of future loads based on historical load series. However, the forecasting models based on the above methods rely on historical load data with obvious change patterns, and lack the ability to handle complex nonlinear relationships between other characteristic factors. To this end, researchers have introduced machine learning methods to improve the ability of load forecasting models in processing nonlinear time series data forecasting. Among them, load forecasting algorithms based on models such as support vector regression, random forest and XGBoost have achieved great success. However, such models have certain limitations in processing the correlation of multidimensional input data, and it is difficult to use multivariate load-related information to optimize the accuracy of load data time series feature extraction.

[0004] In recent years, deep learning methods have developed rapidly, providing new ideas for short-term power load forecasting. The load forecasting model based on convolutional neural network (CNN) extracts hidden features from input data through convolution and pooling operations, and captures seasonal cycles to perform load forecasting. The load forecasting model based on long short-term memory (LSTM) network achieves efficient time series feature extraction of load data by adding gated units, and solves the gradient vanishing problem of traditional recurrent neural networks. In order to reduce the model's requirements for data sets and improve model training efficiency, researchers introduced gated recurrent units (GRU) to simplify traditional recurrent neural networks. It has a simpler internal structure and faster convergence speed, which can effectively shorten the model training time while ensuring high prediction accuracy. However, when the time series processed is long, RNN variant structures such as LSTM and GRU are prone to sequence feature information loss and disordered structural information between data.

[0005] In order to further improve the accuracy of ultra-short-term load forecasting, it is also necessary to consider the impact of multi-dimensional input characteristic parameters on short-term power load forecasting, and further analyze and optimize the multi-dimensional input characteristic parameters. Summary of the invention

[0006] In order to improve the accuracy of ultra-short-term load forecasting in distribution networks, accurately extract auxiliary information features that are potentially correlated with power loads, and improve the accuracy of short-term power load forecasting, the present invention provides a short-term load forecasting method based on a self-attention encoder and a temporal convolutional network. The method constructs a short-term power load forecasting model based on TCN and self-attention encoder, which can improve the short-term prediction accuracy of power load data.

[0007] The objective of the present invention is achieved through the following technical solutions:

[0008] A short-term load forecasting method based on self-attention encoder and temporal convolutional network includes the following steps:

[0009] Step 1: Load data characteristics analysis:

[0010] Taking real power load data as the data set, the maximum information coefficient (MIC) indicator analysis is used to analyze the correlation between the load sequence in the data set and the auxiliary features of different dimensions, and the strongly correlated features are selected as the input of the short-term power load forecasting model.

[0011] Step 2: Construction of short-term power load forecasting model:

[0012] Step 21: Design load characteristic encoder E based on TCN module l Extract the trend and periodic characteristics contained in the load from the historical load series e ;

[0013] Step 2. Design auxiliary information encoder E based on self-attention mechanism a To obtain relevant auxiliary information features f a :

[0014] Step 221: Use the fully connected layer to transform the auxiliary information feature f a Mapped to a feature vector F with dimension d;

[0015] Step 222: Generate a position vector P with a dimension of d using a position encoder;

[0016] Step 223: Add the feature vector F and the position vector P as the auxiliary information encoder E a The input of the auxiliary information encoder E a It consists of N submodules with the same structure. Each submodule consists of a multi-head attention network layer and a feedforward neural network layer. The two sublayers are connected by residuals, and the output dimension of each sublayer is the same. In each submodule, the input vector first passes through the multi-head attention network layer to obtain a weighted feature vector A, and then the weighted feature vector A is sent to a feedforward neural network composed of a ReLU activation function and a linear activation function.

[0017] Step 2: Use feature fusion module F m (ie: fully connected layer) load feature encoder E l The extracted periodic features f e and auxiliary information encoder E a The extracted auxiliary information feature f a After being mapped to feature vectors of the same dimension, they are directly added together to obtain the fused feature f total ,The specific operations of feature fusion are as follows:

[0018] f total =Concat(f e ,f a )

[0019] Among them, f total Represents the fused features;

[0020] Step 24: Construct a predictive decoder D based on the Bi-LSTM model p, learn the time dependency of the feature vector and map it to the final load forecast result. The BI-LSTM model is composed of the forward LSTM model and the backward LSTM model. The output of the BI-LSTM layer is expressed as:

[0021] h(t)=[o pre ,o pos ]

[0022] Where: h is the result of concatenating the forward and backward outputs of the BI-LSTM model; o pre ,o pos They are the outputs of forward LSTM and backward LSTM respectively;

[0023] Step 3: Short-term power load forecast:

[0024] Step 31: Extract load data x and auxiliary feature data x* from input data X respectively, load feature encoder E l Take the load data x as input and extract the hidden trend and periodic features f in the load sequence e , directly tap the potential laws contained in the load;

[0025] Step 32: Auxiliary Information Encoder E a Extract the auxiliary information feature f contained in the auxiliary feature data x* a , and ensure the effectiveness of feature information mining;

[0026] Step 3: In order to make full use of the coupling relationship between load data and related multi-dimensional auxiliary feature factors, the feature fusion module F m The load characteristic encoder E l The extracted periodic features f e and auxiliary information encoder E a The extracted auxiliary information feature f a Perform feature fusion;

[0027] Step 3 and 4: Pass the fused feature vector into the prediction decoder D based on the Bi-Lstm model p , mining the time dependency contained in the fused feature vector and giving the final load forecasting result.

[0028] Compared with the prior art, the present invention has the following advantages:

[0029] 1. The present invention proposes a short-term power load forecasting model composed of a time convolutional network and an auxiliary encoder based on feature screening, which realizes comprehensive mining and prediction of load from two perspectives: input feature construction and prediction model optimization. In terms of input feature construction, by analyzing and screening the multi-dimensional input data of short-term power load forecasting, high-correlation feature parameters are selected as the input of the auxiliary encoder to improve the accuracy of load forecasting. In terms of prediction model optimization, the load feature encoder designed based on TCN extracts trend and periodic feature vectors from the historical load sequence, and uses an auxiliary information encoder based on the self-attention mechanism to perform feature mining on the multi-dimensional influencing factors of the load, such as ambient temperature, humidity, etc., accurately mining the features of factors with potential correlation with the load, and introducing a feature fusion module to map different features to the same subspace, and finally sending the fused joint feature vector to the prediction decoder with Bi-Lstm as the core to mine the temporal dependency contained therein and output the final load forecasting result. Among them, the TCN module uses multi-layer convolution with different receptive fields (convolution kernel sizes) to capture features on different time scales, which enables the model to focus on short-term and long-term trends at the same time. By stacking these convolutional layers, TCN can effectively capture the complex structure in the input sequence. Compared with recurrent neural networks (RNNs), TCN can efficiently process input sequences in parallel because convolution operations do not involve time dependencies, which makes its training and reasoning faster. The auxiliary information encoder based on the self-attention mechanism can extract the load-related feature encoding in the auxiliary information through weight allocation, fully explore the load trend related information in different subspaces, that is, the auxiliary information of load prediction, and finally realize the accurate prediction of power load through feature fusion module and prediction decoder.

[0030] 2. A load data set of a city in Australia is used as experimental data. The experimental results show that the short-term power load model based on feature screening proposed in the present invention has higher prediction accuracy than other prediction models. At the same time, the ablation experiment verifies that each module in the model proposed in the present invention has a positive gain, and all modules have made important contributions to the final performance of the short-term power load forecasting model. BRIEF DESCRIPTION OF THE DRAWINGS

[0031] Figure 1 is the result of feature correlation analysis;

[0032] Figure 2 It is the short-term power load forecasting model structure;

[0033] Figure 3 It is the TCN network architecture;

[0034] Figure 4 This is the causal convolution structure diagram;

[0035] Figure 5 It is the structure diagram of the dilated convolution;

[0036] Figure 6 is the self-attention encoder architecture;

[0037] Figure 7 Schematic diagram of feature fusion;

[0038] Figure 8 It is an LSTM structure;

[0039] Fig. 9 Combine prediction curves for different input features;

[0040] Fig.10 To compare the model proposed in the present invention with other models;

[0041] Fig.11 Comparison of ablation test results of each model. DETAILED DESCRIPTION

[0042] The technical solution of the present invention is further described below in conjunction with the accompanying drawings, but is not limited thereto. Any modification or equivalent replacement of the technical solution of the present invention without departing from the spirit and scope of the technical solution of the present invention should be included in the protection scope of the present invention.

[0043] The present invention provides a short-term load forecasting method based on a self-attention encoder and a temporal convolutional network. The method uses real power load data as a data set, selects a high-correlation feature vector as input by optimizing and screening multi-dimensional input parameters, and constructs a short-term power load forecasting model based on TCN and a self-attention encoder. The model designs a load feature encoder based on TCN to extract the trend and periodic characteristics contained in the load itself. The auxiliary information encoder constructed based on a multi-head self-attention mechanism can automatically select and enhance the extraction of features with high correlation, and explore the potential coupling between auxiliary information of each dimension. At the same time, a feature fusion module is constructed, and the feature fusion module is used to establish the connection between the auxiliary information features and the load's own features in a high-dimensional space, construct the feature vector of the time series and input it into the prediction decoder, and design a prediction decoder module based on the Bi-Lstm unit. The load prediction value is output by training the prediction decoder network to perform short-term power load forecasting. The specific steps are as follows:

[0044] 1. Analysis of load data characteristics

[0045] In order to fully analyze the degree of mutual influence between short-term load and other auxiliary information, the present invention introduces the maximum information coefficient (MIC) index to analyze the correlation between current load data and each auxiliary variable, and selects strong correlation features as the input of the short-term power load forecasting model. MIC can measure the linear and nonlinear correlation between two variables, overcome the disadvantage that mutual information is inconvenient to calculate continuous variables, and has fairness and extensiveness.

[0046] For a set of two-dimensional variables (X, Y), divide it into a grid of x columns and y rows on the plane. Then, under the binary data set D, the formula of MIC is as follows:

[0047]

[0048]

[0049] Among them, M MIC (X, Y) is the maximum information number; N is the number of samples, B(N) is the function of the number of samples, generally B(N) = N 0.6 ;I * (D,x,y) is the maximum mutual information of the two-dimensional variables under the data set D.

[0050] MIC is essentially a normalized maximum mutual information with a value range of [0,1]. The larger the MIC value between two variables, the stronger the correlation between the two variables, and vice versa. According to the above MIC theory, the load sequence in the selected data set is subjected to correlation analysis with auxiliary features of different dimensions. The present invention selects 0.3 as the threshold of MIC, that is, it is considered that when the MIC value range is less than 0.3, it is weakly correlated, and when it is greater than 0.3, it is strongly correlated. The auxiliary features to be selected in the present invention include date and time features, dry bulb temperature, dew point temperature, wet bulb temperature, humidity, and electricity price.

[0051] The results of feature correlation analysis are as follows Figure 1 As shown. Figure 1 It can be seen from the simulation results that the correlation between dew point temperature and electricity price and power load is poor, and dry bulb temperature and warm bulb humidity are highly correlated parameters of power load data.

[0052] 2. Short-term power load forecasting model

[0053] 1. Overall framework

[0054] There are two characteristics of the short-term power load forecasting model. On the one hand, the power consumption habits of power users have certain regularity and periodic changes in the region, and the power load shows certain trends and periodic characteristics. On the other hand, short-term power loads are usually affected by multivariate characteristic factors and have obvious non-stationary and volatile characteristics. In order to effectively mine multivariate information features that are potentially associated with load trends and extract trend and periodic characteristics in load sequences, the present invention proposes a short-term power load forecasting model based on a load feature encoder based on a TCN model and an auxiliary information encoder based on a multi-head self-attention mechanism. First, a load feature encoder is designed based on a TCN module. The TCN module uses multi-layer convolutions with different receptive fields (convolution kernel sizes) to capture features on different time scales, which enables the model to focus on short-term and long-term trends at the same time. By stacking these convolution layers, TCN can effectively capture the complex structure in the input sequence. Secondly, a multi-head self-attention mechanism is introduced, and an auxiliary information encoder is designed to mine the relationship between multivariate characteristic factors and load data. These features that are potentially correlated with power loads are used as auxiliary features for load forecasting, and are fused with load features to form joint features for load forecasting, further improving the accuracy of short-term load forecasting.

[0055] The specific implementation process of the above research is as follows Figure 2 First, the load data x and auxiliary feature data x* are extracted from the input data X, where the load feature encoder E l Taking load data as input, we extract the hidden trends and periodic features in the load sequence and directly explore the potential laws contained in the load. Secondly, the auxiliary information encoder E with multi-head self-attention mechanism as the core a Extract the auxiliary information features contained in the auxiliary feature data and ensure the effectiveness of feature information mining; secondly, in order to make full use of the coupling relationship between load data and related multi-dimensional auxiliary feature factors, the feature fusion module F m The two extracted feature vectors are fused; finally, the fused feature vector is passed to the prediction decoder D based on the Bi-Lstm model. p , mining the time dependency contained in the fused feature vector and giving the final load forecasting result.

[0056] 2. Model construction

[0057] (1) Load characteristic encoder

[0058] In order to make full use of the characteristic information of load data, explore the trend and periodicity of load data, and improve the prediction accuracy, the present invention uses the TCN model to obtain the characteristic vector representing the load data for subsequent prediction. TCN is a neural network model that integrates dilated causal convolution (DCC) and residual connection (RC). Its network architecture is as follows Figure 3 shown.

[0059] Figure 3 The network architecture described in this paper consists of an input layer, multiple residual blocks, and a stacked output layer. Causal convolution can effectively avoid the future information leakage problem caused by convolution operations in traditional convolutional neural networks. Its structure is as follows: Figure 4 shown.

[0060] Based on causal convolution, DCC increases the filter size K and the expansion coefficient d to accept a wider range of input information and increase the receptive field. In addition, each layer of the network in DCC uses filters of the same size to achieve parallel computing and improve computing efficiency. The structure of DCC is as follows: Figure 5 As shown, the dilated convolution operation is as follows:

[0061]

[0062] Where: F(T) represents the dilated convolution operation, f(i) is the filter function; x T-di is the input value corresponding to the moment di shifted from moment T to the past.

[0063] In addition to adjusting the filter size and expansion coefficient mentioned above, the receptive field can also be increased in TCN by increasing the number of layers. However, deep network models with too many layers are unstable during training and are prone to gradient vanishing. The RC structure in TCN allows the error of the previous layer to be directly transmitted to the next layer, which can effectively solve this problem. RC consists of two branches. The first branch transforms the input, and the second branch performs 1×1 convolution on the input. The output results of the two branches are added as the final output of RC. The specific calculation formula of RC is:

[0064] X h =δ(G(X h-1 )+X h-1 ) (4)

[0065] Where: δ(·) is the activation function; G(·) represents the transformation of DCC, weight normalization, activation function, and random dropout; X h-1 is the output of residual block h-1; X h is the output of the residual block h.

[0066] In formula (4), the activation function uses the ReLU function with good convergence, and the random inactivation layer is used for regularization to prevent overfitting problems in deep networks.

[0067] In summary, DCC can capture the long-term dependencies between power load and characteristic variable sequences in parallel, and the RC structure can effectively avoid the gradient vanishing problem in the load forecasting process. Compared with recurrent neural networks and convolutional neural networks, TCN has fewer parameters, lower training difficulty, and requires a smaller data scale. Therefore, the present invention adopts a load forecasting model based on TCN.

[0068] (2) Auxiliary Information Encoder

[0069] Since load forecasting needs to extract auxiliary information contained in multi-dimensional feature factors, the input information is very complex, and the multi-head self-attention mechanism can focus on different parts of the input information and give more weight to important information. Therefore, the present invention designs an auxiliary information encoder E based on the self-attention mechanism. a To obtain relevant auxiliary information features f a , the specific structure of the auxiliary information encoder is as follows Figure 6 As shown in the figure. First, the auxiliary information features are mapped into a feature vector F with a dimension of d using a fully connected layer. Then, a positional encoder is used to generate a position vector P with a dimension of d. The feature vector F and the position vector P are added together as the input of the encoder. The encoder consists of N submodules with the same structure. Each submodule consists of a multi-head attention network layer and a feedforward neural network layer. The two sublayers are connected by residuals, and the output dimensions of each sublayer are the same. In each submodule, the input vector first passes through the multi-head attention network layer to obtain a weighted feature vector A. The weighted feature vector A is then sent to a feedforward neural network composed of a ReLU activation function and a linear activation function.

[0070] Ensure that the model can focus on the most important part of the multidimensional feature factors, as shown in formula (5):

[0071] f a =E a (x t )(5)

[0072] The feedforward neural network here consists of two linear transformations and is activated using the ReLu function, which is mainly used to enhance the nonlinear fitting ability of the model and can be expressed as:

[0073] FFN(x)=max(0,W1x+b1)W2+b2(6)

[0074] Where W1 and W2 represent the weights of the two-layer neural network, and b1 and b2 represent the corresponding bias terms.

[0075] Because residual connections and normalization layers are used between the two sub-layers to alleviate the neural network decay problem and ensure the stability of data feature distribution, the actual output of each sub-layer is:

[0076] output=layernorm(x+sublayer(x))(7)

[0077] Where x represents the input of each sublayer, layernorm represents the normalization layer, and sublayer represents the current sublayer neural network.

[0078] (3) Feature Fusion Module

[0079] In order to make full use of the coupling relationship between load data and related multi-dimensional characteristic factors to improve the prediction accuracy, the present invention constructs a feature fusion module to extract the feature f from the load feature encoder. e and the auxiliary information feature f extracted by the auxiliary information encoder a Combined for subsequent load forecasting, such as Figure 7 shown.

[0080] Formula (8) is used to describe the specific operation of feature fusion:

[0081] f total =Concat(f e ,f a ) (8)

[0082] Among them, f total Represents the fused features.

[0083] (4) Prediction Decoder

[0084] The feature vectors extracted by the load feature encoder and the auxiliary information encoder are relatively complex and also contain time series features. Therefore, the present invention constructs a prediction decoder D based on Bi-LSTM p , learn the time dependency of the feature vector and map it to the final load forecast result. The BI-LSTM model is composed of LSTM, so the LSTM model will be introduced next. The LSTM model structure is as follows Figure 8 shown.

[0085] LSTM memory units can learn long-term and short-term dependency information, and update and utilize information through input gates, forget gates, and output gates. The calculation formulas for each LSTM gating unit are:

[0086] f t =σ(w f [h t-1 ,x t ]+b f ) (9)

[0087] i t =σ(w i [h t-1 ,x t ]+b i ) (10)

[0088]

[0089]

[0090] o t =σ(w o [h t-1 ,x t ]+b o ) (13)

[0091] Where: x t ,h t are input and output respectively; i t ,f t ,o t are the input gate, forget gate and output gate functions respectively; σ, tanh are the Sigmoid activation function and the hyperbolic tangent activation function respectively; w f ,b f are the forget gate weight matrix and bias vector respectively; w i ,b i are the input gate weight matrix and bias vector respectively; w c ,b c are the output gate weight matrix and bias vector respectively; are the candidate values ​​and the new cell states, respectively.

[0092] The BI-LSTM model is composed of a forward LSTM model and a backward LSTM model, which can achieve two-way learning of context information. The output of the final BI-LSTM layer is expressed as:

[0093] h(t)=[o pre ,o pos ](14)

[0094] Where: h is the result of concatenating the forward and backward outputs of the BI-LSTM model; o pre ,o pos They are the outputs of the forward LSTM and backward LSTM, respectively.

[0095] 3. Data Preprocessing

[0096] 1. Dataset

[0097] The present invention uses multidimensional load data from a certain region of Australia from January 1, 2006 to September 1, 2009. The data is sampled in units of 30 minutes, and 48 points are collected every day. The time series data is sequentially divided according to the ratio of 3:1:1, the first 60% of the data is used as the training set, and the last 40% of the data is divided into a validation set and a test set, wherein the validation set is used for parameter tuning during the training process, and the test set is used as the final model evaluation and will not participate in the training process. The present invention uses a sliding window method to construct the input and output of the prediction model, that is, the input is a feature matrix of a specified sliding window width, the output is the power at a certain moment, and the sliding step length of the sliding window is 1. The sliding window width selected by the present invention is 96, and the prediction task is a single-step prediction, that is, predicting the power value of the next 30 minutes in advance.

[0098] 2. Data normalization

[0099] In order to process inputs of different sizes and dimensions and enhance data stability, the input data is normalized. The normalization operation is shown in formula (15):

[0100]

[0101] Among them, x n represents the normalized data, x o represents the original data, x mean represents the average value of the input data, x max and x min Respectively represent the maximum and minimum value of an attribute.

[0102] 3. Evaluation Metrics

[0103] In order to test the effectiveness of the model proposed in the present invention and evaluate the prediction effect, the present invention selects mean absolute error (MAE), mean absolute percentage error (MAPE), and root mean square error (RMSE) as evaluation indicators. The calculation formulas of different evaluation indicators are as follows:

[0104]

[0105]

[0106]

[0107] Among them, y i Indicates the actual value, Represents the predicted value, and N represents the number of samples in the test set.

[0108] 4. Example Analysis

[0109] 1. Experimental setup

[0110] The computer parameters used in the experiment are: CPU model is AMD EPYC 7763, GPU model is NVIDIA A6000, memory is 32GB RAM; the program is written in Python, and uses extension libraries such as scikit-learn, Keras and TensorFlow. Use tensorflow to establish the model proposed in the present invention and the selected baseline model, the training round Epochs is set to 300, the batch data volume is set to 50 and combined with the EarlyStopping early stopping mechanism to improve the training efficiency, and the loss function selects the root mean square error with the Adam optimizer to adjust the model parameters in the validation set data. The main parameter settings of each prediction model are shown in Table 1.

[0111] Table 1 Main parameter settings of each model

[0112]

[0113]

[0114] In order to verify the performance advantages of the model proposed in the present invention, GRU, SVR, CNN-LSTM, and XGBBoost are selected as baseline models, among which GRU and CNN-LSTM are improved recurrent neural networks and are classic time series prediction models; XGBBboost and SVR are classic machine learning models and have performed well in various data mining competitions.

[0115] 2. Comparative experiment

[0116] (1) Comparison of different auxiliary information combinations

[0117] According to the MIC value obtained by the correlation analysis between the load and auxiliary information of different dimensions, the correlation ranking of each dimension with the load forecast can be formed. The present invention attempts to compare and analyze the load forecasting results under different combinations of auxiliary information dimensions, evaluate the differences in load forecasting accuracy under different dimensional volumes, and provide data support for the application optimization process of the model. The selected evaluation indicators are MAPE, RMSE and MAE, and comparative experiments are carried out based on the short-term power load forecasting model proposed in the present invention. Table 2 shows the comparison of prediction errors of different input feature combinations on the test set. The results show that by screening and optimizing the input feature parameters, that is, selecting the feature combination of dry-bulb temperature, wet-bulb temperature and dew point temperature as auxiliary information, the combined model prediction RMSE can be reduced by a maximum of 35.22%, and MAPE can be reduced by a maximum of 0.47%. Fig. 9Shown are the power load forecast curves for a randomly selected day under different input feature combinations in the test set.

[0118] Table 2 Error comparison of different input feature combinations

[0119]

[0120]

[0121] The experimental results show that when the dimension of the input auxiliary information increases, the accuracy of load forecasting is improved to a certain extent; the effect is best when the input auxiliary information contains both the strongly correlated features of dry-bulb temperature and wet-bulb temperature and the weakly correlated feature of dew point temperature. One possible reason is that when the maximum number of information is used for correlation analysis, the deep coupling between the auxiliary information of each dimension and the strong correlation between the auxiliary information and the load data are not taken into account. The auxiliary information encoder with an attention mechanism designed in the present invention can automatically select and enhance the extraction of features with high correlation, and explore the potential coupling between the auxiliary information of each dimension. At the same time, the feature fusion module can associate the load features with the auxiliary information features, effectively improving the accuracy of short-term load forecasting.

[0122] (2) Comparison with the baseline model

[0123] The proposed model and the baseline model are directly used for load forecasting with a step size of 1 on the selected data set, and the prediction accuracy of the model test set is shown in Table 3. In order to produce reliable prediction results, each model is trained 10 times, and the losses on the test set are averaged to obtain the values ​​in Table 3.

[0124] Table 3 Performance analysis of different models

[0125]

[0126] It can be seen from Table 3 that when the prediction step size is 1, the results of each indicator of the model proposed in the present invention are better than the baseline model, among which the average improvement rate of RMSE is 37.69%. Specifically, the RMSE value of the model proposed in the present invention is 33.59% higher than the optimal result of CNN-LSTM, and the RMSE improvement rates are 34.60%, 42.51% and 40.04% compared with GRU, SVR and XGBBoost, respectively. The comparative analysis of experimental results shows that the model proposed in the present invention effectively improves the prediction accuracy. Compared with other models, the model proposed in the present invention can better fit the real load data. The possible reason is that the load feature encoder constructed based on TCN can decompose and extract the long-term and short-term trends and periodic characteristics contained in the load sequence layer by layer, and the auxiliary encoder designed based on the multi-head self-attention mechanism can better mine the auxiliary information features that are potentially correlated with the load, which helps to improve the accuracy of load forecasting. In order to display the prediction results more clearly and intuitively, a certain day is randomly selected for load forecasting, and the prediction results are compared with the real data, as shown in the figure. Fig.10 As shown. Fig.10 It can be seen that the model proposed in the present invention effectively improves the prediction accuracy.

[0127] (3) Ablation experiment

[0128] In order to verify the effectiveness of each module of the prediction model proposed in the present invention, the present invention carried out ablation experiments on the selected data set. All ablation experiments were carried out with a prediction step size of 1. The feature combination of dry-bulb temperature and wet-bulb temperature was selected as auxiliary information. The model was trained 10 times respectively, and the average loss value on the test set was taken.

[0129] The ablation experiment settings are: removing the load feature encoder module and the feature fusion module

[0130] (De-E l &F m ), using a common fully connected neural network to replace the load feature encoder module (De-E l / with-Linear, remove the auxiliary information encoder module and feature fusion module (De-E a &F m ), using 1DCNN to replace the auxiliary information encoder module (De-E a / with-1DCNN) uses a normal fully connected neural network to replace the prediction decoder module (De-D p ). Among them, the input of De-Ea&Fm is historical load data; l &F m 、De-E l / with-Linear、De-E a / with-1DCNN and De-D p The prediction results of each prediction model are shown in Table 4.

[0131] Table 4 Ablation experiment results

[0132]

[0133]

[0134] It can be seen from the experimental results that after removing the load feature encoder and the feature fusion module or replacing the load feature encoder with an ordinary fully connected neural network, the prediction accuracy of the model is significantly reduced, indicating that the load feature encoder module has a great influence on the performance improvement of the model proposed in the present invention; after removing the auxiliary information encoder and the feature fusion module, the prediction performance of the model proposed in the present invention will also decrease, indicating that the auxiliary information encoder module also has a great influence on the prediction performance of the model.

[0135] After replacing the auxiliary information encoder module with 1DCNN, the model performance is improved compared to directly removing the auxiliary information encoder module, but the overall performance is still lower than the model proposed in the present invention. This shows that CNN has certain limitations in extracting long-term patterns of features and cannot well mine the auxiliary information contained in multi-dimensional feature factors. It also shows the usefulness of the auxiliary information encoder based on the multi-head self-attention mechanism designed by the present invention; after using an ordinary fully connected neural network to replace the prediction decoder module, the model error also increases to a certain extent, indicating that the prediction decoder has a certain impact on the model prediction performance. Ablation experimental studies have shown that each component of the model proposed in the present invention has played its own advantages, enabling it to obtain superior prediction performance. Fig.11 The prediction curves and actual loads of each model on a certain day are shown. It can be seen that the degree of fit between De-Dp and the model proposed in the present invention and the actual data is the highest; while other models have large deviations.

Claims

1. A short-term load forecasting method based on self-attention encoder and temporal convolutional network, characterized in that The method comprises the following steps: Step 1: Load data characteristics analysis: Taking real power load data as the data set, the MIC index analysis is used to analyze the correlation between the load sequence in the data set and the auxiliary features of different dimensions, and the strongly correlated features are selected as the input of the short-term power load forecasting model; Step 2: Construction of short-term power load forecasting model: Step 21: Design load characteristic encoder E based on TCN module l Extract the trend and periodic characteristics contained in the load from the historical load series e ; Step 2. Design auxiliary information encoder E based on self-attention mechanism a To obtain relevant auxiliary information features f a ; Step 2: Use feature fusion module F m The load characteristic encoder E l The extracted periodic features f e and auxiliary information encoder E a The extracted auxiliary information feature f a After being mapped to feature vectors of the same dimension, they are directly added together to obtain the fused feature f total ; Step 24: Construct a predictive decoder D based on the Bi-LSTM model p , learn the time dependency of the feature vector and map it to the final load forecasting result; Step 3: Short-term power load forecast: Step 31: Extract load data x and auxiliary feature data x* from input data X respectively, load feature encoder E l Take the load data x as input and extract the hidden trend and periodic features f in the load sequence e , directly tap the potential laws contained in the load; Step 32: Auxiliary Information Encoder E a Extract the auxiliary information feature f contained in the auxiliary feature data x* a , and ensure the effectiveness of feature information mining; Step 3: In order to make full use of the coupling relationship between load data and related multi-dimensional auxiliary feature factors, the feature fusion module F m The load characteristic encoder E l The extracted periodic features f e and auxiliary information encoder E a The extracted auxiliary information feature f a Perform feature fusion; Step 3 and 4: Pass the fused feature vector into the prediction decoder D based on the Bi-Lstm model p , mining the time dependency contained in the fused feature vector and giving the final load forecasting result.

2. The short-term load forecasting method based on self-attention encoder and temporal convolutional network according to claim 1 is characterized in that In step 1, for a set of two-dimensional variables (X, Y), the two-dimensional variables are divided into a grid of x columns and y rows on the plane. Then, under the binary data set D, the formula of MIC is as follows: Among them, M MIC (X, Y) is the maximum information number; N is the number of samples, B(N) is the function of the number of samples, generally B(N) = N 0.6 ;I * (D,x,y) is the maximum mutual information of the two-dimensional variables under the data set D.

3. The short-term load forecasting method based on self-attention encoder and temporal convolutional network according to claim 1 is characterized in that In step 21, TCN is a neural network model that integrates dilated causal convolution DCC and residual connection RC, and the dilated convolution operation is as follows: Where: F(T) represents the dilated convolution operation, f(i) is the filter function; x T-di is the input value corresponding to the moment di shifted from moment T to the past; The calculation formula of RC is: X h =δ(G(X h-1 )+X h-1 ) Where: δ(·) is the activation function; G(·) represents the transformation of DCC, weight normalization, activation function, and random dropout; X h-1 is the output of residual block h-1; X h is the output of the residual block h.

4. The short-term load forecasting method based on self-attention encoder and temporal convolutional network according to claim 1 is characterized in that The specific steps of step 22 are as follows: Step 221: Use the fully connected layer to transform the auxiliary information feature f a Mapped to a feature vector F with dimension d; Step 222: Generate a position vector P with a dimension of d using a position encoder; Step 223: Add the feature vector F and the position vector P as the auxiliary information encoder E a The input of the auxiliary information encoder E a It consists of N sub-modules with the same structure. Each sub-module consists of a multi-head attention network layer and a feedforward neural network layer. The two sub-layers are connected by residual connections, and the output dimension of each sub-layer is the same. In each sub-module, the input vector first passes through the multi-head attention network layer to obtain the weighted feature vector A, and then the weighted feature vector A is sent to the feedforward neural network composed of ReLU activation function and linear activation function.

5. The short-term load forecasting method based on self-attention encoder and temporal convolutional network according to claim 1 is characterized in that In steps 2 and 3, the specific operations of feature fusion are as follows: f total =Concat(f e ,f a ) Among them, f total Represents the fused features.

6. The short-term load forecasting method based on self-attention encoder and temporal convolutional network according to claim 1 is characterized in that In step 24, the BI-LSTM model is composed of a forward LSTM model and a backward LSTM model, and the output of the BI-LSTM layer is expressed as: h(t)=[o pre ,o pos ] Where: h is the result of concatenating the forward and backward outputs of the BI-LSTM model; o pre ,o pos They are the outputs of forward LSTM and backward LSTM respectively.

Citation Information

Patent Citations

  • Wind power ultra-short-term prediction method based on SATCN-LSTM

    CN114676814A

  • Load prediction method based on MIC-TCN-LSTM, storage medium and computer system

    CN114819352A

  • SA-TCN model-based short-term adjustable load prediction method and system

    CN115859815A

  • Short-term multi-energy load prediction method based on DTform

    CN117808175A

  • Convolutional network-based short-term load prediction method and system, and storage medium

    CN117876148A

Cited By

  • User-level electric quantity prediction method and system based on knowledge graph retrieval enhancement generation

    CN118709871A

  • Load prediction method and device based on court portrait, and electronic equipment

    CN119010021A

  • Short-term net load probability prediction method based on high-frequency enhanced denoising diffusion model

    CN119179868A

  • A short-term net load probability forecasting method based on high-frequency enhanced denoising diffusion model

    CN119179868B

  • CNN-XGBoost power load prediction method based on attention mechanism

    CN119577598A