Training method of electricity price abrupt change point prediction model and electricity price abrupt change point prediction method
By constructing and iteratively training the electricity price mutation point prediction model, using historical electricity price data, boundary data and meteorological data, the problem of inaccurate prediction of electricity price mutation point in the existing technology is solved, the accuracy and reliability of the prediction are improved, and the healthy development of the power market is promoted.
Patent Information
- Application Number
- CN202411992183.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-31
- Publication Date
- 2025-05-02
AI Technical Summary
The existing technology is difficult to accurately predict the sudden change in electricity prices in the power market, resulting in huge challenges in trading decisions and resource allocation.
By obtaining historical electricity price data, boundary data and meteorological data, a prediction model of electricity price mutation points is constructed, and through iterative training methods, model parameters are optimized to improve prediction accuracy.
It improves the accuracy and reliability of forecasting of electricity price sudden point, helps market participants better cope with the volatility of the power market, and promotes the healthy development of the power market.
Smart Images

Figure CN119919176A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence technology, and in particular to a training method for an electricity price mutation point prediction model and an electricity price mutation point prediction method. Background Art
[0002] The opening of the electricity market has made spot trading an important market mechanism. However, the volatility of electricity spot prices is extremely high, and electricity price mutation points occur frequently, which brings huge challenges to market participants. Electricity price mutation points are usually caused by multiple factors such as supply and demand imbalance, sudden meteorological events, policy changes or market manipulation. Electricity price mutation points not only affect short-term electricity trading decisions, but also long-term investment and resource allocation. Most of the related technologies rely on statistical analysis of historical electricity price data for time series modeling and prediction, which often ignores the complexity and diversity of electricity price fluctuations and cannot accurately obtain electricity price mutations. 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 an electricity price mutation point prediction model is provided, comprising obtaining a sample data set, wherein each sample data in the sample data set includes the electricity price data of the historical i-1th day and the boundary data and meteorological data of the historical i-th day, wherein i is a natural number greater than 1; inputting the sample data into the electricity price mutation point prediction model to be trained to obtain a predicted electricity price mutation point coding sequence of the historical i-th day; obtaining a real electricity price mutation point coding sequence of the historical i-th day; and iteratively training the electricity price mutation point prediction model according to the predicted electricity price mutation point coding sequence and the real electricity price mutation point coding sequence of the historical i-th day until a converged target electricity price mutation point prediction model is obtained.
[0005] According to the second aspect of the present application, a method for predicting electricity price mutation points is provided, comprising: obtaining boundary data and meteorological data of the d-th day to be predicted and electricity price data of the d-1th day, wherein d is a natural number greater than 1; inputting the boundary data and meteorological data of the d-th day and electricity price data of the d-1th day into a target electricity price mutation point prediction model to obtain an electricity price mutation point coding sequence of the d-th day to be predicted, wherein the target electricity price mutation point prediction model is a model trained using the training method described in the first aspect.
[0006] According to a third aspect of the present application, a training device for an electricity price mutation point 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 the electricity price data of the historical i-th day and the boundary data and meteorological data of the historical i-1th day, wherein i is a natural number greater than or equal to 1; a second acquisition module, used to input the sample data into the electricity price mutation point prediction model to be trained, so as to obtain a predicted electricity price mutation point coding sequence of the historical i-th day; a third acquisition module, used to acquire a real electricity price mutation point coding sequence of the historical i-th day; a training module, used to iteratively train the electricity price mutation point prediction model according to the predicted electricity price mutation point coding sequence and the real electricity price mutation point coding sequence of the historical i-th day, until a converged target electricity price mutation point prediction model is obtained.
[0007] According to the fourth aspect of the present application, a device for predicting an electricity price mutation point is provided, comprising: an acquisition module for acquiring boundary data and meteorological data of the d-th day to be predicted and electricity price data of the d-1th day, wherein d is a natural number greater than 1; a prediction module for inputting the boundary data and meteorological data of the d-th day and electricity price data of the d-1th day into a target electricity price mutation point prediction model to obtain an electricity price mutation point coding sequence of the d-th day to be predicted, wherein the target electricity price mutation point prediction model is a model trained using the 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 in the memory and executable on the processor, and when the processor executes the program, it implements the training method of the electricity price mutation point prediction model as described in the first aspect or the electricity price mutation point 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 electricity price mutation point prediction model described in the first aspect or the electricity price mutation point 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 electricity price mutation point prediction model described in the first aspect or the electricity price mutation point 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 an electricity price mutation point prediction model, by constructing an electricity price mutation point prediction model, training the electricity price mutation point prediction model based on sample data, and predicting electricity price mutation points based on the electricity price mutation point prediction model, thereby improving the accuracy and reliability of electricity price mutation point prediction, and being conducive to promoting the healthy development of the electricity market.
[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 schematic diagram of a flow chart of a method for training an electricity price mutation point prediction model provided in an embodiment of the present application;
[0016] Figure 2 A schematic flow chart of another method for training an electricity price mutation point prediction model provided in an embodiment of the present application;
[0017] Figure 3 A schematic diagram of the structure of an electricity price mutation point 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 sudden change point in electricity price provided in an embodiment of the present application;
[0019] Figure 5 A schematic diagram of the structure of a training device for an electricity price mutation point prediction model provided in an embodiment of the present application;
[0020] Figure 6 A schematic diagram of the structure of a device for predicting a sudden change point in electricity price 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 examples are used to explain in detail the training method of the electricity price mutation point prediction model of the present application.
[0024] Figure 1 A flowchart of a method for training an electricity price mutation point prediction model provided in an embodiment of the present application.
[0025] like Figure 1 As shown, the training method of the electricity price mutation point 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 electricity price data on the historical i-1th day and boundary data and meteorological data on the historical i-th day, wherein i is a natural number greater than 1.
[0027] In an embodiment of the present application, the electricity price data for the historical i-1 day and the boundary data and meteorological data for the historical i day can be obtained, and the electricity price data for the historical i-1 day and the boundary data and meteorological data for the historical i day can be preprocessed and normalized to obtain a sample data set.
[0028] Optionally, the outliers and missing values in the electricity price data of the historical i-1th day and the boundary data and meteorological data of the historical i-th day may be preprocessed, and the preprocessed data may be normalized by minimum-maximum normalization to obtain a sample data set.
[0029] It should be noted that this application does not limit the types of boundary data and meteorological data. For example, boundary data includes load data, new energy output data, west-to-east power transmission data and capacity information, and meteorological data includes temperature data, irradiance data, precipitation data and wind speed data.
[0030] S102, inputting the sample data into the electricity price mutation point prediction model to be trained to obtain the predicted electricity price mutation point coding sequence for the i-th day in history.
[0031] Among them, the model structure of the electricity price mutation point prediction model includes a multi-head attention mechanism layer, a first normalization layer, a feedforward neural network layer and a second normalization layer.
[0032] In an embodiment of the present application, after the sample data is obtained, the sample data can be input into the electricity price mutation point prediction model to be trained to obtain the predicted electricity price mutation point coding sequence for the i-th day in history.
[0033] S103, obtaining the coding sequence of the actual electricity price mutation point on the i-th day in history.
[0034] In an embodiment of the present application, electricity price data for the i-th day in history can be obtained, and the electricity price floating threshold can be determined based on the electricity price data for the i-th day in history, and the adjustment factor of the electricity price floating threshold can be obtained. Based on the electricity price floating threshold and the adjustment factor, the electricity price mutation threshold can be determined, and according to the electricity price mutation threshold, the electricity price data for the i-th day in history can be processed to obtain a coding sequence of the actual electricity price mutation point for the i-th day in history.
[0035] It should be noted that after obtaining the electricity price data of the i-th day, the maximum electricity price and the minimum electricity price can be obtained from the electricity price data of the i-th day, and the difference between the maximum electricity price and the minimum electricity price is used as the electricity price floating threshold.
[0036] It should be noted that the present application does not limit the setting of the adjustment factor of the electricity price floating threshold, for example: the adjustment factor of the electricity price floating threshold is 1 / 4.
[0037] In the embodiment of the present application, after the electricity price floating threshold and the adjustment factor are obtained, the product of the electricity price floating threshold and the adjustment factor can be used as the electricity price mutation threshold Th.
[0038] In an embodiment of the present application, after obtaining the electricity price mutation threshold Th, the electricity price data of the historical i-th day can be processed according to the electricity price mutation threshold to obtain the real electricity price mutation point coding sequence of the historical i-th day.
[0039] Optionally, for the n+1th electricity price point data encoding in the i-th day of history, the difference between the n+1th electricity price point data and the nth electricity price point data is obtained, wherein n is a natural number greater than or equal to 1, and in response to the difference being greater than 0 and greater than the electricity price mutation threshold, the n+1th electricity price point data is encoded as 1; in response to the difference being less than 0 and the absolute value of the difference being greater than the electricity price mutation threshold, the n+1th electricity price point data is encoded as -1; in response to the difference being equal to 0, or in response to the difference being greater than 0 and less than or equal to the electricity price mutation threshold, or in response to the difference being less than 0 and the absolute value of the difference being less than or equal to the electricity price mutation threshold, the n+1th electricity price point data is encoded as 0.
[0040] It should be noted that by repeating the above steps, the data code of each electricity price point in the i-th day in history can be obtained, and the code sequence of the real electricity price mutation point in the i-th day in history can be obtained.
[0041] S104. Iteratively train the electricity price mutation point prediction model according to the predicted electricity price mutation point coding sequence and the actual electricity price mutation point coding sequence of the historical i-th day until a converged target electricity price mutation point prediction model is obtained.
[0042] In an embodiment of the present application, the loss function of the electricity price mutation point prediction model can be obtained based on the predicted electricity price mutation point coding sequence and the actual electricity price mutation point coding sequence, and the model parameters of the electricity price mutation point prediction model can be adjusted according to the loss function until the loss function meets the training end condition, and the electricity price mutation point prediction model after the last adjustment of the model parameters is determined as the converged target electricity price mutation point prediction model.
[0043] Optionally, the model parameters can be optimized by back propagation according to the loss function until the loss function meets the training end condition, and the electricity price mutation point prediction model after the last adjustment of the model parameters is determined as the converged target electricity price mutation point prediction model.
[0044] 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.
[0045] Optionally, the training end condition can be set as the loss function value being less than a preset loss threshold.
[0046] Optionally, the training end condition may be set as the number of times the parameters of the electricity price mutation point prediction model are adjusted reaches a preset number threshold.
[0047] The training method of the electricity price mutation point prediction model provided in the present application obtains a sample data set, wherein each sample data in the sample data set includes the electricity price data of the historical i-1th day and the boundary data and meteorological data of the historical i-th day, and inputs the sample data into the electricity price mutation point prediction model to be trained to obtain the predicted electricity price mutation point coding sequence of the historical i-th day, obtain the real electricity price mutation point coding sequence of the historical i-th day, and iteratively train the electricity price mutation point prediction model according to the predicted electricity price mutation point coding sequence of the historical i-th day and the real electricity price mutation point coding sequence until a converged target electricity price mutation point prediction model is obtained. Therefore, the present application improves the accuracy and reliability of electricity price mutation point prediction by constructing an electricity price mutation point prediction model, training the electricity price mutation point prediction model based on the sample data, and predicting electricity price mutation points based on the electricity price mutation point prediction model, which is conducive to promoting the healthy development of the power market.
[0048] The specific process of inputting sample data into the electricity price mutation point prediction model to be trained to obtain the predicted electricity price mutation point coding sequence for the i-th day in history is explained below.
[0049] As a possible implementation, Figure 2 As shown, based on the above steps, the specific process of inputting the sample data into the electricity price mutation point prediction model to be trained in the above step S102 to obtain the predicted electricity price mutation point coding sequence of the historical i-th day includes the following steps:
[0050] S201. Input sample data into an electricity price mutation point prediction model, wherein the electricity price mutation point prediction model includes a multi-head attention mechanism layer, a first normalization layer, a feedforward neural network layer and a second normalization layer.
[0051] S202. Process the sample data through the multi-head attention mechanism layer to obtain the multi-head attention mechanism layer output.
[0052] It should be noted that the sample data is processed through a multi-head attention mechanism layer to capture the complex relationship between the sample data.
[0053] Optionally, the sample data is transformed through three different linear transformation layers to obtain a query matrix Q, a key matrix K, and a value matrix V, respectively. For a single attention mechanism, the dot product of the query matrix Q and the key matrix K is calculated, and the dot product is scaled to obtain the output matrix using a softmax function.
[0054] Among them, the expression of the output matrix of the attention mechanism is:
[0055]
[0056] Among them, Q is the query matrix, K is the key matrix, V is the value matrix, K T is the transpose of K, and the sizes of the matrices are (n, d k ), n is the length of the sequence, d k The dimension of the key.
[0057] Optionally, a multi-head attention mechanism is used to map the query matrix Q, key matrix K, and value matrix V into different subspaces through linear transformation, each with a dimension of d k / h, h is the number of attention heads. The above single attention mechanism step is performed for each subspace. This process is carried out in parallel on all attention heads, and the results of each attention head are connected through a connection layer (Concat), and the output of the multi-head attention mechanism layer is obtained through a linear transformation (linear layer).
[0058] Among them, the expression of the output of the multi-head attention mechanism layer is:
[0059] MultiHead(Q,K,V)=Concat(head1,...,head h )W O
[0060]
[0061] Among them, MultiHead(Q,K,V) is the output of the multi-head attention mechanism layer, Concat(head1,...,head h)W O To concatenate the output of each attention head, is the parameter matrix for linear projection. Each head has an independent projection matrix, W O It is the weight matrix after connecting the outputs of all attention heads and then linearly transforming them.
[0062] S203. Perform residual connection on the output of the multi-head attention mechanism layer to obtain a first residual connection result, and normalize the first residual connection result through a first normalization layer to obtain a first normalization layer output.
[0063] It should be noted that the output of the multi-head attention mechanism layer is added to the input of the multi-head attention mechanism layer (sample data) to obtain the first residual connection result to retain the integrity of the input information. The first residual connection result is normalized through the first normalization layer to improve training stability and accelerate convergence.
[0064] S204. Process the first normalization layer output through the feedforward neural network layer to obtain the feedforward neural network layer output.
[0065] Optionally, the output of the first normalized layer is subjected to a nonlinear transformation through a feedforward neural network layer. The feedforward neural network layer consists of two layers of linear transformations, with a rectified linear unit (ReLU) used as an activation function in the middle. The feedforward neural network can be expressed as:
[0066] FFN(x)=max(0,xW1+b1)W2+b2
[0067] Among them, FFN(x) is the output of the feedforward neural network layer, W1 and W2 are weight matrices, b1 and b2 are bias vectors, and x is the output of the first normalization layer.
[0068] S205, performing residual connection on the output of the feedforward neural network layer to obtain a second residual connection result, and normalizing the second residual connection result through a second normalization layer to obtain a predicted electricity price mutation point coding sequence.
[0069] It should be noted that the output of the feedforward neural network layer is added to the input of the feedforward neural network layer (the output of the first normalization layer) to obtain the second residual connection result to retain the integrity of the input information. The second residual connection result is normalized by the second normalization layer to obtain the predicted electricity price mutation point coding sequence.
[0070] The specific process of the training method of the electricity price mutation point prediction model of the present application is explained below.
[0071] For example, the model structure of the electricity price mutation point prediction model is as follows: Figure 3 As shown, the electricity price mutation point prediction model includes a multi-head attention mechanism layer, a first normalization layer, a feedforward neural network layer and a second normalization layer. Sample data is input into the electricity price mutation point prediction model, and the sample data is processed by the multi-head attention mechanism layer to obtain the multi-head attention mechanism layer output, wherein the multi-head attention mechanism layer includes a linear layer, multiple attention layers, a connection layer and a linear layer. For obtaining the multi-head attention mechanism layer output, please refer to the above embodiment, which will not be repeated here. The multi-head attention mechanism layer output and the sample data are added to obtain a first residual connection result, and the first residual connection result is normalized by the first normalization layer to obtain the first normalization layer output, and then the multi-head attention mechanism layer output is obtained. The output of the first normalization layer is processed by the feedforward neural network layer to obtain the output of the feedforward neural network layer, the output of the feedforward neural network layer and the output of the first normalization layer are added to obtain the second residual connection result, the second residual connection result is normalized by the second normalization layer to obtain a predicted electricity price mutation point coding sequence, according to the predicted electricity price mutation point coding sequence and the actual electricity price mutation point coding sequence, the loss function of the electricity price mutation point prediction model is obtained, the model parameters of the electricity price mutation point prediction model are adjusted according to the loss function until the loss function meets the training end condition, and the electricity price mutation point prediction model after the last adjustment of the model parameters is determined as the converged target electricity price mutation point prediction model.
[0072] In summary, the training method of the electricity price mutation point prediction model provided in the present application, by inputting sample data into the electricity price mutation point prediction model to be trained to obtain the predicted electricity price mutation point coding sequence of the historical i-th day, and iteratively training the electricity price mutation point prediction model according to the predicted electricity price mutation point coding sequence of the historical i-th day and the actual electricity price mutation point coding sequence, until a converged target electricity price mutation point prediction model is obtained, through the multi-head self-attention mechanism, it can better capture the information in the sample data, improve the expressiveness and efficiency of the electricity price mutation point prediction model, improve the training stability and convergence speed, and optimize the model performance through the loss function, thereby improving the generalization ability and prediction accuracy of the electricity price mutation point prediction model, which is conducive to improving the accuracy of the prediction of the electricity price mutation point coding sequence.
[0073] It should be noted that after obtaining the trained target electricity price mutation point prediction model, the electricity price mutation point prediction can be performed based on the target electricity price mutation point prediction model.
[0074] The following examples are used to explain in detail the method for predicting electricity price mutation points of the present application.
[0075] Figure 4 A schematic diagram of the flow chart of the method for predicting electricity price mutation points provided in an embodiment of the present application.
[0076] like Figure 4As shown, the electricity price mutation point prediction method proposed in this embodiment specifically includes the following steps:
[0077] S401. Obtain boundary data and meteorological data of the dth day to be predicted and electricity price data of the d-1th day, where d is a natural number greater than 1.
[0078] It should be noted that the boundary data on the dth day includes load data, new energy output data, west-to-east power transmission data and capacity information, and the meteorological data on the dth day includes temperature data, irradiance data, precipitation data and wind speed data.
[0079] S402, inputting the boundary data and meteorological data of the dth day and the electricity price data of the d-1th day into the target electricity price mutation point prediction model to obtain the electricity price mutation point coding sequence of the dth day to be predicted.
[0080] Among them, the target electricity price mutation point prediction model is a model trained using the above training method.
[0081] In an embodiment of the present application, after obtaining the boundary data and meteorological data of the d-th day and the electricity price data of the d-1th day, the boundary data and meteorological data of the d-th day and the electricity price data of the d-1th day can be preprocessed and normalized to obtain target data, and the target data is input into the target electricity price mutation point prediction model to obtain the electricity price mutation point coding sequence of the d-th day to be predicted.
[0082] The method for predicting electricity price mutation points provided by the present application obtains the boundary data and meteorological data of the d-th day to be predicted and the electricity price data of the d-1th day, and inputs the boundary data and meteorological data of the d-th day and the electricity price data of the d-1th day into the target electricity price mutation point prediction model to obtain the electricity price mutation point coding sequence of the d-th day to be predicted. Therefore, the present application can clearly, accurately and timely obtain the occurrence time and number of occurrences of the electricity price mutation point through the electricity price mutation point coding sequence of the d-th day to be predicted, which is conducive to market participants to better grasp market dynamics, to formulate transaction bidding plans in a refined manner, to reduce quotation risks, to expand quotation profit space, to improve the overall market efficiency, and is of great significance to promoting the healthy development of the power market.
[0083] In order to implement the above embodiment, this embodiment provides a training device for an electricity price mutation point prediction model. Figure 5 A schematic diagram of the structure of a training device for an electricity price mutation point prediction model provided in an embodiment of the present application.
[0084] like Figure 5 As shown, the training device 1000 of the electricity price mutation point prediction model includes: a first acquisition module 110, a second acquisition module 120, a third acquisition module 130 and a training module 140.
[0085] A first acquisition module 110 is used to acquire a sample data set, wherein each sample data in the sample data set includes electricity price data of the historical i-th day and boundary data and meteorological data of the historical i-1-th day, where i is a natural number greater than or equal to 1;
[0086] The second acquisition module 120 is used to input the sample data into the electricity price mutation point prediction model to be trained to obtain the predicted electricity price mutation point coding sequence of the i-th day in history;
[0087] The third acquisition module 130 is used to obtain the real electricity price mutation point code sequence of the i-th day in history;
[0088] The training module 140 is used to iteratively train the electricity price mutation point prediction model according to the predicted electricity price mutation point coding sequence and the actual electricity price mutation point coding sequence of the historical i-th day until a converged target electricity price mutation point prediction model is obtained.
[0089] According to one embodiment of the present application, the second acquisition module 120 is also used to input the sample data into the electricity price mutation point prediction model, wherein the electricity price mutation point prediction model includes a multi-head attention mechanism layer, a first normalization layer, a feedforward neural network layer and a second normalization layer; the sample data is processed by the multi-head attention mechanism layer to obtain the output of the multi-head attention mechanism layer; the output of the multi-head attention mechanism layer is residually connected to obtain a first residual connection result, and the first residual connection result is normalized by the first normalization layer to obtain the first normalization layer output; the first normalization layer output is processed by the feedforward neural network layer to obtain the feedforward neural network layer output; the feedforward neural network layer output is residually connected to obtain a second residual connection result, and the second residual connection result is normalized by the second normalization layer to obtain the predicted electricity price mutation point coding sequence.
[0090] In one embodiment of the present application, the training module 140 is further used to: obtain the loss function of the electricity price mutation point prediction model based on the predicted electricity price mutation point coding sequence and the actual electricity price mutation point coding sequence; adjust the model parameters of the electricity price mutation point prediction model according to the loss function until the loss function meets the training end condition, and determine the electricity price mutation point prediction model after the last adjustment of the model parameters as the converged target electricity price mutation point prediction model.
[0091] In one embodiment of the present application, the first acquisition module 110 is also used to: obtain the electricity price data of the historical i-1th day and the boundary data and meteorological data of the historical i-th day; preprocess and normalize the electricity price data of the historical i-1th day and the boundary data and meteorological data of the historical i-th day to obtain a sample data set.
[0092] In one embodiment of the present application, the third acquisition module 130 is further used to: obtain the electricity price data of the historical i-th day; determine the electricity price floating threshold based on the electricity price data of the historical i-th day; obtain the adjustment factor of the electricity price floating threshold, and determine the electricity price mutation threshold based on the electricity price floating threshold and the adjustment factor; process the electricity price data of the historical i-th day according to the electricity price mutation threshold to obtain the real electricity price mutation point coding sequence of the historical i-th day.
[0093] In one embodiment of the present application, the third acquisition module 130 is further used to: encode the n+1th electricity price point data in the i-th day of history, obtain the difference between the n+1th electricity price point data and the nth electricity price point data, wherein n is a natural number greater than or equal to 1; in response to the difference being greater than 0 and greater than the electricity price mutation threshold, encode the n+1th electricity price point data as 1; in response to the difference being less than 0 and the absolute value of the difference being greater than the electricity price mutation threshold, encode the n+1th electricity price point data as -1; in response to the difference being equal to 0, or in response to the difference being greater than 0 and less than or equal to the electricity price mutation threshold, or in response to the difference being less than 0 and the absolute value of the difference being less than or equal to the electricity price mutation threshold, encode the n+1th electricity price point data as 0.
[0094] The training device of the electricity price mutation point prediction model provided by the present application obtains a sample data set, wherein each sample data in the sample data set includes the electricity price data of the historical i-1th day and the boundary data and meteorological data of the historical i-th day, and inputs the sample data into the electricity price mutation point prediction model to be trained to obtain the predicted electricity price mutation point coding sequence of the historical i-th day, obtain the real electricity price mutation point coding sequence of the historical i-th day, and iteratively train the electricity price mutation point prediction model according to the predicted electricity price mutation point coding sequence of the historical i-th day and the real electricity price mutation point coding sequence until a converged target electricity price mutation point prediction model is obtained. Therefore, the present application improves the accuracy and reliability of electricity price mutation point prediction by constructing an electricity price mutation point prediction model, training the electricity price mutation point prediction model based on the sample data, and predicting electricity price mutation points based on the electricity price mutation point prediction model, which is conducive to promoting the healthy development of the power market.
[0095] In order to implement the above embodiment, this embodiment provides a device for predicting electricity price mutation points. Figure 6A schematic diagram of the structure of an electricity price mutation point prediction device provided in an embodiment of the present application.
[0096] like Figure 6 As shown, the electricity price mutation point prediction device 2000 includes: an acquisition module 210 and a prediction module 220.
[0097] The acquisition module 210 is used to acquire the boundary data and meteorological data of the dth day to be predicted and the electricity price data of the d-1th day, where d is a natural number greater than 1;
[0098] The prediction module 220 is used to input the boundary data and meteorological data of the d-th day and the electricity price data of the d-1th day into the target electricity price mutation point prediction model to obtain the electricity price mutation point coding sequence of the d-th day to be predicted, wherein the target electricity price mutation point prediction model is a model trained using the training method described in the first aspect.
[0099] The electricity price mutation point prediction device provided by the present application obtains the boundary data and meteorological data of the d-th day to be predicted and the electricity price data of the d-1th day, and inputs the boundary data and meteorological data of the d-th day and the electricity price data of the d-1th day into the target electricity price mutation point prediction model to obtain the electricity price mutation point coding sequence of the d-th day to be predicted. Therefore, the present application can clearly, accurately and timely obtain the appearance time and number of appearances of the electricity price mutation point through the electricity price mutation point coding sequence of the d-th day to be predicted, which is conducive to market participants to better grasp market dynamics, to formulate transaction bidding plans in a refined manner, to reduce quotation risks, to expand quotation profit space, to improve the overall market efficiency, and is of great significance to promoting the healthy development of the power market.
[0100] 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 electricity price mutation point prediction model as described in the first aspect or the electricity price mutation point prediction method as described in the second aspect is implemented.
[0101] 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 electricity price mutation point prediction model described in the first aspect or the electricity price mutation point prediction method described in the second aspect.
[0102] 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 electricity price mutation point prediction model described in the first aspect or the electricity price mutation point prediction method described in the second aspect.
[0103] 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.
[0104] 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 an electricity price mutation point prediction model, characterized in that: The method comprises: Acquire a sample data set, wherein each sample data in the sample data set includes electricity price data on the historical i-1th day and boundary data and meteorological data on the historical i-th day, where i is a natural number greater than 1; Inputting the sample data into the electricity price mutation point prediction model to be trained to obtain a predicted electricity price mutation point coding sequence for the i-th day in history; Get the real electricity price mutation point coding sequence of the history day i; According to the predicted electricity price mutation point coding sequence and the actual electricity price mutation point coding sequence of the historical i-th day, the electricity price mutation point prediction model is iteratively trained until a converged target electricity price mutation point prediction model is obtained.
2. The method according to claim 1, characterized in that The step of inputting the sample data into the electricity price mutation point prediction model to be trained to obtain the predicted electricity price mutation point coding sequence for the i-th day in history includes: Inputting the sample data into the electricity price mutation point prediction model, wherein the electricity price mutation point prediction model includes a multi-head attention mechanism layer, a first normalization layer, a feedforward neural network layer and a second normalization layer; Processing the sample data through a multi-head attention mechanism layer to obtain the multi-head attention mechanism layer output; Performing a residual connection on the output of the multi-head attention mechanism layer to obtain a first residual connection result, and normalizing the first residual connection result through a first normalization layer to obtain a first normalization layer output; Processing the first normalization layer output by the feedforward neural network layer to obtain the feedforward neural network layer output; Performing residual connection on the output of the feedforward neural network layer to obtain a second residual connection result, and performing normalization processing on the second residual connection result through a second normalization layer to obtain the predicted electricity price mutation point coding sequence.
3. The method according to claim 1, characterized in that: The iterative training of the electricity price mutation point prediction model according to the predicted electricity price mutation point coding sequence and the actual electricity price mutation point coding sequence on the historical day i until a converged target electricity price mutation point prediction model is obtained includes: Obtaining a loss function of an electricity price mutation point prediction model according to the predicted electricity price mutation point coding sequence and the actual electricity price mutation point coding sequence; The model parameters of the electricity price mutation point prediction model are adjusted according to the loss function until the loss function meets the training end condition, and the electricity price mutation point prediction model after the last adjustment of the model parameters is determined as the converged target electricity price mutation point prediction model.
4. The method according to claim 1, characterized in that: The obtaining of the sample data set comprises: Obtain the electricity price data for the historical day i-1 and the boundary data and meteorological data for the historical day i; The electricity price data of the historical i-1 day and the boundary data and meteorological data of the historical i day are preprocessed and normalized to obtain a sample data set.
5. The method according to claim 1, characterized in that The step of obtaining the coding sequence of the real electricity price mutation point on the i-th day in history includes: Get the electricity price data for the historical i-th day; Determine the electricity price floating threshold value according to the electricity price data of the historical i-th day; Acquire an adjustment factor of the electricity price floating threshold, and determine an electricity price mutation threshold according to the electricity price floating threshold and the adjustment factor; The electricity price data of the historical i-th day is processed according to the electricity price mutation threshold to obtain a coding sequence of real electricity price mutation points of the historical i-th day.
6. The method according to claim 5, characterized in that The step of processing the electricity price data of the historical i-th day according to the electricity price mutation threshold to obtain a real electricity price mutation point coding sequence of the historical i+1 day includes: For the n+1th electricity price point data code in the history i-th day, obtain the difference between the n+1th electricity price point data and the nth electricity price point data, where n is a natural number greater than or equal to 1; In response to the difference being greater than 0 and greater than the electricity price mutation threshold, encoding the n+1th electricity price point data as 1; In response to the difference being less than 0 and the absolute value of the difference being greater than the electricity price mutation threshold, encoding the (n+1)th electricity price point data as -1; In response to the difference being equal to 0, or in response to the difference being greater than 0 and less than or equal to the electricity price mutation threshold, or in response to the difference being less than 0 and the absolute value of the difference being less than or equal to the electricity price mutation threshold, the n+1th electricity price point data is encoded as 0.
7. A method for predicting electricity price mutation points, characterized in that: The method comprises: Obtain boundary data and meteorological data for the dth day to be predicted and electricity price data for the d-1th day, where d is a natural number greater than 1; The boundary data and meteorological data of the d-th day and the electricity price data of the d-1th day are input into the target electricity price mutation point prediction model to obtain the electricity price mutation point coding sequence of the d-th day to be predicted, wherein the target electricity price mutation point prediction model is a model trained using the training method described in any one of claims 1 to 6.
8. A training device for an electricity price mutation point prediction model, 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 electricity price data of the historical i-th day and boundary data and meteorological data of the historical i-1-th day, where i is a natural number greater than or equal to 1; The second acquisition module is used to input the sample data into the electricity price mutation point prediction model to be trained to obtain the predicted electricity price mutation point coding sequence of the i-th day in history; The third acquisition module is used to obtain the real electricity price mutation point coding sequence on the i-th day of history; The training module is used to iteratively train the electricity price mutation point prediction model according to the predicted electricity price mutation point coding sequence and the actual electricity price mutation point coding sequence of the historical i-th day until a converged target electricity price mutation point prediction model is obtained.
9. A device for predicting sudden change points of electricity prices, characterized in that: The device comprises: An acquisition module is used to acquire boundary data and meteorological data of the dth day to be predicted and electricity price data of the d-1th day, where d is a natural number greater than 1; A prediction module, used to input the boundary data and meteorological data of the d-th day and the electricity price data of the d-1th day into a target electricity price mutation point prediction model to obtain the electricity price mutation point coding sequence of the d-th day to be predicted, wherein the target electricity price mutation point prediction model is a model trained using the training method described in any one of claims 1 to 6.
10. An electronic device, characterized in that: include: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the method according to any one of claims 1 to 6 or claim 7 is implemented.