Short-term power load prediction method
Through the improved TCN network, LSTM network and de-stationary attention mechanism, combined with the Pearson correlation coefficient to quantify the correlation between different seasonal loads and meteorological factors, the TCN-LSTM-DSA prediction model is constructed, which solves the lack of accuracy in short-term power load prediction. problem, achieving higher prediction accuracy.
Patent Information
- Application Number
- CN202410708594.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-03
- Publication Date
- 2024-10-18
AI Technical Summary
The existing single prediction model is difficult to achieve ideal accuracy in short-term power load forecasting, especially due to the nonlinear and non-stationary characteristics of power load, and the combined forecast model is difficult to effectively express information when faced with massive and complex data.
Using the improved TCN network, LSTM network and de-stationary attention mechanism, preprocessing is performed by obtaining historical load and meteorological data, quantifying the correlation between different seasonal loads and meteorological factors based on the Pearson correlation coefficient, constructing meteorological characteristic input variables, and building The TCN-LSTM-DSA prediction model uses de-stationary attention to process non-stationary data and improve prediction accuracy.
It effectively improves the accuracy of short-term power load forecasting, solves the problem of long-term dependence of time series, and improves the accuracy of forecasting.
Smart Images

Figure CN118798255A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of electric power systems, and in particular to a short-term electric power load forecasting method. Background Art
[0002] Due to the difficulty of storing large amounts of electric energy and the ever-changing power demand, the system power generation should be dynamically balanced with the changes in load. Improving the accuracy of load forecasting is conducive to improving the utilization rate of power generation equipment and the effectiveness of economic dispatch. Especially after the market-oriented reform, the supply and demand of electricity will be balanced through real-time transactions, and the accuracy of short-term load forecasting is becoming more and more important. In short-term load forecasting, meteorological factors have a vital impact. At present, many literatures have considered meteorological factors in short-term load forecasting. When considering the impact of multiple meteorological factors on load forecasting, the correlation between meteorological factors and load is usually analyzed to select features. However, considering the differences caused by seasonal non-stationarity, it is necessary to establish a short-term power load forecasting model based on the correlation characteristics between meteorological information and power load in different seasons.
[0003] At present, machine learning technology has been applied to power load forecasting, and the forecasting models can be divided into two categories according to the number of models. One type of forecasting model is a single forecasting model, which uses correlation analysis to extract influencing factors with a high degree of coupling with power load, and then uses least squares support vector machine (LSSVM), long short-term memory (LSTM) network, etc. to further extract data features to obtain the power load forecast value. LSSVM has the advantage of solving nonlinear problems and is widely used in the field of power load forecasting. LSTM network solves the long-term dependency problem of recurrent neural network (RNN) and can significantly improve the forecasting accuracy and efficiency. Due to the nonlinearity and non-stationarity of power load, the structure of a single forecasting model has limitations, so it is difficult to achieve the ideal forecasting accuracy. The other type of forecasting model is a combined forecasting model that integrates the advantages of multiple models. This model has fewer parameters. In the face of today's massive and complex power data, it is difficult to effectively express the information contained in the data. Therefore, it is very necessary to design a short-term power load forecasting method based on de-stationary attention mechanism and improved TCN-LSTM. Summary of the invention
[0004] The purpose of the present invention is to provide a short-term power load forecasting method, which can realize short-term load forecasting and effectively improve the prediction accuracy based on an improved TCN network, LSTM network and a destabilization attention mechanism.
[0005] To achieve the above object, the present invention provides the following solutions:
[0006] A short-term power load forecasting method comprises the following steps:
[0007] Step 1: Obtain historical load and meteorological data and preprocess them;
[0008] Step 2: Quantify the correlation between seasonal loads and various meteorological factors based on the Pearson correlation coefficient, and construct meteorological characteristic input variables according to the correlation results;
[0009] Step 3: Build a short-term power load forecasting model, train the model, and save the best training model;
[0010] Step 4: Test the best training model based on the preprocessed data, denormalize the output results, and obtain the load forecast value.
[0011] Optionally, in step 1, historical load and meteorological data are obtained and preprocessed, specifically:
[0012] Collect historical load and meteorological data, normalize the historical load data, and divide it into training sample set and test sample set.
[0013] Optionally, in step 2, the correlation between the loads in different seasons and each meteorological factor is quantified based on the Pearson correlation coefficient, and the meteorological characteristic input variable is constructed according to the correlation result, specifically:
[0014] The dynamic correlation diagram of the Pearson coefficient between the load in different seasons and various meteorological factors was drawn, and the proportion of days with a correlation coefficient greater than 0.4 was statistically calculated. Finally, the meteorological characteristic input variables were constructed, among which spring included temperature, rainfall and light intensity, summer included temperature and rainfall, autumn included temperature, wind speed, rainfall and light intensity, and winter included temperature, rainfall and light intensity.
[0015] Optionally, in step 3, a short-term power load forecasting model is built, and the model is trained, and the best training model is saved, specifically:
[0016] Based on the improved TCN network, LSTM network and destabilization attention mechanism, a TCN-LSTM-DSA prediction model is built, the model parameters are set, the model is trained based on the training sample set, and the best training model is saved.
[0017] Optionally, in step 4, the best training model is tested based on the preprocessed data, and the output result is denormalized to obtain the load forecast value, specifically:
[0018] The best training model is tested based on the test sample set, and the output results are denormalized to obtain the load forecast value.
[0019] According to the specific embodiments provided by the present invention, the present invention discloses the following technical effects: the short-term power load forecasting method provided by the present invention includes obtaining historical load and meteorological data, and preprocessing them, quantifying the correlation between loads in different seasons and various meteorological factors based on the Pearson correlation coefficient, constructing meteorological feature input variables according to the correlation results, building a short-term power load forecasting model, and training the model, saving the best training model, testing the best training model based on the preprocessed data, and performing denormalization on the output results to obtain a load forecast value. The method takes into account seasonal differences, quantifies the correlation between loads in different seasons and various meteorological factors based on the Pearson correlation coefficient, and constructs meteorological feature input variables according to the correlation results, which is conducive to improving the accuracy of short-term load forecasting, uses an improved TCN to extract features and construct feature vectors of sequences, uses de-stationary attention to process non-stationary time series data, and then uses an LSTM network to perform short-term load forecasting, which solves the long-term dependency problem of time series and improves the accuracy of prediction. BRIEF DESCRIPTION OF THE DRAWINGS
[0020] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative labor.
[0021] Figure 1 A schematic diagram of a short-term power load forecasting method according to an embodiment of the present invention;
[0022] Figure 2a This is a schematic diagram of the correlation between summer temperature and load;
[0023] Figure 2b This is a schematic diagram of the correlation between summer rainfall and load;
[0024] Figure 2c This is a schematic diagram of the correlation between summer humidity and load;
[0025] Figure 2d This is a schematic diagram of the correlation between summer light intensity and load;
[0026] Figure 2e This is a schematic diagram of the correlation between summer wind speed and load;
[0027] Figure 3 Schematic diagram of the expanded causal convolution structure of the TCN network;
[0028] Figure 4 This is a schematic diagram of the DIL network structure;
[0029] Figure 5 This is a schematic diagram of the LSTM network structure;
[0030] Figure 6 It is a schematic diagram of the loss curve;
[0031] Figure 7 This is a schematic diagram of the prediction results. DETAILED DESCRIPTION
[0032] The purpose of the present invention is to provide a short-term power load forecasting method, which can realize short-term load forecasting and effectively improve the prediction accuracy based on an improved TCN network, LSTM network and a destabilization attention mechanism.
[0033] In order to make the above-mentioned objects, features and advantages of the present invention more obvious and easy to understand, the present invention is further described in detail below with reference to the accompanying drawings and specific embodiments.
[0034] like Figure 1 As shown, the short-term power load forecasting method provided by the embodiment of the present invention includes the following steps:
[0035] Step 1: Obtain historical load and meteorological data and preprocess them;
[0036] Step 2: Quantify the correlation between seasonal loads and various meteorological factors based on the Pearson correlation coefficient, and construct meteorological characteristic input variables according to the correlation results;
[0037] Step 3: Build a short-term power load forecasting model, train the model, and save the best training model;
[0038] Step 4: Test the best training model based on the preprocessed data, denormalize the output results, and obtain the load forecast value.
[0039] This method first quantifies the correlation between seasonal loads and various meteorological factors based on the Pearson correlation coefficient, constructs meteorological feature input variables based on the correlation results, uses the improved TCN to extract features and construct the feature vector of the sequence, uses de-stationary attention to process non-stationary time series data, and then uses the LSTM network for short-term load forecasting. A detailed introduction is given as follows:
[0040] In step 1, historical load and meteorological data are obtained and preprocessed, specifically:
[0041] Collect historical load and meteorological data, normalize the historical load data, and divide it into training sample set and test sample set.
[0042] In step 2, the correlation between the loads in different seasons and various meteorological factors is quantified based on the Pearson correlation coefficient, and the meteorological characteristic input variables are constructed according to the correlation results, specifically:
[0043] Draw the dynamic correlation diagram of the Pearson coefficient between the load in different seasons and various meteorological factors, and calculate the proportion of days with a correlation coefficient greater than 0.4. Finally, construct the meteorological characteristic input variables, among which spring includes temperature, rainfall and light intensity, summer includes temperature and rainfall, autumn includes temperature, wind speed, rainfall and light intensity, and winter includes temperature, rainfall and light intensity;
[0044] This process is introduced in detail: First, the Pearson coefficient is introduced. The Pearson coefficient is a statistical indicator used to measure the strength of the linear relationship between two variables. Its value range is limited to [-1, 1]. When the absolute value of the result is close to 1, it means that the correlation between the two is high. Taking power load and temperature as an example, assuming that the power load sequence is X and the temperature sequence is Y, the calculation formula of this method is shown in formula (1);
[0045]
[0046] In the formula, Cov(X,Y) represents the covariance between two variables, Var[X] represents the variance of variable X, Var[Y] represents the variance of variable Y, and r(X,Y) represents the correlation between the two variables;
[0047] The larger the r(X,Y), the stronger the correlation. Generally speaking, when r(X,Y)≥0.6, it indicates a strong correlation, r(X,Y)∈[0.4,0.6) indicates a moderate correlation, r(X,Y)∈[0.2,0.4) indicates a weak correlation, and r(X,Y)∈[0,0.2) indicates an extremely weak correlation or no correlation. Therefore, 0.4 is selected as the critical value of the correlation.
[0048] By drawing the dynamic correlation diagram of the Pearson coefficient, the correlation between different meteorological factors and load can be more intuitively seen, and the proportion of days with a correlation coefficient greater than 0.4 can be counted;
[0049] Taking the load data of a city in northern my country in 2017 as an example, the dynamic correlation results of different meteorological factors and load in summer are as follows: Figure 2a-2e As shown in the figure, the correlation coefficient of 0.4 is defined as the critical value of load correlation, which is the red dotted line in the figure. The relationship between meteorological factors and load correlation over time is explained by the size of the dynamic correlation coefficient. The percentage of days with a correlation coefficient greater than 0.4 is statistically shown in Table 1.
[0050] Table 1 Correlation between meteorological data and load
[0051]
[0052]
[0053] Depend on Figure 2a-2e It can be seen that in summer, the number of days with correlation coefficients of temperature, rainfall and light intensity greater than 0.4 accounts for more than 50%, which are important external influencing factors of load. As can be seen from Table 1, seasonal differences are obvious, and the correlation between temperature and rainfall in the four seasons is the strongest, while the correlation between humidity and load is very weak. The present invention will perform feature selection for different seasons based on the correlation analysis results in Table 1 as the input of the model, and the selection results are as follows: Spring: temperature, rainfall, light intensity; Summer: temperature, rainfall; Autumn: temperature, wind speed, rainfall, light intensity; Winter: temperature, rainfall, light intensity. The present invention will take summer as an example for load prediction, and the analysis process of the other three seasons is the same, which will not be repeated.
[0054] In step 3, a short-term power load forecasting model is built, the model is trained, and the best training model is saved. Specifically:
[0055] Based on the improved TCN network, LSTM network and destabilization attention mechanism, a TCN-LSTM-DSA prediction model is built, model parameters are set, the model is trained based on the training sample set, and the best training model is saved;
[0056] This process is described in detail: First, the improved TCN network is introduced. The temporal convolutional network (TCN) is derived from the convolutional neural network (CNN). It is a neural network architecture specifically used for time series data processing. TCN takes into account the one-dimensional characteristics of time series information, adopts one-dimensional convolution, and applies causal convolution, dilated convolution and residual connections, thereby effectively improving TCN's ability to learn long-term dependencies in time series. Its dilated causal convolution structure is as follows: Figure 3 As shown in FIG, since the traditional TCN may encounter the problem of long-term dependency, the present invention improves the traditional TCN into a DIL (Dilated inception layer), as shown in FIG. Figure 4 As shown;
[0057] A tanh activation function is added after the first DIL, which is used as a filter. Another layer adds a sigmoid activation function, which acts as a gate to control the amount of information that the filter can pass to the next module. In addition, each DIL layer applies a set of standard 1D causal dilated convolutions to discover temporal patterns of various ranges.
[0058] By combining two widely used strategies of convolutional neural networks (inception and 1D dilated convolution), it is not only able to process very long time series, but also able to extract multi-scale temporal features.
[0059] Introduce LSTM network. Long short-term memory network (LSTM) is an improved time recurrent neural network. By introducing three gated units that control information transmission, it effectively solves the problem of gradient disappearance or explosion that may occur when RNN processes long sequences. The structure of LSTM is as follows Figure 5 As shown in the figure, this network relies on its unique gating structure and memory unit to effectively process long time series and preserve the historical information of the series for a long time. The three gating units are the forget gate, input gate and output gate. The forget gate is used to retain useful information while avoiding passing useless information to the next moment, while the input gate and output gate are used to read data and pass the processed data to the next moment respectively. The specific calculation formula is:
[0060] f t =sigmoid(W fx x t +W fs s t-1 +b f ) (2)
[0061] i t =sigmoid(W ix x t +W is s t-1 +b i ) (3)
[0062] g t =tanh(W gx x t +W gs s t-1 +b g ) (4)
[0063] o t =sigmoid(W ox x t +W os s t-1 +b o ) (5)
[0064] c t =f t ·c t-1 +i t ·g t (6)
[0065] S t =tanh(c t )·o t (7)
[0066] In the formula, f t 、i t and t are the output values of the forget gate, input gate, and output gate at time t, respectively. t is the candidate value of the input gate at time t, sigmoid(·) and tanh(·) represent the sigmoid(·) function and the hyperbolic tangent function respectively, x t is the input value at time t, s t-1 and t Respectively represent the output values at time t-1 and time t, W is the weight coefficient matrix, where W = [W fx W fs W ix W is W gx W gs W ox W os ], the corresponding elements represent the function f t 、i t , g t and t Enter x t and outputs t-1 The weight coefficient, b f 、b i 、b g 、b o are the bias terms of the corresponding functions, c t is the state value at time t;
[0067] The de-stationary attention mechanism is introduced. The data distribution and statistical values of non-stationary time series data will change over time, which increases the difficulty of model prediction. The denormalization process can restore some information, but because the normalized data is input into the model, the model still learns relatively stable attention. When calculating the de-stationary attention mechanism, not only the normalized data will be input, but also the statistics at the time of normalization will be input into the model to construct a non-stationary attention representation with approximate unnormalized information. When performing attention calculation, the non-stationary attention representation is obtained by introducing a statistical scale transformation.
[0068] In step 4, the best training model is tested based on the preprocessed data, and the output result is denormalized to obtain the load forecast value, which is specifically:
[0069] The best training model is tested based on the test sample set, and the output results are denormalized to obtain the load forecast value.
[0070] The present invention provides an embodiment based on the above method:
[0071] A total of 52,417 power load data and historical meteorological data were collected from a city in northern my country and sampled every 10 minutes from January 1, 2017 to December 30, 2017. According to the power load characteristics of each season, the data were divided into four periods: March to May (spring), June to August (summer), September to November (autumn), and December to February of the following year (winter). For the data in each period, the first 80% of the data were used as the training set, and the remaining 20% of the data were used as the test set.
[0072] The experimental hardware configuration is a computer with Intel Core i5-12400F CPU and 16G memory, accelerated by NVIDIA Geforce RTX 2060 GPU. The proposed model is built and run in Python 3.11 and pytorch framework;
[0073] In order to eliminate the influence of different dimensions of different factors, each data is normalized to [0, 1], and the calculation formula is:
[0074]
[0075] In the formula, x' is the normalized value; x is the original data; xmax is the maximum value of the sequence; xmin is the minimum value of the sequence, and the normalized values are all in the interval [0,1].
[0076] In order to reasonably evaluate the prediction effect, this example uses mean absolute error (MAE), root mean square error (RMSE) and mean absolute percentage error (MAPE) to measure the accuracy of the algorithm. The calculation methods are:
[0077]
[0078] In the formula, n is the number of prediction set data, is the predicted value of load data, y i is the true value of the load data. The smaller the values of MAE, RMSE and MAPE are, the better the prediction effect of the model is.
[0079] The prediction results are analyzed. Taking spring data as an example, the power load data is sent to the TCN layer as input, and the number of TCN layers is set to 4. TCN changes the model size and sends it to the DSAttention layer for feature extraction and attention allocation. The output of the DSAttention layer is sent to the LSTM. The LSTM input variable dimension is 4, including power load, temperature, rainfall, and light intensity. The output variable dimension is 1, which is the power load. The number of LSTM iterations is set to 50 times, and the initial learning rate is 0.001. Since the Adam algorithm can calculate the learning rate under different parameters and has fast computing speed and small memory, the LSTM solver selected in the study of the present invention is Adam. As the number of LSTM hidden layers increases, although the fitting ability of the prediction model will be further improved, if there is no restriction, the model prediction time will be too long and overfitting will occur. Therefore, the present invention sets the number of LSTM hidden layers to two layers, with the number of layers being 100 and 50 respectively. In order to avoid overfitting, a random inactivation Dropout layer with an element inactivation probability of 20% is added to each layer of the LSTM. The loss curve obtained is as follows Figure 6 As shown, the prediction results are Figure 7 As shown;
[0080] In order to verify the effectiveness of the model of the present invention, LSTM, TCN-LSTM and the method of the present invention are constructed for comparative experiments. To ensure the objectivity of the experiment, the prediction results are the average values of multiple predictions. The experimental results are shown in Table 2.
[0081] Table 2 Load forecasting errors of different models
[0082]
[0083] It can be seen from Table 2 that the method described in this application can effectively improve the accuracy of short-term wind power prediction.
[0084] The present invention provides a short-term power load forecasting method, which includes obtaining historical load and meteorological data, and preprocessing the historical load and meteorological data, quantifying the correlation between loads in different seasons and various meteorological factors based on the Pearson correlation coefficient, constructing meteorological feature input variables according to the correlation results, building a short-term power load forecasting model, and training the model, saving the best training model, testing the best training model based on the preprocessed data, and performing denormalization processing on the output results to obtain a load forecast value. The method takes into account seasonal differences, quantifies the correlation between loads in different seasons and various meteorological factors based on the Pearson correlation coefficient, and constructs meteorological feature input variables according to the correlation results, which is conducive to improving the accuracy of short-term load forecasting, uses an improved TCN to extract features and construct a feature vector of a sequence, uses de-stationary attention to process non-stationary time series data, and then uses an LSTM network to perform short-term load forecasting, solves the long-term dependency problem of time series, and improves the accuracy of prediction.
[0085] The present invention uses specific examples to illustrate the principles and implementation methods of the present invention. The above examples are only used to help understand the method and core ideas of the present invention. At the same time, for those skilled in the art, according to the ideas of the present invention, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as limiting the present invention.
Claims
1. A short-term power load forecasting method, characterized in that: The steps include: Step 1: Obtain historical load and meteorological data and preprocess them; Step 2: Quantify the correlation between seasonal loads and various meteorological factors based on the Pearson correlation coefficient, and construct meteorological characteristic input variables according to the correlation results; Step 3: Build a short-term power load forecasting model, train the model, and save the best training model; Step 4: Test the best training model based on the preprocessed data, denormalize the output results, and obtain the load forecast value.
2. The short-term power load forecasting method according to claim 1, characterized in that: In step 1, historical load and meteorological data are obtained and preprocessed, specifically: Collect historical load and meteorological data, normalize the historical load data, and divide it into training sample set and test sample set.
3. The short-term power load forecasting method according to claim 2, characterized in that: In step 2, the correlation between the loads in different seasons and various meteorological factors is quantified based on the Pearson correlation coefficient, and the meteorological characteristic input variables are constructed according to the correlation results, specifically: The dynamic correlation diagram of the Pearson coefficient between the load in different seasons and various meteorological factors was drawn, and the proportion of days with a correlation coefficient greater than 0.4 was statistically calculated. Finally, the meteorological characteristic input variables were constructed, among which spring included temperature, rainfall and light intensity, summer included temperature and rainfall, autumn included temperature, wind speed, rainfall and light intensity, and winter included temperature, rainfall and light intensity.
4. The short-term power load forecasting method according to claim 3 is characterized in that: In step 3, a short-term power load forecasting model is built, the model is trained, and the best training model is saved. Specifically: Based on the improved TCN network, LSTM network and destabilization attention mechanism, a TCN-LSTM-DSA prediction model is built, the model parameters are set, the model is trained based on the training sample set, and the best training model is saved.
5. The short-term power load forecasting method according to claim 4, characterized in that: In step 4, the best training model is tested based on the preprocessed data, and the output result is denormalized to obtain the load forecast value, which is specifically: The best training model is tested based on the test sample set, and the output results are denormalized to obtain the load forecast value.
Citation Information
Cited By
Ultra-short-term power load prediction method and system
CN122203226A
