Training method and device of electricity clearing price peak prediction model and electronic equipment

By constructing and training the Transformer-DNN hybrid model, using the time-sharing electricity price and load data in the sample data set, the problem of low prediction accuracy of clearing electricity price peak in the existing technology is solved, and higher prediction accuracy is achieved.

CN119557637APending Publication Date: 2025-03-04新源智储能源发展(北京)有限公司
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411457467.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-10-18
Publication Date
2025-03-04

AI Technical Summary

Technical Problem

The prior art has challenges in predicting peak electricity clearance prices, which are affected by a variety of uncertainties, resulting in low prediction accuracy.

Method used

The Transformer-DNN hybrid model is used to train the prediction model of clearing the peak of electricity price. By obtaining the sample data set, including the time-sharing electricity price data and load data, it is input into the Transformer-DNN hybrid model to be trained, and iteratively trained until it converges.

Benefits of technology

The accuracy of clearing out electricity price peak prediction can more accurately capture complex patterns and nonlinear relationships in electricity price data.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119557637A_ABST
    Figure CN119557637A_ABST
Patent Text Reader

Abstract

The invention provides a method and device for training a clearing electricity price peak prediction model and electronic equipment, and the method comprises the steps: obtaining a sample data set, and enabling each piece of sample data in the sample data set to comprise sample time-of-use electricity price data and sample load data; inputting the sample data into a Transformer-DNN hybrid model to be trained and used for carrying out clearing electricity price peak value prediction, so as to obtain a clearing electricity price prediction peak value corresponding to the sample data; acquiring a real peak value of the clearing electricity price corresponding to the sample data; and performing iterative training on the Transform-DNN hybrid model according to the predicted peak value of the clearing electricity price and the real peak value of the clearing electricity price until a convergent target Transform-DNN hybrid model is obtained, so that by constructing the Transform-DNN hybrid model and training the Transform-DNN hybrid model on the basis of the sample data, the convergence of the target Transform-DNN hybrid model is improved, and the convergence efficiency of the target Transform-DNN hybrid model is improved. And the clearing electricity price peak value prediction is carried out based on the target Transformer-DNN hybrid model, so that the accuracy of the clearing electricity price peak value prediction is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a training method, device and electronic equipment for a clearing electricity price peak prediction model. Background Art

[0002] Deep learning models are widely used in the field of forecasting, and often use statistical models or simple machine learning models to predict the trend of clearing electricity prices. Since the peak of clearing electricity prices is often affected by a variety of uncertain factors, such as sudden weather changes, equipment failures, and sudden increases in electricity demand, there are still certain challenges in predicting the peak of clearing electricity prices. Summary of the invention

[0003] The present application aims to solve one of the technical problems in the related art at least to some extent.

[0004] According to the first aspect of the present application, a training method for a clearing electricity price peak prediction model is provided, comprising: obtaining a sample data set, wherein each sample data in the sample data set includes sample time-of-use electricity price data and sample load data; inputting the sample data into a Transformer-DNN hybrid model to be trained for clearing electricity price peak prediction to obtain a clearing electricity price prediction peak value corresponding to the sample data; obtaining a clearing electricity price true peak value corresponding to the sample data; and iteratively training the Transformer-DNN hybrid model according to the clearing electricity price prediction peak value and the clearing electricity price true peak value until a converged target Transformer-DNN hybrid model is obtained.

[0005] According to the second aspect of the present application, a method for predicting a peak clearing electricity price is provided, comprising: obtaining historical time-of-use electricity price data and historical load data corresponding to a day to be predicted; inputting the historical electricity price data and historical load data into a target Transformer-DNN hybrid model to obtain a predicted peak clearing electricity price for the day to be predicted, wherein the target Transformer-DNN hybrid model is a model trained using the model training method described in the first aspect.

[0006] According to the third aspect of the present application, a training device for a clearing electricity price peak prediction model is provided, comprising: a first acquisition module, used to acquire a sample data set, wherein each sample data in the sample data set includes sample time-of-use electricity price data and sample load data; a second acquisition module, used to input the sample data into a Transformer-DNN hybrid model to be trained for clearing electricity price peak prediction, so as to obtain the clearing electricity price prediction peak value corresponding to the sample data; a third acquisition module, used to obtain the clearing electricity price actual peak value corresponding to the sample data; and a training module, which iteratively trains the Transformer-DNN hybrid model according to the clearing electricity price prediction peak value and the clearing electricity price actual peak value until a converged target Transformer-DNN hybrid model is obtained.

[0007] According to the fourth aspect of the present application, a clearing electricity price peak prediction device is provided, comprising: an acquisition module for acquiring historical time-of-use electricity price data and historical load data corresponding to a day to be predicted; a prediction module for inputting the historical electricity price data and historical load data into a target Transformer-DNN hybrid model to obtain the predicted peak clearing electricity price for the day to be predicted, wherein the target Transformer-DNN hybrid model is a model trained using the model training method described in the first aspect.

[0008] In order to achieve the above-mentioned purpose, the fifth aspect of the present application proposes an electronic device, characterized in that it includes: a memory, a processor, and a computer program stored on the memory and executable on the processor, and when the processor executes the program, it implements the training method of the clearing electricity price peak prediction model as described in the first aspect or the clearing electricity price peak prediction method as described in the second aspect.

[0009] In order to achieve the above-mentioned objectives, the sixth aspect of the present application proposes a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to enable the computer to execute the training method of the clearing electricity price peak prediction model described in the first aspect or the clearing electricity price peak prediction method described in the second aspect.

[0010] In order to achieve the above-mentioned objectives, the seventh aspect of the present application proposes a computer program product, including a computer program, which, when executed by a processor, implements the training method of the clearing electricity price peak prediction model described in the first aspect or the clearing electricity price peak prediction method described in the second aspect.

[0011] The technical solution provided by the embodiments of the present application includes at least the following beneficial effects:

[0012] The present application provides a training method for a clearing electricity price peak prediction model, which improves the accuracy of clearing electricity price peak prediction by constructing a Transformer-DNN hybrid model, training the Transformer-DNN hybrid model based on sample data, and performing clearing electricity price peak prediction based on a target Transformer-DNN hybrid model.

[0013] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present application, nor is it intended to limit the scope of the present application. Other features of the present application will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0014] The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present application.

[0015] Figure 1 A flowchart of a method for training a peak prediction model for clearing electricity prices provided in an embodiment of the present application;

[0016] Figure 2 A flowchart of another method for training a peak clearing electricity price prediction model provided in an embodiment of the present application;

[0017] Figure 3 A flowchart of another method for training a peak clearing electricity price prediction model provided in an embodiment of the present application;

[0018] Figure 4 A schematic diagram of a flow chart of a method for predicting a peak clearing electricity price provided in an embodiment of the present application;

[0019] Figure 5 A schematic diagram of the structure of a training device for a peak prediction model of clearing electricity prices provided in an embodiment of the present application;

[0020] Figure 6 A schematic diagram of the structure of a peak value prediction device for clearing electricity prices provided in an embodiment of the present application;

[0021] Figure 7 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0022] The following is a description of exemplary embodiments of the present application in conjunction with the accompanying drawings, including various details of the embodiments of the present application to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications can be made to the embodiments described herein without departing from the scope and spirit of the present application. Similarly, for the sake of clarity and conciseness, the description of well-known functions and structures is omitted in the following description.

[0023] The following embodiment is used to explain in detail the training method of the peak prediction model of the clearing electricity price of the present application.

[0024] Figure 1 A flowchart of a method for training a clearing electricity price peak prediction model provided in an embodiment of the present application.

[0025] like Figure 1 As shown, the training method of the clearing electricity price peak prediction model proposed in this embodiment specifically includes the following steps:

[0026] S101. Obtain a sample data set, wherein each sample data in the sample data set includes sample time-of-use electricity price data and sample load data.

[0027] In an embodiment of the present application, a historical time-of-use electricity price data set and a historical load data set can be obtained, and an initial sample data set is constructed based on the historical time-of-use electricity price data set and the historical load data set. The initial sample data set is divided by a K-fold cross-validation method to obtain K initial sample data subsets, where K is a positive integer. The K initial sample data subsets are normalized to obtain a sample data set.

[0028] Optionally, historical time-of-use electricity price data sets and historical load data sets can be obtained from the historical database at preset period intervals. For example, the preset period can be set to 14 days, that is, the historical time-of-use electricity price data sets and historical load data sets every 14 days are used as a set of sample data to obtain the historical time-of-use electricity price data sets and historical load data sets, and then construct the initial sample data set.

[0029] Optionally, the K value in the K-fold cross validation may be obtained, and the initial sample data set may be divided into K initial sample data subsets. The K initial sample data subsets may be normalized by the MinMaxScaler method to obtain the sample data set.

[0030] For example, the historical time-of-use electricity price data in the K initial sample data subsets can be normalized using the following formula:

[0031] X n =a+(X t -X min )*(ba) / (X max -v min )

[0032] Among them, X n is the normalized historical time-of-use electricity price data, v t is the historical time-of-use electricity price data in the initial sample data subset, X min is the minimum value of the scaled feature, X maxis the maximum value of the scaled feature, a is the minimum value of the target range, and b is the maximum value of the target range.

[0033] It should be noted that the MinMaxScaler method can map the minimum value of the historical time-of-use electricity price data in the K initial sample data subsets to a, and the maximum value to b. Other values ​​are linearly distributed within this range. Normalization can maintain the relative distribution of sample data and convert features of different scales into the same range, which is conducive to improving the training effect of the model.

[0034] It should be noted that the historical load data in the K initial sample data subsets can be normalized using the above method. The specific process will not be repeated here. By obtaining the normalized historical time-of-use electricity price data and historical load data in the K initial sample data subsets, the sample data set can be obtained.

[0035] It should be noted that after using the sample data set, in the subsequent model training, the cross-validation method can be used to improve the generalization ability and prediction accuracy of the Transformer-DNN hybrid model, that is, a subset of the sample data set is selected as the validation set in each round, and the remaining K-1 subsets are combined as the training set. The model is trained with the training set, and the model performance is evaluated with the validation set to obtain a converged target Transformer-DNN hybrid model.

[0036] S102: input the sample data into a Transformer-DNN hybrid model to be trained for clearing electricity price peak prediction, so as to obtain a clearing electricity price prediction peak corresponding to the sample data.

[0037] Among them, the model structure of the Transformer-DNN hybrid model includes an embedding layer, a Transformer network, a deep neural network (DNN) and a fully connected layer.

[0038] In an embodiment of the present application, after the sample data is obtained, the sample data can be input into a Transformer-DNN hybrid model to be trained for clearing electricity price peak prediction to obtain a clearing electricity price prediction peak corresponding to the sample data.

[0039] Optionally, the characteristics of the sample time-of-use electricity price data are learned through the Transformer network, the characteristics of the sample load data are learned through the DNN, and the Transformer network output and the DNN output are spliced ​​through a fully connected layer to obtain the clearing electricity price prediction peak.

[0040] S103. Obtain the true peak value of the clearing electricity price corresponding to the sample data.

[0041] In the embodiment of the present application, after the sample data is obtained, the real peak value of the clearing electricity price corresponding to the sample data can be obtained.

[0042] For example, for sample data 1, if sample data 1 is composed of sample time-of-use electricity price data and sample load data from 2024.1.1 to 2024.1.14, the clearing electricity price peak on 2024.1.15 can be used as the true peak of the clearing electricity price of sample data 1.

[0043] S104. According to the predicted peak value of the clearing electricity price and the actual peak value of the clearing electricity price, the Transformer-DNN hybrid model is iteratively trained until a converged target Transformer-DNN hybrid model is obtained.

[0044] In an embodiment of the present application, after obtaining the predicted peak clearing electricity price and the actual peak clearing electricity price, the loss function of the Transformer-DNN hybrid model can be obtained according to the predicted peak clearing electricity price and the actual peak clearing electricity price, and the model parameters of the Transformer-DNN hybrid model can be adjusted according to the loss function until the loss function meets the training end conditions, and the Transformer-DNN hybrid model after the last adjustment of the model parameters is determined as the converged target Transformer-DNN hybrid model.

[0045] It should be noted that the present disclosure does not limit the setting of the loss function, which can be set according to actual conditions.

[0046] Optionally, the loss function may be at least one of a mean square error (MSE) loss function, a root mean square error (RMSE) and a mean absolute error (MAE) to reduce the difference between the predicted peak value of the clearing electricity price and the actual peak value of the clearing electricity price.

[0047] Among them, MSE, RMSE and MAE can be calculated using the following formula:

[0048]

[0049] Where N is the number of sample data, y true is the real peak value of the clearing electricity price, y pred Forecast peaks for clearing electricity prices.

[0050] It should be noted that the present application does not limit the setting of the training end condition, and it can be selected according to the actual situation.

[0051] Optionally, the training end condition can be set as the loss function value being less than a preset loss threshold.

[0052] Optionally, the training end condition can be set as the number of times the parameters of the Transformer-DNN hybrid model are adjusted reaches a preset number threshold.

[0053] The training method of the clearing electricity price peak prediction model provided in the present application obtains a sample data set, wherein each sample data in the sample data set includes sample time-of-use electricity price data and sample load data, and inputs the sample data into a Transformer-DNN hybrid model to be trained for clearing electricity price peak prediction to obtain the clearing electricity price prediction peak corresponding to the sample data, obtain the clearing electricity price true peak corresponding to the sample data, and iteratively train the Transformer-DNN hybrid model according to the clearing electricity price prediction peak and the clearing electricity price true peak until a converged target Transformer-DNN hybrid model is obtained. Therefore, the present application improves the accuracy of clearing electricity price peak prediction by constructing a Transformer-DNN hybrid model, training the Transformer-DNN hybrid model based on the sample data, and predicting the clearing electricity price peak based on the target Transformer-DNN hybrid model.

[0054] The following explains the specific process of inputting sample data into the Transformer-DNN hybrid model to be trained for clearing electricity price peak prediction to obtain the clearing electricity price prediction peak corresponding to the sample data.

[0055] As a possible implementation, Figure 2 As shown, based on the above steps, in the above step S102, the sample data is input into the Transformer-DNN hybrid model to be trained for clearing electricity price peak prediction to obtain the specific process of the clearing electricity price prediction peak corresponding to the sample data, including the following steps:

[0056] S201. Input the sample data into the Transformer-DNN hybrid model, wherein the Transformer-DNN hybrid model includes an embedding layer, a Transformer network, a deep neural network DNN and a fully connected layer.

[0057] S202 . Process the sample data through an embedding layer to obtain a first embedding vector corresponding to the sample electricity price data and a second embedding vector corresponding to the sample load data.

[0058] In an embodiment of the present application, the sample electricity price data and the sample load data are vectorized through an embedding layer, that is, the sample electricity price data and the sample load data are mapped to a vector space of a set dimension to obtain a first embedding vector corresponding to the sample electricity price data and a second embedding vector corresponding to the sample load data.

[0059] S203, processing the first embedding vector through a Transformer network to obtain a Transformer network output, and processing the second embedding vector through a DNN to obtain a DNN output.

[0060] Among them, the Transformer network includes a position encoding layer, a multi-head attention mechanism layer and a feedforward network layer.

[0061] In an embodiment of the present application, the first embedding vector is input into the Transformer network, the first embedding vector is encoded through the position encoding layer to obtain the position encoding layer output, the position encoding layer output is processed through the multi-head attention mechanism (Multi-HeadSelf-Attention Mechanism) layer to obtain the multi-head attention mechanism layer output, and the multi-head attention mechanism layer output is processed through the feedforward network layer to obtain the Transformer network output.

[0062] Optionally, the first embedding vector may be encoded using the following formula:

[0063]

[0064] Among them, pos is the position, i is the dimension of the encoding vector, and d_model is the embedding dimension of the Transformer-DNN hybrid model.

[0065] It should be noted that the position encoding layer can add position information to each element in the first embedding vector to obtain an embedding vector with position information, where 10000 is an empirical value. When the value is large enough, it can produce a sufficiently slow periodic change, so that the position encoding layer can distinguish different positions in a longer sequence. The use of 2i and 2i+1 allows the alternating use of sine and cosine functions, and the encoding of any position can be easily calculated. There is a fixed offset relationship between the encodings of different positions, allowing the model to learn relative position relationships.

[0066] Optionally, the position encoding layer output can be processed using the following formula:

[0067]

[0068] Among them, Q is the query matrix, K is the key matrix, V is the value matrix, K Tis the transpose of K and d_k is the dimension of the key vector.

[0069] head_i=Attention(Q×W_i_Q,K×W_i_K,V×W_i_V)

[0070] Among them, head_i is the i-th attention head, Wi_i_Q is the query weight matrix, which converts the input into a query vector, Wi_i_K is the input into a key vector, and Wi_i_V is the value weight matrix.

[0071] Q_i=X×W_i_Q

[0072] K_i=X×W_i_K

[0073] V_i=X×W_i_V

[0074] MultiHead(Q,K,V)=Concat(head_1,...,head_h)W_O

[0075] Among them, for the i-th attention head head_i, Q_i, K_i, V_i are determined by the input, and each head has unique W_Q, W_K, W_V, allowing different heads to focus on different features. During the model training process, it will be continuously adjusted to minimize the loss function. It is learned through the back-propagation algorithm, which enhances the model's ability to capture complex patterns. W_O is an independent weight matrix that can be learned through the back-propagation algorithm. It is updated together with other parameters of the model and is used to map the results of multi-head attention to the final output space, allowing the model to learn how to best combine the information of different attention heads, so that the model can integrate features of different scales or aspects.

[0076] Among them, the feedforward neural network layer is after the multi-head attention mechanism layer and consists of two linear transformations to increase the nonlinear expression ability of the model. The calculation formula is as follows:

[0077] FFN(X)=max(0,X×W_1+b_1)×W_2+b_2

[0078] Among them, max(0,X) is the nonlinearity introduced by the rectified linear unit (ReLU), W_1 and W_2 are weight matrices, and b_1 and b_2 are bias vectors.

[0079] It should be noted that the feedforward neural network (FNN) layer is usually located after the multi-head attention mechanism layer of each encoder and decoder layer. It is applied independently to each position in the sequence and integrates information between the outputs of different attention heads. The position encoding layer solves the problem of the lack of sequence order information in the Transformer model. The FFN layer enhances the nonlinear expression ability of the model. Through the position encoding layer and position encoding, the Transformer network can effectively process sequence data and learn complex patterns.

[0080] In an embodiment of the present application, the second embedding vector is input into multiple hidden layers in the DNN for processing to obtain a DNN output.

[0081] It should be noted that DNN is a multi-layer feedforward neural network that performs nonlinear transformation on input data through multiple hidden layers to learn complex feature representations. DNN is used to process sample load data and capture the nonlinear relationship between load data and time-of-use electricity price data.

[0082] It should be noted that for the forward propagation in DNN:

[0083] Z[l]=W[l]A[l-1]+b[l]

[0084] A[l]=g(Z[l])

[0085] Where Z[l] is the linear output of layer l, A[l] is the activation output, W[l] is the weight matrix, b[l] is the bias vector, and g is the activation function (ReLU)

[0086] It should be noted that for the ReLU activation function in DNN: ReLU(x)=max(0,x), the ReLU function introduces nonlinearity, which enables DNN to learn complex nonlinear relationships and helps alleviate the gradient vanishing problem.

[0087] It should be noted that, for the loss function MAE in DNN:

[0088]

[0089] Where, N is the number of sample data, y truei is the true value of the i-th sample data, y predi is the predicted value of the i-th sample data.

[0090] It should be noted that the gradient of the loss function to the weights and biases is calculated through the back-propagation algorithm, and these gradients are used to update the weights and biases, and the weights and biases are updated by stochastic gradient descent:

[0091]

[0092] Among them, α is the learning rate, and are the gradients of the loss function with respect to weights and biases, respectively.

[0093] S204. Concatenate the Transformer network output and the DNN output through a fully connected layer to obtain the peak value of the clearing electricity price forecast.

[0094] In an embodiment of the present application, the Transformer network output and the DNN output are spliced ​​to obtain spliced ​​data, and the spliced ​​data is processed by an activation function to obtain a first clearing electricity price forecast peak value, and the first clearing electricity price forecast peak value is denormalized to obtain a clearing electricity price forecast peak value.

[0095] The specific process of the training method of the peak prediction model of the clearing electricity price of this application is explained below.

[0096] For example, the model structure of the Transformer-DNN hybrid model is as follows Figure 3 As shown, the model of the Transformer-DNN hybrid model includes an embedding layer, a Transformer network, a deep neural network DNN and a fully connected layer. The sample data is processed by the embedding layer to obtain a first embedding vector corresponding to the sample electricity price data and a second embedding vector corresponding to the sample load data. The first embedding vector is processed by the Transformer network to obtain the Transformer network output, and the second embedding vector is processed by the DNN to obtain the DNN output. The Transformer network output and the DNN output are spliced ​​by the fully connected layer to obtain the predicted peak value of the clearing electricity price. According to the predicted peak value of the clearing electricity price and the actual peak value of the clearing electricity price, the Transformer-DNN hybrid model is evaluated and trained (performance indicators and cross-validation). By iteratively training the Transformer-DNN hybrid model, the model parameters of the Transformer-DNN hybrid model are continuously adjusted until a converged target Transformer-DNN hybrid model is obtained.

[0097] The training method of the clearing electricity price peak prediction model provided in the present application obtains sample data constructed by electricity price data and load data, constructs a Transformer-DNN hybrid model by combining a Transformer network and a deep neural network, and learns electricity price characteristics through a Transformer network. The multi-head self-attention mechanism based on the Transformer network can capture the time dependency and emergencies in time-of-use electricity price series data. By learning load characteristics through DNN, the advantages of complex nonlinear relationships can be improved and the model's ability to grasp sample data trends and patterns can be strengthened. The generalization ability and prediction accuracy of the Transformer-DNN hybrid model are improved through a cross-validation method, which is conducive to improving the accuracy of the clearing electricity price prediction peak.

[0098] It should be noted that after obtaining the trained target Transformer-DNN hybrid model, the peak of the clearing electricity price can be predicted based on the target Transformer-DNN hybrid model.

[0099] The following example describes in detail the method for predicting the peak value of the clearing electricity price of the present application.

[0100] Figure 4 A flow chart of a method for predicting peak clearing electricity prices according to an embodiment of the present application.

[0101] like Figure 4 As shown, the method for predicting the peak value of the clearing electricity price proposed in this embodiment specifically includes the following steps:

[0102] S401. Obtain historical time-of-use electricity price data and historical load data corresponding to the day to be predicted.

[0103] For example, if the date to be predicted is 2024.10.15, the historical time-of-use electricity price data and historical load data from 2024.10.1 to 2024.10.14 can be filtered out from the database, and the historical time-of-use electricity price data and historical load data from 2024.10.1 to 2024.10.14 can be used as the historical time-of-use electricity price data and historical load data corresponding to the date to be predicted.

[0104] S402: Input historical electricity price data and historical load data into the target Transformer-DNN hybrid model to obtain the predicted peak clearing electricity price on the day to be predicted.

[0105] Among them, the target Transformer-DNN hybrid model is a model trained using the above-mentioned model training method.

[0106] In an embodiment of the present application, historical electricity price data and historical load data may be input into a Transformer-DNN hybrid model for predictive reasoning to obtain a predicted peak clearing electricity price for the day to be predicted.

[0107] The clearing electricity price peak prediction method provided in the present application obtains the historical time-of-use electricity price data and historical load data corresponding to the day to be predicted, and inputs the historical electricity price data and historical load data into the target Transformer-DNN hybrid model to obtain the clearing electricity price prediction peak of the day to be predicted, thereby improving the accuracy and reliability of obtaining the clearing electricity price prediction peak. By obtaining the clearing electricity price prediction peak, resource allocation in the electricity trading market can be more reasonable and risk management can be more effective, and strategies related to participating in the electricity spot market can be formulated more scientifically and reasonably, as well as peak-valley price differences and bidding strategies in the electricity market can be fully explored, which is conducive to improving economic benefits and the stability of energy supply.

[0108] In order to implement the above embodiment, this embodiment provides a training device for a clearing electricity price peak prediction model.

[0109] like Figure 5 As shown, the training device 1000 for the clearing electricity price peak prediction model includes: a first acquisition module 110 , a second acquisition module 120 , a third acquisition module 130 and a training module 140 .

[0110] A first acquisition module 110 is used to acquire a sample data set, wherein each sample data in the sample data set includes sample time-of-use electricity price data and sample load data;

[0111] A second acquisition module 120 is used to input the sample data into a Transformer-DNN hybrid model to be trained for clearing electricity price peak prediction, so as to obtain a clearing electricity price prediction peak corresponding to the sample data;

[0112] The third acquisition module 130 is used to obtain the real peak value of the clearing electricity price corresponding to the sample data;

[0113] The training module 140 iteratively trains the Transformer-DNN hybrid model according to the predicted peak value of the clearing electricity price and the actual peak value of the clearing electricity price until a converged target Transformer-DNN hybrid model is obtained.

[0114] According to one embodiment of the present application, the second acquisition module 120 is also used to: input the sample data into the Transformer-DNN hybrid model, wherein the Transformer-DNN hybrid model includes an embedding layer, a Transformer network, a deep neural network DNN and a fully connected layer; process the sample data through the embedding layer to obtain a first embedding vector corresponding to the sample electricity price data and a second embedding vector corresponding to the sample load data; process the first embedding vector through the Transformer network to obtain a Transformer network output, and process the second embedding vector through the DNN to obtain a DNN output; splice the Transformer network output and the DNN output through the fully connected layer to obtain the clearing electricity price forecast peak.

[0115] In one embodiment of the present application, the second acquisition module 120 is also used to: input the first embedding vector into the Transformer network, wherein the Transformer network includes a position encoding layer, a multi-head attention mechanism layer and a feedforward network layer; encode the first embedding vector through the position encoding layer to obtain a position encoding layer output; process the position encoding layer output through the multi-head attention mechanism layer to obtain the multi-head attention mechanism layer output; process the multi-head attention mechanism layer output through the feedforward network layer to obtain the Transformer network output.

[0116] In one embodiment of the present application, the second acquisition module 120 is further used to: input the second embedding vector into multiple hidden layers in the DNN for processing to obtain the DNN output.

[0117] In one embodiment of the present application, the second acquisition module 120 is further used to: splice the Transformer network output and the DNN output to obtain spliced ​​data, and process the spliced ​​data through an activation function to obtain a first clearing electricity price forecast peak; and denormalize the first clearing electricity price forecast peak to obtain the clearing electricity price forecast peak.

[0118] In one embodiment of the present application, the training module 140 is further used to: obtain the loss function of the Transformer-DNN hybrid model based on the predicted peak value of the clearing electricity price and the actual peak value of the clearing electricity price; adjust the model parameters of the Transformer-DNN hybrid model according to the loss function until the loss function meets the training end condition, and determine the Transformer-DNN hybrid model after the last adjustment of the model parameters as the converged target Transformer-DNN hybrid model.

[0119] In one embodiment of the present application, the first acquisition module 110 is further used to: obtain a historical time-of-use electricity price data set and a historical load data set within a preset period, and construct an initial sample data set based on the historical time-of-use electricity price data set and the historical load data set; divide the initial sample data set by a K-fold cross-validation method to obtain K initial sample data subsets, wherein K is a positive integer; and normalize the K initial sample data subsets to obtain the sample data set.

[0120] The training device of the clearing electricity price peak prediction model provided in the present application obtains a sample data set, wherein each sample data in the sample data set includes sample time-of-use electricity price data and sample load data, and inputs the sample data into a Transformer-DNN hybrid model to be trained for clearing electricity price peak prediction to obtain the clearing electricity price prediction peak corresponding to the sample data, obtain the clearing electricity price true peak corresponding to the sample data, and iteratively train the Transformer-DNN hybrid model according to the clearing electricity price prediction peak and the clearing electricity price true peak until a converged target Transformer-DNN hybrid model is obtained. Therefore, the present application improves the accuracy of clearing electricity price peak prediction by constructing a Transformer-DNN hybrid model, training the Transformer-DNN hybrid model based on the sample data, and predicting the clearing electricity price peak based on the target Transformer-DNN hybrid model.

[0121] In order to implement the above embodiment, this embodiment provides a clearing electricity price peak prediction device. Figure 6 A schematic diagram of the structure of a clearing electricity price peak prediction device provided in an embodiment of the present application.

[0122] like Figure 6 As shown, the clearing electricity price peak prediction device 2000 includes: an acquisition module 210 and a prediction module 220.

[0123] An acquisition module 210 is used to acquire historical time-of-use electricity price data and historical load data corresponding to the day to be predicted;

[0124] The prediction module 220 is used to input the historical electricity price data and the historical load data into the target Transformer-DNN hybrid model to obtain the predicted peak value of the clearing electricity price on the predicted day, wherein the target Transformer-DNN hybrid model is a model trained using the model training method described in the first aspect.

[0125] The clearing electricity price peak prediction device provided in the present application obtains the historical time-of-use electricity price data and historical load data corresponding to the day to be predicted, and inputs the historical electricity price data and historical load data into the target Transformer-DNN hybrid model to obtain the clearing electricity price prediction peak of the day to be predicted, thereby improving the accuracy and reliability of obtaining the clearing electricity price prediction peak. By obtaining the clearing electricity price prediction peak, resource allocation in the electricity trading market can be more reasonable and risk management can be more effective. It is possible to formulate strategies related to participating in the electricity spot market more scientifically and reasonably, and to fully explore the peak-valley price difference and the bidding strategy of the electricity market, which is conducive to improving economic benefits and the stability of energy supply.

[0126] In order to implement the above embodiment, the present application also proposes an electronic device 3000, such as Figure 7 As shown, it includes: a memory 310, a processor 320 and a computer program stored in the memory 310 and executable on the processor 320. When the processor executes the program, the training method of the clearing electricity price peak prediction model as described in the first aspect or the clearing electricity price peak prediction method as described in the second aspect is implemented.

[0127] In order to implement the above embodiments, the present application proposes a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to enable the computer to execute the training method of the clearing electricity price peak prediction model described in the first aspect or the clearing electricity price peak prediction method described in the second aspect.

[0128] In order to implement the above embodiments, the present application also proposes a computer program product, including a computer program, which, when executed by a processor, implements the training method of the clearing electricity price peak prediction model described in the first aspect or the clearing electricity price peak prediction method described in the second aspect.

[0129] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this application can be executed in parallel, sequentially or in different orders, as long as the expected results of the technical solution disclosed in this application can be achieved, and this document is not limited here.

[0130] The above specific implementations do not constitute a limitation on the protection scope of this application. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions and improvements made within the spirit and principles of this application should be included in the protection scope of this application.

Claims

1. A training method for a peak clearing electricity price prediction model, characterized in that: The method comprises: Acquire a sample data set, wherein each sample data in the sample data set includes sample time-of-use electricity price data and sample load data; Inputting the sample data into a Transformer-DNN hybrid model to be trained for clearing electricity price peak prediction to obtain a clearing electricity price prediction peak corresponding to the sample data; Obtaining a true peak value of the clearing electricity price corresponding to the sample data; The Transformer-DNN hybrid model is iteratively trained according to the predicted peak value of the clearing electricity price and the actual peak value of the clearing electricity price until a converged target Transformer-DNN hybrid model is obtained.

2. The method according to claim 1, characterized in that The step of inputting the sample data into a Transformer-DNN hybrid model to be trained for clearing electricity price peak prediction to obtain a clearing electricity price prediction peak corresponding to the sample data includes: Inputting the sample data into the Transformer-DNN hybrid model, wherein the Transformer-DNN hybrid model includes an embedding layer, a Transformer network, a deep neural network DNN, and a fully connected layer; Processing the sample data through an embedding layer to obtain a first embedding vector corresponding to the sample electricity price data and a second embedding vector corresponding to the sample load data; Processing the first embedding vector through the Transformer network to obtain a Transformer network output, and processing the second embedding vector through the DNN to obtain a DNN output; The Transformer network output and the DNN output are concatenated through the fully connected layer to obtain the predicted peak value of the clearing electricity price.

3. The method according to claim 2, characterized in that The processing the first embedding vector through the Transformer network to obtain a Transformer network output includes: Inputting the first embedding vector into the Transformer network, wherein the Transformer network includes a position encoding layer, a multi-head attention mechanism layer, and a feed-forward network layer; Encoding the first embedding vector through the position encoding layer to obtain a position encoding layer output; Processing the position encoding layer output through a multi-head attention mechanism layer to obtain the multi-head attention mechanism layer output; The output of the multi-head attention mechanism layer is processed by the feedforward network layer to obtain the Transformer network output.

4. The method according to claim 2, characterized in that: The processing the second embedding vector by the DNN to obtain a DNN output includes: The second embedding vector is input into a plurality of hidden layers in the DNN for processing to obtain the DNN output.

5. The method according to claim 2, characterized in that: The step of splicing the Transformer network output and the DNN output through the fully connected layer to obtain the clearing electricity price forecast peak value includes: splicing the Transformer network output and the DNN output to obtain spliced ​​data, and processing the spliced ​​data through an activation function to obtain a first clearing electricity price forecast peak value; The first clearing electricity price forecast peak value is denormalized to obtain the clearing electricity price forecast peak value.

6. The method according to claim 1, characterized in that The iterative training of the Transformer-DNN hybrid model according to the predicted peak value of the clearing electricity price and the actual peak value of the clearing electricity price until a converged target Transformer-DNN hybrid model is obtained includes: Obtaining a loss function of a Transformer-DNN hybrid model according to the predicted peak value of the clearing electricity price and the actual peak value of the clearing electricity price; The model parameters of the Transformer-DNN hybrid model are adjusted according to the loss function until the loss function satisfies the training end condition, and the Transformer-DNN hybrid model after the last adjustment of the model parameters is determined as the converged target Transformer-DNN hybrid model.

7. The method according to claim 1, characterized in that The obtaining of the sample data set comprises: Acquire a historical time-of-use electricity price data set and a historical load data set, and construct an initial sample data set based on the historical time-of-use electricity price data set and the historical load data set; Dividing the initial sample data set by a K-fold cross-validation method to obtain K initial sample data subsets, wherein K is a positive integer; The K initial sample data subsets are normalized to obtain the sample data set.

8. A method for predicting peak clearing electricity prices, characterized in that: The method comprises: Obtain the historical time-of-use electricity price data and historical load data corresponding to the day to be predicted; The historical electricity price data and historical load data are input into a target Transformer-DNN hybrid model to obtain the predicted peak clearing electricity price for the predicted day, wherein the target Transformer-DNN hybrid model is a model trained using the model training method described in any one of claims 1 to 7.

9. A training device for a peak prediction model of clearing electricity prices, characterized in that: The device comprises: A first acquisition module is used to acquire a sample data set, wherein each sample data in the sample data set includes sample time-of-use electricity price data and sample load data; A second acquisition module is used to input the sample data into a Transformer-DNN hybrid model to be trained for clearing electricity price peak prediction, so as to obtain a clearing electricity price prediction peak corresponding to the sample data; A third acquisition module is used to obtain the real peak value of the clearing electricity price corresponding to the sample data; The training module iteratively trains the Transformer-DNN hybrid model according to the predicted peak value of the clearing electricity price and the actual peak value of the clearing electricity price until a converged target Transformer-DNN hybrid model is obtained.

10. A peak prediction device for clearing electricity price, characterized in that: The device comprises: An acquisition module is used to acquire historical time-of-use electricity price data and historical load data corresponding to the day to be predicted; A prediction module is used to input the historical electricity price data and the historical load data into a target Transformer-DNN hybrid model to obtain the predicted peak value of the clearing electricity price on the predicted day, wherein the target Transformer-DNN hybrid model is a model trained using the model training method according to any one of claims 1 to 7.