A method for constructing a power load forecasting model based on Seq2Seq and its application
By introducing a combination of residual connections, temporal convolutional networks, and long-short-term memory networks into the Seq2Seq power load forecasting model, the deficiencies in forecasting accuracy of the Seq2Seq model are solved, and the accuracy of power load forecasting and the trainability of the model are improved. .
Patent Information
- Application Number
- CN202210569462.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-24
- Publication Date
- 2024-09-06
- Estimated Expiration
- 2042-05-24
AI Technical Summary
Existing power load forecasting methods have shortcomings in prediction accuracy. In particular, the Seq2Seq model is difficult to fully extract effective information when processing long input sequences, resulting in low prediction accuracy.
The power load forecasting model based on Seq2Seq is adopted. By introducing multiple basic blocks in series into the model, including encoder, prediction decoder and estimation decoder, and through the residual connection mechanism, the input of each basic block is the superior basic block. The difference between the historical power load sequence of the block and the estimated sequence output by the upper-level basic block is used as the residual of the model to minimize the prediction error. The encoder uses a temporal convolutional network, and the decoder uses a parameter-shared LSTM unit, which combines the advantages of a temporal convolutional network and a long short-term memory network.
It improves the accuracy of power load prediction, overcomes the problem that the context vector in the traditional Seq2Seq model cannot fully express the input sequence information, enhances the model's trainability and prediction accuracy, and is suitable for power grid energy prediction.
Smart Images

Figure CN114970711B
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of power load forecasting, and more specifically, relates to a method for constructing a Seq2Seq-based power load forecasting model and its application. Background Art
[0002] With the rapid development of modernization and urbanization, the role of a stable and efficient power system in society is becoming increasingly significant. In power systems, load forecasting is crucial for determining power supply, establishing efficient and accurate operation plans, reducing system losses, and improving the reliability, efficiency, and safety of power supply to users. However, power load data exhibits complex patterns and fluctuations, making accurate load forecasting a challenging task. In the era of big data, analyzing historical power load data curves to predict power load curves for the next day or several days is a crucial aspect of power system scheduling.
[0003] Defects and shortcomings of existing technology:
[0004] Power load data is essentially a time series. There are three main types of time series forecasting methods: statistical methods, traditional machine learning-based methods, and deep learning-based methods.
[0005] Statistical models use historical load data to fit a regression model. In particular, the Autoregressive Integrated Moving Average (ARIMA) model is one of the most well-known statistical models for load forecasting, overcoming the ARMA model's limitation of being applicable only to stationary time series. However, ARIMA and its variants have proven to perform poorly on nonlinear and nonstationary load data, as these models fail to capture the underlying temporal relationships within the time series.
[0006] Traditional machine learning-based models learn from input load data. Unlike statistical models, the input-output mapping in machine learning models does not need to be defined in advance, but is learned during the training process. Support Vector Regression (SVR) is one of the most commonly used machine learning models in load forecasting. It maps historical load data into a higher-dimensional space through nonlinear mapping and then performs linear regression on the mapped elements. Another commonly used model is the regression tree (RT). However, these machine learning models require complex feature engineering before modeling, and these features directly determine the effectiveness of the forecasting model. Feature engineering, in turn, requires extensive practical experience and domain-specific knowledge.
[0007] Deep learning-based models have become the most promising approaches for load forecasting due to their excellent nonlinear fitting capabilities. They are able to effectively extract features and automatically establish complex mappings between multiple inputs and outputs. Convolutional neural networks (CNNs) and long short-term memory (LSTM) have been widely used in load forecasting and have achieved some success in single-step power load forecasting. Furthermore, the application of the Seq2Seq model has made multi-step power load forecasting possible. The core of this model lies in two different sequence-based neural networks, an encoder and a decoder, which enhance the prediction of continuous sequences while also allowing inputs and outputs to have different temporal dimensions. The encoder is responsible for converting the input sequence into a fixed-size vector representation, called a context vector. The decoder is responsible for converting the context vector into an output sequence. However, for longer input sequences, the encoder struggles to compress all the valid temporal information in the input sequence into the context vector, and the decoder struggles to extract all the valuable information from the context vector, resulting in low prediction accuracy. Summary of the Invention
[0008] In response to the above defects or improvement needs of the existing technology, the present invention provides a method for constructing and applying a Seq2Seq-based power load forecasting model to solve the technical problem of low prediction accuracy of existing power load forecasting methods.
[0009] To achieve the above objectives, the present invention provides a method for constructing a power load forecasting model based on Seq2Seq, comprising the following steps:
[0010] S1. Build a power load forecasting model. The power load forecasting model includes: multiple basic blocks connected in series; wherein the basic blocks include an encoder, a prediction decoder, and an estimation decoder; the encoder is used to extract the features of the input historical power load sequence, obtain a context vector, and output it to the prediction decoder and the estimation decoder respectively; the prediction decoder is used to predict the power load information at T time points in the future based on the context vector to generate a prediction sequence; the estimation decoder is used to estimate the historical power load sequence based on the context vector to obtain an estimated sequence;
[0011] Any two adjacent basic blocks are connected by residuals. The input of a lower-level basic block is the difference between the historical power load sequence input to its upper-level basic block and the estimated sequence output by the upper-level basic block. The estimated sequence output by the last-level basic block is the residual of the above power load forecasting model.
[0012] The above power load forecasting model is used to predict the power load at T time points in the future. The predicted power load sequence is the superposition of the prediction sequences output by all basic blocks.
[0013] S2, minimizing the deviation between the power load sequence predicted by the power load forecasting model and the actual power load sequence and minimizing the residual error of the power load forecasting model, using a pre-collected training set to train the power load forecasting model;
[0014] The training set includes: a historical power load sequence and its corresponding real power load at T future time points; the historical power load sequence includes power load data at N historical time points, and a sequence consisting of corresponding temperature and wind speed.
[0015] Further preferably, the method for obtaining the historical power load sequence includes:
[0016] Max-Min normalization is performed on the raw power data obtained from the power system. The raw power data includes the power load data collected at historical time points, as well as the corresponding temperature and wind speed.
[0017] The standardized data is rolled and segmented based on the sliding window to obtain multiple groups of historical power load series.
[0018] Further preferably, the encoder comprises a plurality of temporal convolutional networks connected in series.
[0019] Further preferably, the above-mentioned prediction decoder includes multiple LSTM units connected in series and sharing parameters; the number of LSTM units in the prediction decoder is T.
[0020] Further preferably, the estimation decoder comprises a plurality of LSTM units connected in series and sharing parameters; the number of LSTM units in the estimation decoder is the same as the length of the historical power load sequence input into the basic block where the estimation decoder is located.
[0021] Further preferably, the loss function of the above power load forecasting model is:
[0022]
[0023] Where m is the number of historical power load sequences in the training set; Y i is the actual power load at T future time points corresponding to the i-th historical power load sequence; is the power load sequence predicted by the power load forecasting model when the i-th historical power load sequence is input; E i is the residual of the power load forecasting model when the i-th historical power load series is input.
[0024] In a second aspect, the present invention provides a Seq2Seq-based power load forecasting method, comprising:
[0025] The currently collected historical power load sequence is input into the power load forecasting model constructed based on the above-mentioned power load forecasting model construction method to obtain the predicted value of the power load at the next T time points.
[0026] Further preferably, the method for obtaining the historical power load sequence includes:
[0027] Perform Max-Min normalization on the raw power data currently acquired from the power system. The raw power data includes the power load data collected at historical time points, as well as the corresponding temperature and wind speed.
[0028] The standardized data is rolled and segmented based on the sliding window to obtain multiple groups of historical power load series.
[0029] In a third aspect, the present invention provides a Seq2Seq-based power load forecasting system, comprising: a memory and a processor, wherein the memory stores a computer program, and the processor executes the power load forecasting method provided in the second aspect of the present invention when executing the computer program.
[0030] In a fourth aspect, the present invention provides a machine-readable storage medium, which stores machine-executable instructions. When the machine-executable instructions are called and executed by a processor, the machine-executable instructions prompt the processor to implement the method for constructing the power load forecasting model provided in the first aspect of the present invention and / or the power load forecasting method provided in the second aspect of the present invention.
[0031] In general, the above technical solutions conceived by the present invention can achieve the following beneficial effects:
[0032] 1. The present invention provides a method for constructing a Seq2Seq-based power load forecasting model. The basic blocks in the constructed power load forecasting model are connected through residuals. By using the residuals as the input of the next basic block, each subsequent basic block only predicts and analyzes the residuals of the previous basic block. The residual input ensures that the information that can be easily fitted in the sequence is removed, so that the downstream basic blocks can focus more on predicting the unlearned information, thereby avoiding the problem that the context vector in the traditional Seq2Seq model cannot fully express all the information of the input sequence and the decoder has difficulty extracting all useful information from the context vector. The present invention allows the information that the current basic block cannot learn to be submitted to the downstream basic block for learning, reducing the burden of each basic block and allowing the time series information in the power load sequence to be more fully mined; at the same time, the present invention accumulates the final residual output of the power load forecasting model into the loss function, improving the trainability of the deep neural network and the convergence of the model; therefore, the present invention can more accurately predict the power load at T time points in the future.
[0033] 2. The method for constructing a Seq2Seq-based power load forecasting model provided by the present invention, in each basic block, the encoder is implemented by a temporal convolutional network (TCN), and the decoder adopts a series of long short-term memory network (LSTM) basic units with parameter sharing; among them, the temporal convolutional network ensures that information in the future load sequence will not be leaked to the current moment, and the long short-term memory network can prevent the gradient vanishing and gradient exploding problems in the long sequence training process; the present invention combines the respective advantages of TCN and LSTM, and has achieved a considerable improvement in the prediction results. It can be applied to energy prediction in the power grid and has strong practical applicability.
[0034] 3. The method for constructing a Seq2Seq-based power load forecasting model provided by the present invention deeply integrates the decomposition strategy into the Seq2Seq framework. During the prediction process, the original time series can be dynamically decomposed into multiple components for prediction, reducing the overall prediction burden and improving the prediction accuracy. It overcomes the defect that the encoder in the traditional Seq2Seq model is difficult to completely compress the effective information in the input sequence into the context vector. BRIEF DESCRIPTION OF THE DRAWINGS
[0035] Figure 1 Flowchart of a method for constructing a Seq2Seq-based power load forecasting model provided in Example 1 of the present invention;
[0036] Figure 2 A schematic diagram of the structure of a temporal convolutional network provided in Example 1 of the present invention;
[0037] Figure 3A schematic diagram of the structure of an LSTM unit provided in Example 1 of the present invention;
[0038] Figure 4 A schematic diagram of a process for generating historical power load sequence samples in a training set based on a sliding window provided in Example 1 of the present invention;
[0039] Figure 5 A schematic diagram of the structure of the power load forecasting model provided in Example 1 of the present invention;
[0040] Figure 6 A schematic diagram of the structure of the basic blocks provided in Example 1 of the present invention;
[0041] Figure 7 This is a flow chart of power load forecasting using a power load forecasting model provided in Example 2 of the present invention. DETAILED DESCRIPTION
[0042] In order to make the objectives, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below with reference to the accompanying drawings and embodiments.
[0043] It should be understood that the specific implementation described herein is only used to explain the present invention and is not intended to limit the present invention. In addition, all technical and scientific terms used in the present invention have the same meanings as those commonly understood by those skilled in the art to which this application belongs.
[0044] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit the exemplary embodiments according to the present application. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should be understood that when the terms "comprise" and / or "include" are used in this specification, they indicate the presence of features, steps, operations, devices, components and / or combinations thereof.
[0045] In the present invention, terms such as "upper", "lower", "left", "right", "front", "back", "vertical", "horizontal", "side", "bottom", etc. indicating directions or positional relationships are based on the directions or positional relationships shown in the accompanying drawings. They are relational words determined only for the convenience of describing the structural relationships of the various parts or elements of the present invention, and do not specifically refer to any part or element in the present invention, and should not be understood as limiting the present invention.
[0046] In the present invention, terms such as "fixed connection," "connected," and "connection" should be interpreted broadly to mean a fixed connection, an integral connection, or a detachable connection; a direct connection or an indirect connection through an intermediary. Relevant researchers or technicians in this field may determine the specific meanings of these terms in the present invention based on specific circumstances, and they should not be construed as limitations of the present invention.
[0047] Example 1
[0048] A method for constructing a power load forecasting model based on Seq2Seq, such as Figure 1 As shown, the following steps are included:
[0049] S1. Build a power load forecasting model. The power load forecasting model includes: multiple basic blocks connected in series;
[0050] Among them, each basic block includes an encoder, a prediction decoder and an estimation decoder; the encoder is used to extract the features of the input historical power load sequence and output it as a vector, called a context vector, which is output to the prediction decoder and the estimation decoder respectively; the prediction decoder is used to predict the power load information at T time points in the future based on the power load information in the context vector and generate a prediction sequence; the prediction sequence will be used as part of the final predicted power load sequence; the estimation decoder is used to estimate the historical power load sequence based on the power load information in the context vector to obtain an estimated sequence, which is used to measure the learning ability of the current basic block and transmit the information that has not been learned in the current basic block to the next basic block through the residual.
[0051] Any two adjacent basic blocks are connected by residuals; each basic block consists of an input sequence and two output sequences (a predicted sequence and an estimated sequence). The final prediction result of the power load forecasting model is the superposition of the predicted sequences of all basic blocks. The difference between the estimated sequence and the input of the current basic block is the information that the current basic block has not learned and will serve as the input of the next basic block.
[0052] Specifically, the input of the lower-level basic block is the difference between the historical power load sequence input to its upper-level basic block and the estimated sequence output by the upper-level basic block; the estimated sequence output by the last-level basic block is the residual of the entire power load forecasting model;
[0053] The basic blocks in the power load forecasting model are connected through residuals, so that information that cannot be learned by the current basic block can be submitted to the downstream basic blocks for learning, which reduces the burden of each basic block and enables the timing information in the power load sequence to be more fully mined, thereby realizing the prediction of the power load at the next T time points.
[0054] Specifically, each basic block includes an input x and two outputs: predicted output z and estimated output e. The input of the first-level basic block is the input data of the model, that is, x 1 =X; the output of the subsequent basic block is the residual of the previous basic block, that is, x i =x i-1 -e iThe final prediction result of the power load forecasting model is the superposition of the prediction outputs of each basic block. The mathematical expression of the power load forecasting model is as follows:
[0055]
[0056]
[0057] Where L is the number of basic blocks, z i is the prediction sequence of the i-th basic block, e i is the estimation sequence of the i-th basic block, X is the input of the power load forecasting model, is the prediction output of the power load forecasting model, and E is the output residual of the power load forecasting model.
[0058] Preferably, in an optional embodiment, the encoder is implemented by a temporal convolutional network (TCN), and the prediction decoder and the estimation decoder adopt a series of long short-term memory network (LSTM) basic units with parameter sharing, combining the respective advantages of TCN and LSTM, and achieving a considerable improvement in the prediction results.
[0059] Specifically, the encoder includes multiple serially connected temporal convolutional networks to extract the features of the time series data input in the current basic block; the temporal convolutional network (TCN) is used for sequence modeling, and its structural diagram is shown in the following figure: Figure 2 As shown in the figure, the model consists of three parts: causal convolution, dilated convolution, and residual connections. Causal convolution ensures causal constraints on the prediction task, meaning that information from future load sequences is not leaked to the current moment. Dilated convolution ensures that the receptive field of the temporal convolutional network increases exponentially with the number of convolutional layers, and residual connections ensure better and faster model training. In actual modeling, the convolution kernel parameters of the temporal convolutional network are adjusted as hyperparameters.
[0060] Furthermore, the prediction decoder includes a plurality of LSTM units connected in series and sharing parameters; the number of LSTM units in the prediction decoder is T. The estimation decoder includes a plurality of LSTM units connected in series and sharing parameters; the number of LSTM units in the estimation decoder is the same as the length of the historical power load sequence input to the basic block where the estimation decoder is located. In order to establish long-term dependencies, the LSTM maintains a new internal state s throughout its life cycle. In addition, three gating structures are introduced: input gate, forget gate, and output gate. The internal state s t-1 With the external state h t-1 and input x t Interaction, with the help of the gating mechanism, the output of the previous time step and the input of the current time step are used to determine the internal state vector of the elements that should be maintained, updated or deleted. The structural diagram of the LSTM unit is as follows Figure 3 shown.
[0061] In an optional implementation, the ReLU activation function is selected as the output layer activation function of each neural network in the power load forecasting model to reduce gradient vanishing and gradient explosion, so as to ensure smooth operation of the power load forecasting model during the training process.
[0062] S2. Minimizing the deviation between the power load sequence predicted by the power load forecasting model and the actual power load sequence and minimizing the residual error of the power load forecasting model are the goals. The power load forecasting model is trained using a pre-collected training set. The training set includes: a historical power load sequence and its corresponding actual power load at T future time points. The historical power load sequence includes power load data at N historical time points, and a sequence of corresponding temperatures and wind speeds arranged in chronological order. In this embodiment, load data at the past 24 time points are used to predict load data at the next 12 time points, i.e., N = 24, T = 12.
[0063] Preferably, the loss function of the power load forecasting model includes two parts. The first part is the mean square error between the power load sequence finally predicted by the power load forecasting model and the actual power load sequence; the second part is the residual finally output by the power load forecasting model.
[0064] Specifically, the loss value is calculated through the loss function; in addition to the deviation between the power load sequence predicted by the power load forecasting model and the actual power load sequence, in order to ensure the convergence of the power load forecasting model, the residual output of the power load forecasting model is also added to the loss function as the optimization target. The loss function of the above power load forecasting model is:
[0065]
[0066] Where m is the number of historical power load sequences in the training set; Y i is the actual power load at T future time points corresponding to the i-th historical power load sequence; is the power load sequence predicted by the power load forecasting model when the i-th historical power load sequence is input; E i is the residual of the power load forecasting model when the i-th historical power load series is input.
[0067] It should be noted that during the training process, the training set can be divided into different batches to train the power load forecasting model, and the loss value of the power load forecasting model is minimized in each batch. The parameters of the power load forecasting model are learned through the backpropagation mechanism. In this embodiment, the mean square error (MSE) is selected as the loss function. In addition, the residual output of the power load forecasting model is added to the loss function so that the power load forecasting model can learn the information contained in the input sequence as completely as possible. In an optional embodiment, during the training process, the stochastic gradient descent method is used to optimize the parameters of the model.
[0068] In an optional implementation manner, the method for obtaining the historical power load sequence includes:
[0069] 1) Max-Min normalization is performed on the raw power data obtained from the power system, so that the power load data range is [0, 1]. This avoids the dimensionality impact of data with different characteristics and thus speeds up the gradient descent. The raw power data includes the power load data collected at historical time points, as well as the corresponding temperature and wind speed.
[0070] Specifically, since there are dimensional differences between different dimensions of the input data, which will affect the results of model training and prediction, the Max-Min method is used to normalize the input data. The normalization range is [0,1]. The Max-Min normalization mathematical expression is as follows:
[0071]
[0072] Where x(t) and x'(t) are the original power load sequence and the standardized power load sequence at time t, respectively. min and x max are the minimum and maximum values in the original power load sequence, respectively.
[0073] 2) The standardized data is rolled and segmented based on a sliding window to obtain multiple groups of historical power load sequences, thereby obtaining the historical power load sequences in the above training set.
[0074] Specifically, the specific operation of the sliding window technology is to perform rolling segmentation on the standardized power load data according to the preset sliding window length to obtain multiple groups of time series, and each group of time series contains N input data and H target data (i.e., the actual power load at T time points in the future of the corresponding label, H = T), and the input data at each time contains d features. Specifically, the process of generating historical power load series samples in the training set based on the sliding window is shown in the following figure. Figure 4In this embodiment, data from 24 historical time points (including power load, temperature, and wind speed) are used to predict power load data for the next 12 time points. In this case, N = 24, H = 12, and d = 3. d = 3 is because the data from the 24 historical time points includes three features: power load, temperature, and wind speed.
[0075] It should be noted that the power load forecasting model provided by the present invention is composed of a series of basic blocks, and each basic block can be regarded as a component of the decomposition. Each basic block consists of three parts and appears in a fork-shaped structure. The first part is the encoder, which is responsible for compressing all useful information of the input sequence data u into the context vector c; the second part is the prediction decoder (F-Decoder), which decodes the context vector c and generates a prediction output z; the third part is the estimation decoder (E-Decoder), which is responsible for generating the best estimate e of the input sequence u based on the context vector c, where the length of the estimated sequence e is the same as the length of the input sequence u. Specifically, for the i-th basic block, it receives a sequence data u i ∈R N *d , and output two sequence data: predicted sequence z i ∈R H*1 and the estimated sequence e i ∈R N*1 For the first basic block of the model, its input u 1 The original data X={x1,x2,x3,…,x N}, contains the power load data of N time points, and the data of each time point contains d features. For other basic blocks, the input is the residual of the previous basic block, which is obtained by i-1 Subtract its estimated value e i-1 Therefore, each timestamp contains a feature, that is, d = 1. One of the output z i Is the predicted sequence data of length H generated by F-Decoder. Another output e i is the estimated sequence of input data generated by E-Decoder. Formally, the computation process of the i-th (i≥2) basic block is as follows:
[0076] u i =u i-1 -e i-1
[0077]
[0078]
[0079]
[0080] Among them, u i is the input of the i-th block; z i and e i are the predicted and estimated sequence data, which are the output of the i-th block. f (·), g e (·) represents Encoder, F-Decoder, and E-Decoder respectively, are the corresponding parameters.
[0081] In each basic block, the estimated sequence of the input sequence is generated by the E-Decoder, and the residual is obtained by calculating the difference with the input sequence. The residual is then used as the input of the next basic block, so that each subsequent basic block only predicts and analyzes the residual of the previous basic block. The residual input ensures that the information that can be easily fitted in the sequence is removed, so that the downstream basic blocks can focus more on predicting the unlearned information. This avoids the problem that the context vector in the traditional Seq2Seq model cannot fully express all the information of the input sequence and the decoder has difficulty in extracting all useful information from the context vector. In addition, the basic blocks are connected through residuals, which has significant advantages in improving the trainability of deep architectures. The structural diagram of the proposed power load prediction model is shown in Figure 2. Figure 5 shown.
[0082] Accordingly, the final output of the power load forecasting model includes two items: one is the prediction sequence of length H is the aggregation of all basic block prediction outputs; the other is a residual sequence E of length N. The form is expressed as follows:
[0083]
[0084]
[0085] Among them, z i and e i are the predicted and estimated outputs of the i-th block, respectively, and L is the total number of basic blocks.
[0086] In an optional implementation, the encoder in the basic block is implemented by TCN due to its powerful feature extraction and efficient computing capabilities. The decoders in the basic block are a series of LSTM units with shared parameters. In the encoder, the number of TCN residual blocks is a hyperparameter, which is determined by the convolution domain and the length of the input sequence; in the two decoders, the number of LSTM units is determined by the length of the prediction sequence and the estimated sequence respectively. The structural diagram of the basic block is shown in the figure below. Figure 6 shown.
[0087] Example 2
[0088] A Seq2Seq-based power load forecasting method, comprising:
[0089] The currently collected historical power load sequence is input into the power load forecasting model constructed based on the power load forecasting model construction method provided in Example 1 of the present invention to obtain the predicted value of the power load at T time points in the future.
[0090] In an optional implementation manner, the method for obtaining the historical power load sequence includes:
[0091] Perform Max-Min standardization on the raw power data currently obtained from the power system;
[0092] The standardized data is rolled and segmented based on the sliding window to obtain multiple groups of historical power load series.
[0093] The relevant technical solutions are the same as those in Example 1 and will not be described in detail here.
[0094] Specifically, using the power load forecasting model to forecast power load mainly includes the following two steps:
[0095] 1. Data normalization. Divide the classified data into training and test sets. Use the Max-Min method to normalize the data to the range [0, 1]. Then, use the sliding window technique to generate training samples. The relevant scheme is the same as in Example 1 and will not be repeated here.
[0096] 2. Model training and prediction. Use the constructed power load forecasting model to train the standardized training data, and input the standardized test set data into the trained power load forecasting model for prediction, and finally obtain the final prediction result. The whole prediction process is as follows: Figure 7 As shown, the power load forecasting model is recorded as the Novel-Seq2Seq model.
[0097] In this implementation, the training data set comes from power load data from three countries obtained from the Open Power System Data Platform. The load data is sampled at a 15-minute frequency. Temperature and wind speed are also included. Comparisons were conducted with multiple time series forecasting models for different forecast horizons.
[0098] The model was constructed using the PyTorch library. Hyperparameters were determined using a grid search strategy. Four prediction ranges were used: N = 3, N = 6, N = 12, and N = 24. The batch size for the training set was set to 128, and the batch size for the test set was set to 64. The learning rate was set to 0.001, and the mean squared error (MSE) and mean absolute percentage error (MAPE) were used to measure the performance of the model predictions.
[0099] Table 1 shows the mean square error comparison values obtained by the power load forecasting model (Proposed) provided by the present invention and the benchmark model for different prediction ranges on three data sets.
[0100] Table 1
[0101]
[0102] Table 1 shows that, for different prediction horizons, the proposed model achieves the best performance across both evaluation metrics compared to the baseline models. For example, when the prediction horizon is 3, as shown in the second column of the prediction results on the CH dataset, the proposed model achieves a MAPE of 2.958%, while the baseline models achieve MAPEs of 3.439%, 5.401%, and 4.061%, respectively. Furthermore, the accuracy of each model decreases as the prediction horizon increases. This is primarily due to two factors. First, as the prediction horizon increases, the uncertainty of the power load data increases, making the prediction task more difficult. Second, it is due to flaws in the prediction models. Specifically, the SVR and ARIMA models employ a recursive strategy for multi-step prediction, which inherently suffers from error accumulation. Therefore, accuracy decreases dramatically as the prediction horizon increases. Although Seq2Seq models do not suffer from error accumulation, as the prediction horizon increases, more information must be learned from the power load data, making it difficult for the context vector generated by the encoder to capture all patterns. The power load forecasting model provided by the present invention uses residual connections between basic blocks, allowing information not learned by previous basic blocks to be passed to downstream basic blocks for learning, resulting in high accuracy. Therefore, the advantages of the invented model become more pronounced as the prediction range increases. In summary, the power load forecasting model provided by the present invention achieves excellent results in all aspects.
[0103] In summary, the present invention deeply integrates the decomposition strategy into the Seq2Seq framework. During the prediction process, the original time series can be dynamically decomposed into multiple components for prediction, reducing the overall prediction burden, improving the prediction accuracy, and overcoming the defect that the encoder in the traditional Seq2Seq model is difficult to completely compress the effective information in the input sequence into the context vector. The power load prediction model provided by the present invention is connected by a series of basic blocks through residuals, and the final residual output of the model is added to the loss function, which improves the trainability of the deep neural network and the convergence of the model. Specifically, in each basic block, the encoder is implemented by a temporal convolutional network (TCN), and the decoder adopts a series of long short-term memory network (LSTM) basic units with parameter sharing, combining the respective advantages of TCN and LSTM, and has achieved a considerable improvement in the prediction results. It can be applied to energy prediction in power grids and has strong practical applicability.
[0104] Example 3
[0105] A Seq2Seq-based power load forecasting system includes: a memory and a processor, wherein the memory stores a computer program, and the processor executes the power load forecasting method provided in Example 2 of the present invention when executing the computer program.
[0106] The relevant technical solution is the same as that in Example 2 and will not be described in detail here.
[0107] Example 4
[0108] A machine-readable storage medium stores machine-executable instructions. When the machine-executable instructions are called and executed by a processor, the machine-executable instructions prompt the processor to implement the method for constructing a power load forecasting model provided in Example 1 of the present invention and / or the power load forecasting method provided in Example 2 of the present invention.
[0109] The relevant technical solutions are the same as those in Example 1 and Example 2 and will not be described in detail here.
[0110] It will be easily understood by those skilled in the art that the above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
Claims
1. A method for constructing a power load forecasting model based on Seq2Seq, characterized in that: The following steps are involved: S1. Build a power load forecasting model; The electric load forecasting model comprises: a plurality of basic blocks connected in series; the basic blocks comprise an encoder, a prediction decoder and an estimation decoder; the encoder is used to extract the features of the input historical electric load sequence, obtain a context vector, and output it to the prediction decoder and the estimation decoder respectively; the prediction decoder is used to predict the electric load information at T time points in the future based on the context vector to generate a prediction sequence; the estimation decoder is used to estimate the historical electric load sequence based on the context vector to obtain an estimation sequence; Any two adjacent basic blocks are connected by residuals; the input of the lower basic block is the difference between the historical power load sequence input to its upper basic block and the estimated sequence output by the upper basic block; the estimated sequence output by the last basic block is the residual of the power load forecasting model; The power load prediction model is used to predict the power load at T future time points, and the predicted power load sequence is a sequence obtained by superimposing the prediction sequences output by all basic blocks; S2, minimizing the deviation between the power load sequence predicted by the power load forecasting model and the actual power load sequence and minimizing the residual of the power load forecasting model as the goal, using the pre-collected training set to train the power load forecasting model; The training set includes: a historical power load sequence and its corresponding real power load at T future time points; the historical power load sequence includes power load data at N historical time points, and a sequence consisting of corresponding temperature and wind speed.
2. The method for constructing a power load prediction model according to claim 1, characterized in that: The method for obtaining the historical power load sequence includes: Max-Min standardization is performed on the original power data obtained from the power system; the original power data includes the power load data collected at the historical time point, and the corresponding temperature and wind speed; The standardized data is rolled and segmented based on the sliding window to obtain multiple groups of historical power load sequences.
3. The method for constructing a power load forecasting model according to claim 1 or 2, characterized in that: The encoder includes multiple temporal convolutional networks connected in series.
4. The method for constructing a power load forecasting model according to claim 1 or 2, characterized in that: The prediction decoder includes a plurality of LSTM units connected in series and sharing parameters; the number of LSTM units in the prediction decoder is T.
5. The method for constructing a power load prediction model according to claim 1 or 2, characterized in that: The estimation decoder comprises a plurality of LSTM units connected in series and sharing parameters; the number of LSTM units in the estimation decoder is the same as the length of the historical power load sequence input into the basic block where the estimation decoder is located.
6. The method for constructing a power load prediction model according to claim 1, characterized in that: The loss function of the power load forecasting model is: Wherein, m is the number of historical power load sequences in the training set; Y i is the actual power load at T future time points corresponding to the i-th historical power load sequence; is the power load sequence predicted by the power load forecasting model when the i-th historical power load sequence is input; E i is the residual of the power load forecasting model when the i-th historical power load sequence is input.
7. A method for power load forecasting based on Seq2Seq, characterized in that: include: The currently collected historical power load sequence is input into the power load forecasting model constructed by the power load forecasting model construction method described in any one of claims 1-6 to obtain the predicted value of the power load at T time points in the future.
8. The power load forecasting method according to claim 7, characterized in that: The method for obtaining the historical power load sequence includes: The original power data currently obtained from the power system is Max-Min standardized; the original power data includes the power load data collected at the historical time point, and the corresponding temperature and wind speed; The standardized data is rolled and segmented based on the sliding window to obtain multiple groups of historical power load sequences.
9. A power load forecasting system based on Seq2Seq, characterized in that: include: A memory and a processor, wherein the memory stores a computer program, and the processor executes the power load forecasting method according to claim 7 or 8 when executing the computer program.
10. A machine-readable storage medium, characterized in that: The machine-readable storage medium stores machine-executable instructions. When the machine-executable instructions are called and executed by the processor, the machine-executable instructions prompt the processor to implement the method for constructing the power load forecasting model described in any one of claims 1-6 and / or the power load forecasting method described in any one of claims 7-8.
