Day-ahead electricity price prediction method of long-term and short-term time sequence network based on attention mechanism

Through long-term and short-term time series networks based on attention mechanism, combined with neural networks and autoregressive modules, the nonlinear and linear parts of electricity prices are solved, and the problem of insufficient prediction accuracy in the existing technology is achieved, and higher prediction accuracy and faster training efficiency are achieved.

CN119784448AInactive Publication Date: 2025-04-08KUNMING UNIV OF SCI & TECH
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411844115.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-15
Publication Date
2025-04-08
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

The prior art is difficult to effectively deal with nonlinear and extreme values ​​when predicting electricity prices, resulting in insufficient prediction accuracy, especially when dealing with electricity price fluctuations caused by new energy generation such as wind power and photovoltaic power generation.

Method used

Long-term and short-term time series networks based on attention mechanism are used to mine the dependence between multi-dimensional input variables through a combined neural network, predict the nonlinear part of electricity price, and use the autoregressive module to increase sensitivity to the extreme value of electricity price to predict the linear part of electricity price. Finally, the two parts of the predicted values ​​are fused to obtain the final prediction result.

Benefits of technology

The accuracy and accuracy of electricity price prediction are improved, especially when dealing with electricity price sequences with non-seasonal periodic characteristics, key features are highlighted, the difficulties of the model in such predictions are overcome, and the training efficiency and convergence speed of the model are effectively improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119784448A_ABST
    Figure CN119784448A_ABST
Patent Text Reader

Abstract

The invention discloses a day-ahead electricity price prediction method based on long-term and short-term time series networks of an attention mechanism. The method comprises the following steps: acquiring a data set related to electricity price; calculating the correlation between the electricity price influence factors and the electricity price change in the data set so as to sequentially screen out the electricity price influence factors with relatively strong correlation, and constructing a sample set for the data set according to the screened electricity price influence factors and the electricity price; dividing the sample set into a training set and a test set, and normalizing data of the training set and the test set; forming an input matrix by a plurality of continuous time sequences in the normalized training set, inputting the input matrix into long-term and short-term time sequence network models based on an attention mechanism for training, and finely adjusting parameters in the training process to obtain a day-ahead electricity price prediction model with optimal parameter configuration as a trained day-ahead electricity price prediction model; and forming an input matrix by a plurality of continuous time sequences in the normalized test set, inputting the input matrix into the trained day-ahead electricity price prediction model for testing to obtain a predicted day-ahead electricity price data normalized value, and performing reverse normalization to obtain a day-ahead electricity price prediction value of a standard dimension. According to the invention, the precision of day-ahead electricity price prediction can be effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to a day-ahead electricity price prediction method based on a long-term and short-term time series network with an attention mechanism, and belongs to the field of electricity price prediction. Background Art

[0002] As the proportion of new energy power generation such as wind power and photovoltaic power continues to increase, new impetus has been injected into the power system. However, the strong volatility of wind power and photovoltaic power generation makes the traditional power industry structure unfavorable for the consumption of new energy power generation. Entering the 21st century, many countries have carried out a new round of power market reforms, improving the flexibility of power system operation through market transactions, and creating a better consumption environment for wind power and photovoltaic power generation. Electricity prices are the link between supply and demand in the power market, with strong market regulation capabilities. Participants in the power market need to better cope with market price fluctuations. On the one hand, accurate prediction of electricity prices provides important information and basis for power market participants, which helps market participants to formulate reasonable power market strategies and improve their competitive advantages. On the other hand, it encourages the effectiveness and economy of resource allocation, avoids imbalance between supply and demand and energy waste, and is of great significance to achieving a balance between power supply and demand and a balance in power market resource allocation.

[0003] At present, most of the research on spot electricity price forecasting treats spot electricity price forecasting as a time series forecasting problem, using statistical models, machine learning, deep learning and other methods for forecasting. Traditional statistical methods work well in stable electricity price forecasting, but the forecasting effect is poor when dealing with non-linear problems such as non-stationary and highly random spot electricity prices, and cannot meet the current forecasting accuracy requirements. Machine learning is also difficult to explore the laws of features in nonlinear time series in electricity price forecasting, and its accuracy and precision are still insufficient in short-term electricity price forecasting. In recent years, many scholars have applied deep learning to electricity price forecasting, but the electricity price series has nonlinear characteristics. When dealing with longer series, a single deep learning method is prone to gradient explosion or vanishing problems, resulting in poor prediction accuracy.

[0004] In view of this, the present invention is proposed. Summary of the invention

[0005] The present invention provides a method for predicting the day-ahead electricity price based on a long-term and short-term time series network with an attention mechanism. The method predicts the nonlinear part of the electricity price by mining the dependency relationship between multi-dimensional input variables through a neural network combined with multiple modules. The method predicts the linear part of the electricity price by increasing the sensitivity of the neural network to the extreme values ​​of the electricity price using an autoregressive module. Finally, the predicted values ​​of the two parts (the nonlinear part and the linear part) are fused to obtain the final prediction result.

[0006] The technical solution of the present invention is:

[0007] According to a first aspect of the present invention, a method for predicting day-ahead electricity prices based on a long-term and short-term time series network with an attention mechanism is provided, comprising the following steps:

[0008] S1. Obtain a data set related to electricity prices; calculate the correlation between electricity price influencing factors and electricity price changes in the data set, thereby successively screening out electricity price influencing factors with strong correlations, and construct a sample set for the data set based on the screened electricity price influencing factors and electricity prices;

[0009] S2, divide the sample set into a training set and a test set, and normalize the training set and the test set data;

[0010] S3, forming an input matrix with multiple continuous time series in the normalized training set, and inputting it into the long-term and short-term time series network models based on the attention mechanism for training, fine-tuning the parameters in the training process, and obtaining the day-ahead electricity price prediction model with the best parameter configuration as the trained day-ahead electricity price prediction model;

[0011] S4. Multiple continuous time series in the normalized test set are combined into an input matrix and input into the trained day-ahead electricity price prediction model for testing to obtain the normalized value of the predicted day-ahead electricity price data. After denormalization, the day-ahead electricity price prediction value of the standard dimension is obtained.

[0012] Furthermore, the data set includes carbon dioxide emissions, line losses, total electricity consumption, electricity prices, and predicted values ​​of three features, namely, onshore wind power generation, offshore wind power generation, and photovoltaic power generation, at the day before, within the day, 5 hours, 1 hour, and the current moment, for a total of 19 features.

[0013] Furthermore, the Pearson correlation coefficient is used to calculate the correlation between the influencing factors and the electricity price.

[0014] Furthermore, the long-term and short-term time series network model based on the attention mechanism consists of a multivariate time series input layer, a convolution module, a loop module, a loop skip module, an attention mechanism, an AR autoregressive module, a fully connected layer and an output layer, wherein the linear part is the AR autoregressive module and the rest are nonlinear parts.

[0015] Furthermore, the long-term and short-term time series network model based on the attention mechanism has a total of 17 layers, namely, a multivariate time series input layer, a sequence folding layer, a convolution layer 1, a convolution layer 2, a global average pooling layer, an activation layer 1, an activation layer 2, an activation layer 3, a sequence expansion layer, a BiLSTM layer, a recurrent skip layer, a fully connected layer, an attention mechanism layer 1, an attention mechanism layer 2, an activation layer 4, an AR autoregressive layer, and an output layer; the input matrix is ​​input into the model through the multivariate time series input layer as the input of the sequence folding layer and the AR autoregressive layer; the sequence folding layer folds the multivariate time series into a convolution image as the input of the convolution module, and the convolution layer 1 in the convolution module performs a convolution operation on the convolution image and then performs a convolution operation. It is the input of convolution layer 2 and the global average pooling layer, and activation layer 1, activation layer 2 and activation layer 3 are introduced after convolution layer 1, convolution layer 2 and the global average pooling layer; the output of convolution layer 2 and the global average pooling layer is point multiplied as the input of the sequence expansion layer, and the sequence expansion layer expands the convolution image into a time series as the input of the loop module and the loop skip module; the loop module processes the time series through the BiLSTM layer, and the loop skip module processes the time series through the loop skip layer. The outputs of the loop and loop skip modules are integrated together and input into the output layer through the fully connected layer with the attention mechanism. The output layer integrates the outputs of the fully connected layer and the AR autoregressive layer to obtain the electricity price prediction result.

[0016] According to a second aspect of the present invention, a day-ahead electricity price prediction system based on a long-term and short-term time series network with an attention mechanism is provided, comprising:

[0017] The screening module is used to obtain a data set related to electricity prices; it is used to calculate the correlation between the electricity price influencing factors and electricity price changes in the data set, so as to screen out the electricity price influencing factors with strong correlation in turn, and construct a sample set for the data set based on the screened electricity price influencing factors and electricity prices;

[0018] The preprocessing module is used to divide the sample set into a training set and a test set, and normalize the training set and the test set data;

[0019] The training module is used to form an input matrix from multiple continuous time series in the normalized training set, and input it into the long-term and short-term time series network models based on the attention mechanism for training, fine-tune the parameters in the training process, and obtain the day-ahead electricity price prediction model with the best parameter configuration as the trained day-ahead electricity price prediction model;

[0020] The prediction module is used to input the input matrix composed of multiple continuous time series in the normalized test set into the trained day-ahead electricity price prediction model for testing, obtain the normalized value of the predicted day-ahead electricity price data, and obtain the day-ahead electricity price prediction value of the standard dimension after denormalization.

[0021] According to a third aspect of the present invention, there is provided a terminal comprising a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the processor is configured to execute any one of the above-described methods for predicting day-ahead electricity prices based on long-term and short-term time series networks using an attention mechanism.

[0022] The beneficial effects of the present invention are:

[0023] First, the present invention uses the Pearson correlation coefficient to measure the correlation between the influencing factors and the electricity price, thereby achieving a reasonable selection of the influencing factors and avoiding the situation where irrelevant features affect the prediction speed and accuracy of the model.

[0024] Secondly, the present invention uses the LSTNet model to mine the dependency relationship between the multi-dimensional input variables of electricity price data and the electricity price to predict the nonlinear and linear parts of the electricity price, and fuses the predicted values ​​of the two parts (the nonlinear part and the linear part) to obtain the final prediction result; on this basis, the attention mechanism (ATT) is introduced to adaptively allocate the weights of the strongly correlated features of the influencing factors and the electricity price at each time point, highlighting the key features, and overcoming the difficulties of the model in predicting the electricity price series with non-seasonal periodic characteristics; at the same time, it effectively improves the training efficiency and convergence speed of the model.

[0025] Third, by introducing the nonlinear part + linear part of the attention mechanism, the present invention compares and analyzes the prediction results of the BP, LSTM, CNN-LSTM, CNN-BiLSTM and other models. The various evaluation indicators of the prediction results of the LSTNet-ATT model have achieved good results and high prediction accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] Figure 1 It is a flowchart of the present invention;

[0027] Figure 2 This is the LSTNet-ATT model structure diagram;

[0028] Figure 3 It is the correlation of factors affecting electricity prices provided by the embodiment of the present invention;

[0029] Figure 4 This is a comparison chart of the prediction results of LSTNet with and without the introduction of the attention mechanism;

[0030] Figure 5 This is a comparison chart of prediction results from different models;

[0031] Figure 6 It is a comparison chart of ablation analysis prediction results. DETAILED DESCRIPTION

[0032] In order to make the purpose, technical scheme and advantages of the embodiments of the present invention clearer, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the accompanying drawings. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention. It should be noted that the embodiments in this application and the features in the embodiments can be combined with each other arbitrarily without conflict.

[0033] Example 1: Figure 1-6 As shown, according to a first aspect of an embodiment of the present invention, a method for predicting day-ahead electricity prices based on a long-term and short-term time series network based on an attention mechanism is provided, comprising the following steps:

[0034] S1. Obtain a data set related to electricity prices; calculate the correlation between electricity price influencing factors and electricity price changes in the data set using the Pearson correlation coefficient formula, thereby successively screening out electricity price influencing factors with strong correlations, and construct a sample set for the data set based on the screened electricity price influencing factors and electricity prices;

[0035] S2, divide the sample set into a training set and a test set, and use the min-max method to normalize the training set and test set data to between [0,1];

[0036] S3, forming an input matrix with multiple continuous time series in the normalized training set, and inputting it into the long-term and short-term time series network models based on the attention mechanism for training, fine-tuning the parameters in the training process, and obtaining the day-ahead electricity price prediction model with the best parameter configuration as the trained day-ahead electricity price prediction model;

[0037] S4. Multiple continuous time series in the normalized test set are combined into an input matrix and input into the trained day-ahead electricity price prediction model for testing to obtain the normalized value of the predicted day-ahead electricity price data. After denormalization, the day-ahead electricity price prediction value of the standard dimension is obtained.

[0038] Furthermore, the data set includes carbon dioxide emissions, line losses, total electricity consumption, electricity prices, and predicted values ​​of three features, namely, onshore wind power generation, offshore wind power generation, and photovoltaic power generation, at the day before, within the day, 5 hours, 1 hour, and the current moment, totaling 19 features, and 18 factors affecting electricity prices (i.e., features other than electricity prices).

[0039] Furthermore, the Pearson correlation coefficients (PCCs) are used to calculate the correlation between the influencing factors and the electricity price, so as to achieve a reasonable selection of the influencing factors, eliminate irrelevant features, and incorporate the features with strong correlation into the sample data.

[0040] Furthermore, the long-term and short-term time series network model (LSTNet-ATT) based on the attention mechanism consists of a multivariate time series input layer, a convolution module, a loop module, a loop skip module, an attention mechanism, an AR autoregressive module, a fully connected layer and an output layer, wherein the linear part is the AR autoregressive module and the rest are nonlinear parts.

[0041] Furthermore, the entire model has 17 layers, namely, multivariate time series input layer, sequence folding layer, convolution layer 1, convolution layer 2, global average pooling layer, activation layer 1, activation layer 2, activation layer 3, sequence expansion layer, BiLSTM layer, recurrent skip layer, fully connected layer, attention mechanism layer 1, attention mechanism layer 2, activation layer 4, AR autoregressive layer, and output layer; the input matrix is ​​input into the model through the multivariate time series input layer as the input of the sequence folding layer and the AR autoregressive layer; the sequence folding layer folds the multivariate time series into a convolution image as the input of the convolution module, and the convolution layer 1 in the convolution module performs a convolution operation on the convolution image as the input of the convolution layer 2 and the global average pooling layer, and the convolution layer 1, convolution layer 2 and the global average pooling layer are used as the input. After the average pooling layer, activation layer 1, activation layer 2 and activation layer 3 are introduced; the output of convolution layer 2 and the global average pooling layer is multiplied as the input of the sequence expansion layer, and the sequence expansion layer expands the convolution image into a time series as the input of the loop module and the loop skip module; the loop module processes the time series through the BiLSTM layer, and the loop skip module processes the time series through the BiLSTM layer (loop skip layer) with jump steps. The outputs of the loop and loop skip modules are integrated together and input into the output layer by introducing the full connection layer of the attention mechanism. The output layer integrates the outputs of the full connection layer and the AR autoregressive layer to obtain the electricity price prediction result; the attention mechanism includes attention mechanism layer 1, attention mechanism layer 2, and activation layer 4;

[0042] Furthermore, the learner of the long-term and short-term time series network model based on the attention mechanism adopts the Adam gradient descent algorithm. The convolution module has 8 parameters including the convolution step size, padding method, convolution kernel size and number, and the number of hidden layer nodes of the loop module and the loop skip module, the number of jump steps of the loop skip module, the size of the fully connected layer, the number of channels of the two attention mechanism layers, the output layer size, the learning rate of the model and the number of training rounds, a total of 9 parameters.

[0043] According to a second aspect of an embodiment of the present invention, a day-ahead electricity price prediction system based on a long-term and short-term time series network with an attention mechanism is provided, comprising:

[0044] The screening module is used to obtain a data set related to electricity prices; it is used to calculate the correlation between the electricity price influencing factors and electricity price changes in the data set, so as to screen out the electricity price influencing factors with strong correlation in turn, and construct a sample set for the data set based on the screened electricity price influencing factors and electricity prices;

[0045] The preprocessing module is used to divide the sample set into a training set and a test set, and normalize the training set and the test set data;

[0046] The training module is used to form an input matrix from multiple continuous time series in the normalized training set, and input it into the long-term and short-term time series network models based on the attention mechanism for training, fine-tune the parameters in the training process, and obtain the day-ahead electricity price prediction model with the best parameter configuration as the trained day-ahead electricity price prediction model;

[0047] The prediction module is used to input the input matrix composed of multiple continuous time series in the normalized test set into the trained day-ahead electricity price prediction model for testing, obtain the normalized value of the predicted day-ahead electricity price data, and obtain the day-ahead electricity price prediction value of the standard dimension after denormalization.

[0048] The term "module" as used above may be a combination of software and / or hardware that implements a predetermined function. For parts not described in detail for each module, please refer to the relevant description of this embodiment.

[0049] According to a third aspect of an embodiment of the present invention, a terminal is provided, comprising a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein the processor is configured to execute any one of the above-mentioned methods for predicting day-ahead electricity prices based on long-term and short-term time series networks using an attention mechanism.

[0050] Example 2: The present invention builds a long-term and short-term time series network based on the attention mechanism on the MATLAB software platform. An optional implementation of the present invention is described in detail below:

[0051] S1. The correlation between the factors affecting electricity prices and electricity prices in the data set is calculated using the Pearson correlation coefficient formula, so that the factors with strong correlation are selected in turn to form a new feature matrix. The calculation formula is as follows:

[0052]

[0053] Where: P is the Pearson correlation coefficient between the influencing factors and electricity prices; x i is the value in the influencing factor sequence, y i is the value in the electricity price series; is the sequence mean of the influencing factors, is the series mean of electricity price.

[0054] The correlation between electricity price influencing factors and electricity price calculated by Pearson correlation coefficient formula is as follows: Figure 3 As shown in the figure, the correlation between onshore wind power generation and electricity price is the largest in the data set, and it has a significant impact on electricity price. In addition, the correlation between offshore wind power generation and electricity price is second only to that of onshore wind power. The electricity price influencing factors with an absolute value of the Pearson correlation coefficient greater than 0.2 are selected as relevant variables for electricity price prediction. The data set is constructed based on the screened electricity price influencing factors and electricity prices. The screened electricity price influencing factors include line loss, total power consumption, 5 predicted values ​​of onshore wind power generation, and 4 predicted values ​​of offshore wind power generation, namely, day-ahead, 5h, 1h, and current, for a total of 11 electricity price influencing factors. The 11 electricity price influencing factors and electricity prices in the data set are used to construct a sample set.

[0055] S2. Divide the sample set into a training set and a test set. The sampling frequency of the data set is 24 times / day, the length of the data set is 30 days, and there are 720 sampling points in total, including 696 sampling points in the training set and 24 sampling points in the test set. The min-max method is used to normalize the training set and test set data to [0,1]. The sample set used by the model includes 11 factors affecting electricity prices and a total of 12 features of electricity prices. Different influencing factors have different units and different data variation ranges. Data with a larger numerical variation range can easily mask data with a smaller range variation. It is necessary to normalize each feature data to avoid the impact of dimensional differences on the results. The calculation formula for normalizing data to [0,1] using the min-max method is:

[0056]

[0057] In the formula, x i is the original value in the eigenvector, x min is the minimum value of this feature, x max is the largest value in the eigenvector. is the normalized data.

[0058] S3. Use multiple continuous time series in the normalized training set to form an input matrix, and input it into the long-term and short-term time series network model based on the attention mechanism for training. Fine-tune the parameters during the training process to obtain the day-ahead electricity price prediction model with the best parameter configuration. The output result is the electricity price prediction value of the corresponding sampling point.

[0059] S4. Multiple continuous time series in the normalized test set are combined into an input matrix and input into the trained day-ahead electricity price prediction model for testing to obtain the normalized value of the predicted day-ahead electricity price data, and then denormalize to obtain the standard dimension electricity price prediction value.

[0060] In order to verify the effectiveness of the attention mechanism in the LSTNet-ATT day-ahead electricity price prediction model, the LSTNet model without the attention mechanism was used to experiment on the test set. Each model was repeated 7 times, and the accuracy was averaged 7 times. The prediction results are shown in the figure below: Figure 4 As shown, through Figure 4 It can be seen that the prediction accuracy of the LSTNet model without the introduction of the attention mechanism is significantly lower, while the prediction result change curve of the LSTNet-ATT model of the present invention is more consistent with the actual electricity price change curve, which shows that the prediction accuracy of the LSTNet-ATT model with the introduction of the attention mechanism is significantly improved.

[0061] In order to verify the effectiveness of the LSTNet-ATT day-ahead electricity price prediction model proposed in this invention, different comparison models are used to conduct diagnostic experiments on fault data. Each model is repeated 7 times, and the accuracy is taken as the average of 7 times. The prediction results are as follows: Figure 5 As shown, Figure 5 The comparison models involved are traditional BP, LSTM, CNN-LSTM, and CNN-BiLSTM. Figure 5 It can be seen that the prediction result curve of the LSTNet-ATT model based on the attention mechanism proposed in the present invention is closest to the actual electricity price change curve and has the highest degree of fit. Among them, the prediction results output by the single BP model and LSTM model before and after the 10th sampling point of the test set show large fluctuations, which are quite different from the change trend of the actual value of the electricity price. The prediction result curve fitting degree of the two combined models of CNN-LSTM and CNN-BiLSTM is better than that of the prediction result of the two models of BP and LSTM, but still not as good as the prediction result curve fitting degree of the LSTNet-ATT model proposed in the present invention.

[0062] In order to verify the rationality of the linear and nonlinear settings of the LSTNet-ATT day-ahead electricity price forecasting model, a forecasting model excluding the linear part (model 1) and a forecasting model excluding the nonlinear part (model 2) are considered. Model 1 and model 2 are trained and predicted using the same operating environment and the same data set. Each model is repeated 7 times, and the accuracy is averaged 7 times. Finally, the prediction results of each model are obtained. The change curve is shown in the figure below. Figure 6 As shown, through Figure 6It can be seen that the prediction curves of Model 1 and Model 2 have a slightly lower degree of fit, and the prediction curve of the LSTNet-ATT model proposed in the present invention has a higher degree of fit with the actual value curve of the electricity price. Model 1 has poor performance locally because it does not have an autoregressive module to process the periodic components in the time series data and extract the periodic time series characteristics of the electricity price series. However, thanks to the cyclic jump module in the model, it can better find the connection between the current data and the data at the same time of the previous and next dates, and the prediction results have a better fitting effect on the overall trend of electricity price changes. Model 2 only uses the autoregressive module to predict electricity prices, and is more sensitive to local electricity price fluctuations, but when the number of prediction steps is large, the prediction results have a poor fit with the trend of changes in the actual value of electricity prices.

[0063] By applying the above technical solution, it can be seen that the present invention predicts the nonlinear part of the electricity price by combining neural networks to mine the dependency relationship between multi-dimensional input variables, and predicts the linear part of the electricity price by using an autoregressive module to increase the sensitivity of the neural network to the extreme values ​​of the electricity price. Finally, the predicted values ​​of the two parts (nonlinear part and linear part) are fused to obtain the final prediction result. Compared with various prediction models, the present invention has achieved higher prediction accuracy, indicating that the present invention can effectively improve the accuracy of the day-ahead electricity price prediction.

[0064] The specific implementation modes of the present invention are described in detail above in conjunction with the accompanying drawings, but the present invention is not limited to the above implementation modes, and various changes can be made within the knowledge scope of ordinary technicians in this field without departing from the purpose of the present invention.

Claims

1. A method for predicting day-ahead electricity prices based on long-term and short-term time series networks with attention mechanism, characterized in that: The following steps are involved: S1. Obtain data sets related to electricity prices; Calculate the correlation between the factors affecting electricity prices and the changes in electricity prices in the data set, thereby successively selecting the factors affecting electricity prices with strong correlations, and construct a sample set for the data set based on the selected factors affecting electricity prices and electricity prices; S2, divide the sample set into a training set and a test set, and normalize the training set and the test set data; S3, forming an input matrix with multiple continuous time series in the normalized training set, and inputting it into the long-term and short-term time series network models based on the attention mechanism for training, fine-tuning the parameters in the training process, and obtaining the day-ahead electricity price prediction model with the best parameter configuration as the trained day-ahead electricity price prediction model; S4. Multiple continuous time series in the normalized test set are combined into an input matrix and input into the trained day-ahead electricity price prediction model for testing to obtain the normalized value of the predicted day-ahead electricity price data. After denormalization, the day-ahead electricity price prediction value of the standard dimension is obtained.

2. The method for predicting day-ahead electricity prices based on long-term and short-term time series networks with attention mechanism according to claim 1 is characterized in that: The data set includes carbon dioxide emissions, line losses, total electricity consumption, electricity prices, and the predicted values ​​of onshore wind power generation, offshore wind power generation, and photovoltaic power generation at the day before, within the day, 5 hours, 1 hour, and the current moment, totaling 19 features.

3. The method for predicting day-ahead electricity prices based on long-term and short-term time series networks with attention mechanism according to claim 1, characterized in that: The Pearson correlation coefficient is used to calculate the correlation between the influencing factors and electricity prices.

4. The method for predicting day-ahead electricity prices based on long-term and short-term time series networks with attention mechanism according to claim 1 is characterized in that: The long-term and short-term time series network model based on the attention mechanism consists of a multivariate time series input layer, a convolution module, a loop module, a loop skip module, an attention mechanism, an AR autoregressive module, a fully connected layer and an output layer, wherein the linear part is the AR autoregressive module and the rest are nonlinear parts.

5. The method for predicting day-ahead electricity prices based on long-term and short-term time series networks with attention mechanism according to claim 4 is characterized in that: The long-term and short-term time series network model based on the attention mechanism has a total of 17 layers, namely, multivariate time series input layer, sequence folding layer, convolution layer 1, convolution layer 2, global average pooling layer, activation layer 1, activation layer 2, activation layer 3, sequence expansion layer, BiLSTM layer, recurrent skip layer, fully connected layer, attention mechanism layer 1, attention mechanism layer 2, activation layer 4, AR autoregressive layer, and output layer; The input matrix is ​​input into the model through the multivariate time series input layer as the input of the sequence folding layer and the AR autoregressive layer; the sequence folding layer folds the multivariate time series into a convolution image as the input of the convolution module, and the convolution layer 1 in the convolution module performs a convolution operation on the convolution image as the input of the convolution layer 2 and the global average pooling layer, and the activation layer 1, activation layer 2 and activation layer 3 are introduced after the convolution layer 1, convolution layer 2 and the global average pooling layer; the output of the convolution layer 2 and the global average pooling layer is multiplied by the point and used as the input of the sequence expansion layer, and the sequence expansion layer expands the convolution image into a time series as the input of the loop module and the loop skip module; The loop module processes the time series through the BiLSTM layer, and the loop skip module processes the time series through the loop skip layer. The outputs of the loop and loop skip modules are integrated together and input into the output layer through the fully connected layer with the introduction of the attention mechanism. The output layer integrates the outputs of the fully connected layer and the AR autoregressive layer to obtain the electricity price prediction result.

6. A day-ahead electricity price prediction system based on long-term and short-term time series networks with attention mechanism, characterized in that: include: A screening module for obtaining data sets related to electricity prices; It is used to calculate the correlation between the factors affecting electricity prices and the changes in electricity prices in the data set, so as to screen out the factors affecting electricity prices with strong correlations in turn, and construct a sample set for the data set based on the screened factors affecting electricity prices and electricity prices; The preprocessing module is used to divide the sample set into a training set and a test set, and normalize the training set and the test set data; The training module is used to form an input matrix from multiple continuous time series in the normalized training set, and input it into the long-term and short-term time series network models based on the attention mechanism for training, fine-tune the parameters in the training process, and obtain the day-ahead electricity price prediction model with the best parameter configuration as the trained day-ahead electricity price prediction model; The prediction module is used to input the input matrix composed of multiple continuous time series in the normalized test set into the trained day-ahead electricity price prediction model for testing, obtain the normalized value of the predicted day-ahead electricity price data, and obtain the day-ahead electricity price prediction value of the standard dimension after denormalization.

7. A terminal, characterized in that: The invention comprises a processor, a memory and a computer program stored in the memory and executable on the processor, wherein the processor is configured to execute the day-ahead electricity price prediction method based on the long-term and short-term time series network of the attention mechanism as described in any one of claims 1 to 5.

Citation Information

Cited By

  • Day-ahead electricity price prediction method based on parallel multi-dimensional attention mechanism

    CN119180671A