An attention-rnn-based short-term power load prediction method
By introducing the Attention mechanism and RNN network, and combining the characteristics of diverse heterogeneous data, a serial and parallel model integration framework is constructed, which solves the problem of nonlinear and non-stationary data in short-term power load forecasting and achieves higher forecast accuracy and stability.
Patent Information
- Application Number
- CN202310388456.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-04-12
- Publication Date
- 2026-11-27
- Estimated Expiration
- 2043-04-12
AI Technical Summary
Existing short-term power load forecasting algorithms cannot effectively handle nonlinear problems and non-stationary data, resulting in insufficient forecast accuracy.
By adopting an Attention-RNN-based approach, an integrated framework of serial and parallel models is constructed by introducing an attention mechanism and an RNN network, combined with the characteristics of diverse heterogeneous data. This framework adaptively learns key information and trend features in the power load time series, thereby improving prediction accuracy.
It improves the accuracy and generalization ability of short-term power load forecasting, better handles long-term dependency problems, performs well under high noise conditions, and enhances the flexibility and reliability of the model.
Smart Images

Figure CN116703644B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of power system load forecasting technology, and in particular to a short-term power load forecasting method based on Attention-RNN. Background Technology
[0002] Short-term power load forecasting refers to predicting the power load of the power grid for the next few hours or days, so that power companies can rationally plan power production and supply, thereby ensuring the stable operation of the grid and meeting users' electricity needs. Short-term power load forecasting typically employs statistical and machine learning methods based on historical data, and the underlying technologies mainly include data acquisition, preprocessing, feature extraction, model building, and evaluation.
[0003] First, forecasting electricity load requires collecting a large amount of historical data, including various factors such as weather, holidays, and weekdays / rest days. This data is collected through sensors, weather forecasts, and electricity meters, forming a large dataset. Next, the data undergoes preprocessing, including data cleaning, normalization, and noise reduction, to ensure data quality and reliability.
[0004] Feature extraction is a key step in building predictive models, typically requiring the extraction of useful features from data using methods such as time series analysis, frequency domain analysis, and wavelet analysis. For example, features such as average load, peak load, minimum load, and load fluctuation for each day of a week can be extracted from historical data.
[0005] Model building is the core of short-term power load forecasting, requiring the selection and training of appropriate models. Commonly used models include regression models, time series models, and neural network models. Among these, neural network models perform exceptionally well in short-term power load forecasting, especially deep learning models such as Long Short-Term Memory (RNN) networks, which can automatically learn features and possess excellent predictive capabilities.
[0006] Finally, to evaluate the accuracy and performance of the prediction model, some metrics are needed to measure the prediction error. For example, the root mean square error (RMSE) can be used to assess the magnitude of the prediction error, or the mean absolute error (MAPE) can be used to assess the degree of bias in the prediction.
[0007] While current power load forecasting algorithms are relatively mature, they still have some shortcomings, such as their inability to handle nonlinear problems and non-stationary data. Therefore, more advanced algorithms are needed to improve forecast accuracy. Summary of the Invention
[0008] The technical problem to be solved and the technical task proposed by this invention is to improve and refine existing technical solutions, and to provide a short-term power load forecasting method based on Attention-RNN, so as to improve the accuracy of short-term power load forecasting. To this end, this invention adopts the following technical solution.
[0009] A short-term power load forecasting method based on Attention-RNN includes the following steps:
[0010] 1) Determine the characteristic representation method of multivariate heterogeneous data including temperature and holiday information, define the dataset format for short-term load forecasting that considers multiple load influencing factors, and construct the basic framework for single-step and multi-step forecasting of day-ahead power load.
[0011] 2) Based on the basic framework for day-ahead power load forecasting formed in step 1), the temporal correlation implied between time nodes in the load time series is quantified based on the Attention mechanism to form the day-ahead power load forecasting Attention module.
[0012] 3) Based on the basic framework for day-ahead power load forecasting formed in step 1), the trend and periodic features implied in the long-term load sequence are extracted using RNN, and the temporal dependence of the load sequence is mined to form a day-ahead power load forecasting RNN module.
[0013] 4) Based on the Attention module and RNN module formed in steps 2) and 3), construct a model integration framework that integrates serial and parallel models. Utilize the Attention mechanism and RNN network characteristics to mine the temporal correlation and long-term dependency features of load time series from historical data, forming a short-term power load prediction model based on Attention-RNN. Perform short-term power load prediction based on the short-term power load prediction model.
[0014] This technical solution, based on RNNs, introduces an attention mechanism to adaptively learn key information from long-sequence data and more accurately capture changes and trends within the sequence. Compared to traditional RNN models, RNN models utilizing the attention mechanism better handle long-term dependencies and adaptively adjust weights when modeling historical data, improving prediction accuracy. Due to the introduction of the attention mechanism, it can adaptively capture key information in time-series data. This method typically combines gated recurrent units and attention mechanisms, enhancing the modeling ability for long-sequence data and exhibiting strong generalization capabilities. It handles long-term series data better and performs better under conditions of uncertain input features or high data noise.
[0015] As a preferred technical means: In step 1), the original dataset is represented as follows:
[0016]
[0017] In the formula: X is the input matrix; x i Let l be the input feature vector for day i, derived from the 96-point load feature vector. i With external factor eigenvector f i Composition; l i ∈R 96 f is the load vector for day i, and the number of points depends on the sampling frequency; i ∈R 26 Let d be the external factor feature vector for day i, encoded by the workday type. i ∈R 7 Season type code s i ∈R 4 Monthly type code m i ∈R 12 Holiday type code h i ∈R 2 and meteorological feature vector n i Composition, f i Represented as:
[0018] f i =[d i s i m i h i n i (16)
[0019] The time-stamped feature encoding method adopts one-hot encoding; after determining the data structure for short-term power load forecasting, the basic framework for single-step and multi-step forecasting of day-ahead power load forecasting is expressed as follows:
[0020]
[0021]
[0022] X i+1:i+T =[x i+1 x i+2 … x i+T ] T (19)
[0023] F i+T+K:i+T+K+τ =[f i+T+K f i+T+K+1 … f i+T+K+τ ] T (20)
[0024] In the formula, X is the power load forecasting matrix; i+1:i+T For the historical input matrix; F i+T+K:i+T+K+τ The synchronous feature matrix is represented by T and τ, which are the historical window width and the prediction window width, respectively. K represents the number of days for advance prediction. Φ represents the short-term power load prediction model. θ * These are the parameters obtained from model training.
[0025] The original dataset uses daily, seasonal, monthly, holiday, and meteorological data for short-term power load forecasting, which helps improve forecast accuracy, generalization ability, and reliability, and is of great significance for practical applications. Specifically:
[0026] 1. Multiple factors are considered: By introducing multiple features, the complexity and uncertainty of power load changes can be more comprehensively reflected, including factors such as the natural environment, socio-cultural factors, and population flow. These features can provide more accurate input information, thereby improving the accuracy of forecasts.
[0027] 2. Improved data distribution uniformity: By considering multiple characteristics, it can improve the unevenness of data distribution and reduce prediction errors. For example, it can better reflect the actual changes in power load during important events such as holidays or sudden weather changes.
[0028] 3. Enhanced model generalization ability: By considering multiple time scales and different types of features, the model's adaptability to unknown situations can be improved, enhancing its generalization ability and making the model more reliable and robust.
[0029] In addition, the use of one-hot encoding time-scale features and the basic framework of single-step and multi-step prediction in this technical solution can improve the flexibility, scalability and accuracy of the model, making it suitable for various short-term power load prediction scenarios.
[0030] Using one-hot encoding for time-stamped features facilitates model processing: In neural networks, features in numerical form are easily misinterpreted. One-hot encoding converts categorical variables into vector form for easier processing by the neural network. This allows the model to better understand the relationships between different time points in the time series data. Furthermore, it avoids misleading the model regarding numerical magnitude: Numerical time-stamped features can mislead the model, causing it to incorrectly consider some time points more important than others. One-hot encoding eliminates this misinterpretation, ensuring that each time point is treated equally.
[0031] Employing single-step and multi-step prediction frameworks enhances flexibility: these frameworks can be flexibly applied to different datasets and tasks, meeting diverse application needs. For example, multi-step prediction frameworks can be used for tasks requiring more refined predictions, improving accuracy and stability; while single-step prediction frameworks can be chosen for simpler tasks to reduce computational load. It also improves scalability: frameworks based on single-step and multi-step prediction can be combined with other model structures to achieve more complex prediction tasks. For instance, these frameworks can be combined with deep learning methods, statistical models, and traditional time series prediction methods to improve prediction accuracy and robustness.
[0032] As a preferred technical approach: In step 2), the temporal correlation implied between time nodes in the load time series is quantified based on the Attention mechanism, and cross-correlation features are extracted; to quantify the temporal correlation between each time step of the load time series, a "key-value" mechanism is adopted; the input feature vector is transformed into a query vector q through linear mapping. i Key vector k i and value vector v i The relevance score 'a' between different time steps is obtained by calculating the dot product of the query vector and the key vector.
[0033] a=q·k (21)
[0034] The temporal correlation between different time steps is obtained by calculating the dot product of the query vector and the key vector at different time steps. The overall process of quantifying the temporal correlation of the load based on the Attention mechanism is represented as follows:
[0035] q i =W q x i ,k i =W k x i ,v i =W v x i ,a i,j =q i ·k j (twenty two)
[0036]
[0037] A = softmax(K) T Q),H=VA (24)
[0038] In the formula, W q W k W v To query the mapping matrix, key mapping matrix, and value mapping matrix; a i,j For the input vector xi x j The correlation score between them; matrix A consists of a i,j Composition; K and Q are the key matrix and query matrix, respectively, composed of k i and q i Composition; H is the Attention output.
[0039] Employing a key-value mechanism to quantify the temporal correlation between different time steps in a load time series offers several advantages, including clearly defined temporal relationships, high flexibility, and convenient data processing. Clear Temporal Relationships: The key-value mechanism clearly describes the relationships between different time steps; each key represents a feature of that time step, while the value represents the specific numerical value or vector for that time step. This mechanism allows the model to better grasp the dependencies between different time steps in the time series data, thus predicting future trends more accurately. High Flexibility: When using the key-value mechanism, the keys for each time step can be customized according to actual needs, such as using different time scales like seasons or months. Multiple keys can also be customized for different application scenarios, further improving prediction accuracy and generalization ability. Convenient Data Processing: The key-value mechanism allows different information to be stored and processed in the same format, facilitating batch data reading and processing. It also allows for easy integration with attention mechanisms to further enhance model performance.
[0040] As a preferred technical means: in step 3), the processing formulas for the day-ahead power load forecasting RNN module based on the load time-series dependency characteristics of RNN are shown in (11)-(14);
[0041]
[0042]
[0043]
[0044]
[0045] In the formula, Let L be the weight matrix of the l-th layer of the RNN; σ is the bias of the l-th layer of the RNN; σ is the sigmoid activation function; W o It is a linear mapping matrix; The hidden state features at time t are extracted from the l-th layer RNN network; h represents the hidden state features of the RNN output layer and the nearest neighbor time step to be predicted; RNN is the feature vector extracted by the RNN; L is the number of layers in the RNN network; T is the width of the RNN input window.
[0046] As a preferred technical means: In step 4), the original dataset is processed through a sliding window to generate a historical window and a prediction window;
[0047] In the serial integration framework: First, the data within the historical window is input into the RNN module. The RNN module processes the data and extracts the time-dependent features of the load sequence. Then, the feature vector set extracted by the RNN module is... The Attention module is input to extract the correlation between each time step. Finally, H and the synchronous features in the prediction window are input into the fully connected layer to output the short-term power load prediction value.
[0048] In the parallel ensemble framework: First, the data within the historical window is input in parallel into the RNN module and the Attention module to mine the temporal correlation and long-term dependency features of the load time series; then, the feature vector group extracted by the RNN is... The Attention output H and the synchronous features within the prediction window are input into the fully connected layer, and the output is the short-term power load prediction value.
[0049] Using historical windows as input, multi-model fusion in serial or parallel fusion frameworks can fully leverage the complementarity between different models, which is beneficial for improving prediction accuracy.
[0050] Beneficial Effects: This technical solution employs an Attention module and an RNN module, using a serial and parallel model integration framework. The serial integration framework enhances the mapping capability of the prediction model, reducing load prediction error by decreasing model prediction variance. The parallel integration framework increases the capacity of the prediction model, reducing load prediction error by decreasing model bias. Considering the temporal characteristics of load and external multidimensional influencing factors based on the Attention mechanism and RNN network characteristics, the RNN model utilizing the Attention mechanism can better handle long-term dependency problems and adaptively adjust weights when modeling historical data, improving the model's prediction accuracy. Due to the introduction of the attention mechanism, key information in time-series data can be adaptively captured. Compared to traditional prediction schemes, such as short-term load prediction methods based on feedforward neural networks, convolutional neural networks, and recurrent neural networks, this technical solution effectively improves the accuracy of short-term power load prediction. Attached Figure Description
[0051] Figure 1 This is a schematic diagram of the overall process of the present invention.
[0052] Figure 2 This is a schematic diagram of the sliding window processing of the present invention.
[0053] Figure 3This is a schematic diagram of the Attention mechanism of the present invention.
[0054] Figure 4 This is a schematic diagram of the RNN of the present invention.
[0055] Figure 5 This is a schematic diagram of the serial integration framework of the present invention.
[0056] Figure 6 This is a schematic diagram of the parallel integration framework of the present invention.
[0057] Figure 7 This is the short-term load forecast curve of the present invention. Detailed Implementation
[0058] To better understand the purpose, technical solution, and technical effects of this invention, the invention will be further explained below in conjunction with the accompanying drawings.
[0059] This embodiment proposes a short-term power load forecasting method based on Attention-RNN, and its implementation process includes the following detailed steps:
[0060] Step 1: Propose a feature representation method for diverse and heterogeneous data such as temperature and holiday information, define a dataset format for short-term load forecasting that considers multiple load influencing factors, and construct a basic framework for single-step and multi-step forecasting of day-ahead power load.
[0061] The raw dataset for short-term power load forecasting can be represented as:
[0062]
[0063] In the formula: X is the input matrix; x i Let l be the input feature vector for day i, derived from the 96-point load feature vector. i With external factor eigenvector f i Composition; l i ∈R 96 f is the load vector for day i, and the number of points depends on the sampling frequency; i ∈R 26 Let d be the external factor feature vector for day i, encoded by the workday type. i ∈R 7 Season type code s i ∈R 4 Monthly type code m i ∈R 12 Holiday type code h i ∈R 2 and meteorological feature vector n i Composition, f i It can be represented as
[0064] f i =[d i s i m i h i n i (2)
[0065] The time-stamped feature encoding (weekday type encoding, seasonal type encoding, etc.) adopts one-hot encoding, that is, the dimension of the type for the current day is set to 1, and the other dimensions are set to 0. After determining the data structure for short-term power load forecasting, the basic framework for single-step and multi-step forecasting of day-ahead power load can be represented as follows:
[0066]
[0067]
[0068]
[0069] In the formula, X is the power load forecasting matrix; i+1:i+T For the historical input matrix; F i+T+K:i+T+K+τ The synchronous feature matrix is represented by T and τ, which are the historical window width and the prediction window width, respectively. K represents the number of days for advance prediction. Φ represents the short-term power load prediction model. θ * These are the parameters obtained from model training.
[0070] The key to short-term power load forecasting modeling lies in constructing a suitable model and determining its parameters. In this embodiment, the model parameters are determined by minimizing the expected risk R. exp Sure:
[0071]
[0072] In the formula, Let represent the loss function. The expected parameters of the final model satisfy:
[0073]
[0074] In practical applications, we approximate the expected risk by calculating the empirical risk. According to the law of large numbers, when the sample size is large enough, the empirical risk will approach the expected risk.
[0075]
[0076] To achieve rolling forecasting of short-term power load, this embodiment proposes a sliding window processing method, such as... Figure 2As shown, historical load data and synchronous correlation data within the sliding window are used as inputs to the short-term power load forecasting model to consider the autocorrelation characteristics of load changes and the cross-correlation characteristics of load and its influencing factors. As the sliding window slides, the forecasting model gradually outputs load forecast values.
[0077] Step 2: Based on the basic framework for day-ahead power load forecasting formed in Step 1, the temporal correlation implied between time nodes in the load time series is quantified based on the Attention mechanism to form the day-ahead power load forecasting Attention module.
[0078] Based on the basic framework for day-ahead power load forecasting established in step 1, the temporal correlations implied between time nodes in the load time series are quantified using the Attention mechanism, and cross-correlation features are extracted. The calculation process of Attention is as follows: Figure 3 As shown. To quantify the temporal correlation between different time steps of the load time series, a "key-value" mechanism is introduced. The input feature vector is transformed into a query vector q through a linear mapping. i Key vector k i and value vector v i The correlation score 'a' between different time steps is obtained by calculating the dot product between key vectors:
[0079] a=q·k (10)
[0080] The temporal correlation between different time steps is obtained by calculating the dot product between key value vectors at different time steps. The overall process of quantifying the temporal correlation of load based on the Attention mechanism can be expressed as follows:
[0081] q i =W q x i ,k i =W k x i ,v i =W v x i ,a i,j =q i ·k j (11)
[0082]
[0083] A = softmax(K) T Q),H=VA (13)
[0084] In the formula, W q W k W v To query the mapping matrix, key mapping matrix, and value mapping matrix; a i,j For the input vector xi x j The correlation score between them; matrix A consists of a i,j Composition; K and Q are the key matrix and query matrix, respectively, composed of k i and q i The structure is as follows: H is the output obtained by weighting the value vectors at each time step with the Attention score weights.
[0085] Step 3: Based on the basic framework for day-ahead power load forecasting formed in Step 1, extract the trend and periodic features implied in the long-term load sequence using RNN, mine the temporal dependence of the load sequence, and form the day-ahead power load forecasting RNN module.
[0086] The processing flow of the load time-dependent feature extraction module based on RNN is shown in (14)-(17).
[0087]
[0088]
[0089]
[0090]
[0091] In the formula, Let L be the weight matrix of the l-th layer of the RNN; σ is the bias of the l-th layer of the RNN; σ is the sigmoid activation function; W o It is a linear mapping matrix; The hidden state features at time t are extracted from the l-th layer RNN network; h represents the hidden state features of the RNN output layer and the nearest neighbor time step to be predicted. RNN is the feature vector extracted by the RNN; L is the number of layers in the RNN network; T is the width of the RNN input window.
[0092] A multidimensional RNN network layer consists of multiple units connected in series, and the load state characteristics at different times are conveyed through the hidden states. By transmitting load information, the RNN can extract and memorize the dependency features between time points in a continuous load sequence, coupling load information from different time points. To enhance the RNN network's ability to extract and represent load time-series features, this embodiment stacks multiple RNNs to learn the complex nonlinear relationship between industry load and its influencing factors. The RNN-based day-ahead power load forecasting module is as follows: Figure 4 As shown.
[0093] Step 4: Based on the Attention module and RNN module formed in Step 2 and Step 3, construct an integrated framework of serial and parallel models. Utilize the Attention mechanism and RNN network characteristics to mine the temporal correlation and long-term dependency features of load time series from historical data, forming a short-term power load forecasting method based on Attention-RNN.
[0094] Based on the Attention module and the RNN module, a fusion framework for both serial and parallel models is constructed. In the serial fusion framework: first, the data within the historical window is input into the RNN module, which processes the data to extract the temporal dependency features of the load sequence; then, the feature vector group extracted by the RNN module is... The input to the Attention module extracts the correlation between each time step, resulting in an output matrix H that considers the correlation between time steps. Finally, H, along with the synchronization features within the prediction window, is input into the fully connected layer to obtain the short-term power load forecast. A schematic diagram of the serial integration framework is shown below. Figure 5 As shown. In the parallel ensemble framework: firstly, the data within the historical window is input in parallel into the RNN module and the Attention module to mine the temporal correlation and long-term dependency features of the load time series; then, the feature vector group extracted by the RNN is... The Attention output H and the synchronization features within the prediction window are input into the fully connected layer, and the output is the short-term power load forecast. A schematic diagram of the parallel integration framework is shown below. Figure 6 As shown.
[0095] To evaluate the model's prediction performance, the root mean square error and the mean absolute percentage error are used as prediction evaluation indicators, as shown in equations (18) and (19), respectively.
[0096]
[0097]
[0098] To verify the effectiveness and accuracy of the proposed short-term power load forecasting method based on Attention-RNN, a simulation was conducted using daily load data from 96 points in a certain city in 2021.
[0099] First, based on the feature representation method of multivariate heterogeneous data proposed in step 1 and the basic framework of single-step and multi-step forecasting of day-ahead power load, the original 96-point daily load data are preprocessed, including data normalization, feature encoding, data shaping and sliding window processing.
[0100] Next, based on the sliding window data, and according to the RNN feature extraction method and the Attention temporal correlation quantification method mentioned in steps 2 and 3, the RNN module and the Attention module are formed.
[0101] Then, based on the two frameworks proposed in step 3, the RNN module and the Attention module are integrated, taking into account the influence of synchronous related features within the prediction window, and inputting them into a fully connected layer. To improve the model's training efficiency while ensuring a certain mapping capability, the GRU module has 2 hidden layers, 1 Attention layer, 2 nonlinear mapping layers for synchronous features, and 1 fully connected layer. This completes the modeling work for the short-term daily load prediction model. Based on the determined model structure, the dataset after sliding windowing is divided into a training set and a test set. The training set is used to train the constructed model and determine its parameters; the test set is used to validate the performance of the constructed model.
[0102] This embodiment employs an integrated framework combining an Attention module and an RNN module, integrating serial and parallel models. It leverages the Attention mechanism and RNN network characteristics to consider load temporal characteristics and external multidimensional influencing factors, offering the following advantages compared to traditional prediction methods:
[0103] Considering external multidimensional influencing factors: Traditional forecasting methods often only consider historical load data itself, while this technical solution can effectively consider external multidimensional influencing factors, such as temperature, humidity, and holidays, by introducing an attention mechanism, thereby improving forecasting accuracy.
[0104] Fully exploit time series characteristics: By using RNN networks, the time series characteristics of load data can be modeled, thereby better capturing information such as periodicity and trends in load data and further improving prediction accuracy.
[0105] Model fusion improves robustness: By integrating the Attention module and the RNN module through a serial and parallel model integration framework, the complementarity between different models is fully explored, thereby improving the robustness and stability of prediction.
[0106] High interpretability: Due to the adoption of the Attention mechanism, the importance of each external influencing factor in the prediction can be shown in a visual way, thereby improving the interpretability of the model.
[0107] To verify the effectiveness and superiority of the method proposed in this invention, other typical prediction models, such as ANN, CNN, GRU, and CNN-GRU, were constructed and compared with the prediction results of this invention. The evaluation indicators of each prediction model are compared in the table below.
[0108] Table 1 Comparison of Evaluation Indicators for Short-Term Load Forecasting Models
[0109]
[0110] The short-term load forecast curve based on the above model is as follows: Figure 7 As shown. According to Figure 7 As shown in Table 1, compared with other short-term load forecasting models, the short-term load forecasting model based on Attention-RNN proposed in this invention has relatively higher prediction accuracy. Among them, the serial architecture Attention-RNN short-term load forecasting model has the highest accuracy, the smallest error, and the best generalization performance.
[0111] The above-described short-term power load forecasting method based on Attention-RNN is a specific embodiment of the present invention, demonstrating the substantial features and progress of the present invention. Based on actual usage needs, equivalent modifications in shape, structure, etc., can be made to it under the guidance of the present invention, all of which are within the scope of protection of this solution.
Claims
1. A short-term power load forecasting method based on Attention-RNN, characterized in that, Includes the following steps: 1) Determine the characteristic representation method of multivariate heterogeneous data including temperature and holiday information, define the dataset format for short-term load forecasting that considers multiple load influencing factors, and construct the basic framework for single-step and multi-step forecasting of day-ahead power load. 2) Based on the basic framework for day-ahead power load forecasting formed in step 1), the temporal correlation implied between time nodes in the load time series is quantified based on the Attention mechanism to form the day-ahead power load forecasting Attention module. 3) Based on the basic framework for day-ahead power load forecasting formed in step 1), the trend and periodic features implied in the long-term load sequence are extracted using RNN, and the temporal dependence of the load sequence is mined to form a day-ahead power load forecasting RNN module. 4) Based on the Attention module and RNN module formed in steps 2) and 3), construct an integrated framework of serial and parallel models. Utilize the Attention mechanism and RNN network characteristics to mine the temporal correlation and long-term dependency features of load time series from historical data, forming a short-term power load forecasting model based on Attention-RNN. Short-term power load forecasting is then performed based on this model. In step 2), the temporal correlations implied between time points in the load time series are quantified based on the Attention mechanism, and cross-correlation features are extracted. To quantify the temporal correlations between different time steps in the load time series, a "key-value" mechanism is adopted. The input feature vector is transformed into a query vector through linear mapping. q i Key vector k i and value vector v i Correlation scores between different time steps a We obtain the result by calculating the dot product of the query vector and the key vector: (7) The temporal correlation between different time steps is obtained by calculating the dot product of the query vector and the key vector at different time steps. The overall process of quantifying the temporal correlation of the load based on the Attention mechanism is represented as follows: (8) (9) (10) In the formula, , , To query the mapping matrix, key mapping matrix, and value mapping matrix; For input vectors x i , x j The correlation score between them; A The matrix is composed of constitute; K and Q The key matrix and query matrix are respectively composed of k i and q i constitute; H The Attention output is used; in step 3), the processing formulas of the day-ahead power load forecasting RNN module based on the load time-series dependency features of RNN are shown in (11)-(14); (11) (12) (13) (14) In the formula, , For RNN l Layer weight matrix; , For RNN l Layer bias; It is the sigmoid activation function; W o It is a linear mapping matrix; For the first l Extracted from layer RNN network t Hidden state characteristics at any given time; The hidden state features of the RNN output layer and the nearest neighbor time to the time to be predicted; The feature vector extracted by the RNN; L The number of layers in an RNN network; T The input window width for the RNN; In step 4): The original dataset is processed using a sliding window to generate a history window and a prediction window; In the serial integration framework: First, the data within the historical window is input into the RNN module. The RNN module processes the data and extracts the time-dependent features of the load sequence. Then, the feature vector set extracted by the RNN module is... Input the Attention module to extract the correlation between time steps, and finally, H The synchronous features within the prediction window are input into the fully connected layer, and the output is the short-term power load forecast. In the parallel ensemble framework: First, the data within the historical window is input in parallel into the RNN module and the Attention module to mine the temporal correlation and long-term dependency features of the load time series; then, the feature vector group extracted by the RNN is... Attention output H The synchronous features within the prediction window are input into the fully connected layer, and the short-term power load prediction value is output.
2. The short-term power load forecasting method based on Attention-RNN according to claim 1, characterized in that: In step 1), the original dataset is represented as follows: (1) In the formula: X The input matrix; x i For the first i The daily input feature vector consists of 96 load feature vectors. l i External factor eigenvectors f i constitute; For the first i The daily load vector, the number of points depends on the sampling frequency; For the first i The external factor feature vector of a day is encoded by the workday type. Season type coding Monthly type coding Holiday type coding and meteorological feature vectors n i constitute, f i Represented as: (2) The time-stamped feature encoding method adopts one-hot encoding; after determining the data structure for short-term power load forecasting, the basic framework for single-step and multi-step forecasting of day-ahead power load forecasting is expressed as follows: (3) (4) (5) (6) In the formula, This is the power load forecast matrix; Input matrix for history; The synchronization feature matrix; T and These are the historical window width and the prediction window width, respectively. K To predict the number of days in advance; This represents a short-term power load forecasting model; These are the parameters obtained from model training.
Citation Information
Patent Citations
Power load forecasting method based on long short-term memory neural network
WO2018161722A1
KR20220040968A
