Power price prediction method and device based on time dimension, equipment and storage medium

By extracting features from multi-source datasets and performing dimensionality reduction, combined with advanced neural network models, the problem of accuracy in multi-scale demand forecasting for electricity prices has been solved, achieving high efficiency, accuracy, and flexibility in real-time, day-ahead, and week-ahead electricity price forecasts.

CN121120113APending Publication Date: 2025-12-12CHENGDU GCL DIGITAL INTELLIGENCE TECHNOLOGY CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202511279927.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-09
Publication Date
2025-12-12

AI Technical Summary

Technical Problem

Existing technologies struggle to meet multi-scale requirements in real-time, day-ahead, and week-ahead electricity price forecasts, resulting in low accuracy. They are also susceptible to multiple factors, making it difficult to capture nonlinear dynamics. Furthermore, data gaps and computational complexity contribute to inaccurate forecasts.

Method used

By acquiring multi-source datasets, using mutual information scores and correlation matrices to determine target features, combining Bernoulli distribution to generate mask matrices and principal component analysis techniques for dimensionality reduction, a power price prediction model based on multi-head attention mechanism, convolutional layers, and bidirectional long short-term memory networks is constructed, and trained and validated to adapt to power markets in different regions and policies.

Benefits of technology

It improves the accuracy and flexibility of electricity price forecasts across different time dimensions, significantly reduces forecasting costs, and enhances the comprehensiveness and accuracy of forecasts.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121120113A_ABST
    Figure CN121120113A_ABST
Patent Text Reader

Abstract

The invention discloses an electric power price prediction method and device based on time dimension, equipment and a storage medium, and relates to the technical field of electric power systems, and the method comprises the steps: carrying out the preprocessing of a multi-source data set comprising historical electric power transaction data, a load demand curve, energy production data and fuel cost, performing feature extraction on the obtained processed data set to obtain each data feature, and determining a training set and a verification set based on the data features by using Bernoulli distribution; constructing an initial power price prediction model based on a multi-head attention mechanism, a convolutional layer, a preset activation function, a bidirectional long-short-term memory network and integration of a low-rank adaptation technology, and training and verifying the initial power price prediction model by using the training set and the verification set respectively; and performing multi-scale prediction by using the obtained target power price prediction model to obtain prediction results of the power price in different time dimensions. And the real-time, day-ahead and weekly prediction accuracy of the electric power price is improved.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the technical field of power systems, in particular to a power price prediction method and device based on time dimension, equipment and storage medium. BACKGROUND

[0002] Power price prediction is a key technology for efficient operation of power markets, and is of great significance on real-time, day-ahead and week-ahead scales. Real-time prediction (minute / hour level) helps market participants (such as power generation and consumption enterprises) to adjust supply and demand, optimize scheduling and reduce peak risk in real time; day-ahead prediction (next 24 hours) supports short-term planning, load management and trading strategies, and improves resource allocation efficiency; week-ahead prediction (next week) is used for medium-term planning, contract negotiation and risk hedging, and promotes market stability and energy transformation. These predictions support smart grids and renewable energy integration, and provide a decision-making data foundation.

[0003] However, the existing technology faces the following challenges: price fluctuations are severe, influenced by multiple factors such as demand, weather, fuel, intermittent renewable energy and geopolitical events, making it difficult for models to capture nonlinear dynamics; there are large differences in different scales, real-time needs to handle high-frequency noise, day-ahead emphasizes short-term uncertainty, and week-ahead involves long-term trends, traditional methods (such as ARIMA (Autoregressive Integrated Moving Average Model), neural networks) are often targeted at a single scale, and it is difficult to consider multiple scales; data loss, delay and computational complexity result in low accuracy, which cannot meet the complex market demand.

[0004] From the above, how to improve the prediction accuracy of power prices in real time, day-ahead and week-ahead is a problem to be solved at present. SUMMARY

[0005] Therefore, the purpose of the present application is to provide a power price prediction method and device based on time dimension, equipment and storage medium, which can improve the prediction accuracy of power prices in real time, day-ahead and week-ahead. The specific scheme is as follows:

[0006] In a first aspect, the present application provides a power price prediction method based on time dimension, comprising:

[0007] Obtaining a multi-source data set including historical power transaction data, load demand curve, energy production data and fuel cost, preprocessing the multi-source data set to obtain a processed data set, extracting features of the processed data set to obtain data features, determining mutual information scores and correlation matrices of the data features and power prices, and determining target features based on the mutual information scores and the correlation matrices;

[0008] The mask matrix is generated by using a Bernoulli distribution, a hidden feature is determined based on the mask matrix and a feature matrix corresponding to the target feature, and a principal component analysis technique is used to reduce the dimension of the hidden feature to obtain a reduced feature, and a corresponding training set and a validation set are determined based on the reduced feature;

[0009] An initial electricity price prediction model is constructed based on a multi-head attention mechanism, a convolution layer, a preset activation function, a bidirectional long short-term memory network and integration of a low-rank adaptive technology, the training set and the validation set are used to train and verify the initial electricity price prediction model respectively, and a target electricity price prediction model is obtained;

[0010] Based on the input data and using the target electricity price prediction model, multi-scale prediction is performed to obtain the prediction results of the electricity price in different time dimensions.

[0011] Optionally, the acquisition includes a multi-source data set including historical electricity trading data, load demand curve, energy production data and fuel cost, and the multi-source data set is preprocessed to obtain a processed data set, including:

[0012] Multi-scale feature data is collected based on multiple sources; the multi-scale feature data includes historical electricity trading data, load demand curve, energy production data, fuel cost and external influence data;

[0013] The multi-scale feature data is time-aligned to obtain aligned data, and the aligned data is uniformly processed in format to obtain uniform data;

[0014] The uniform data is processed for missing values and outliers to obtain a processed data set.

[0015] Optionally, the processed data set is feature-extracted to obtain each data feature, the mutual information score and the correlation matrix of the data feature and the electricity price are determined, and the target feature is determined based on the mutual information score and the correlation matrix, including:

[0016] The processed data set is feature-extracted to obtain data features, and the mutual information score is determined based on the dependency relationship between each data feature and the electricity price;

[0017] The first correlation coefficient between each data feature is determined, and the second correlation coefficient between the data feature and the electricity price is determined;

[0018] The correlation matrix is constructed based on the first correlation coefficient and the second correlation coefficient, the correlation matrix is extracted, and the second correlation coefficient extracted is determined as the correlation score between each data feature and the electricity price;

[0019] determine the data features corresponding to the mutual information scores greater than the first target threshold as first screened features, and determine the data features corresponding to the correlation scores greater than the second target threshold as second screened features;

[0020] determine the union of the first screened features and the second screened features as candidate features, and perform redundancy filtering on the candidate features based on the first correlation coefficients in the correlation matrix to obtain target features.

[0021] Optionally, the Bernoulli distribution is used to generate a mask matrix, a masked feature is determined based on the mask matrix and a feature matrix corresponding to the target feature, and principal component analysis technology is used to reduce the dimension of the masked feature to obtain a reduced dimension feature, and a corresponding training set and validation set are determined based on the reduced dimension feature, including:

[0022] generate a mask matrix based on the target feature and the Bernoulli distribution and according to a target masking ratio, and determine a masked feature based on the mask matrix and the target feature and using an element multiplication method;

[0023] merge the masked features to obtain an enhanced data set, use principal component analysis technology to reduce the dimension of the enhanced data set to obtain a reduced dimension feature, and divide the reduced dimension feature based on a preset division method to obtain a corresponding training set and validation set.

[0024] Optionally, the initial power price prediction model is constructed based on the union of the multi-head attention mechanism, the convolution layer, the preset activation function, the bidirectional long short-term memory network and the low-rank adaptive technology, the training set and the validation set are used to train and verify the initial power price prediction model respectively to obtain a target power price prediction model, including:

[0025] construct an initial power price prediction model based on the multi-head attention mechanism, the convolution layer, the preset activation function and the bidirectional long short-term memory network;

[0026] map the training set to a hidden dimension using a first fully connected layer of the initial power price prediction model to obtain an initial hidden state, and perform trigonometric function positional encoding on the initial hidden state to obtain an input layer output result;

[0027] project the input layer output result to obtain a query, a key and a value, determine a single-head attention result based on the query, the key and the value and using the multi-head attention mechanism, and splice the single-head attention result to obtain a multi-head attention output result;

[0028] extract local features based on the multi-head attention output result and using the convolution layer to obtain a convolution layer output result;

[0029] performing non-linear transformation on the convolutional layer output result by using a preset activation function to obtain an activation function output result, determining a forward processing result and a backward processing result based on the activation function output result and by using the bidirectional long short-term memory network respectively, and merging the forward processing result and the backward processing result to obtain a memory network output result;

[0030] performing linear mapping on the memory network output result by using a linear layer of the initial power price prediction model to obtain a linear layer output result;

[0031] performing residual connection and layer normalization on the linear layer output result to obtain a normalized output result, determining the normalized output result as a new input layer output result, and jumping to the step of projecting the input layer output result until a target iteration number is reached to obtain a target normalized output result;

[0032] performing flattening processing on the target normalized output result to obtain a flattened result, and determining an initial prediction result based on the flattened result and by using a second fully connected layer of the initial power price prediction model;

[0033] determining a corresponding loss value based on the initial prediction result and an actual value of the power price and by using a mean square error loss function, and adjusting the initial power price prediction model based on the loss value and a first preset learning rate and by using a back propagation technique to obtain a trained power price prediction model;

[0034] verifying the trained power price prediction model by using a verification set to obtain a target power price prediction model.

[0035] Optionally, the verifying the trained power price prediction model by using a verification set to obtain a target power price prediction model comprises:

[0036] freezing a multi-head attention mechanism of the trained power price prediction model based on a low-rank adaptation technique to obtain a frozen power price prediction model;

[0037] fine-tuning the frozen power price prediction model by using a second preset learning rate to obtain a fine-tuned power price prediction model; the first preset learning rate is greater than the second preset learning rate;

[0038] verifying the fine-tuned power price prediction model by using a verification set to determine a target power price prediction model based on a verification result.

[0039] Optionally, the multi-scale prediction based on the input data and using the target power price prediction model is performed to obtain a prediction result of the power price in different time dimensions, including:

[0040] A prediction interval is determined using the target power price prediction model and the actual predicted demand;

[0041] If the prediction interval is a first target value, real-time prediction is performed based on the input data and using the target power price prediction model to obtain a first prediction result;

[0042] If the prediction interval is a second target value, day-ahead prediction is performed based on the input data and using the target power price prediction model to obtain a second prediction result;

[0043] If the prediction interval is a third target value, week-ahead prediction is performed based on the input data and using the target power price prediction model to obtain a third prediction result.

[0044] In a second aspect, the present application provides a power price prediction device based on time dimension, comprising:

[0045] A target feature determination module is configured to obtain a multi-source data set including historical power transaction data, load demand curve, energy production data and fuel cost, pre-process the multi-source data set to obtain a processed data set, extract each data feature from the processed data set, determine mutual information scores and correlation matrices of the data features and power prices, and determine target features based on the mutual information scores and the correlation matrices;

[0046] A feature dimension reduction module is configured to generate a mask matrix using a Bernoulli distribution, determine a masked feature based on the mask matrix and a feature matrix corresponding to the target feature, and reduce the dimension of the masked feature using a principal component analysis technique to obtain a reduced feature, and determine a corresponding training set and validation set based on the reduced feature;

[0047] A target model determination module is configured to construct an initial power price prediction model based on a multi-head attention mechanism, a convolution layer, a preset activation function, a bidirectional long short-term memory network and an integrated low-rank adaptive technology, train and validate the initial power price prediction model using the training set and the validation set respectively to obtain a target power price prediction model;

[0048] A power price prediction module is configured to perform multi-scale prediction based on input data and using the target power price prediction model to obtain a prediction result of the power price in different time dimensions.

[0049] In a third aspect, the present application provides an electronic device, comprising:

[0050] a memory for storing the computer program;

[0051] a processor for executing the computer program to implement the time-dimension based power price prediction method.

[0052] In a fourth aspect, the present application provides a computer readable storage medium for storing a computer program, wherein the computer program, when executed by a processor, implements the time-dimension based power price prediction method.

[0053] The present application obtains a multi-source data set including historical power transaction data, load demand curve, energy production data and fuel cost, pre-processes the multi-source data set to obtain a processed data set, extracts each data feature from the processed data set, determines mutual information scores and correlation matrices of the data features and power prices, determines target features based on the mutual information scores and the correlation matrices; generates a mask matrix using Bernoulli distribution, determines masked features based on the mask matrix and the feature matrix corresponding to the target features, and reduces the dimensions of the masked features using principal component analysis technology to obtain reduced dimension features, determines corresponding training set and validation set based on the reduced dimension features; constructs an initial power price prediction model based on the union of multi-head attention mechanism, convolution layer, preset activation function, bidirectional long short-term memory network and low-rank adaptive technology, respectively trains and validates the initial power price prediction model using the training set and the validation set to obtain a target power price prediction model; and performs multi-scale prediction based on input data and using the target power price prediction model to obtain prediction results of power prices in different time dimensions.

[0054] As can be seen from the above, the present application integrates historical power transaction data, load demand curve, energy production data and fuel cost as a multi-source data set, extracts target features with high correlation with power prices based on mutual information, then generates a mask matrix using Bernoulli distribution to simulate common data missing situations in industrial scenarios to generate masked features, and reduces the dimensions of the features through principal component analysis technology to reduce the computational amount of model parameters; then constructs an initial power price prediction model based on the union of multi-head attention mechanism, convolution layer, preset activation function, bidirectional long short-term memory network and low-rank adaptive technology, and obtains a target power price prediction model using the training set and the validation set. In this way, the low-rank adaptive technology can adapt to power markets in different regions and with different policies, improve the flexibility of the target power price prediction model, use the target power price prediction model for multi-scale prediction, greatly reduce the prediction cost, and significantly improve the comprehensiveness and accuracy of power price prediction. BRIEF DESCRIPTION OF DRAWINGS

[0055] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the accompanying drawings needed to be used in the embodiments or prior art description will be briefly introduced as follows. Obviously, the accompanying drawings in the following description only are the embodiments of the present application, and for those skilled in the art, other drawings can also be obtained based on the provided drawings without any creative effort.

[0056] Figure 1 A flow chart of a time-dimension-based power price prediction method disclosed in the present application;

[0057] Figure 2 A data preprocessing schematic diagram provided in the present application;

[0058] Figure 3 A structural schematic diagram of an initial power price prediction model provided in the present application;

[0059] Figure 4 A power price prediction result schematic diagram corresponding to a 10% shielding ratio provided in the present application;

[0060] Figure 5 A power price prediction result schematic diagram corresponding to a 20% shielding ratio provided in the present application;

[0061] Figure 6 A power price prediction result schematic diagram corresponding to a 30% shielding ratio provided in the present application;

[0062] Figure 7 A power price prediction result schematic diagram corresponding to a 40% shielding ratio provided in the present application;

[0063] Figure 8 A power price prediction result schematic diagram corresponding to a 50% shielding ratio provided in the present application;

[0064] Figure 9 A real-time power price prediction comparison schematic diagram provided in the present application;

[0065] Figure 10 A week-ahead power price prediction comparison schematic diagram provided in the present application;

[0066] Figure 11 A structural schematic diagram of a time-dimension-based power price prediction device disclosed in the present application;

[0067] Figure 12 A structural diagram of an electronic device disclosed in the present application. DETAILED DESCRIPTION

[0068] With reference to the drawings of the embodiments of the present application, the technical solutions in the embodiments of the present application will be clearly and completely described, obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor are within the protection scope of the present application.

[0069] At present, the existing technology is not only volatile when predicting the electricity price, but also affected by multiple factors such as demand, weather, fuel, renewable energy intermittency and geopolitical events, and the model is difficult to capture nonlinear dynamics; the difference between different scales of demand is large, real-time needs to process high-frequency noise, day-ahead emphasizes short-term uncertainty, week-ahead involves long-term trend, and cannot meet the complex market demand. Therefore, the present application provides a time-dimension-based electricity price prediction method, which can adapt to different regions and different policy electricity markets by using low-rank adaptation technology, improve the flexibility of the target electricity price prediction model, use the target electricity price prediction model for multi-scale prediction, greatly reduce the prediction cost, and significantly improve the comprehensiveness and accuracy of the electricity price prediction.

[0070] Referring to Figure 1 The embodiment of the present application discloses a time-dimension-based electricity price prediction method, which comprises:

[0071] Step S11, a multi-source data set including historical electricity transaction data, load demand curve, energy production data and fuel cost is obtained, the multi-source data set is preprocessed to obtain a processed data set, each data feature is obtained by performing feature extraction on the processed data set, mutual information scores and correlation matrices of the data features and the electricity price are determined, and target features are determined based on the mutual information scores and the correlation matrices.

[0072] In the embodiment, multi-scale feature data is collected from multiple sources, historical / real-time electricity transaction data conforming to the demand curve, such as hourly peak electricity consumption, can be obtained from the electricity market database; minute / hourly weather data including temperature, humidity and wind speed can be obtained from the meteorological API (Application Programming Interface, API); various energy generation capacities and fuel costs can be obtained from the energy statistics platform, and geopolitical event indicators such as the stability of energy transportation channels can be obtained. Figure 2An example of data preprocessing is provided. After obtaining the multi-scale feature data, the multi-scale feature data is cleaned and processed, and the correlation matrix and mutual information score are used to extract features from the obtained processed data set, and random masking is performed to obtain an enhanced data set. Then, principal component analysis technology is used to complete the corresponding noise reduction and principal component extraction operation to obtain the reduced dimension features. Specifically, after obtaining the multi-scale feature data, because the sampling rates of different channels are different, for example, the meteorological data is minute-level, and the energy statistics is hour-level, the time interval needs to be unified. Therefore, the multi-scale feature data is aligned according to the time stamp to obtain the aligned data, and the aligned data is processed in a unified format and missing values and outliers. The IQR (Interquartile Range) method can be used to identify outliers to obtain the processed data set. Specifically, the multi-source data set including historical power transaction data, load demand curve, energy production data, and fuel cost is obtained, and the multi-source data set is preprocessed to obtain the processed data set, including: collecting multi-scale feature data based on multiple sources; the multi-scale feature data includes historical power transaction data, load demand curve, energy production data, fuel cost, and external influence data; time alignment is performed on the multi-scale feature data to obtain aligned data, and the aligned data is processed in a unified format to obtain unified data; the unified data is processed for missing values and outliers to obtain the processed data set.

[0073] It can be understood that the processed data set is extracted to obtain data features, the mutual information score between each data feature and the electricity price is determined, if the data feature changes, the electricity price also changes, and the corresponding mutual information score is large; the first correlation coefficient between any two data features is determined, the first correlation coefficient between each data feature is determined, and the second correlation coefficient between the data feature and the electricity price is determined; the first correlation coefficient and the second correlation coefficient can be Pearson coefficient, a correlation matrix is constructed based on the first correlation coefficient and the second correlation coefficient, the correlation matrix is extracted, and the absolute value of the second correlation coefficient extracted is determined as the correlation score between each data feature and the electricity price; the data feature corresponding to the mutual information score greater than 0.2 is determined as the first screened feature, and the data feature corresponding to the correlation score greater than 0.2 is determined as the second screened feature; the union of the first screened feature and the second screened feature is determined as the candidate feature, the candidate feature can be filtered based on the first correlation coefficient in the correlation matrix, or the candidate feature can be filtered based on business logic to obtain the target feature.

[0074] Specifically, the feature extraction on the processed data set obtains each data feature, the mutual information score and the correlation matrix of the data feature and the electricity price are determined, and the target feature is determined based on the mutual information score and the correlation matrix, including: performing feature extraction on the processed data set to obtain data features, and determining a mutual information score based on the dependency relationship between each data feature and the electricity price; determining a first correlation coefficient between each data feature, and determining a second correlation coefficient between the data feature and the electricity price; constructing a correlation matrix based on the first correlation coefficient and the second correlation coefficient, extracting the correlation matrix, and determining the second correlation coefficient obtained by extraction as the correlation score between each data feature and the electricity price; determining the data feature corresponding to the mutual information score greater than a first target threshold as a first screened feature, and determining the data feature corresponding to the correlation score greater than a second target threshold as a second screened feature; determining the union of the first screened feature and the second screened feature as a candidate feature, and performing redundancy filtering on the candidate feature based on the first correlation coefficient in the correlation matrix to obtain a target feature. It is worth mentioning that the first target threshold and the second target threshold can be adjusted according to actual conditions, which are not limited here.

[0075] In step S12, a mask matrix is generated using a Bernoulli distribution, a masked feature is determined based on the mask matrix and a feature matrix corresponding to the target feature, and dimension reduction is performed on the masked feature using principal component analysis technology to obtain a reduced feature, and a corresponding training set and validation set are determined based on the reduced feature.

[0076] In this embodiment, after obtaining the target feature, a mask matrix is generated based on the target feature and a Bernoulli distribution according to a target masking ratio, a masked feature matrix is determined based on the mask matrix and the target feature using element multiplication, and the corresponding formula is as follows:

[0077] ;

[0078] Wherein, is a masked feature matrix, i.e. a masked feature; is the mask matrix, generated according to a Bernoulli distribution, and the probability of an element taking 1 is , and the probability of taking 0.0001 is ; is the target feature, including n samples and m feature dimensions; is the element multiplication method; is the masking ratio, representing a random masking rate of 10% to 90%. Masked feature matrices with different masking ratios are combined to obtain an enhanced data set, and the corresponding formula is as follows:

[0079] ;

[0080] wherein, is the enhanced dataset; is the union set; is a label vector, i.e., a power price. After obtaining the enhanced dataset, a principal component analysis (PCA) technique is used to reduce the dimension of the enhanced dataset to obtain reduced dimension features, and the reduced dimension features are divided based on a preset division manner to obtain a corresponding training set and a validation set.

[0081] Specifically, the use of Bernoulli distribution to generate a mask matrix, determining the masked feature based on the mask matrix and the feature matrix corresponding to the target feature, and using the principal component analysis technique to reduce the dimension of the masked feature to obtain the reduced dimension feature, and determining the corresponding training set and the validation set based on the reduced dimension feature, comprises: generating a mask matrix based on the target feature and the Bernoulli distribution and according to the target masking ratio, determining the masked feature based on the mask matrix and the target feature and using element multiplication method; merging the masked feature to obtain an enhanced dataset, using the principal component analysis technique to reduce the dimension of the enhanced dataset to obtain the reduced dimension feature, and dividing the reduced dimension feature based on a preset division manner to obtain a corresponding training set and a validation set.

[0082] Step S13, based on the multi-head attention mechanism, the convolution layer, the preset activation function, the bidirectional long short-term memory network and the integrated low-rank adaptive technology to construct an initial power price prediction model, and respectively using the training set and the validation set to train and verify the initial power price prediction model to obtain a target power price prediction model.

[0083] In this embodiment, an initial power price prediction model is constructed based on the multi-head attention mechanism, the convolution layer, the preset activation function and the bidirectional long short-term memory network, and the structure of the initial power price prediction model is as shown in Figure 3 The training set is input into the input layer of the initial power price prediction model to map to the hidden dimension, and the trigonometric function position coding is performed to obtain the input layer output result, and the corresponding formula is as follows:

[0084] ;

[0085] wherein, is the input layer output result; is the first full connection layer; is the position coding, which uses the standard trigonometric function position coding to add the position information of the sequence, preventing the coding layer attention mechanism from ignoring the time sequence; is the input training set corresponding to the tensor, that is , where batch is the batch size, seq_len is the sequence length, that is, the historical time step, which can be divided by a sliding window, indicating how many time steps of data before the predicted time are related, and input_size is the feature dimension, that is, the number of input columns corresponding to the reduced features. The output shape of the final input layer is , where hidden_size is the internal dimension of the model.

[0086] It can be understood that the initial power price prediction model adopts an N-layer stackable encoding layer structure, where N is usually 3, and can also be adjusted according to actual conditions. The feature flow of the stackable encoding layer is: input , that is, the output shape of the input layer output result, i=1~N, corresponding to the number of stackable encoding layers, after being transformed by each encoding layer module, output , where batch is the batch size, seq_len is the sequence length, and d_model is the model dimension, which is usually set to equal hidden_size, and the layers have residual connections, that is , to avoid information loss caused by incorrect activation of parameters in the encoding layer. The stackable encoding layer includes multi-head attention, a convolutional layer, a preset activation function, a bidirectional long short-term memory network, and a linear layer. After obtaining the input layer output result, the input layer output result is input to the multi-head attention, and the input of the multi-head attention is , which is initially , the input layer output result is projected into a query Q, a key K, and a value V, that is , , , where , , and are projection matrices, and the shape of the projection matrix is , where , d_model is the model dimension; is the number of preset multi-head attention heads; based on the query, the key, and the value and using the multi-head attention mechanism, a single-head attention result is determined, and the corresponding formula is as follows:

[0087] ;

[0088] , where is the single-head attention result; is the attention mechanism; Q is the query; K is the key; and V is the value. Then, the single-head attention result is spliced to obtain a multi-head attention output result, and the corresponding formula is as follows:

[0089] ;

[0090] wherein, is the multi-head attention output result; is connected; is a preset output projection matrix, which is used to map the splicing result corresponding to the multi-head attention output result back to the target dimension of the model, so as to keep the input feature dimension consistent.

[0091] Further, after obtaining the multi-head attention output result, the multi-head attention output result is processed by using the convolution layer, and the corresponding formula is as follows:

[0092] ;

[0093] wherein, is the convolution layer output result; is a one-dimensional convolution function of the convolution layer; is the multi-head attention output result; is the input channel number of the convolution layer; hidden_size is the internal dimension of the model; is the output channel number of the convolution layer; d_model is the model dimension; is the time window size of the convolution layer; indicates that one 0 is filled at each end of the time dimension of the multi-head attention result, so as to ensure that the sequence length after convolution is unchanged. After obtaining the convolution layer output result, the convolution layer output result is nonlinearly transformed by using a GELU (Gaussian Error Linear Unit) activation function or a ReLU (Rectified Linear Unit) activation function, so as to obtain an activation function output result, and the corresponding formula is as follows:

[0094] ;

[0095] wherein, is the activation function output result; is the convolution layer output result; is to perform probability weighting on the convolution layer output result, if the value of C is larger, closer to 1; if the value of C is smaller, closer to 0. After obtaining the activation function output result, the forward processing result and the backward processing result are respectively determined based on the activation function output result and by using the bidirectional long short-term memory network, and the corresponding formula is as follows:

[0096] ;

[0097] ;

[0098] wherein, is the hidden state of the t1th time step, i.e., the forward processing result; is the backward processing result; is the activation function output result of the tth time step; is the core calculation unit of the long short-term memory network; is the hidden state of the t-1th time step; is the hidden state of the t+1th time step, and the forward processing result and the backward processing result are combined to obtain a combined processing result , and dropout (a regularization technique in deep learning algorithm) is added in the combined processing result to prevent overfitting, to obtain a memory network output result L.

[0099] In this embodiment, after obtaining the memory network output result, linear mapping is performed based on the memory network output result and using a linear layer of the initial power price prediction model to map back to the d_model dimension, supporting stacking. Then residual connection and layer normalization are performed to obtain a normalized output result, and the corresponding formula is as follows:

[0100] ;

[0101] wherein, is the normalized output result; is the normalization operation; is the linear layer; is the residual connection; is the memory network output result. Based on the normalized output result and the total number of encoding layers corresponding to the stackable encoding layer, a final initial prediction result is determined, and the corresponding formula is as follows:

[0102] ;

[0103] wherein, is the initial prediction result; is is the flattening function; n is the total number of encoding layers; is the second fully connected layer; batch is the batch size; is the normalized output result; For the prediction interval, it is assumed that the time interval is 1 hour, the real-time prediction is adjusted to 1, and the day-ahead prediction is adjusted to 24. It is worth mentioning that the total number of encoding layers and the target iteration number are a one-to-one correspondence, and the total number of encoding layers is 3 by default, which can also be adjusted according to actual conditions. Then the obtained initial prediction result is compared with the true value of the electricity price, based on the obtained comparison result and using the mean square error loss function to determine the corresponding loss value, based on the loss value and the first preset learning rate corresponding to the AdamW (Adaptive Moment Estimation with Weight Decay, an optimization algorithm for deep learning) optimizer and using the back propagation technology to adjust the parameters of each layer of the initial electricity price prediction model to obtain the trained electricity price prediction model, and then using the validation set to verify the trained electricity price prediction model to obtain the target electricity price prediction model.

[0104] Specifically, the initial electricity price prediction model is constructed based on the multi-head attention mechanism, the convolution layer, the preset activation function and the bidirectional long short-term memory network and integrated with the low-rank adaptation technology, the training set and the validation set are used to train and verify the initial electricity price prediction model respectively to obtain the target electricity price prediction model, including: constructing an initial electricity price prediction model based on the multi-head attention mechanism, the convolution layer, the preset activation function and the bidirectional long short-term memory network; mapping the training set to a hidden dimension by using a first full connection layer of the initial electricity price prediction model to obtain an initial hidden state, and performing triangular function position coding on the initial hidden state to obtain an input layer output result; projecting the input layer output result to obtain a query, a key and a value, determining a single-head attention result based on the query, the key and the value and by using the multi-head attention mechanism, splicing the single-head attention result to obtain a multi-head attention output result; extracting local features based on the multi-head attention output result and by using the convolution layer to obtain a convolution layer output result; performing nonlinear transformation on the convolution layer output result by using a preset activation function to obtain an activation function output result, determining a forward processing result and a backward processing result based on the activation function output result and by using the bidirectional long short-term memory network respectively, and merging the forward processing result and the backward processing result to obtain a memory network output result; performing linear mapping on the memory network output result by using a linear layer of the initial electricity price prediction model to obtain a linear layer output result; performing residual connection and layer normalization on the linear layer output result to obtain a normalized output result, determining the normalized output result as a new input layer output result, and jumping to the step of projecting the input layer output result until a target iteration number is reached to obtain a target normalized output result; performing flattening processing on the target normalized output result to obtain a flattened result, and determining an initial prediction result based on the flattened result and by using a second full connection layer of the initial electricity price prediction model; determining a corresponding loss value based on the initial prediction result and an electricity price true value and by using a mean square error loss function, adjusting the initial electricity price prediction model based on the loss value and a first preset learning rate and by using a back propagation technology to obtain a trained electricity price prediction model; verifying the trained electricity price prediction model by using the validation set to obtain the target electricity price prediction model.

[0105] In the embodiment, the low-rank adaptation technology is introduced into the trained electricity price prediction model, a multi-layer perception layer is added as an adapter, parameters corresponding to the multi-head attention mechanism can be frozen to obtain a frozen electricity price prediction model, and the corresponding formula is as follows:

[0106] ;

[0107] wherein, is a target output result corresponding to the frozen power price prediction model; is a parameter of the frozen multi-head attention; is an original output result of the multi-head attention layer; is a low-rank parameter corresponding to the low-rank adaptation technology. Since the power price data has a long time span and different power markets do not have high precision and universality after the first training due to external environmental factors, fine-tuning is needed. By default, the core layer is frozen, that is, the parameters of the multi-head attention mechanism. According to actual needs, the parameters of other layers can also be frozen to improve adaptability. If the desired accuracy is still not achieved, retrain all parameters of the model using new data. The second preset learning rate at this time can be set to one-tenth of the first preset learning rate. Then, the fine-tuned power price prediction model is verified using the validation set to determine the target power price prediction model based on the verification result.

[0108] Specifically, the verification of the trained power price prediction model using the validation set to obtain the target power price prediction model comprises: freezing the multi-head attention mechanism of the trained power price prediction model based on the low-rank adaptation technology to obtain a frozen power price prediction model; fine-tuning the frozen power price prediction model using a second preset learning rate to obtain a fine-tuned power price prediction model; the first preset learning rate is greater than the second preset learning rate; and verifying the fine-tuned power price prediction model using the validation set to determine the target power price prediction model based on the verification result.

[0109] Step S14: performing multi-scale prediction based on the input data and using the target power price prediction model to obtain prediction results of the power price in different time dimensions.

[0110] In this embodiment, the processed input data is input into the target electricity price prediction model for multi-scale prediction. The input data corresponds to the data after dimensionality reduction. If the prediction interval is 1, it is a real-time prediction of electricity prices; if the preset interval is 24, it is a day-ahead prediction of electricity prices; if the prediction interval is 168, it is a week-ahead prediction of electricity prices. Specifically, the multi-scale prediction based on the input data and using the target electricity price prediction model to obtain prediction results of electricity prices at different time dimensions includes: determining the prediction interval using the target electricity price prediction model and actual prediction demand; if the prediction interval is a first target value, then real-time prediction is performed based on the input data and using the target electricity price prediction model to obtain a first prediction result; if the prediction interval is a second target value, then day-ahead prediction is performed based on the input data and using the target electricity price prediction model to obtain a second prediction result; if the prediction interval is a third target value, then week-ahead prediction is performed based on the input data and using the target electricity price prediction model to obtain a third prediction result.

[0111] Understandably, after obtaining the target electricity price prediction model, to highlight the model's robustness, random shading of the test set data is used to simulate data loss or feature loss during actual use for day-ahead prediction. After training the model using the complete shading dataset, inference is performed. The shading ratio of the inference dataset is 10%, 20%, 30%, 40%, and 50% to simulate the loss of 10%, 20%, 30%, 40%, and 50% of data during actual data collection, respectively. Then, the 24-hour electricity price for the same day is predicted. The electricity price prediction result corresponding to a 10% shading ratio is shown below. Figure 4 As shown, the actual price is the actual 24-hour electricity price. When the shading ratio is 10%, the corresponding evaluation indicators RMSE (Root Mean Square Error) is 2.3801 and MAPE (Mean Absolute Percentage Error) is 0.0295. When the data is not shaded, the evaluation indicators RMSE is 2.6199 and MAPE is 0.0320. It can be seen that when there is a 10% loss of data, the prediction effect of the target electricity price prediction model is improved to a certain extent. And a data loss of about 10% is the situation faced in most actual electricity price prediction scenarios.

[0112] Understandable, Figure 5The power price prediction result corresponding to a shielding ratio of 20% provided by the embodiment, wherein when the shielding ratio is 20%, the evaluation index RMSE is 3.1550 and the MAPE is 0.0386; and when the data is not shielded, the evaluation index RMSE is 2.6199 and the MAPE is 0.0320. It can be seen that when the loss ratio is 20%, the prediction accuracy decreases slightly, but the MAPE is controlled within 4%, and the model accuracy is still excellent. Figure 6 The power price prediction result corresponding to a shielding ratio of 30% provided by the embodiment, wherein when the data shielding ratio is 30%, the evaluation index RMSE is 3.7473 and the MAPE is 0.0433. It can be seen that when the loss ratio is 30%, the model prediction accuracy continues to decrease, but the MAPE is controlled within 5%. Figure 7 The power price prediction result corresponding to a shielding ratio of 40% provided by the embodiment, wherein when the data shielding ratio is 40%, the evaluation index RMSE is 2.6062 and the MAPE is 0.0298. It can be seen that when the loss ratio is 40%, the prediction accuracy of the day increases. Figure 8 The power price prediction result corresponding to a shielding ratio of 50% provided by the embodiment, wherein when the data shielding ratio is 50%, the evaluation index RMSE is 4.7780 and the MAPE is 0.0514. It can be seen that when the loss ratio is 50%, that is, the feature vector information loss is almost general, the model accuracy decreases obviously, but the MAPE is still maintained at about 5%, indicating that the model has strong robustness.

[0113] Further, Figure 9 The real-time prediction power price comparison diagram provided by the embodiment can be seen. In the observation of nearly 1000 time steps, the model prediction value is always close to the true value. For the only prediction interval with obvious deviation, it can be found that the trend of the prediction value is consistent with the true value in this interval. It may be due to some sudden power system failure, abnormal power supply peak, which causes the true value to be lower than the prediction trend as a whole. Figure 10 The week-ahead prediction power price comparison diagram provided by the embodiment can be seen. It can be seen that the prediction points of the first two days have high accuracy, and the overall electricity price trend of the last 5 days is tracked well, which is similar to the way of obtaining the target prediction size at one time through the output layer structure. Because the objective function is the root mean square error of the whole week of 168 points, the initial stage prediction value may deviate obviously. However, the overall error MAPE is controlled within 15.7%.

[0114] As can be seen from the above, the application integrates historical electricity transaction data, load demand curve, energy production data and fuel cost as a multi-source data set, extracts target features related to high electricity price based on mutual information, then generates a mask matrix using Bernoulli distribution to simulate the common data missing situation in the industrial scene to generate the masked features, and reduces the feature dimension through principal component analysis technology to reduce the operation amount of model parameters; then based on the set of multi-head attention mechanism, convolution layer, preset activation function and bidirectional long short-term memory network and integrating low-rank adaptive technology to construct an initial electricity price prediction model, and using the training set and the validation set to obtain the target electricity price prediction model. In this way, the low-rank adaptive technology can adapt to different regions and different policy electricity markets, improve the flexibility of the target electricity price prediction model, use the target electricity price prediction model for multi-scale prediction, greatly reduce the prediction cost, and significantly improve the comprehensiveness and accuracy of electricity price prediction.

[0115] Correspondingly, referring to Figure 11 The application also provides an electricity price prediction device based on time dimension, which comprises:

[0116] A target feature determination module 11 is configured to acquire a multi-source data set comprising historical electricity transaction data, load demand curve, energy production data and fuel cost, pre-process the multi-source data set to obtain a processed data set, extract data features from the processed data set, determine mutual information scores and correlation matrices of the data features and electricity price, and determine target features based on the mutual information scores and the correlation matrices.

[0117] A feature dimension reduction module 12 is configured to generate a mask matrix using Bernoulli distribution, determine masked features based on the mask matrix and the feature matrix corresponding to the target features, and reduce the dimension of the masked features using principal component analysis technology to obtain reduced features, and determine corresponding training set and validation set based on the reduced features.

[0118] A target model determination module 13 is configured to construct an initial electricity price prediction model based on the set of multi-head attention mechanism, convolution layer, preset activation function and bidirectional long short-term memory network and integrating low-rank adaptive technology, train and validate the initial electricity price prediction model using the training set and the validation set respectively to obtain a target electricity price prediction model.

[0119] An electricity price prediction module 14 is configured to perform multi-scale prediction based on input data and using the target electricity price prediction model to obtain the prediction results of electricity price in different time dimensions.

[0120] In some embodiments, the target feature determination module 11 can specifically include:

[0121] a feature data collection unit configured to collect multi-scale feature data based on multi-source channels, wherein the multi-scale feature data includes historical electricity transaction data, load demand curve, energy production data, fuel cost and external influence data;

[0122] a data alignment unit configured to perform time alignment on the multi-scale feature data to obtain aligned data, and perform format unification processing on the aligned data to obtain unified data;

[0123] a data processing unit configured to perform missing value and abnormal value processing on the unified data to obtain a processed data set.

[0124] In some embodiments, the target feature determination module 11 can specifically include:

[0125] a score determination unit configured to perform feature extraction on the processed data set to obtain data features, and determine mutual information scores based on the dependency relationship between each data feature and electricity price;

[0126] a coefficient determination unit configured to determine first correlation coefficients between each data feature, and determine second correlation coefficients between the data features and the electricity price;

[0127] the score determination unit is configured to construct a correlation matrix based on the first correlation coefficients and the second correlation coefficients, extract the correlation matrix, and determine the second correlation coefficients as the correlation scores between each data feature and the electricity price;

[0128] a screened feature determination unit configured to determine data features corresponding to mutual information scores greater than a first target threshold as first screened features, and determine data features corresponding to correlation scores greater than a second target threshold as second screened features;

[0129] a feature filtering unit configured to determine the union of the first screened features and the second screened features as candidate features, and perform redundancy filtering on the candidate features based on the first correlation coefficients in the correlation matrix to obtain target features.

[0130] In some embodiments, the feature dimension reduction module 12 can specifically include:

[0131] a masked feature determination unit configured to generate a mask matrix based on target features and a Bernoulli distribution according to a target masking proportion, and determine masked features based on the mask matrix and the target features and using element multiplication method;

[0132] a feature division unit, configured to merge the shielding features to obtain an enhanced data set, perform dimension reduction on the enhanced data set by using a principal component analysis technique to obtain reduced features, and divide the reduced features based on a preset division manner to obtain corresponding training sets and verification sets.

[0133] In some embodiments, the target model determination module 13 can specifically include:

[0134] an initial model construction unit, configured to construct an initial power price prediction model based on a multi-head attention mechanism, a convolution layer, a preset activation function, and a bidirectional long short-term memory network;

[0135] a first output result determination unit, configured to map the training set to a hidden dimension by using a first full connection layer of the initial power price prediction model to obtain an initial hidden state, and perform trigonometric function position coding on the initial hidden state to obtain an input layer output result;

[0136] a second output result determination unit, configured to project the input layer output result to obtain a query, a key, and a value, determine a single-head attention result based on the query, the key, and the value and by using the multi-head attention mechanism, and splice the single-head attention result to obtain a multi-head attention output result;

[0137] a third output result determination unit, configured to extract local features based on the multi-head attention output result and by using the convolution layer to obtain a convolution layer output result;

[0138] a fourth output result determination unit, configured to perform nonlinear transformation on the convolution layer output result by using a preset activation function to obtain an activation function output result, determine a forward processing result and a backward processing result based on the activation function output result and by using the bidirectional long short-term memory network, respectively, and combine the forward processing result and the backward processing result to obtain a memory network output result;

[0139] a fifth output result determination unit, configured to perform linear mapping based on the memory network output result and by using a linear layer of the initial power price prediction model to obtain a linear layer output result;

[0140] a sixth output result determination unit, configured to perform residual connection and layer normalization on the linear layer output result to obtain a normalized output result, determine the normalized output result as a new input layer output result, and jump to the step of projecting the input layer output result until a target number of iterations is reached to obtain a target normalized output result;

[0141] An initial result determination unit is configured to perform flattening processing on the target normalized output result to obtain a flattened result, and determine an initial prediction result based on the flattened result and a second full connection layer of the initial power price prediction model;

[0142] A model adjustment unit is configured to determine a corresponding loss value based on the initial prediction result and a real power price value and using a mean square error loss function, and adjust the initial power price prediction model based on the loss value and a first preset learning rate and using a back propagation technique to obtain a trained power price prediction model.

[0143] A model verification unit is configured to verify the trained power price prediction model using a verification set to obtain a target power price prediction model.

[0144] In some embodiments, the feature dimension reduction module 12 can specifically include:

[0145] A mechanism freezing unit is configured to freeze a multi-head attention mechanism of the trained power price prediction model based on a low-rank adaptation technique to obtain a frozen power price prediction model.

[0146] A model fine-tuning unit is configured to fine-tune the frozen power price prediction model using a second preset learning rate to obtain a fine-tuned power price prediction model; the first preset learning rate is greater than the second preset learning rate.

[0147] A target model determination unit is configured to verify the fine-tuned power price prediction model using a verification set to determine a target power price prediction model based on a verification result.

[0148] In some embodiments, the power price prediction module 14 can specifically include:

[0149] A prediction interval determination unit is configured to determine a prediction interval using the target power price prediction model and an actual predicted demand.

[0150] A first prediction result determination unit is configured to, if the prediction interval is a first target value, perform real-time prediction based on input data and using the target power price prediction model to obtain a first prediction result.

[0151] A second prediction result determination unit is configured to, if the prediction interval is a second target value, perform day-ahead prediction based on input data and using the target power price prediction model to obtain a second prediction result.

[0152] The third prediction result determination unit is configured to, if the prediction interval is a third target value, perform a week-ahead prediction based on the input data and using the target power price prediction model to obtain a third prediction result.

[0153] Further, the embodiment of the present application further discloses an electronic device, Figure 12 is a structural diagram of an electronic device 20 according to an exemplary embodiment, and the content in the figure cannot be considered as any limitation on the use range of the present application. The electronic device 20 can specifically include at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25 and a communication bus 26. The memory 22 is configured to store a computer program, and the computer program is loaded and executed by the processor 21 to implement the related steps in the power price prediction method based on the time dimension disclosed in any of the foregoing embodiments. In addition, the electronic device 20 in the embodiment can be an electronic computer.

[0154] In the embodiment, the power supply 23 is configured to provide working voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and external devices, and the communication protocol followed by the communication interface 24 can be any communication protocol applicable to the technical solution of the present application, which is not limited specifically herein; the input / output interface 25 is configured to obtain external input data or output data to the outside, and the specific interface type can be selected according to the specific application needs, which is not limited specifically herein.

[0155] In addition, the memory 22 as a carrier for resource storage can be a read-only memory, a random access memory, a magnetic disk or an optical disk, and the resources stored thereon can include an operating system 221, a computer program 222, etc., and the storage mode can be temporary storage or permanent storage.

[0156] The operating system 221 is configured to manage and control each hardware device on the electronic device 20 and the computer program 222, and can be Windows Server, Netware, Unix, Linux, etc. The computer program 222 can further include computer programs capable of completing other specific work in addition to the computer programs capable of completing the power price prediction method based on the time dimension executed by the electronic device 20 disclosed in any of the foregoing embodiments.

[0157] Further, the present application further discloses a computer readable storage medium for storing a computer program; wherein the computer program is executed by a processor to implement the power price prediction method based on the time dimension disclosed above. The specific steps of the method can refer to the corresponding content disclosed in the foregoing embodiments, which will not be repeated here.

[0158] The various embodiments described in this specification are presented by way of example, and each embodiment is not necessarily composed of all features described with respect to other embodiments. Each embodiment described in this specification can be implemented in conjunction with one or more other embodiments described in this specification, and each embodiment described in this specification can be implemented independently of any other embodiments described in this specification. Some embodiments described in this specification are presented by way of example only and can not be necessarily used in conjunction with any other embodiments described in this specification. Some embodiments described in this specification are not mutually exclusive, including the described arrangements, but can exist in the same device, the same system, in different devices, or in different systems.

[0159] Those skilled in the art will further appreciate that the units and algorithms described in connection with the examples disclosed herein can be embodied directly in hardware, in software, or in a combination of the two. For ease of understanding, descriptions of the examples have been generally presented in the context of software instructions being executed by a processor. Those skilled in the art will recognize that software instructions in this context can include software, firmware, one or more programs, pre-compiled code, scripts, or other functionality operating as a functional equivalent, as these terms are understood in the technical field of computer science. Those skilled in the art will also recognize that the software instructions can be implemented in a variety of programming languages, including machine languages, assembly languages, high-level procedural or object-oriented languages, and that the software instructions can be deployed in varying ways, including as stand-alone programs or as modules, components, subroutines, or other units of programs.

[0160] The steps of a method or algorithm described in connection with the examples disclosed herein can be embodied directly in hardware, in software, or in a combination of the two. Software modules can be stored in RAM, ROM, a hard disk, a removable magnetic disk, a CD-ROM, or any other form of storage medium known in the art. The software modules can include one or more of a process, a function, a procedure, an object, an executable, a thread of execution, a program, or any combination of the above.

[0161] Finally, it should be noted that the terms "first", "second", and the like, herein do not denote any order, quantity, combination, or importance, but rather are used to distinguish one element from another, and do not imply singular or plural. Moreover, the terms "include", "have", or any other variant thereof are intended to encompass non-exclusive inclusions, such that processes, methods, articles, or apparatuses that comprise a set of elements not expressly listed or inherent to such processes, methods, articles, or apparatuses are also encompassed within the scope of the specification. Unless otherwise defined, an element specified by the statement "comprising a" does not exclude the presence of additional identical elements in the process, method, article, or apparatus that includes the element.

[0162] The technical solutions provided by the present application are described in detail above, and the principles and implementation manners of the present application are described by using specific examples. The above description of the examples is only used to help understand the method of the present application and its core idea; meanwhile, for those skilled in the art, according to the idea of the present application, the specific implementation manners and application ranges will be changed, and the above description of the content of the specification should not be understood as a limitation on the present application.

Claims

1. A time-dimension based electricity price forecasting method, characterized by, The method comprises the following steps: acquiring a multi-source data set comprising historical electricity transaction data, load demand curve, energy production data and fuel cost, preprocessing the multi-source data set to obtain a processed data set, extracting data features from the processed data set, determining mutual information scores and correlation matrices of the data features and electricity prices, and determining target features based on the mutual information scores and the correlation matrices; generating a mask matrix using a Bernoulli distribution, determining masked features based on the mask matrix and the feature matrix corresponding to the target features, and reducing the dimensions of the masked features using principal component analysis to obtain reduced features, and determining corresponding training set and validation set based on the reduced features; constructing an initial electricity price prediction model based on multi-head attention mechanism, convolution layer, preset activation function, bidirectional long short-term memory network and low-rank adaptive technology, training and verifying the initial electricity price prediction model using the training set and the validation set respectively to obtain a target electricity price prediction model; performing multi-scale prediction based on input data and using the target electricity price prediction model to obtain prediction results of electricity prices in different time dimensions. 2.The time-dimension based electricity price forecasting method according to claim 1, wherein, The method comprises the following steps: collecting multi-scale feature data based on multi-source channels; the multi-scale feature data comprises historical electricity transaction data, load demand curve, energy production data, fuel cost and external influence data; aligning the multi-scale feature data in time to obtain aligned data, and uniformly processing the aligned data in format to obtain uniform data; processing the uniform data for missing values and outliers to obtain a processed data set. 3.The time-dimension based electricity price forecasting method of claim 1, wherein, The method comprises the following steps: extracting data features from the processed data set, determining mutual information scores and correlation matrices of the data features and electricity prices based on the dependence relationship between each data feature and electricity price, and determining target features based on the mutual information scores and the correlation matrices. extracting data features from the processed data set, determining mutual information scores based on the dependence relationship between each data feature and electricity price; determining first correlation coefficients between each data feature and second correlation coefficients between the data features and the electricity prices; constructing a correlation matrix based on the first correlation coefficients and the second correlation coefficients, extracting the correlation matrix, and determining the second correlation coefficients as the correlation scores between each data feature and the electricity prices; determining the data features corresponding to the mutual information scores greater than a first target threshold as first filtered features, and determining the data features corresponding to the correlation scores greater than a second target threshold as second filtered features; determining the union of the first filtered features and the second filtered features as candidate features, and performing redundancy filtering on the candidate features based on the first correlation coefficients in the correlation matrix to obtain target features. 4.The time-dimension based electricity price forecasting method according to claim 1, wherein, The Bernoulli distribution is used to generate a mask matrix, a masked feature is determined based on the mask matrix and a feature matrix corresponding to the target feature, and a principal component analysis technique is used to reduce the dimension of the masked feature to obtain a reduced dimension feature. Based on the reduced dimension feature, a corresponding training set and a validation set are determined, including: Based on the target feature and the Bernoulli distribution, a mask matrix is generated according to the target masking ratio. Based on the mask matrix and the target feature, a masked feature is determined using an element multiplication method. The masked features are merged to obtain an enhanced data set. The enhanced data set is reduced in dimension using a principal component analysis technique to obtain a reduced dimension feature. The reduced dimension feature is divided based on a preset division method to obtain a corresponding training set and a validation set. 5.The time-dimension based power price forecasting method according to claim 1, wherein, The initial power price prediction model is constructed based on the multi-head attention mechanism, the convolution layer, the preset activation function, the bidirectional long short-term memory network, and the integrated low-rank adaptive technology. The training set and the validation set are used to train and verify the initial power price prediction model, respectively, to obtain a target power price prediction model, including: An initial power price prediction model is constructed based on the multi-head attention mechanism, the convolution layer, the preset activation function, and the bidirectional long short-term memory network. The first full connection layer of the initial power price prediction model is used to map the training set to a hidden dimension to obtain an initial hidden state, and the initial hidden state is position encoded using a trigonometric function to obtain an input layer output result. The input layer output result is projected to obtain a query, a key, and a value. The multi-head attention mechanism is used to determine a single-head attention result based on the query, the key, and the value. The single-head attention result is spliced to obtain a multi-head attention output result. The multi-head attention output result is used to extract local features using the convolution layer to obtain a convolution layer output result. The convolution layer output result is nonlinearly transformed using a preset activation function to obtain an activation function output result. The activation function output result is used to determine a forward processing result and a backward processing result using the bidirectional long short-term memory network, respectively. The forward processing result and the backward processing result are merged to obtain a memory network output result. The memory network output result is linearly mapped using the linear layer of the initial power price prediction model to obtain a linear layer output result. The linear layer output result is residual connected and layer normalized to obtain a normalized output result. The normalized output result is determined as a new input layer output result, and the step of projecting the input layer output result is jumped to until a target iteration number is reached to obtain a target normalized output result. The target normalized output result is flattened to obtain a flattened result. The flattened result is used to determine an initial prediction result using the second full connection layer of the initial power price prediction model. determine a loss value corresponding to the initial prediction result and the real value of the electricity price by using a mean square error loss function, and adjust the initial electricity price prediction model based on the loss value and a first preset learning rate by using a back propagation technique to obtain a trained electricity price prediction model; verify the trained electricity price prediction model by using a verification set to obtain a target electricity price prediction model. 6.The time-dimension based electricity price forecasting method of claim 5, wherein, The verification of the trained electricity price prediction model by using the verification set to obtain the target electricity price prediction model comprises: freeze the multi-head attention mechanism of the trained electricity price prediction model based on a low-rank adaptation technique to obtain a frozen electricity price prediction model; fine-tune the frozen electricity price prediction model by using a second preset learning rate to obtain a fine-tuned electricity price prediction model; the first preset learning rate is greater than the second preset learning rate; verify the fine-tuned electricity price prediction model by using a verification set to determine a target electricity price prediction model based on a verification result.

7. The time-dimension based electricity price forecasting method according to any one of claims 1 to 6, characterized in that, The multi-scale prediction based on the input data and the target electricity price prediction model to obtain the prediction result of the electricity price in different time dimensions comprises: determine a prediction interval by using the target electricity price prediction model and the actual prediction demand; if the prediction interval is a first target value, perform real-time prediction based on the input data and the target electricity price prediction model to obtain a first prediction result; if the prediction interval is a second target value, perform day-ahead prediction based on the input data and the target electricity price prediction model to obtain a second prediction result; if the prediction interval is a third target value, perform week-ahead prediction based on the input data and the target electricity price prediction model to obtain a third prediction result.

8. A time-dimension-based power price forecasting device characterized by comprising: comprise: a target feature determination module configured to obtain a multi-source data set comprising historical electricity transaction data, load demand curve, energy production data and fuel cost, pre-process the multi-source data set to obtain a processed data set, extract data features from the processed data set, determine mutual information scores and correlation matrices of the data features and electricity prices, and determine target features based on the mutual information scores and the correlation matrices; a feature dimension reduction module configured to generate a mask matrix by using a Bernoulli distribution, determine masked features based on the mask matrix and a feature matrix corresponding to the target features, and reduce the dimensions of the masked features by using a principal component analysis technique to obtain reduced features, and determine a training set and a verification set based on the reduced features; a target model determination module configured to construct an initial electricity price prediction model based on a multi-head attention mechanism, a convolution layer, a preset activation function, a bidirectional long short-term memory network and an integrated low-rank adaptation technique, train and verify the initial electricity price prediction model by using the training set and the verification set respectively to obtain a target electricity price prediction model; The power price prediction module is configured to perform multi-scale prediction based on input data and by using the target power price prediction model, to obtain a prediction result of the power price in different time dimensions.

9. An electronic device, comprising: The computer program product comprises: a memory configured to store a computer program; a processor configured to execute the computer program to implement the time-dimension-based power price prediction method according to any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, The computer program product comprises: a memory configured to store a computer program; a processor configured to execute the computer program to implement the time-dimension-based power price prediction method according to any one of claims 1 to 7.

Citation Information

Cited By

  • Electricity price time sequence attention model construction method and system fused with power grid blocking information

    CN122312193A