Transaction electricity price trend prediction method based on electric power spot transaction data
By using a K-means+RF model based on electricity spot trading data, combined with power plant output and meteorological data, electricity price forecasting is performed, which solves the problem that the electricity trading system cannot reflect the scarcity of electricity resources in real time, and realizes the safe operation of the power grid and the improvement of trading revenue.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- 航融智慧能源(上海)有限公司
- Filing Date
- 2025-12-12
- Publication Date
- 2026-05-01
AI Technical Summary
The existing power trading system cannot reflect the scarcity of ultra-short-term power resources in real time, making it difficult to achieve safe grid operation and power balance, and market fluctuations lead to trading losses.
A K-means+RF model based on electricity spot trading data is used, combined with power plant grid connection data, meteorological data, and renewable energy output data, to predict electricity prices. Through data validity verification and completion, power generation is optimized to reduce risks.
It improved the accuracy of predicting electricity price trends, reduced trading risks caused by market fluctuations, optimized power generation, and increased overall revenue.
Smart Images

Figure CN121961722A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of electricity price prediction technology, and relates to a method for predicting electricity price trends based on electricity spot trading data. Background Technology
[0002] With the significant increase in electricity trading volume on power exchanges, electricity prices have become one of the cornerstones of energy market research. However, electricity production itself is an engineering-related process, making market research on electricity prices a complex issue. Currently, the market only offers spot trading platforms for electricity. These platforms announce the starting units and generating capacity of generating units for the following day, as well as reference prices, one day in advance. This allows for adjustments to the required power generation and consumption curves and deviations from medium- and long-term contracts, essentially achieving a balance of power supply and demand for the following day and meeting grid security constraints. However, they cannot reflect the scarcity of power resources in the ultra-short term in real time, thus failing to achieve the goals of real-time power balance and safe grid operation. Summary of the Invention
[0003] To address the aforementioned technical problems, the present invention aims to provide a method for predicting electricity price trends based on electricity spot trading data. This method can obtain highly accurate electricity price trends, reduce trading losses caused by unpredictable market fluctuations and boundary conditions, and increase overall revenue.
[0004] To achieve the above objectives, the technical solution adopted by the present invention is as follows:
[0005] A method for predicting electricity price trends based on electricity spot market data includes the following steps:
[0006] Step S1: Obtain the first power data group connected to the power station, and obtain the second power data group after verifying the legality of the first power data in the first power data group; the first power data group is a collection of the first power data, and the first power data is the original power data;
[0007] Step S2: Obtain the first indicator data group for electricity spot trading, and obtain the second indicator data group after verifying the legality of the first indicator data in the first indicator data group; the first indicator data group is a collection of the first indicator data, which includes a collection of raw meteorological data, raw node price clearing data and raw renewable energy output data;
[0008] Step S3: Input the second electricity data group and the second index data group into the electricity price prediction model to obtain the predicted electricity price; the electricity price prediction model is a K-means+RF model.
[0009] Furthermore, after verifying the legality of the first power data in the first power data group, a second power data group is obtained. Specifically, the first power data in the first power data group is verified using an installed capacity conversion algorithm to obtain a legal first power data group and an illegal first power data group, and the legal first power data group is used as the second power data group.
[0010] Furthermore, it also includes completing the illegal first power data group to obtain a completed illegal first power data group;
[0011] The second power data group also includes the completed illegal first power data group.
[0012] Furthermore, the illegal first power data group includes illegal first power data; the illegal first power data includes 0, negative numbers, null values, and raw power data exceeding the installed capacity range;
[0013] The illegal first power data group is supplemented by: removing the illegal first power data from the illegal first power data group and replacing the corresponding illegal first power data with the first power data from the nearest subsequent time point.
[0014] Furthermore, the original power data is the power data obtained every 15 minutes for 96 points within 24 hours.
[0015] Furthermore, after verifying the legality of the first indicator data in the first indicator data group, a second indicator data group is obtained. Specifically, the first indicator data in the first indicator data group is verified using an installed capacity conversion algorithm to obtain a legal first indicator data group and an illegal first indicator data group, and the legal first indicator data group is used as the second indicator data group.
[0016] Furthermore, it also includes completing the illegal first indicator data group to obtain a completed illegal first indicator data group;
[0017] The second indicator data group also includes the completed illegal first indicator data group;
[0018] To complete the illegal first indicator data group, specifically: remove the illegal first indicator data from the illegal first indicator data group and replace the corresponding illegal first indicator data with the first indicator data from the nearest subsequent time point;
[0019] Furthermore, the illegal first indicator data group includes illegal first indicator data; the illegal first indicator data includes 0, negative numbers, null values, as well as raw meteorological data, raw node price clearing data, and raw new energy output data that exceed the installed capacity range;
[0020] The illegal first indicator data group is supplemented by: removing the illegal first indicator data from the illegal first indicator data group and replacing the corresponding illegal first indicator data with the first indicator data from the nearest subsequent time point.
[0021] Furthermore, the raw meteorological data, raw node price clearing data, and raw new energy output data are respectively meteorological data, node price clearing data, and new energy output data at 96 points every 15 minutes within 24 hours.
[0022] The present invention, by adopting the above technical solution, has the following advantages and effects:
[0023] This invention provides a method for predicting electricity price trends based on electricity spot market data. It integrates multi-dimensional information such as power plant grid connection data, meteorological data, nodal price clearing data, and renewable energy output data, covering key factors affecting electricity prices. The model enables dynamic price prediction, providing traders with nodal price forecasts and reducing risk during trading. For newcomers to the industry with limited experience, it provides real-time data support, preventing errors due to insufficient preparation. Furthermore, the model-predicted dynamic electricity prices can optimize power generation, ensuring power generation within reasonable timeframes and increasing profitability. Attached Figure Description
[0024] Figure 1 This is a flowchart of a method for predicting electricity price trends based on electricity spot trading data. Detailed Implementation
[0025] The embodiments of the present invention will be described in detail below with reference to the accompanying drawings to provide a clearer understanding of the purpose, features, and advantages of the present invention. It should be understood that the embodiments shown in the drawings are not intended to limit the scope of the present invention, but are merely illustrative of the essential spirit of the technical solution of the present invention.
[0026] like Figure 1 As shown. This invention provides a method for predicting electricity price trends based on electricity spot market data, comprising the following steps:
[0027] Step S1: Obtain the first power data group connected to the power station, and obtain the second power data group after verifying the legality of the first power data in the first power data group; the first power data group is a collection of first power data arranged in chronological order, and the first power data is the original power data.
[0028] Specifically, based on the eHorus platform, the system uses an HTTP-authorized API to obtain continuous raw power data from the actual power plant connected to the Internet. The raw power data at continuous time points is used as the first power data group, and the raw power data is stored in a designated cloud for later use.
[0029] Furthermore, after verifying the validity of the first power data in the first power data group, a second power data group is obtained. Specifically, the first power data in the first power data group is verified using an installed capacity conversion algorithm to obtain a valid first power data group and an invalid first power data group. The valid first power data group is used as the second power data group. The installed capacity conversion algorithm can transform installed capacity data from different units and dimensions into a comparable and aggregated unified indicator through standardized calculation methods.
[0030] Specifically, the power generation data of 96 points every 15 minutes within 24 hours of the power station being connected to the grid is used as the first power generation data. An algorithm based on installed capacity conversion is used to verify the validity of this first power generation data group. The verified valid first power generation data group is then directly stored in the database as the second power generation data group. Here, "96 points every 15 minutes within 24 hours" means dividing the 24 hours into 15-minute intervals, resulting in 96 points in total, for example, 00:15, 00:30, 00:45, 01:00, and so on.
[0031] Furthermore, the second power data group also includes the completed illegal first power data group, that is, the illegal first power data group is completed to obtain the completed illegal first power data group; the completed illegal first power data group is used as the second power data group.
[0032] Specifically, when completing the illegal first power data group, the illegal first power data in the illegal first power data group is first removed, and then the first power data of the nearest subsequent time point is taken to replace it to form the third power data group, that is, the completed illegal first power data group. At this time, the third power data group is stored in the database as the second power data group.
[0033] Step S2: Obtain the first indicator data group for electricity spot trading. After verifying the legality of the first indicator data in the first indicator data group, obtain the second indicator data group. The first indicator data group is a collection of first indicator data arranged in chronological order. The first indicator data includes a collection of original meteorological data, original node price clearing data, and original renewable energy output data.
[0034] Specifically, when collecting the first indicator data, the data is collected through the power trading system of the power spot trading platform via a browser. The browser's built-in plugin and the power trading system interface are connected and authenticated. After successful authentication, the data of each indicator can be automatically collected and stored in the designated cloud for later use.
[0035] Furthermore, after verifying the legality of the first indicator data in the first indicator data group, a second indicator data group is obtained. Specifically, the first indicator data in the first indicator data group is verified using an installed capacity conversion algorithm to obtain a legal first indicator data group and an illegal first indicator data group. The legal first indicator data group is then used as the second indicator data group.
[0036] Specifically, meteorological data, node price clearing data, and new energy output data are used as the first indicator data, with 96 points of meteorological data, node price clearing data, and new energy output data every 15 minutes within 24 hours of electricity spot trading. The first indicator data of the first indicator data group is verified for legality using an algorithm based on installed capacity conversion. The verified legal first indicator data group is then directly stored in the database as the second indicator data group.
[0037] Furthermore, the second indicator data group also includes the completed illegal first indicator data group, that is, the illegal first indicator data group is completed to obtain the completed illegal first indicator data group; the completed illegal first indicator data group is used as the second indicator data group, and the verified illegal first indicator data group can be completed and stored in the database as the second indicator data group.
[0038] Specifically, when completing the illegal first indicator data group, the illegal first indicator data in the illegal first indicator data group is first removed, and then the first indicator data of the nearest subsequent time point is taken to replace it to form the third indicator data group, that is, the completed illegal first indicator data group. At this time, the third indicator data group can be stored in the database as the second indicator data group.
[0039] Illegal first power data and illegal first indicator data are directly removed and filled with first power data and first indicator data by backward recursion. Compared with traditional forward and backward mean interpolation, this method is more in line with the real-time balance requirements of the power system. When data failure is detected at a certain moment, subsequent stable operating condition data is used as the replacement to avoid introducing lag error due to forward filling.
[0040] Step S3: Input the second electricity data set and the second indicator data set into the electricity price prediction model to obtain the predicted electricity price; the electricity price prediction model is a K-means (similar day clustering) + RF (random forest) model.
[0041] Specifically, the first electricity data of the second electricity data group and the first indicator data of the second indicator data group in the database are uploaded to the electricity price prediction model in chronological order via an HTTP interface, and the training method of the electricity price prediction model is called to start executing the electricity price prediction.
[0042] When uploading the first battery data and the second indicator data, upload them in Excel file format. An example file for the first battery data is shown below:
[0043]
[0044] The following is an example of a meteorological data file for the second indicator:
[0045]
[0046]
[0047] The following is an example of a node price clearing data file for the second indicator:
[0048] Time-based clearing price actual settlement 1 100.0 98.5
[0050] 2 105.0 103.2.
[0051] During forecasting, the K-means+RF model takes into account the strong weather dependence of GF (photovoltaic) data. First, it extracts the daily output curves of 96 points from the first power data group and the first index data group as features, and then uses the K-means algorithm to cluster the historical data.
[0052] To avoid inappropriate parameter selection, a combination of silhouette score and elbow method was used to determine the optimal number of clusters k based on the output curve shape. The optimal number of clusters k can usually effectively correspond to typical weather patterns such as "sunny", "cloudy", and "rainy / intermittent".
[0053] Furthermore, when predicting the next day, the power output curve of the GF data is first categorized into one of k classes. Then, a time-series model (such as LSTM or Long Short-Term Neural Network) trained only on that class of data is used to perform a unified settlement price prediction. The electricity price prediction model automatically generates the following features for each time point:
[0054] Basic time: hour, day of the week, month, date;
[0055] Time indicators: whether it is a weekend, a holiday, a quarter, or a season;
[0056] Time periods are categorized as: morning, afternoon, evening, and night.
[0057] Weather feature processing;
[0058] Weather type codes: Sunny = 0, Cloudy = 1, Overcast = 2, Light rain = 3, Moderate rain = 4, Heavy rain = 5;
[0059] Sunny Day Indicator: Whether it is a sunny day (0 or 1).
[0060] After the electricity price forecasting model completes execution, it outputs a forecast data file. The forecast results (predictions) within the forecast data file sequentially display the corresponding forecasted electricity prices. The forecast data file is returned in JSON format.
[0061] The following is an example of a prediction data file:
[0062]
[0063]
[0064]
[0065]
[0066]
Claims
1. A method for predicting electricity price trends based on electricity spot trading data, characterized in that, Includes the following steps: Step S1: Obtain the first power data group connected to the power station, and obtain the second power data group after verifying the legality of the first power data in the first power data group; the first power data group is a collection of the first power data, and the first power data is the original power data; Step S2: Obtain the first indicator data group for electricity spot trading, and obtain the second indicator data group after verifying the legality of the first indicator data in the first indicator data group; the first indicator data group is a collection of the first indicator data, which includes a collection of raw meteorological data, raw node price clearing data and raw renewable energy output data; Step S3: Input the second electricity data group and the second index data group into the electricity price prediction model to obtain the predicted electricity price; the electricity price prediction model is a K-means+RF model.
2. The method for predicting electricity price trends based on electricity spot trading data according to claim 1, characterized in that, After verifying the legality of the first power data in the first power data group, a second power data group is obtained. Specifically, the first power data in the first power data group is verified by using an installed capacity conversion algorithm to obtain a legal first power data group and an illegal first power data group. The legal first power data group is then used as the second power data group.
3. The method for predicting electricity price trends based on electricity spot trading data according to claim 2, characterized in that, It also includes completing the illegal first power data group to obtain the completed illegal first power data group; The second power data group also includes the completed illegal first power data group.
4. The method for predicting electricity price trends based on electricity spot trading data according to claim 3, characterized in that, The illegal first power data group includes illegal first power data; the illegal first power data includes 0, negative numbers, null values, and raw power data exceeding the installed capacity range; The illegal first power data group is supplemented by: removing the illegal first power data from the illegal first power data group and replacing the corresponding illegal first power data with the first power data from the nearest subsequent time point.
5. The method for predicting electricity price trends based on electricity spot trading data according to claim 4, characterized in that, The original power consumption data is the power consumption data obtained every 15 minutes (96 points) within 24 hours.
6. The method for predicting electricity price trends based on electricity spot trading data according to claim 1, characterized in that, After verifying the legality of the first indicator data in the first indicator data group, a second indicator data group is obtained. Specifically, the first indicator data in the first indicator data group is verified using an installed capacity conversion algorithm to obtain a legal first indicator data group and an illegal first indicator data group. The legal first indicator data group is then used as the second indicator data group.
7. The method for predicting electricity price trends based on electricity spot trading data according to claim 6, characterized in that, It also includes completing the illegal first indicator data group to obtain the completed illegal first indicator data group; The second indicator data group also includes the completed illegal first indicator data group.
8. The method for predicting electricity price trends based on electricity spot trading data according to claim 7, characterized in that, The illegal first indicator data group includes illegal first indicator data; the illegal first indicator data includes 0, negative numbers, null values, as well as raw meteorological data, raw node price clearing data, and raw new energy output data that exceed the installed capacity range; The illegal first indicator data group is supplemented by: removing the illegal first indicator data from the illegal first indicator data group and replacing the corresponding illegal first indicator data with the first indicator data from the nearest subsequent time point.
9. The method for predicting electricity price trends based on electricity spot trading data according to claim 8, characterized in that, The raw meteorological data, raw node price clearing data, and raw new energy output data are meteorological data, node price clearing data, and new energy output data at 96 points every 15 minutes within 24 hours, respectively.