Power load prediction method considering physical social economic factors and terminal

Through the Se2Seq-LSTM model based on the dual attention mechanism, factors such as natural weather, social development and economic level are taken into consideration to solve the accuracy and complexity problems of power load prediction in the existing technology, and achieve accurate and efficient prediction of power load. Modeling.

CN118539411AActive Publication Date: 2024-08-23STATE GRID FUJIAN POWER ELECTRIC CO ECONOMIC RESEARCH INSTITUTE +1

Patent Information

Application Number
CN202410454177.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-04-16
Publication Date
2024-08-23
Estimated Expiration
2044-04-16

AI Technical Summary

Technical Problem

Existing load forecasting methods are difficult to adapt to the randomness and dynamic changes on the demand side, and have complex processing of nonlinear models, complicated parameter settings, and are sensitive to outliers, making it difficult to achieve accurate prediction of power load.

Method used

The Se2Seq-LSTM model based on the dual attention mechanism is used to obtain historical power load data for preprocessing, construct an input sequence, and conduct training based on the sequence, and conduct power load prediction considering factors such as natural weather, social development, and economic level.

Benefits of technology

It achieves accurate prediction of power load, enhances the algorithm's ability to learn the spatiotemporal characteristics of feature sequences, and improves prediction accuracy and robustness.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118539411A
    Figure CN118539411A
Patent Text Reader

Abstract

The invention discloses a power load prediction method considering physical, social and economic factors and a terminal, and the method comprises the steps: obtaining historical power load data which comprises power loads under different time and space, and daily type information, natural data indexes, economic data indexes and social data indexes corresponding to the power loads; according to the method, historical power load data is preprocessed, an input sequence is constructed based on the preprocessed historical power load data by adopting time steps of 24 points, and then a constructed Se2Seq-LSTM prediction model based on a double attention mechanism is trained based on the input sequence. According to the method, factors such as natural weather, social development and economic level are considered during power load prediction, and the constructed prediction model is a Se2Seq-LSTM model based on a double attention mechanism, so that the learning ability of the algorithm on the spatial-temporal features of the feature sequence is enhanced, and accurate prediction of the power load is realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of load forecasting, and in particular to a method and terminal for forecasting electric load taking physical, social and economic factors into consideration. Background Art

[0002] Load forecasting is an essential information support for power system unit combination, dispatch optimization, investment planning, etc., and plays a key role in formulating reliable, safe and efficient demand-side energy information management strategies. Existing classical load forecasting methods have problems such as difficulty in handling nonlinear models, complex modeling and parameter settings, and sensitivity to outliers. With the widespread access of new loads, more and more uncontrollable factors have brought great challenges to demand forecasting. Such load forecasting methods have been difficult to adapt to the increasing randomness and dynamic variability of the demand side. In recent years, the development of deep learning algorithms has made them widely used in time series prediction research. Deep learning can learn complex nonlinear relationships and can effectively capture long-term and short-term feature changes, thereby improving the ability to model load changes. At the same time, deep learning models are usually robust to noise and outliers, and are also highly flexible and can be easily extended to models containing more input variables or more complex structures. This makes deep learning suitable for dealing with evolving power systems and new influencing factors. Summary of the invention

[0003] The technical problem to be solved by the present invention is to provide a method and terminal for predicting power load taking into account physical, social and economic factors, so as to achieve accurate prediction of power load.

[0004] In order to solve the above technical problems, the technical solution adopted by the present invention is:

[0005] A method for predicting power load considering physical, social and economic factors, comprising the steps of:

[0006] Acquire historical power load data, the historical power load data including power loads at different times and spaces, daily type information corresponding to the power loads, natural data indicators, economic data indicators, and social data indicators;

[0007] Preprocessing the historical power load data to obtain preprocessed historical power load data, and constructing an input sequence based on the preprocessed historical power load data using a 24-point time step;

[0008] Constructing a Se2Seq-LSTM prediction model based on a dual attention mechanism, and training the Se2Seq-LSTM prediction model based on the dual attention mechanism based on the input sequence to obtain a trained Se2Seq-LSTM prediction model based on the dual attention mechanism;

[0009] The trained Se2Seq-LSTM prediction model based on the dual attention mechanism is used for power load forecasting.

[0010] In order to solve the above technical problems, another technical solution adopted by the present invention is:

[0011] A power load forecasting terminal considering physical, social and economic factors comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the following steps when executing the computer program:

[0012] Acquire historical power load data, the historical power load data including power loads at different times and spaces, daily type information corresponding to the power loads, natural data indicators, economic data indicators, and social data indicators;

[0013] Preprocessing the historical power load data to obtain preprocessed historical power load data, and constructing an input sequence based on the preprocessed historical power load data using a 24-point time step;

[0014] Constructing a Se2Seq-LSTM prediction model based on a dual attention mechanism, and training the Se2Seq-LSTM prediction model based on the dual attention mechanism based on the input sequence to obtain a trained Se2Seq-LSTM prediction model based on the dual attention mechanism;

[0015] The trained Se2Seq-LSTM prediction model based on the dual attention mechanism is used for power load forecasting.

[0016] The beneficial effects of the present invention are: obtaining historical power load data, which includes power loads at different times and spaces, corresponding daily type information, natural data indicators, economic data indicators, and social data indicators, preprocessing the historical power load data, and using a 24-point time step to construct an input sequence based on the preprocessed historical power load data, and then training the constructed Se2Seq-LSTM prediction model based on the dual attention mechanism based on the input sequence. Compared with the existing load forecasting, factors such as natural weather, social development and economic level are considered in power load forecasting, and the constructed prediction model is a Se2Seq-LSTM model based on the dual attention mechanism, which enhances the algorithm's learning ability for the spatiotemporal characteristics of feature sequences, thereby achieving accurate prediction of power load. BRIEF DESCRIPTION OF THE DRAWINGS

[0017] Figure 1A flowchart of the steps of a method for predicting power load considering physical, social and economic factors according to an embodiment of the present invention;

[0018] Figure 2 This is a schematic diagram of the structure of a power load forecasting terminal considering physical, social and economic factors according to an embodiment of the present invention;

[0019] Figure 3 Schematic diagram of the Se2Seq-LSTM prediction model based on the dual attention mechanism in the power load forecasting method considering physical socio-economic factors in an embodiment of the present invention. DETAILED DESCRIPTION

[0020] In order to explain the technical content, achieved objectives and effects of the present invention in detail, the following is an explanation in combination with the implementation modes and the accompanying drawings.

[0021] Please refer to Figure 1 , a method for power load forecasting considering physical socio-economic factors, comprising the steps of:

[0022] Acquire historical power load data, the historical power load data including power loads at different times and spaces, daily type information corresponding to the power loads, natural data indicators, economic data indicators, and social data indicators;

[0023] Preprocessing the historical power load data to obtain preprocessed historical power load data, and constructing an input sequence based on the preprocessed historical power load data using a 24-point time step;

[0024] Constructing a Se2Seq-LSTM prediction model based on a dual attention mechanism, and training the Se2Seq-LSTM prediction model based on the dual attention mechanism based on the input sequence to obtain a trained Se2Seq-LSTM prediction model based on the dual attention mechanism;

[0025] The trained Se2Seq-LSTM prediction model based on the dual attention mechanism is used for power load forecasting.

[0026] From the above description, it can be seen that the beneficial effects of the present invention are: obtaining historical power load data, which includes power loads at different times and spaces, corresponding daily type information, natural data indicators, economic data indicators and social data indicators, preprocessing the historical power load data, and using a 24-point time step to construct an input sequence based on the preprocessed historical power load data, and then training the constructed Se2Seq-LSTM prediction model based on the dual attention mechanism based on the input sequence. Compared with the existing load forecasting, factors such as natural weather, social development and economic level are considered in the power load forecasting, and the constructed prediction model is a Se2Seq-LSTM model based on the dual attention mechanism, which enhances the algorithm's learning ability for the temporal and spatial characteristics of the feature sequence, thereby achieving accurate prediction of the power load.

[0027] Further, the preprocessing of the historical power load data to obtain the preprocessed historical power load data includes:

[0028] Processing the historical power load data using a linear interpolation method to obtain preliminarily processed historical power load data;

[0029] The historical power load data after the preliminary processing is normalized to obtain the pre-processed historical power load data.

[0030] From the above description, it can be seen that the historical power load data is processed using linear interpolation to ensure the smoothness of the data. In addition, normalizing the historical power load data after preliminary processing can ensure that the data has the same specifications and accelerate the convergence of the neural network.

[0031] Furthermore, the Se2Seq-LSTM prediction model based on the dual attention mechanism is trained based on the input sequence to obtain the trained Se2Seq-LSTM prediction model based on the dual attention mechanism, including:

[0032] In the encoder stage of the Se2Seq-LSTM prediction model based on the dual attention mechanism, the input sequence is encoded to obtain an encoded vector, and in the decoder stage, the encoded vector is decoded according to the neural network training rule to generate an output sequence.

[0033] From the above description, it can be seen that the input sequence is input into the Se2Seq-LSTM prediction model based on the dual attention mechanism, encoded in the encoder stage to obtain the encoded vector, and decoded in the decoder stage according to the neural network training rules to generate the output sequence, which can effectively extract the key feature sequence and reduce the impact of unused feature sequences that may be caused by the attention weight.

[0034] Furthermore, the encoder stage in the Se2Seq-LSTM prediction model based on the dual attention mechanism encodes the input sequence to obtain an encoded vector, and decodes the encoded vector according to the neural network training rule in the decoder stage to generate an output sequence including:

[0035] Assigning weights to the input sequence through the first attention layer in the Se2Seq-LSTM prediction model based on the dual attention mechanism to obtain a new input sequence;

[0036] Performing feature learning on the new input sequence through the first LSTM layer in the Se2Seq-LSTM prediction model based on the dual attention mechanism, and obtaining a semantic vector from the learned features through the second attention layer;

[0037] The second LSTM layer in the Se2Seq-LSTM prediction model based on the dual attention mechanism performs feature learning according to the semantic vector to obtain an output sequence.

[0038] From the above description, it can be seen that the use of the dual attention mechanism can enhance the extraction of feature information of the input sequence, analyze the correlation between the feature sequence and the target sequence in space and time respectively, assign different weights to different information, and use the LSTM network to better model the complex patterns in the time series, thereby effectively improving the accuracy of power load forecasting.

[0039] Furthermore, the step of training the Se2Seq-LSTM prediction model based on the dual attention mechanism based on the input sequence to obtain the trained Se2Seq-LSTM prediction model based on the dual attention mechanism further includes:

[0040] Calculate the symmetric mean absolute percentage error of each time step of the trained Se2Seq-LSTM prediction model based on the dual attention mechanism;

[0041] Calculate the average of the symmetric mean absolute percentage errors over all time steps;

[0042] Determine whether the average value reaches a preset value. If so, the training is completed. If not, return to execute the training of the Se2Seq-LSTM prediction model based on the dual attention mechanism based on the input sequence.

[0043] From the above description, it can be seen that after training the model, the prediction performance of the model is evaluated using the symmetric mean absolute percentage error, which effectively measures the prediction accuracy of the model to ensure the effectiveness and reliability of the power load prediction model.

[0044] Please refer to Figure 2 , a power load forecasting terminal considering physical, social and economic factors, comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the following steps when executing the computer program:

[0045] Acquire historical power load data, the historical power load data including power loads at different times and spaces, daily type information corresponding to the power loads, natural data indicators, economic data indicators, and social data indicators;

[0046] Preprocessing the historical power load data to obtain preprocessed historical power load data, and constructing an input sequence based on the preprocessed historical power load data using a 24-point time step;

[0047] Constructing a Se2Seq-LSTM prediction model based on a dual attention mechanism, and training the Se2Seq-LSTM prediction model based on the dual attention mechanism based on the input sequence to obtain a trained Se2Seq-LSTM prediction model based on the dual attention mechanism;

[0048] The trained Se2Seq-LSTM prediction model based on the dual attention mechanism is used for power load forecasting.

[0049] From the above description, it can be seen that the beneficial effects of the present invention are: obtaining historical power load data, which includes power loads at different times and spaces, corresponding daily type information, natural data indicators, economic data indicators and social data indicators, preprocessing the historical power load data, and using a 24-point time step to construct an input sequence based on the preprocessed historical power load data, and then training the constructed Se2Seq-LSTM prediction model based on the dual attention mechanism based on the input sequence. Compared with the existing load forecasting, factors such as natural weather, social development and economic level are considered in the power load forecasting, and the constructed prediction model is a Se2Seq-LSTM model based on the dual attention mechanism, which enhances the algorithm's learning ability for the temporal and spatial characteristics of the feature sequence, thereby achieving accurate prediction of the power load.

[0050] Further, the preprocessing of the historical power load data to obtain the preprocessed historical power load data includes:

[0051] Processing the historical power load data using a linear interpolation method to obtain preliminarily processed historical power load data;

[0052] The historical power load data after the preliminary processing is normalized to obtain the pre-processed historical power load data.

[0053] From the above description, it can be seen that the historical power load data is processed using linear interpolation to ensure the smoothness of the data. In addition, normalizing the historical power load data after preliminary processing can ensure that the data has the same specifications and accelerate the convergence of the neural network.

[0054] Furthermore, the Se2Seq-LSTM prediction model based on the dual attention mechanism is trained based on the input sequence to obtain the trained Se2Seq-LSTM prediction model based on the dual attention mechanism, including:

[0055] In the encoder stage of the Se2Seq-LSTM prediction model based on the dual attention mechanism, the input sequence is encoded to obtain an encoded vector, and in the decoder stage, the encoded vector is decoded according to the neural network training rule to generate an output sequence.

[0056] From the above description, it can be seen that the input sequence is input into the Se2Seq-LSTM prediction model based on the dual attention mechanism, encoded in the encoder stage to obtain the encoded vector, and decoded in the decoder stage according to the neural network training rules to generate the output sequence, which can effectively extract the key feature sequence and reduce the impact of unused feature sequences that may be caused by the attention weight.

[0057] Furthermore, the encoder stage in the Se2Seq-LSTM prediction model based on the dual attention mechanism encodes the input sequence to obtain an encoded vector, and decodes the encoded vector according to the neural network training rule in the decoder stage to generate an output sequence including:

[0058] Assigning weights to the input sequence through the first attention layer in the Se2Seq-LSTM prediction model based on the dual attention mechanism to obtain a new input sequence;

[0059] Performing feature learning on the new input sequence through the first LSTM layer in the Se2Seq-LSTM prediction model based on the dual attention mechanism, and obtaining a semantic vector from the learned features through the second attention layer;

[0060] The second LSTM layer in the Se2Seq-LSTM prediction model based on the dual attention mechanism performs feature learning according to the semantic vector to obtain an output sequence.

[0061] From the above description, it can be seen that the use of the dual attention mechanism can enhance the extraction of feature information of the input sequence, analyze the correlation between the feature sequence and the target sequence in space and time respectively, assign different weights to different information, and use the LSTM network to better model the complex patterns in the time series, thereby effectively improving the accuracy of power load forecasting.

[0062] Furthermore, the step of training the Se2Seq-LSTM prediction model based on the dual attention mechanism based on the input sequence to obtain the trained Se2Seq-LSTM prediction model based on the dual attention mechanism further includes:

[0063] Calculate the symmetric mean absolute percentage error of each time step of the trained Se2Seq-LSTM prediction model based on the dual attention mechanism;

[0064] Calculate the average of the symmetric mean absolute percentage errors over all time steps;

[0065] Determine whether the average value reaches a preset value. If so, the training is completed. If not, return to execute the training of the Se2Seq-LSTM prediction model based on the dual attention mechanism based on the input sequence.

[0066] From the above description, it can be seen that after training the model, the prediction performance of the model is evaluated using the symmetric mean absolute percentage error, which effectively measures the prediction accuracy of the model to ensure the effectiveness and reliability of the power load prediction model.

[0067] The above-mentioned power load forecasting method and terminal considering physical, social and economic factors of the present invention can be applied to power load forecasting scenarios, which are described below through specific implementation methods:

[0068] Please refer to Figure 1 and Figure 3 , Embodiment 1 of the present invention is:

[0069] A method for predicting power load considering physical, social and economic factors, comprising the steps of:

[0070] S1. Acquire historical power load data, wherein the historical power load data includes power loads at different times and spaces, daily type information corresponding to the power loads, natural data indicators, economic data indicators, and social data indicators.

[0071] Among them, the day type information is the working day / weekend information described by 0 / 1 variables, the natural data indicators include solar radiation, temperature, humidity, wind speed and precipitation, the economic data indicators include GDP (gross domestic product) and electricity prices, and the social data indicators include regional population.

[0072] The above-mentioned indicators and power load are used together as historical power load data because:

[0073] The same weather conditions have different effects on power load and its forecast in different regions. Similarly, different meteorological conditions have unique effects on power load and forecasting in the same region. This involves a variety of meteorological factors, including temperature, precipitation, wind speed, and air humidity. In particular, temperature has the most significant impact on short-term power load forecasting. When the temperature is too high or too low, people usually use a lot of cooling or heating appliances, which causes an increase in power load during the corresponding period. This shows that comprehensive consideration of meteorological factors is crucial for accurate power load forecasting.

[0074] In addition, the power load will change with time. For different day types, such as holidays, working days or rest days, the corresponding power load is also different. This makes it necessary to consider the date factor in the prediction of power load, including daily periodicity and weekly periodicity.

[0075] And, as the population grows, the overall electricity demand of society will also increase accordingly. More people means more households, businesses and industries, which leads to a growing demand for electricity. GDP is a measure of the total economic activity of a country, and economic activity is closely related to the electricity load. The development of industrial, commercial and service industries is usually accompanied by an increased demand for electricity. Countries with high output value often need more electricity to maintain their production and service activities. With urbanization, the population is concentrated in urban areas, which is usually accompanied by higher electricity demand. Industrial, commercial and residential areas in cities have a greater demand for electricity. An increase in GDP is usually accompanied by an improvement in people's living standards, and an improved living standard usually involves more electricity use, such as more household appliances, transportation, etc.

[0076] Therefore, the historical power load data includes power loads at different times and spaces, daily type information corresponding to the power loads, natural data indicators, economic data indicators, and social data indicators, so as to ensure the accuracy of subsequent predictions.

[0077] S2, preprocessing the historical power load data to obtain the preprocessed historical power load data, and constructing an input sequence based on the preprocessed historical power load data using a 24-point time step, specifically including S21-S23:

[0078] S21. Process the historical power load data using a linear interpolation method to obtain preliminarily processed historical power load data.

[0079] Since the power load data is continuous, the difference between the power load at a certain moment and the loads before and after it is usually not too large. Therefore, when the load data at a certain moment exceeds the threshold range, the horizontal linear interpolation method is used to repair the data. Specifically, when the original data is detected to be 0 or a mutation occurs, the average value of the data at the previous moment and the next moment is used to replace the missing data. If continuous data is 0, the data at the previous moment will be used to replace it. This helps maintain the continuity and consistency of the data so that subsequent analysis and modeling can be carried out more effectively.

[0080] S22, normalizing the historical power load data after the preliminary processing to obtain the pre-processed historical power load data.

[0081] Specifically, the historical power load data after preliminary processing is normalized to a preset interval to obtain the preprocessed historical power load data to achieve dimensionless conversion, wherein the preset interval is [-0.5, 0.5], and the center of the preset interval is set to 0, which is conducive to the convergence of the neural network.

[0082] In an optional implementation manner, after S22, the following steps may also be included:

[0083] The Pearson correlation coefficient of the preprocessed historical power load data is calculated. If the absolute value of the Pearson correlation coefficient is within a preset range, the historical power load data corresponding to the Pearson correlation coefficient within the preset range is eliminated to obtain the eliminated historical power load data.

[0084] Among them, the Pearson correlation coefficient (PC) is a common coefficient that reflects linear relationships. Its symbol is r, and the value range of r is [-1,1]. Its size reflects the change in the strength of the correlation. If r>0, it means that the two variables are positively correlated; if r<0, it means that the two variables are negatively correlated; if r=1 or -1, it means that the two variables are completely correlated; if r=0, it means that the two variables are unrelated. The Pearson correlation coefficient formula is as follows:

[0085]

[0086] In the formula, ρ X,Y represents the Pearson correlation coefficient, cov(X,Y) represents the covariance of variables X and Y, ρ X,Y It represents the standard deviation of variables X and Y, E(X) represents the expectation of variable X, and E(Y) represents the expectation of variable Y.

[0087] S23, using a time step of 24 points to construct an input sequence based on the preprocessed historical power load data.

[0088] In an optional implementation, a time step of 24 points is used to construct an input sequence based on the eliminated historical power load data.

[0089] S3, constructing a Se2Seq-LSTM prediction model based on a dual attention mechanism, and training the Se2Seq-LSTM prediction model based on the dual attention mechanism based on the input sequence to obtain a trained Se2Seq-LSTM prediction model based on a dual attention mechanism, specifically including S31-S32:

[0090] S31, build a Se2Seq-LSTM prediction model based on the dual attention mechanism, such as Figure 3 shown.

[0091] Among them, the Se2Seq-LSTM prediction model based on the dual attention mechanism uses mean square error as the loss function, and uses the Adam optimizer to perform gradient descent to update parameters. The encoder and decoder of the prediction model are built based on LSTM (Long Short-Term Memory). The unit in LSTM includes an input gate, an output gate, and a forget gate to realize the state update of information. The information update of the LSTM unit can be expressed by the following formula:

[0092] f t =σ(W f [h t-1 ,x t ]+b f );

[0093] i t =σ(W i [h t-1 ,x t ]+b i );

[0094] o t =σ(W o [h t-1 ,x t ]+b o );

[0095] g t =tanh(W g [h t-1 ,x t ]+b g );

[0096] s t =f ts t-1 +i t g t ;

[0097] h t =o t tanhs t ;

[0098] In the formula, f t represents the forget gate, i t represents the input gate, o t represents the output gate, g t Represents input, s t represents the LSTM cell state at the current time step t, h t represents the hidden layer state at the current time step t, σ represents the sigmoid function, W f represents the first weight matrix, W i represents the second weight matrix, W o represents the third weight matrix, W g represents the fourth weight matrix, h t-1 represents the hidden layer state at the previous time step t-1, x t Indicates the input value, b f represents the first bias vector, b i represents the second bias vector, b o represents the third bias vector, b g represents the fourth bias vector, s t-1 Represents the LSTM cell state at the previous time step t-1.

[0099] The calculation steps of the LSTM layer (including the first LSTM layer and the second LSTM layer) are as follows:

[0100] (1) Input data: The input data of a time step t includes the input features of the current time step and the hidden state of the previous time step.

[0101] (2) Calculate the forget gate to determine which information in the hidden state of the previous time step will be forgotten. The forget gate is calculated as follows:

[0102] f t =σ(W f [h t-1 ,x t ]+b f );

[0103] At the same time, calculate new candidate memory cells:

[0104] g t =tanh(W g [ht-1 ,x t ]+b g ).

[0105] (3) The calculation for updating memory cells is as follows:

[0106] s t =f t s t-1 +i t g t ;

[0107] The forget gate determines how much memory from the previous step is retained, and the input gate determines how much new information is included.

[0108] (4) Calculate the output gate. The output gate is used to determine the new hidden state. The calculation of the output gate is as follows:

[0109] o t =σ(W o [h t-1 ,x t ]+b o ).

[0110] (5) The final hidden state is obtained by multiplying the activation value of the memory cell of the tanh function through the output gate:

[0111] h t =o t tanhs t .

[0112] These gating mechanisms enable LSTM to effectively capture long-term dependencies when processing long sequences while avoiding the gradient problem in traditional RNNs (recurrent neural networks). Each gating unit has its own weight matrix and bias, which are learned through the back-propagation algorithm during training. The entire LSTM network is composed of multiple such units in series to form a deep structure to better model complex patterns in time series.

[0113] In neural networks, the attention mechanism is a common module that is widely used in various fields, including but not limited to machine translation. This mechanism has excellent data processing capabilities and clear interpretability, and has also shown important value in fields such as power system load forecasting. The inspiration of the attention mechanism comes from the way humans process information. When faced with a variety of information, humans automatically ignore low-value content and focus on high-value information. In order to simulate this mode of thinking, the attention mechanism was introduced in artificial neural networks to reduce the interference of invalid information. Compared with general neural networks, the latter usually evenly distribute the weights of input resources, while the attention mechanism redistributes the weights according to the importance of the input resources, thereby improving the overall information utilization.

[0114] The traditional attention mechanism can filter the information inside the model and avoid the influence of the input order in the general RNN network, so it has a good performance in the prediction of general power load. However, there are many feature information in the information of the prediction data input that are difficult to describe intuitively but have obvious correlations. Therefore, the dual attention mechanism can be used to enhance the extraction of feature information. The encoder and decoder under the dual attention mechanism each contain an attention layer, which can analyze the correlation between the feature sequence and the target sequence in space and time respectively, and assign different weights to different information to improve the accuracy of the prediction.

[0115] In the dual attention mechanism, the calculation formula of the attention layer (including the first attention layer and the second attention layer) is as follows:

[0116]

[0117]

[0118]

[0119] In the formula, F t represents the output of the attention layer, W t represents the calculation weight, represents the state of the hidden layer, b t represents the bias, β t represents the attention weight at each moment, T represents the total number of time steps, and F A Represents the output function of attention.

[0120] S32, encoding the input sequence in the encoder stage of the Se2Seq-LSTM prediction model based on the dual attention mechanism to obtain an encoded vector, and decoding the encoded vector according to the neural network training rule in the decoder stage to generate an output sequence, wherein the output sequence is the predicted power load, specifically including S321-S323:

[0121] S321. Assign weights to the input sequence through the first attention layer in the Se2Seq-LSTM prediction model based on the dual attention mechanism to obtain a new input sequence.

[0122] S322. Perform feature learning on the new input sequence through the first LSTM layer in the Se2Seq-LSTM prediction model based on the dual attention mechanism, and obtain a semantic vector using the learned features through the second attention layer.

[0123] S323. Perform feature learning according to the semantic vector through the second LSTM layer in the Se2Seq-LSTM prediction model based on the dual attention mechanism to obtain an output sequence.

[0124] Specifically, Figure 3 As shown in the figure, a spatial attention mechanism (i.e., the first attention layer) is introduced in the encoder stage to extract features in each time step of the model input, and select groups with higher values ​​in the feature vector sequences of all groups at that time step and assign them higher weights.

[0125] The original input sequence is: X = (x 1 ,x 2 ,…,x n ), including n input features, among which, represents the i-th feature sequence with a step length of T, is the tth input feature, so the input sequence under the same step length is

[0126] The hidden state value of the encoder stage is h en,t , where f en For the LSTM function:

[0127] h en,t =f en (h en,t-1 ,x t );

[0128] Then according to the h at the previous moment en,t-1 and the neuron state value s of the encoder LSTM t-1 Calculate the weight of each feature

[0129]

[0130]

[0131] In the formula, represents the weight of the i-th feature at time t, v e ' represents the transposed v e Vector, W e represents the first parameter to be learned, s t-1 represents the cell state at time t-1, U e represents the second parameter to be learned, express The result after weight normalization is Represents the weight of the kth feature at time t.

[0132] Thus, the attention mechanism is used to combine the information of the hidden layer to give specific weights to each dimension of features to obtain a new input sequence

[0133]

[0134] And recalculate the hidden layer state h en,t :

[0135] In the decoder stage, the temporal attention mechanism (i.e., the second attention layer) is introduced to extract features from the hidden layer states of multiple time steps of the model input, analyze the time steps with higher values ​​in the hidden layer states of different time steps, assign them higher weights, and use them as parameters to update the semantic vector and improve the prediction effect.

[0136] In the traditional Seq2Seq (sequence to sequence) model, the hidden layer state output by the encoder is averaged, or the hidden layer state h output by the encoder at time T is directly used. en,T The semantic vector c as the encoder t , but the neural network cannot focus on the key parts. Therefore, the decoder's attention mechanism can be used to utilize the decoder's hidden layer state h de,t-1 and the neuron state s de,t-1 For the encoder hidden layer state h en,t Perform weighted average.

[0137] First, the weights are calculated based on the encoder hidden layer state and the decoder neuron state and hidden layer state:

[0138]

[0139]

[0140] In the formula, Represents the hidden layer state h of the encoder at time i en,i The weight, v d ' represents the transposed v d Vector, W d represents the third parameter to be learned, h de,t-1 represents the hidden layer state of the decoder, s de,t-1 Indicates the cell state, U d represents the fourth parameter to be learned, Representation weight The normalized result is represents the hidden layer state h of the encoder at time j en,i The weight of .

[0141] Then, according to the semantic vector c at the previous moment t-1 Update y t-1 get

[0142]

[0143] In the formula, represents the fifth parameter to be learned, which is also the transposed vector, Represents the sixth parameter to be learned.

[0144] And use the updated Calculate the hidden layer state h de,t , where f de For the LSTM function:

[0145]

[0146] The output stage refers to the use of historical data of load series by traditional statistical methods to output the final prediction results, and selects the historical load series of nearby time points and other characteristic series as the input of the neural network output layer, where h de,T represents the historical load characteristics in the time period from 1 to T, c T Represents the energy system characteristics in the time period 1 to T, and the result y is obtained after inputting them together T+Δt :

[0147] y T+Δt =f(y1,…,y T ,x1,…,x T )=v y '(W y [h de,T ,c T ]+b m )+b0;

[0148] In the formula, f(y1,…,yT ,x1,…,x T ) means the final result is (y1,…,y T ) and (x1,…,x T ) decides, y ' represents the seventh parameter to be learned, W y represents the eighth parameter to be learned, b m represents the ninth parameter to be learned, b0 represents the tenth parameter to be learned, Δt represents the time interval between the output predicted load sequence and the input historical load sequence, and in this embodiment, Δt=24h.

[0149] S4. Calculate the symmetric mean absolute percentage error (SMAPE) of each time step of the trained Se2Seq-LSTM prediction model based on the dual attention mechanism, specifically:

[0150]

[0151] Where SMAPE represents the symmetric mean absolute percentage error, N represents the total number of time steps, and Y i represents the predicted power load value, y i Indicates the actual power load value.

[0152] S5. Calculate the average of the symmetric mean absolute percentage errors for all time steps.

[0153] S6. Determine whether the average value reaches a preset value. If so, the training is completed. If not, return to execute S32.

[0154] S7. Use the trained Se2Seq-LSTM prediction model based on the dual attention mechanism to perform power load forecasting.

[0155] Please refer to Figure 2 , Embodiment 2 of the present invention is:

[0156] A power load forecasting terminal that takes physical, social and economic factors into consideration comprises a memory, a processor and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, each step of the power load forecasting method that takes physical, social and economic factors into consideration in Embodiment 1 is implemented.

[0157] In summary, the present invention provides a method and terminal for predicting power load considering physical, social and economic factors, obtains historical power load data, and the historical power load data includes power loads at different times and spaces, corresponding daily type information, natural data indicators, economic data indicators and social data indicators, pre-processes the historical power load data, and uses a 24-point time step to construct an input sequence based on the pre-processed historical power load data, and then trains the constructed Se2Seq-LSTM prediction model based on the dual attention mechanism based on the input sequence. Compared with the existing load forecasting, the natural weather, social development and economic water level are taken into account in the power load forecasting. Equal factors, and the constructed prediction model is a Se2Seq-LSTM model based on the dual attention mechanism, which enhances the algorithm's learning ability of the temporal and spatial features of the feature sequence, thereby achieving accurate prediction of the power load; and the use of linear interpolation to process the historical power load data to ensure the smoothness of the data. In addition, normalization of the historical power load data after preliminary processing can ensure that the data has the same specifications and accelerate the convergence of the neural network; further, after the model is trained, the symmetric mean absolute percentage error is used to evaluate the prediction performance of the model, which effectively measures the prediction accuracy of the model to ensure the effectiveness and reliability of the power load prediction model. .

[0158] The above descriptions are merely embodiments of the present invention and are not intended to limit the patent scope of the present invention. Any equivalent transformations made using the contents of the present invention's specification and drawings, or directly or indirectly applied in related technical fields, are also included in the patent protection scope of the present invention.

Claims

1. A method for power load forecasting considering physical socio-economic factors, It is characterized in that Includes steps: Acquire historical power load data, the historical power load data including power loads at different times and spaces, daily type information corresponding to the power loads, natural data indicators, economic data indicators, and social data indicators; Preprocessing the historical power load data to obtain preprocessed historical power load data, and constructing an input sequence based on the preprocessed historical power load data using a 24-point time step; Constructing a Se2Seq-LSTM prediction model based on a dual attention mechanism, and training the Se2Seq-LSTM prediction model based on the dual attention mechanism based on the input sequence to obtain a trained Se2Seq-LSTM prediction model based on the dual attention mechanism; The trained Se2Seq-LSTM prediction model based on the dual attention mechanism is used for power load forecasting.

2. A method for predicting power load considering physical, social and economic factors according to claim 1, It is characterized in that The preprocessing of the historical power load data to obtain the preprocessed historical power load data includes: Processing the historical power load data using a linear interpolation method to obtain preliminarily processed historical power load data; The historical power load data after the preliminary processing is normalized to obtain the pre-processed historical power load data.

3. A method for predicting power load considering physical, social and economic factors according to claim 1, It is characterized in that The Se2Seq-LSTM prediction model based on the dual attention mechanism is trained based on the input sequence to obtain the trained Se2Seq-LSTM prediction model based on the dual attention mechanism, including: In the encoder stage of the Se2Seq-LSTM prediction model based on the dual attention mechanism, the input sequence is encoded to obtain an encoded vector, and in the decoder stage, the encoded vector is decoded according to the neural network training rules to generate an output sequence, which is the predicted power load.

4. A method for predicting power load considering physical, social and economic factors according to claim 1, It is characterized in that The encoder stage in the Se2Seq-LSTM prediction model based on the dual attention mechanism encodes the input sequence to obtain an encoded vector, and decodes the encoded vector according to the neural network training rule in the decoder stage to generate an output sequence including: Assigning weights to the input sequence through the first attention layer in the Se2Seq-LSTM prediction model based on the dual attention mechanism to obtain a new input sequence; Performing feature learning on the new input sequence through the first LSTM layer in the Se2Seq-LSTM prediction model based on the dual attention mechanism, and obtaining a semantic vector from the learned features through the second attention layer; The second LSTM layer in the Se2Seq-LSTM prediction model based on the dual attention mechanism performs feature learning according to the semantic vector to obtain an output sequence.

5. A method for predicting power load considering physical, social and economic factors according to claim 1, It is characterized in that The step of training the Se2Seq-LSTM prediction model based on the dual attention mechanism based on the input sequence to obtain the trained Se2Seq-LSTM prediction model based on the dual attention mechanism further includes: Calculate the symmetric mean absolute percentage error of each time step of the trained Se2Seq-LSTM prediction model based on the dual attention mechanism; Calculate the average of the symmetric mean absolute percentage errors over all time steps; Determine whether the average value reaches a preset value. If so, the training is completed. If not, return to execute the training of the Se2Seq-LSTM prediction model based on the dual attention mechanism based on the input sequence.

6. A power load forecasting terminal considering physical, social and economic factors, comprising a memory, a processor and a computer program stored in the memory and executable on the processor, It is characterized in that When the processor executes the computer program, the following steps are implemented: Acquire historical power load data, the historical power load data including power loads at different times and spaces, daily type information corresponding to the power loads, natural data indicators, economic data indicators, and social data indicators; Preprocessing the historical power load data to obtain preprocessed historical power load data, and constructing an input sequence based on the preprocessed historical power load data using a 24-point time step; Constructing a Se2Seq-LSTM prediction model based on a dual attention mechanism, and training the Se2Seq-LSTM prediction model based on the dual attention mechanism based on the input sequence to obtain a trained Se2Seq-LSTM prediction model based on the dual attention mechanism; The trained Se2Seq-LSTM prediction model based on the dual attention mechanism is used for power load forecasting.

7. The power load forecasting terminal considering physical, social and economic factors according to claim 6, It is characterized in that The preprocessing of the historical power load data to obtain the preprocessed historical power load data includes: Processing the historical power load data using a linear interpolation method to obtain preliminarily processed historical power load data; The historical power load data after the preliminary processing is normalized to obtain the pre-processed historical power load data.

8. The power load forecasting terminal considering physical, social and economic factors according to claim 6, It is characterized in that The Se2Seq-LSTM prediction model based on the dual attention mechanism is trained based on the input sequence to obtain the trained Se2Seq-LSTM prediction model based on the dual attention mechanism, including: In the encoder stage of the Se2Seq-LSTM prediction model based on the dual attention mechanism, the input sequence is encoded to obtain an encoded vector, and in the decoder stage, the encoded vector is decoded according to the neural network training rules to generate an output sequence, which is the predicted power load.

9. The power load forecasting terminal considering physical, social and economic factors according to claim 6, It is characterized in that The encoder stage in the Se2Seq-LSTM prediction model based on the dual attention mechanism encodes the input sequence to obtain an encoded vector, and decodes the encoded vector according to the neural network training rule in the decoder stage to generate an output sequence including: Assigning weights to the input sequence through the first attention layer in the Se2Seq-LSTM prediction model based on the dual attention mechanism to obtain a new input sequence; Performing feature learning on the new input sequence through the first LSTM layer in the Se2Seq-LSTM prediction model based on the dual attention mechanism, and obtaining a semantic vector from the learned features through the second attention layer; The second LSTM layer in the Se2Seq-LSTM prediction model based on the dual attention mechanism performs feature learning according to the semantic vector to obtain an output sequence.

10. The power load forecasting terminal considering physical, social and economic factors according to claim 6, It is characterized in that The step of training the Se2Seq-LSTM prediction model based on the dual attention mechanism based on the input sequence to obtain the trained Se2Seq-LSTM prediction model based on the dual attention mechanism further includes: Calculate the symmetric mean absolute percentage error of each time step of the trained Se2Seq-LSTM prediction model based on the dual attention mechanism; Calculate the average of the symmetric mean absolute percentage errors over all time steps; Determine whether the average value reaches a preset value. If so, the training is completed. If not, return to execute the training of the Se2Seq-LSTM prediction model based on the dual attention mechanism based on the input sequence.

Citation Information

Patent Citations

  • Short-term load prediction method considering demand response

    CN113222279A

  • Real-time traffic data processing method and device, computer equipment and storage medium

    CN113435122A

  • Power system load prediction method based on combined model

    CN113837487A

  • Automatic prediction method and system for intelligent power grid big data in short-term load prediction

    CN115313355A

  • KR20230170314A

Cited By

  • Model training method, electric load prediction method, equipment and storage medium

    CN120354380A