Power market price prediction method, device and equipment based on machine learning
Through the machine learning-based power market price prediction method, combined with point prediction and quantile prediction, the problem that the impact of new energy access on the power system inertia changes is solved, and the accuracy and flexibility of power market price prediction is improved. , help trading entities better manage trading strategies.
Patent Information
- Application Number
- CN202411365815.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-29
- Publication Date
- 2025-01-14
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
The existing technology fails to fully consider the impact of new energy access on changes in power system inertia, which limits the accuracy and practicality of price predictions in the spot power market.
Using machine learning-based power market price prediction method, point prediction is performed using a pre-trained power market price prediction model, combined with quantile prediction by obtaining historical data sets, including price data, power load and renewable energy generation. The model provides probability intervals and uses multivariate quantile regression method to improve the flexibility and effectiveness of predictions.
It improves the accuracy and practicality of price prediction in the power market, provides richer forecast results and uncertainty information, and helps trading entities manage trading strategies more effectively.
Smart Images

Figure CN119313371A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of artificial intelligence, and in particular to a method, device and equipment for predicting electricity market prices based on machine learning. Background Art
[0002] As my country gradually carries out pilot operations of the electricity spot market in different regions, the future electricity market system will be a complex system combining the electricity spot market and the medium- and long-term market. Driven by the "dual carbon" goal, the development of new energy such as wind power and solar energy has become an effective way to achieve carbon emission reduction goals. However, the high proportion of new energy access has brought new challenges to the power system, especially the increase in price volatility risks.
[0003] In traditional power systems dominated by thermal power units, the clearing price of the spot market is relatively stable because the load fluctuation is small and the system inertia level is high. However, in new power systems, the volatility of new energy sources such as wind and solar energy leads to strong volatility in the output of the source side. At the same time, with the continuous improvement of the penetration rate of new energy, the inertia level of the system has been significantly reduced, and the inertia volatility has increased, which directly affects the day-ahead and real-time dispatching decisions of the power system, and further affects the clearing price of the power spot market. In the prior art, the prediction of the power spot market price mainly depends on the load forecast and the new energy output forecast. The methods used include time series method, combined forecasting method, neural network method, etc. However, the prior art has not fully considered the impact of inertia constraints on the prediction results, which limits the accuracy and practicality of the prediction.
[0004] The existing technology fails to fully consider the impact of changes in system inertia caused by the access of new energy on spot market prices. Summary of the invention
[0005] In view of this, the present application provides a method for predicting electricity market prices based on machine learning to solve the technical problem that the existing technology fails to fully consider the impact of new energy access on electricity prices.
[0006] According to a first aspect of the present application, a method for predicting electricity market prices based on machine learning is provided, comprising:
[0007] Obtaining a historical data set of the electricity market, wherein the historical data set includes price data, electricity load, and renewable energy generation;
[0008] Input historical data into a pre-trained electricity market price prediction model to predict electricity market prices;
[0009] Input historical data into the pre-trained electricity market price quantile prediction model to predict the probability range of electricity market prices.
[0010] According to a second aspect of the present application, there is provided a device for predicting electricity market prices based on machine learning, comprising:
[0011] A data acquisition module, used to acquire a historical data set of the power market, wherein the historical data set includes price data, power load and renewable energy generation;
[0012] The first prediction module is used to input historical data into a pre-trained power market price prediction model to predict the power market price;
[0013] The second prediction module inputs historical data into a pre-trained electricity market price quantile prediction model to predict the probability interval of electricity market prices.
[0014] According to a third aspect of the present application, a computer device is provided, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor implements the steps of the above-mentioned method for predicting electricity market prices based on machine learning when executing the computer program.
[0015] According to a fourth aspect of the present application, a computer-readable storage medium is provided, which stores a computer program. When the computer program is executed by a processor, the steps of the above-mentioned machine learning-based electricity market price forecasting method are implemented.
[0016] Through the above-mentioned technical scheme, the present application provides a method, device, equipment and medium for predicting electricity market prices based on machine learning, which obtains historical data sets of the electricity market, inputs the historical data into a pre-trained electricity market price prediction model to predict the electricity market price, and inputs the historical data into a pre-trained electricity market price quantile prediction model to predict the probability interval of the electricity market price. The present invention adopts a mixed method of point prediction and quantile prediction to make the prediction results richer. Point prediction can give an expected value, while quantile prediction provides more information about prediction uncertainty. This combination makes the prediction results more flexible and effective in practical applications. By using the multivariate quantile regression method, trading entities can more effectively manage their trading strategies in the electricity spot market.
[0017] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application and to implement it in accordance with the contents of the specification, and to make the above and other purposes, features and advantages of the present application more obvious and easy to understand, the specific implementation methods of the present application are listed below. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0019] Figure 1 A schematic diagram of an application scenario of a method for predicting electricity market prices based on machine learning provided in an embodiment of the present application is shown;
[0020] Figure 2 A flow chart of a method for predicting electricity market prices based on machine learning provided in an embodiment of the present application is shown;
[0021] Figure 3 A flow chart of a method for training a point prediction model provided in an embodiment of the present application is shown;
[0022] Figure 4 A schematic diagram of the method flow of the quantile prediction model training provided in an embodiment of the present application is shown;
[0023] Figure 5 Another schematic diagram of the point prediction model network structure provided in an embodiment of the present application is shown;
[0024] Figure 6 A structural schematic diagram of a power market price prediction device based on machine learning provided in an embodiment of the present application is shown. DETAILED DESCRIPTION
[0025] The specific implementation of the present application will be described in detail below with reference to the accompanying drawings and in combination with the embodiments. It should be noted that the embodiments and features in the embodiments of the present application can be combined with each other without conflict.
[0026] The present invention provides a method for predicting electricity market prices based on machine learning, which can be applied to Figure 1In the scenario shown, the spot electricity in the power system includes traditional energy generation, renewable energy generation, energy storage, etc. Based on the above application scenario, in the power market price prediction, a power market price prediction method based on machine learning provided in an embodiment of the present invention is applied, by obtaining a historical data set of the power market, wherein the historical data set includes price data, power load and renewable energy generation; inputting the historical data into a pre-trained power market price prediction model to predict the power market price; inputting the historical data into a pre-trained power market price quantile prediction model to predict the probability interval of the power market price. The embodiment of the present invention adopts a mixed method of point prediction plus quantile prediction to make the prediction results richer. The point prediction can give an expected value, while the quantile prediction provides more information about the prediction uncertainty. This combination makes the prediction results more flexible and effective in practical applications. By using the multivariate quantile regression method, the trading subject can more effectively manage its trading strategy in the power spot market.
[0027] The present invention is described in detail below through specific embodiments.
[0028] Embodiment 1:
[0029] like Figure 2 As shown, a method for predicting electricity market prices based on machine learning is provided in an embodiment of the present invention, comprising:
[0030] Step 201: Acquire a historical data set of the power market, wherein the historical data set includes price data, power load, and renewable energy generation;
[0031] Step 202: input the historical data into a pre-trained electricity market price prediction model to predict the electricity market price;
[0032] Step 203: Input the historical data into a pre-trained electricity market price quantile prediction model to predict the probability interval of the electricity market price.
[0033] A method for predicting electricity market prices based on machine learning is provided in Embodiment 1 of the present invention. The method obtains a historical data set of the electricity market, inputs the historical data into a pre-trained electricity market price prediction model, predicts the electricity market price, and inputs the historical data into a pre-trained electricity market price quantile prediction model to predict the probability interval of the electricity market price. The present invention adopts a mixed method of point prediction plus quantile prediction to make the prediction results richer. The point prediction can give an expected value, while the quantile prediction provides more information about the prediction uncertainty. It not only provides a single prediction value, but also can generate prediction results at different quantile levels. This combination makes the prediction results more flexible and effective in practical applications. By using the multivariate quantile regression method, trading entities can more effectively manage their trading strategies in the electricity spot market.
[0034] In the first embodiment of the present invention, the power market price prediction model and the power market price quantile prediction model are comprehensively applied. Accordingly, the model needs to be trained accordingly in advance. Before step 202, the following steps are included:
[0035] Step 202-1, randomly splitting the historical data set;
[0036] Step 202-2: Based on each segmented historical data set as a training sample, train the electricity market price prediction model to obtain the electricity market price prediction model.
[0037] Step 202-3: Based on each segmented historical data set as a training sample, the electricity market price quantile prediction model is trained to obtain the electricity market price quantile prediction model.
[0038] Step 202-1 specifically includes:
[0039] Set the split ratio of the historical data set;
[0040] Randomly divide the historical data set into training set and validation set;
[0041] The above random segmentation steps are repeated in a loop, and the results of each segmentation are stored.
[0042] By randomly dividing the historical data set into training sets and validation sets multiple times, multiple prediction results can be obtained from different data subsets. This helps to reduce the high variance problem that may be caused by a single data segmentation, thereby improving the stability of the prediction. Repeatedly using different data subsets to train the model and make predictions can increase the diversity of data learned by the model, thereby improving the accuracy of the overall prediction. Random segmentation allows the model to learn data distribution from multiple perspectives and better capture the uncertainty and potential random fluctuations of the data. Since the model is trained on different data subsets, this method reduces the risk of the model overfitting to a specific data subset.
[0043] Embodiment 2:
[0044] In order to achieve point forecasting of electricity market prices, such as Figure 3 As shown, including:
[0045] Step 301: construct an autoregressive model;
[0046] The autoregressive model is Among them, Y t is the electricity price at time t, α is a constant term, φ i is the autoregression coefficient, β j is the coefficient of the exogenous variable, X t-j is an exogenous variable at time tj, ε t is the error term, and the exogenous variables include power load and renewable energy generation;
[0047] Step 302: Based on each segmented historical data set as a training sample, estimate model parameters by least square method;
[0048] Step 303: Output the electricity market price prediction model.
[0049] The autoregressive model in the second embodiment of the present invention can capture the dynamic characteristics of time series data, such as trends, seasonality, etc., which is particularly important for the prediction of the short-term electricity market. By combining exogenous variables, such as weather forecasts, fuel prices, etc., the model can more accurately reflect the external factors affecting the electricity market. Compared with other complex models, it has lower computational complexity. The model does not predict each variable separately, but jointly predicts multiple time series (such as electricity prices, loads, and renewable energy generation) as a whole, which helps to better understand the relationship between variables. At the same time, the uncertainty of the prediction is estimated by random resampling, allowing the model to dynamically update parameters according to the latest market information, thereby improving the adaptability of the prediction model to market changes. The autoregressive model AR in the prior art is usually used for single-step prediction, but the method in the second embodiment of the present invention extends it to multi-step prediction, which is of great significance for the long-term planning and decision-making of the electricity market (the model parameters are independently estimated and applicable to each hour, which means that the model can perform continuous multi-step predictions and adapt to market changes in different time periods within a day).
[0050] Embodiment three:
[0051] In order to generate prediction results at different quantile levels and realize the quantile interval prediction of electricity market prices, such as Figure 4 As shown, including:
[0052] Step 401: Input each segmented historical data set as a training sample into a quantile regression model;
[0053] Step 402: Calculate the loss using the quantile loss function;
[0054] The loss function is Among them, τ is the quantile, Y t is the actual value of the endogenous variable at time t, Q τ (Y t ) is the endogenous variable Y at a given quantile τ t The predicted value of X t is the actual value of the exogenous variable at time t, Y t is the actual value of the electricity market price at time t, is the regression coefficient corresponding to the quantile τ;
[0055] Step 403: Update the quantile regression model parameters θ by minimizing the loss function τ , to estimate the model parameters θ τ ;
[0056] Step 404: Calculate the estimated model parameters θ corresponding to N quantiles τ And the corresponding quantile prediction model
[0057] Wherein, N is the number of quantile values;
[0058] Step 405: According to the set significance level α, obtain the corresponding quantile prediction model Q α / 2 (Y T+1 )=X T+1 θ α / 2 and Q (1-α / 2) (Y T+1 )=X T+1 θ (1-α / 2) ;
[0059] Step 406: Obtain the electricity price Y at time t+1 t+1 The prediction interval PI (1-α) =[Q α / 2 (Y T+1 ),Q (1-α / 2) (Y T+1 )];
[0060] Among them, 1-α is the prediction interval coverage.
[0061] Normally, the traditional point prediction result is only an estimated prediction value and lacks reliability measurement. Therefore, the interval prediction is introduced in the third embodiment of the present invention, that is, the confidence interval of the prediction value is given at a given confidence level, which helps users better understand the development trend of electricity market prices. The evaluation of interval prediction accuracy mainly includes prediction interval coverage. The quantile prediction method provided in the third embodiment of the present invention estimates the simultaneous uncertainty of multivariate prediction by repeated resampling. Since this method is non-parametric, it can be used in combination with different point prediction methods to generate prediction results of different quantiles. Users can obtain predictions at different confidence levels to help them better manage risks and make decisions.
[0062] Embodiment 4:
[0063] In order to achieve Figure 5 The network structure of the model is shown. The training steps of the model include:
[0064] Step 501: construct a power market price prediction model based on a convolutional neural network (CNN), a long short-term memory (LSTM) network and a Transformer model;
[0065] Among them, the input layer receives historical data set data; convolution operation is applied in the convolutional neural network CNN to extract local features in the data, and the convolution kernel size is 3, which is used to capture local patterns in the data; the pooling layer is used to perform pooling operations to reduce the spatial dimension of the data while increasing the invariance to small changes. In the fourth embodiment of the present invention, the pooling window size is set to 2 to reduce the amount of data and improve computing efficiency; the fully connected layer converts the output of the convolution layer and the pooling layer into a one-dimensional feature vector to provide input for the subsequent LSTM layer. The long short-term memory network LSTM uses its long-term memory function to extract time-varying information. Each LSTM unit contains an input gate, a forget gate, and an output gate. These gates control the flow of information to capture long-term dependencies in time series data. Among them, the hidden layer state dimension is set to 64 to store and process historical information in time series data. The activation function uses the ReLU activation function to increase the nonlinear expression ability of the model. Transformer model (corresponding to Figure 5 The attention layer in the encoder layer learns the dependencies in the sequence through the multi-head attention mechanism and captures the global context information in the sequence by processing the dependencies in multiple subspaces in parallel. Each encoder layer contains a multi-head self-attention mechanism and a feedforward network to process the input sequence. Through the self-attention mechanism, the model can learn the relative importance of words or features in the sequence, thereby improving the accuracy of the prediction.
[0066] Step 502, initializing the learning rate and training cycle;
[0067] Among them, the initial learning rate is set to 0.01. The setting of the learning rate directly affects the convergence speed and final effect of the model training. 50 training cycles are selected in the fourth embodiment of the present invention.
[0068] Step 503: Each segmented historical data set is used as a training sample, and the mean square error (MSE) is used as a loss function to train the electricity market price prediction model.
[0069] As an innovative point prediction model, the CNN+LSTM+Transformer hybrid model provided in Example 4 of the present invention has a lower RMSE value in predicting electricity market prices than traditional ARIMA, XGBoost and LSTM models, showing higher prediction accuracy. The hybrid model can simultaneously process the spatial and temporal characteristics of the data, as well as long-term dependency problems, and is superior to the point prediction method in the prior art. The parallel attention mechanism of Transformer accelerates the training process of the model and improves the prediction efficiency.
[0070] Further, as Figures 2 to 5 The specific implementation of the method, the embodiment of the present invention provides a device for predicting electricity market prices based on machine learning, such as Figure 6As shown, the device comprises:
[0071] A data acquisition module 610 is used to acquire a historical data set of the power market, wherein the historical data set includes price data, power load and renewable energy generation;
[0072] The first prediction module 620 is used to input historical data into a pre-trained power market price prediction model to predict the power market price;
[0073] The second prediction module 630 inputs the historical data into a pre-trained electricity market price quantile prediction model to predict the probability interval of the electricity market price.
[0074] In an embodiment of the present invention, a computer device is provided, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the steps of implementing a method for predicting electricity market prices based on machine learning include:
[0075] Obtaining a historical data set of the electricity market, wherein the historical data set includes price data, electricity load, and renewable energy generation;
[0076] Input historical data into a pre-trained electricity market price prediction model to predict electricity market prices;
[0077] Input historical data into the pre-trained electricity market price quantile prediction model to predict the probability range of electricity market prices.
[0078] In an embodiment of the present invention, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, the following steps are implemented:
[0079] Obtaining a historical data set of the electricity market, wherein the historical data set includes price data, electricity load, and renewable energy generation;
[0080] Input historical data into a pre-trained electricity market price prediction model to predict electricity market prices;
[0081] Input historical data into the pre-trained electricity market price quantile prediction model to predict the probability range of electricity market prices.
[0082] It should be noted that the above embodiments only use electricity market price forecasting as an example to illustrate the principles and implementation steps of the embodiments of the present invention, without making specific limitations on actual application scenarios, such as power load forecasting, renewable energy power generation forecasting, and the technical solution of the present invention can also be applied to the forecast of other power indicators. For the functions or steps that can be implemented by computer-readable storage media or computer devices, please refer to the aforementioned method embodiments. To avoid repetition, they will not be described one by one here.
[0083] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0084] Those skilled in the art can clearly understand that for the convenience and simplicity of description, only the division of the above-mentioned functional units and modules is used as an example. In actual applications, the above-mentioned functions can be distributed and completed by different functional units and modules as needed, that is, the internal structure of the device can be divided into different functional units or modules to complete all or part of the functions described above.
[0085] The embodiments described above are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. Such modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention, and should all be included in the protection scope of the present invention.
Claims
1. A method for predicting electricity market prices based on machine learning, characterized in that: include: Acquire a historical data set of the electricity market, wherein the historical data set includes price data, power load, and renewable energy generation; Inputting the historical data into a pre-trained electricity market price prediction model to predict the electricity market price; The historical data is input into a pre-trained electricity market price quantile prediction model to predict the probability interval of the electricity market price.
2. The method for predicting electricity market prices based on machine learning according to claim 1, characterized in that: Before the step of inputting the historical data into a pre-trained electricity market price prediction model to predict the electricity market price, the step includes: Randomly splitting the historical data set; Based on each segmented historical data set as a training sample, the electricity market price prediction model is trained to obtain the electricity market price prediction model.
3. The method for predicting electricity market prices based on machine learning according to claim 2, characterized in that: Before the step of inputting the historical data into a pre-trained electricity market price quantile prediction model to predict the probability interval of the electricity market price, the method includes: Randomly splitting the historical data set; Based on each segmented historical data set as a training sample, the electricity market price quantile prediction model is trained to obtain the electricity market price quantile prediction model.
4. The method for predicting electricity market prices based on machine learning according to any one of claims 2 or 3, characterized in that: The step of randomly dividing the historical data set comprises: Setting a split ratio of the historical data set; Randomly divide the historical data set into a training set and a validation set; The above random segmentation steps are repeated in a loop, and the results of each segmentation are stored.
5. The method for predicting electricity market prices based on machine learning according to claim 2, characterized in that: The step of training the power market price prediction model based on each segmented historical data set as a training sample to obtain the power market price prediction model comprises: Construct an autoregressive model, where the autoregressive model is Among them, Y t is the electricity price at time t, α is a constant term, φ i is the autoregressive coefficient, β j is the coefficient of the exogenous variable, X t-j is an exogenous variable at time tj, ε t is the error term, and the exogenous variables include power load and renewable energy generation; Based on each segmented historical data set as a training sample, estimating model parameters by least squares method; Output electricity market price forecasting model.
6. The method for predicting electricity market prices based on machine learning according to claim 3, characterized in that: The step of training the electricity market price quantile prediction model based on each segmented historical data set as a training sample to obtain the electricity market price quantile prediction model includes: Input each segmented historical data set as a training sample into a quantile regression model; The loss is calculated using the quantile loss function, where the loss function is Among them, τ is the quantile, Y t is the actual value of the endogenous variable at time t, Q τ (Y t ) is the endogenous variable Y at a given quantile τ t The predicted value of X t is the actual value of the exogenous variable at time t, Y t is the actual value of the electricity market price at time t, is the regression coefficient corresponding to the quantile τ; Update the quantile regression model parameters θ by minimizing the loss function τ , to estimate the model parameters θ τ ; Calculate the estimated model parameters θ corresponding to N quantiles τ And the corresponding quantile prediction model Wherein, N is the number of quantile values; According to the set significance level α, the corresponding quantile prediction model Q is obtained α / 2 (Y T+1 )=X T+1 θ α / 2 and Q (1-α / 2) (Y T+1 )=X T+1 θ (1-α / 2) ; Get the electricity price Y at time t+1 t+1 The prediction interval PI (1-α) =[Q α / 2 (Y T+1 ),Q (1-α / 2) (Y T+1 )], where 1-α is the prediction interval coverage.
7. The method for predicting electricity market prices based on machine learning according to claim 1, characterized in that: The step of training the power market price prediction model based on each segmented historical data set as a training sample to obtain the power market price prediction model comprises: Based on convolutional neural network CNN, long short-term memory network LSTM and Transformer model, a power market price prediction model is constructed; Initialize learning rate and training cycle; Each segmented historical data set is used as a training sample, and the mean square error (MSE) is used as a loss function to train the electricity market price prediction model.
8. A device for predicting electricity market prices based on machine learning, characterized in that: include: A data acquisition module, used to acquire a historical data set of the power market, wherein the historical data set includes price data, power load and renewable energy generation; A first prediction module, used for inputting the historical data into a pre-trained electricity market price prediction model to predict the electricity market price; The second prediction module inputs the historical data into a pre-trained electricity market price quantile prediction model to predict the probability interval of the electricity market price.
9. A computer device comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that: When the processor executes the computer program, the steps of the method for predicting electricity market price based on machine learning as described in any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium storing a computer program, characterized in that: When the computer program is executed by a processor, the steps of the method for predicting electricity market price based on machine learning as described in any one of claims 1 to 7 are implemented.
Citation Information
Cited By
Logistics transportation cost accounting method, system, equipment and medium
CN121581740A