Electric power spot market real-time price prediction method based on low-sample high-dimension data
By combining the generative neural network model TimesGen and heuristic predictor, the problem of inaccurate real-time electricity price prediction in the power spot market under low sample high-dimensional data is solved, and accurate prediction and robustness of electricity prices are achieved.
Patent Information
- Application Number
- CN202510342570.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-21
- Publication Date
- 2025-07-08
AI Technical Summary
In the real-time electricity price prediction of the power spot market under low sample high-dimensional data, existing deep learning models are difficult to effectively capture the influence of unstructured factors, resulting in inaccurate prediction results.
The generative neural network model TimesGen combined with heuristic predictors is used to capture complex patterns and long-term dependencies in electricity price data through feature extraction, standardization processing and rule constraint systems, and adjust them in a comprehensive way, taking into account similarity, trend factors, seasonal factors and special event factors.
Accurate prediction of real-time prices of the electricity spot market is achieved, the accuracy and robustness of the prediction are improved, market changes are adapted to market changes, and the potential impact of extreme forecast values on the market is avoided.
Smart Images

Figure CN120278745A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of real-time price prediction in the electricity spot market, and particularly to a method for predicting the real-time price of the electricity spot market based on low-sample and high-dimensional data. Background Technique
[0002] Real-time electricity price prediction plays a crucial role in the modern electricity market, which is directly related to the trading decisions and economic benefits of power generation enterprises, electricity sales companies, and large users. With the continuous development and improvement of the electricity market, especially the gradual implementation of the electricity spot market, higher requirements are put forward for the accuracy of real-time electricity price prediction. However, the current real-time electricity price prediction technology faces many challenges, especially significant problems in dealing with unstructured factors.
[0003] In the initial stage of the development of the electricity spot market, the market environment is complex and changeable, affected by various unstructured factors. These factors include, but are not limited to, frequent changes in policy details, extreme weather conditions, market emergencies, legal holidays, and centralized heating within the province in winter. These factors often have the characteristics of suddenness, uncertainty, and difficulty in quantification, bringing great difficulties to real-time electricity price prediction.
[0004] The original deep learning prediction technology, although improving the accuracy of electricity price prediction to a certain extent, is unable to cope effectively when dealing with these unstructured factors. These technologies often rely on a large amount of historical data for training, and predict by mining the potential laws and patterns in the data. However, for unstructured factors such as policy changes and extreme weather, due to their uncertainty in quantification and prediction, the original deep learning models often cannot effectively capture and reflect the impact of these factors on electricity prices, resulting in inaccurate prediction results.
[0005] Especially in the initial stage of the development of the electricity spot market, due to insufficient historical data accumulation, small sample size and high dimension, the prediction difficulty is further exacerbated. Traditional deep learning and machine learning technologies are difficult to perform optimally in this data environment and cannot meet the high-precision requirements of real-time electricity price prediction. Summary of the Invention
[0006] The present invention aims to provide a method for predicting the real-time price of the electricity spot market based on low-sample and high-dimensional data, to solve the problem that in the initial stage of the development of the electricity spot market, the existing electricity price prediction technology cannot reasonably quantify external factors, resulting in inaccurate prediction results.
[0007] To achieve the above object, the present invention adopts the following technical solution: A method for predicting the real-time price of the electricity spot market based on low-sample and high-dimensional data, including:
[0008] Step 1: Extract historical data from the database;
[0009] Step 2: Extract features from historical data and then standardize the extracted features.
[0010] Step 3: Build a real-time electricity price prediction model using a generative neural network model with the TimesGen architecture, and input the extracted features of historical data into the real-time electricity price prediction model to obtain a first predicted electricity price.
[0011] Step 4: Input the first predicted electricity price into a heuristic predictor for adjustment to obtain a second predicted electricity price.
[0012] The adjustment factors for the heuristic predictor to adjust the first predicted electricity price include similarity, trend factor, seasonal factor, and special event adjustment factor. The adjustment factors are fused to comprehensively adjust the first predicted electricity price to obtain an adjusted second predicted electricity price.
[0013] Similarity adjustment includes calculating the similarity between the historical date and the target date in historical data, and selecting similar dates according to the similarity value. The calculation formula for similarity is as follows:
[0014] similarity = (load_similarity * 0.4 + clean_similarity * 0.4) * day_weight;
[0015] Among them, similarity is the similarity, load_similarity is the similarity of the provincial unified regulated load, clean_similarity is the similarity of the new energy output load, and day_weight represents the matching degree of the day of the week.
[0016] Trend factor adjustment is achieved by fitting the trend of recent historical data, and its calculation formula is as follows:
[0017] trend_factor = 1 + tanh(trend * 0.1);
[0018] Among them, trend_factor is the trend factor, trend is the trend slope of recent data, and the tanh(x) function is used to map the trend slope to a reasonable range.
[0019] For the seasonal factor, select the seasonal weight corresponding to the month of the target date in the seasonal weight dictionary as the seasonal factor for the target date; for the special event factor, determine whether there is a corresponding holiday on the target date, and use the special event factor corresponding to the holiday as the special event factor for the target date.
[0020] The principle and advantages of this solution are as follows: In practical applications, by combining a generative neural network model with a heuristic prediction algorithm, accurate prediction of the real-time price in the electricity spot market is achieved.
[0021] A generative neural network model, such as the TimesGen model, is used to construct a real-time electricity price prediction model, and the processed historical data features are input into this model for training. Through the learning of the model, complex patterns and long-term dependencies in the electricity price data can be captured, thereby generating a preliminary electricity price prediction result, that is, the first predicted electricity price.
[0022] To further improve the prediction accuracy, the present invention introduces a heuristic predictor to adjust the preliminary prediction result. The heuristic predictor uses adjustment factors such as domain knowledge, similar days, trend factors, seasonal factors, and special event factors in historical data to comprehensively adjust the preliminary prediction result to obtain an electricity price prediction value that more conforms to the actual situation, that is, the second predicted electricity price.
[0023] By combining a generative neural network model and a heuristic prediction algorithm, the present invention can capture complex patterns and long-term dependencies in electricity price data, and consider the influence of various unstructured factors, thereby achieving accurate prediction of the real-time price in the electricity spot market. By comprehensively considering various external factors such as similarity, trend factors, seasonal factors, and special event adjustment factors through the heuristic predictor, this solution can more comprehensively reflect the actual situation of the electricity market and solve the problem that external factors are difficult to quantify. And the parameters in the heuristic predictor can be dynamically adjusted according to the changes in observable elements in the market, enabling the prediction model to adapt to market changes. By comprehensively considering various external factors, this solution can more accurately capture the change law of electricity prices and improve the prediction accuracy.
[0024] Preferably, as an improvement, it further includes:
[0025] Step Five: Input the second predicted electricity price into a rule constraint system for adjustment to obtain the third predicted electricity price;
[0026] The constraint rules of the rule constraint system are as follows:
[0027] Peak period constraint: The price is constrained by upper and lower limits from 7:00 to 22:00 during the peak period. The formula is as follows:
[0028] constrained_price = clip(price, 150, 800);
[0029] Among them, constrained_price refers to the electricity price after peak period constraint, that is, the third predicted electricity price; price is the second predicted electricity price; clip(price, 150, 800) is a clipping function;
[0030] Adjust the unified dispatching load and the new energy output load constraints, and adjust the price according to the relationship between the load and the new energy output. The formula is as follows:
[0031]
[0032] Among them, constrained_price refers to the electricity price after the unified dispatching load and the new energy output load constraints, that is, the third predicted electricity price; price is the second predicted electricity price; load is the unified dispatching load; clean_energy is the new energy output load;
[0033] Step 6: Save the third predicted price to the target database as the final predicted electricity price at this moment.
[0034] The beneficial effect of this improvement is that if the price is lower than 150, it is set to 150; if the price is higher than 800, it is set to 800; otherwise, the original price remains unchanged. If the unified dispatching load minus the new energy output is greater than 20,000, the price is at least 200, that is, take the larger value of the second predicted price and 200. If the new energy output is greater than 50% of the unified dispatching load, the price is at most 600, that is, take the smaller value of the second predicted price and 600. Otherwise, the price remains unchanged.
[0035] By introducing a rule constraint system to adjust the second predicted electricity price, especially to set the upper and lower limits of the price during peak hours, and adjusting the price according to the relationship between the unified dispatching load and the new energy output load, this improvement significantly enhances the practicality of the prediction results. It ensures that the predicted electricity price is not only mathematically reasonable but also feasible in economic operation, avoids potential impacts on the market caused by extreme predicted values, and improves the robustness and reliability of the prediction.
[0036] Preferably, as an improvement, the historical data includes historical electricity price data and external variable data. The external variable data includes the provincial unified dispatching load, new energy output load, hydropower output load, and inter-provincial tie-line load. Calculate the thermal power bidding space load according to the external variable data. The calculation formula is as follows:
[0037] P price_space =P unified -P clean -P water +P con ;
[0038] Among them, P price_space is the thermal power bidding space load, P unified is the provincial unified dispatching load, P clean is the new energy output load, P water is the hydropower output load, P conFor the load of the inter-provincial connection line.
[0039] The beneficial effect of this improvement is that the historical data is extended from simple historical electricity price data to include external variable data, and based on this, the thermal power bidding space load is calculated. This improvement greatly enriches the information input of the prediction model. It not only considers the historical data of the electricity price itself, but also incorporates multi-dimensional external factors affecting the electricity price, thereby improving the prediction model's ability to capture the complex dynamics of the power market and making the prediction results closer to the actual situation.
[0040] Preferably, as an improvement, feature extraction is performed from historical data, including time feature extraction, statistical feature extraction, and cross feature extraction;
[0041] Time feature extraction extracts various time features from the timestamps of historical data and performs sine / cosine transformation on the time features;
[0042] Statistical feature extraction calculates sliding statistics on historical data. The sliding statistics include sliding mean, sliding standard deviation, sliding maximum, and sliding minimum;
[0043] The cross feature is obtained by calculating the ratio of the thermal power bidding space load to the new energy output load, and the load-to-new energy output ratio, and its calculation formula is as follows:
[0044]
[0045] Where, P LCR is the load-to-new energy output ratio, P price_space is the thermal power bidding space load, P clean is the new energy output load.
[0046] The beneficial effect of this improvement is that during the historical data feature extraction process, not only time features and statistical features are extracted, but also cross features are further introduced. This improvement enhances the feature expression ability and the generalization ability of the prediction model. Cross features can reveal the internal relationship between different variables, enabling the prediction model to mine high-dimensional information from low-sample data, better understand the complex relationships in the power market, and thus improve the accuracy and robustness of the prediction.
[0047] Preferably, as an improvement, the extracted features are standardized, and its processing formula is as follows:
[0048]
[0049] Where, X is the original data, mean(X) is the mean of the original data, std(X) is the standard deviation of the original data, X scaledData after standardization; Feature standardization is performed by statistical features. X is the value of the current data point, mean(X) = rolling_mean(96), and std(X) = rolling_std(96).
[0050] The beneficial effect of this improvement is that the extracted features are standardized, making different features comparable in value. For non-stationary data, that is, data whose statistical characteristics change over time, using the global mean and standard deviation for standardization may not accurately reflect the current state of the data. The moving mean and moving standard deviation can be updated as the data changes. The moving mean and moving standard deviation can reflect the statistical characteristics of the data within a specific time window. Therefore, using them for standardization can better capture the local changes in the data.
[0051] Preferably, as an improvement, the architecture of the real-time electricity price prediction model is optimized:
[0052] Adopt a data processing method with batch priority; directly map the original features to the hidden dimension through the input projection layer; remove the positional encoding module and replace it with a dependence on the masking mechanism to maintain temporal information; configure the number of encoder layers to be 6; use 8 attention heads in each layer; adopt a feed-forward network with 4 times the hidden dimension.
[0053] The beneficial effect of this improvement is that optimizing the architecture of the real-time electricity price prediction model, such as adopting a data processing method with batch priority, removing the positional encoding module and replacing it with a dependence on the masking mechanism to maintain temporal information, etc., this improvement significantly improves the computational efficiency and prediction performance of the model. Architecture optimization enables the model to process large-scale data more efficiently while maintaining sensitivity and accuracy to time series data, thereby improving the real-time and reliability of prediction.
[0054] Preferably, as an improvement, the prediction mechanism of the real-time electricity price prediction model is optimized:
[0055] Integrate heuristic predictors to implement a hybrid prediction strategy; support batch prediction of multiple time points; adopt a two-stage output layer design, introduce non-linear transformation through the ReLU activation function; gradually reduce the output dimension in the output layer; support the masking mechanism to shield information of future time steps.
[0056] The beneficial effect of this improvement is that integrating heuristic predictors to implement a hybrid prediction strategy, supporting batch prediction of multiple time points, and adopting optimization measures such as a two-stage output layer design, this improvement enhances the flexibility and adaptability of the prediction model. Optimizing the prediction mechanism enables the model to adjust the prediction strategy according to different prediction requirements and market dynamics, thereby improving the accuracy and practicality of prediction. At the same time, batch prediction and the two-stage output layer design also improve the computational efficiency and prediction efficiency of the model.
[0057] Preferably, as an improvement, the real-time electricity price prediction model is trained and optimized:
[0058] Introduce the dropout mechanism, randomly discard 0.1 proportion of neuron connections; adopt the square matrix type subsequent mask generation method; support dynamic batch processing; support flexible customization of key hyperparameters, including hidden dimension, number of layers, number of attention heads, and dropout; maintain the flexibility of the input dimension to adapt to different feature combinations; support multi-model fusion prediction.
[0059] The beneficial effects of this improvement are as follows: Introducing the dropout mechanism, adopting the square matrix type subsequent mask generation method, supporting dynamic batch processing and other training optimization designs improve the generalization ability and robustness of the prediction model. The training optimization design enables the model to better handle the overfitting problem during the training process while maintaining sensitivity and accuracy to unseen data. In addition, supporting flexible customization of key hyperparameters and multi-model fusion prediction also improves the flexibility and scalability of the model, enabling the model to adapt to different prediction scenarios and data sources. Brief Description of the Drawings
[0060] Figure 1 It is a flowchart of an embodiment of the present invention. Detailed Description of the Embodiment
[0061] The following is further detailed through specific embodiments:
[0062] Embodiment
[0063] Basically as shown in the attached Figure 1 As shown, a real-time price prediction method for the electricity spot market based on low-sample and high-dimensional data includes:
[0064] Step 1: Extract historical data from the database and convert the data format of the historical data into a data frame including timestamps.
[0065] The historical data includes historical electricity price data and external variable data. The external variable data includes provincial unified regulated load, new energy output load, hydropower output load, and inter-provincial tie line load. The provincial unified regulated load refers to the electric load that is uniformly dispatched and managed by the provincial power grid within a province. The new energy output load refers to the electric power output generated by new energy power generation facilities such as wind energy and solar energy, also known as new energy generation load. The hydropower output load refers to the electric power output generated by hydropower stations, also known as hydropower generation load. The inter-provincial tie line load refers to the electric load transmitted between different provincial power grids through tie lines.
[0066] Among them, for the data format conversion of historical electricity price data, the data format for extracting historical electricity price data from the database is date, data_type, v_values, where date is the timestamp and v_values is a string including 96 time points at 15-minute intervals per day, such as {v1:100, v2:105,...}. The data is converted into a time series format through string processing, including removing curly braces, splitting key-value pairs, and converting to floating-point numbers. Thus, a data frame containing the timestamp and real-time electricity price time series data is finally generated.
[0067] Among them, for the data format conversion of external variable data, the data format extracted from the database is (run_date, v_values), where run_date is the timestamp and v_values is a string including 96 time points. Through string processing, the data is converted into a time series format. Finally, a data frame including the timestamp and the provincial unified regulation load / new energy output load / hydroelectric output load / inter-provincial tie line load is generated.
[0068] It is also necessary to calculate the thermal power bidding space load based on the external variable data. The calculation formula is as follows:
[0069] P price_space = P unified - P clean - P water + P con ;
[0070] Among them, P price_space is the thermal power bidding space load, P unified is the provincial unified regulation load, P clean is the new energy output load, P water is the hydroelectric output load, P con is the inter-provincial tie line load; the values of the provincial unified regulation load, new energy output load, and hydroelectric output load are default positive, and the value of the inter-provincial tie line load is represented by a negative number.
[0071] Step 2: Extract features from historical data, fill in missing values, and then standardize the extracted features.
[0072] The methods for filling in missing values include forward filling and backward filling; feature extraction includes time feature extraction, statistical feature extraction, and cross feature extraction.
[0073] Time feature extraction uses the TimeFeatureExtractor to extract various time features from the timestamps of historical data. The time features include hour, minute, second, day of the week, month, and whether it is a working day, etc. And sine / cosine transformation is performed on the time features. By capturing the periodic information in the time variable and inputting it into the model in a continuous form. For example, the transformation formulas for hour and week are as follows:
[0074]
[0075] where hour is the number of hours in a day, ranging from 0 to 23; day_of_week is the day of the week, ranging from 0 to 6, representing Monday to Sunday.
[0076] Statistical feature extraction calculates the sliding statistics on the historical data. The sliding statistics include sliding mean, sliding standard deviation, sliding maximum, and sliding minimum. Among them, the sliding time window is set to 24 hours. For example, the formulas for sliding mean and sliding standard deviation are as follows:
[0077] mean_24h = rolling_mean(96);
[0078] std_24h = rolling_std(96);
[0079] where rolling_mean(96) represents calculating the average value of the past 96 data points; rolling_std(96) represents calculating the standard deviation of the past 96 data points. The calculation methods of sliding maximum rolling_max(96) and sliding minimum rolling_min(96) are similar.
[0080] Cross features are obtained by combining or operating on two or more features. The operations that can be performed include the ratio, product, sum, and difference between features. In this embodiment, the ratio of load to new energy output is obtained by calculating the ratio of the thermal power bidding space load to the new energy output load. Its calculation formula is as follows:
[0081]
[0082] where P LCR is the ratio of load to new energy output, P price_space is the thermal power bidding space load, and P clean is the new energy output load.
[0083] StandardScaler is used to perform standardization processing on the features. Its processing formula is as follows:
[0084]
[0085] Among them, X is the original data, mean(X) is the mean of the original data, std(X) is the standard deviation of the original data, and X scaled is the standardized data. In this embodiment, feature standardization is performed based on statistical features. X is the value of the current data point, mean(X) = rolling_mean(96), and std(X) = rolling_std(96). For non-stationary data, that is, data whose statistical characteristics change over time, using the global mean and standard deviation for standardization may not accurately reflect the current state of the data. The rolling mean and rolling standard deviation can be updated as the data changes. The rolling mean and rolling standard deviation can reflect the statistical characteristics of the data within a specific time window. Therefore, using them for standardization can better capture the local changes in the data.
[0086] Step 3: Construct a real-time electricity price prediction model using the generative neural network model (TimesGen), and input the extracted features of the historical data into the real-time electricity price prediction model. The real-time electricity price prediction model predicts the electricity price change in the future for a period of time based on the input data to obtain the first predicted electricity price.
[0087] TimesGen is a generative neural network model based on the inverted Transformer (i.e., iTransformer) architecture, which combines the encodable multi-head self-attention mechanism and the feed-forward neural network to capture the long-term dependencies in the time series.
[0088] To further improve the performance of the TimesGen model in the real-time electricity price prediction task, the following architecture optimizations are carried out:
[0089] Adopt the data processing method of batch_first; time series data usually has two dimensions: time steps and batches. This optimization method adopts batch_first to better conform to the characteristics of time series data and helps the model process data more effectively.
[0090] Directly map the original features to the hidden dimension through the input projection layer (input_proj). This step simplifies the feature transformation process, reduces the model complexity, and retains important information at the same time.
[0091] Remove the positional encoding module and rely on the masking mechanism to maintain temporal information. In traditional Transformer models, positional encoding is used to provide information about each position in the sequence. However, in TimesGen, to handle time series data more flexibly, the positional encoding module is removed and the model relies on the masking mechanism to maintain temporal information. The masking mechanism can dynamically control the model's attention to different positions in the sequence during training.
[0092] Support flexible configuration of the number of encoder layers (num_layers), with a default depth of 6 layers; each layer uses 8 attention heads (num_heads) for parallel feature extraction; a feed-forward network with 4 times the hidden dimension (hidden_dim*4) is adopted to enhance the model's expressive power.
[0093] To further enhance the flexibility and accuracy of the TimesGen model in real-time electricity price prediction tasks, the following prediction mechanism optimizations are carried out:
[0094] Integrate a heuristic predictor. The TimesGen model integrates a heuristic predictor (HeuristicPricePredictor), combining the heuristic method with deep learning; this hybrid prediction strategy not only utilizes the automatic feature extraction ability of deep learning but also incorporates domain knowledge in the heuristic method, thus improving the accuracy and robustness of the prediction.
[0095] Batch prediction support. The model supports batch prediction of multiple time points, effectively improving the prediction efficiency. This is particularly important in practical applications, especially in the electricity spot market where rapid response to market changes is required.
[0096] Two-stage output layer design. The TimesGen model adopts a two-stage output layer design, introducing a non-linear transformation through the ReLU activation function to enhance the model's expressive power; this design enables the model to handle output data more flexibly and improves the prediction accuracy.
[0097] Progressive dimensionality reduction. The output dimension progressively decreases in the output layer, from hidden_dim to hidden_dim / / 2, and then to 1. This design helps reduce prediction bias and improve the stability of the prediction.
[0098] Masking mechanism controls prediction dependence. The model supports the masking mechanism (mask) to mask information of future time steps in the encoder, preventing information leakage. This ensures that the prediction only depends on historical information, meeting the basic requirements of time series prediction.
[0099] To improve the training efficiency and generalization ability of the TimesGen model, the following training optimization designs are carried out:
[0100] The dropout mechanism is introduced. During the training process, the dropout mechanism is introduced with a default value of 0.1. By randomly discarding some neuron connections, the risk of the model overfitting to the training data is reduced, and the generalization ability of the model is improved.
[0101] Square matrix subsequent mask generation. The square matrix subsequent mask generation method is adopted to ensure that the prediction only depends on historical information, further enhancing the robustness of the model.
[0102] Dynamic batch processing. The model supports dynamic batch processing, which can automatically adjust the batch size according to the scale of the training data, improving the training efficiency and also helping the model to converge better.
[0103] Flexible customization of hyperparameters. The TimesGen model supports flexible customization of key hyperparameters, including hidden dimension, number of layers, number of attention heads, dropout, etc. This enables the model to be customized according to different application scenarios and datasets, improving the applicability of the model.
[0104] Flexibility of input dimension. The model maintains the flexibility of the input dimension and can adapt to data inputs with different feature combinations. This is very important in practical applications, especially in the real-time electricity price prediction task of the electricity spot market that needs to handle various external factors.
[0105] Model fusion support. The TimesGen model is convenient to integrate with other prediction models and supports model fusion prediction. This design enables the model to make full use of the advantages of different prediction methods, further improving the accuracy and robustness of the prediction.
[0106] Step 4: Input the first predicted electricity price into the heuristic predictor for adjustment to obtain the second predicted electricity price.
[0107] The adjustment factors for the heuristic predictor to adjust the predicted electricity price include similarity, trend factor, seasonal factor, and special event adjustment factor.
[0108] Similarity adjustment includes calculating the similarity between the historical date and the target date in the historical data, and selecting similar dates according to the similarity value. The calculation formula for similarity is as follows:
[0109] similarity=(load_similarity*0.4+clean_similarity*0.4)*day_weight;
[0110] Among them, similarity is the similarity degree, load_similarity is the similarity degree of the province-wide unified regulated load, which can be calculated by comparing the numerical differences in the unified regulated load between the historical date and the target date; clean_similarity is the similarity degree of the new energy output load, which is calculated by comparing the numerical differences in the new energy output load between the historical date and the target date; day_weight represents the matching degree of the day of the week. If the historical date and the target date are the same day of the week, this value may be relatively high, otherwise it is relatively low. This value can be set according to the actual situation. For example, it can be set to 1 for the same day of the week and 0 for different days, or different weights can be set according to the correlation of the day of the week.
[0111] According to the calculated similarity values, select one or more historical dates with the highest similarity as the similar days. Use the electricity price data of these similar dates and combine with the similarity values to calculate a weighted average value as the adjustment basis of the similar day factor for the predicted electricity price.
[0112] The trend factor adjustment is achieved by fitting the trend of recent historical data, and its calculation formula is as follows:
[0113] trend_factor = 1 + tanh(trend * 0.1);
[0114] Among them, trend_factor is the trend factor, trend is the trend slope of recent data, which reflects the rising or falling speed of the data; the tanh(x) function is used to map the trend slope to a reasonable range, making the influence of the trend factor on the prediction result more stable.
[0115] For the seasonal factor, select the seasonal weight corresponding to the month of the target date in the seasonal weight dictionary as the seasonal factor of the target date, and its formula is as follows:
[0116] seasonal_factor = seasonal_weights[month];
[0117] Among them, seasonal_factor is the seasonal factor, month is the month of the target date, and seasonal_weights[month] is the weight of the month of the target date in the seasonal weight dictionary. The seasonal weight dictionary can be obtained by collecting the electricity prices or related load data of different months in the historical data, analyzing the data characteristics of each month to identify the seasonal change patterns, and setting a seasonal weight for each month according to the analysis of the historical data. The seasonal weight reflects the relative level of the electricity price of each month compared to other months.
[0118] Special event factor. Based on whether there is a corresponding holiday on the target date, and using the special event factor corresponding to the holiday as the special event factor for the target date. The relationship is as follows:
[0119] P2 = P1 * event_factor;
[0120] Where P1 is the original predicted data, event_factor is the special event factor, and P2 is the predicted data adjusted by the special event factor.
[0121] The setting of the special event factor can be done by collecting information on special events that may occur before and after the target date, such as holidays; determining the possible impact of these special events on the electricity price. Based on the nature and impact degree of the special event, an adjustment factor is set for each special event. The adjustment factor reflects the increase or decrease impact of the special event on the electricity price or load.
[0122] Fuse the similarity, trend factor, seasonal factor, and special event factor to comprehensively adjust the first predicted electricity price to obtain the adjusted second predicted electricity price. Among them, methods such as linear weighted adjustment, non - linear adjustment, and model fusion adjustment can be used to fuse and adjust the adjustment factors.
[0123] When using linear weighted adjustment, linearly weight the adjustment factors to obtain a comprehensive adjustment factor. The calculation formula for the second predicted electricity price is as follows:
[0124] adjusted_price = initial_price * (similarity_factor * weight_similarity + trend_factor * weight_trend + seasonal_factor * weight_seasonal + event_factor * weight_event);
[0125] Where initial_price is the first predicted electricity price; similarity_factor, trend_factor, seasonal_factor, event_factor are the similarity, trend factor, seasonal factor, and special event factor respectively; weight_similarity, weight_trend, weight_seasonal, weight_event are the weights of the similarity, trend factor, seasonal factor, and special event factor respectively, which can be set according to the actual situation.
[0126] When non - linear adjustment is adopted, it can adapt to the non - linear impact of adjustment factors on the predicted electricity price. Non - linear functions, such as exponential functions, logarithmic functions, etc., can be used to process each adjustment factor to more accurately reflect its impact on the predicted electricity price.
[0127] When model fusion adjustment is adopted, if multiple prediction models or methods are used, the prediction results of each model can be fused with each adjustment factor to obtain a more accurate final predicted electricity price. For example, methods such as weighted average and stacked models can be used for model fusion.
[0128] Step Five: Input the second predicted electricity price into the rule - constraint system for adjustment to obtain the third predicted electricity price.
[0129] The rule - constraint system constrains the prediction results by applying domain rules to ensure that the prediction results meet the actual operation requirements. It can be flexibly configured according to the operation status of the spot market. The design logic of the rule - constraint system in this embodiment is as follows:
[0130] Peak - hour constraint:
[0131] During the peak hours (7:00 - 22:00), upper and lower limits are imposed on the price. The formula is as follows:
[0132] constrained_Price=clip(price,150,800);
[0133] Among them, constrained_price refers to the electricity price after peak - hour constraint, that is, the third predicted electricity price; price is the second predicted electricity price; clip(price,150,800) is a clipping function that limits the price between 150 and 800. If the price is lower than 150, it is set to 150; if the price is higher than 800, it is set to 800; otherwise, the original price remains unchanged.
[0134] System - adjusted load and new - energy output load constraint:
[0135] Adjust the price according to the relationship between the load and the new - energy output. The formula is as follows:
[0136]
[0137] Among them, constrained_price refers to the electricity price after being constrained by the unified regulated load and the new energy output load, that is, the third predicted electricity price; price is the second predicted electricity price; load is the unified regulated load; clean_energy is the new energy output load. If the unified regulated load minus the new energy output is greater than 20000, the price is at least 200, that is, take the larger value between the second predicted price and 200. If the new energy output is greater than 50% of the unified regulated load, the price is at most 600, that is, take the smaller value between the second predicted price and 600. Otherwise, the price remains unchanged.
[0138] Step Six: Save the third predicted price to the target database as the final predicted electricity price at this moment.
[0139] The above are only embodiments of the present invention. Specific technical solutions and / or common knowledge such as characteristics well known in the art are not described in detail herein. It should be noted that for those skilled in the art, without departing from the technical solution of the present invention, several deformations and improvements can be made, which should also be regarded as the protection scope of the present invention, and these will not affect the implementation effect of the present invention and the practicality of the patent. The protection scope required by this application should be based on the content of its claims, and the specific implementation manners and the like recorded in the specification can be used to interpret the content of the claims.
Claims
1. A real-time price prediction method for the electricity spot market based on low-sample high-dimensional data, characterized in that, Including: Step 1: Extract historical data from the database; Step 2: Extract features from the historical data and then standardize the extracted features; Step 3: Use a generative neural network model with the TimesGen architecture to construct a real-time electricity price prediction model, and input the extracted features of the historical data into the real-time electricity price prediction model to obtain the first predicted electricity price; Step 4: Input the first predicted electricity price into a heuristic predictor for adjustment to obtain the second predicted electricity price; The adjustment factors for the heuristic predictor to adjust the first predicted electricity price include similarity, trend factor, seasonal factor, and special event adjustment factor. The adjustment factors are fused to comprehensively adjust the first predicted electricity price to obtain the adjusted second predicted electricity price; The similarity adjustment includes calculating the similarity between the historical date and the target date in the historical data, and selecting similar dates according to the similarity value. The calculation formula for similarity is as follows: similarity=(load_similarity*0.4 + clean_similarity*0.4)*day_weight; where similarity is the similarity, load_similarity is the similarity of the provincial unified regulated load, clean_similarity is the similarity of the new energy output load, and day_weight represents the matching degree of the day of the week; The trend factor adjustment is achieved by fitting the trend of recent historical data, and its calculation formula is as follows: trend_factor = 1 + tanh(trend*0.1); where trend_factor is the trend factor, trend is the trend slope of recent data, and the tanh(x) function is used to map the trend slope to a reasonable range; For the seasonal factor, select the seasonal weight corresponding to the month of the target date in the seasonal weight dictionary as the seasonal factor for the target date; for the special event factor, determine whether there is a corresponding holiday on the target date, and use the special event factor corresponding to the holiday as the special event factor for the target date.
2. A real-time price prediction method for the electricity spot market based on low-sample high-dimensional data according to claim 1, characterized in that Also including: Step 5: Input the second predicted electricity price into a rule constraint system for adjustment to obtain the third predicted electricity price; The constraint rules of the rule constraint system are as follows: Peak period constraint: Constrain the price within the upper and lower limits from 7:00 to 22:00 during the peak period. The formula is as follows: constrained_price = clip(price, 150, 800); where constrained_price refers to the electricity price after the peak period constraint, that is, the third predicted electricity price; price is the second predicted electricity price; clip(price, 150, 800) is the clipping function; Unified regulated load and new energy output load constraint: Adjust the price according to the relationship between the load and the new energy output. The formula is as follows: Among them, constrained_price refers to the electricity price after being constrained by the unified regulated load and the new energy output load, that is, the third predicted electricity price; price is the second predicted electricity price; load is the unified regulated load; clean_energy is the new energy output load; Step 6: Save the third predicted price to the target database as the final predicted electricity price at this moment.
3. A real-time price prediction method for the electricity spot market based on low-sample high-dimensional data according to claim 2, characterized in that: The historical data includes historical electricity price data and external variable data. The external variable data includes the provincial unified regulated load, new energy output load, hydropower output load, and inter-provincial tie line load. Calculate the thermal power bidding space load according to the external variable data, and its calculation formula is as follows: P pr i ce_space = P unified - P clean - P water + P con ; Among them, P price_space is the thermal power competitive bidding space load, P unified is the province-wide unified regulation load, P clean is the new energy output load, P water is the hydropower output load, P con is the inter-provincial tie line load.
4. A real-time price prediction method for the electricity spot market based on low-sample high-dimensional data according to claim 3, characterized in that: Extract features from historical data, including time feature extraction, statistical feature extraction, and cross feature extraction; Time feature extraction is to extract various time features from the timestamps of historical data and perform sine / cosine transformation on the time features; Statistical feature extraction calculates the sliding statistics of historical data. The sliding statistics include sliding average, sliding standard deviation, sliding maximum, and sliding minimum; The cross feature is obtained by calculating the ratio of the thermal power bidding space load to the new energy output load to get the ratio of the load to the new energy output. Its calculation formula is as follows: Among them, P LCR is the ratio of load to new energy output, P price_space is the load of thermal power bidding space, and P clean is the load of new energy output.
5. A real-time price prediction method for the electricity spot market based on low-sample high-dimensional data according to claim 4, characterized in that: The features extracted are subjected to standardization processing, and its processing formula is as follows: Among them, X is the original data, mean(X) is the mean of the original data, std(X) is the standard deviation of the original data, and X scaled is the data after standardization; feature standardization is performed based on statistical features. X is the value of the current data point, mean(X) = rolling_mean(96), and std(X) = rolling_std(96).
6. A real-time price prediction method for the electricity spot market based on low-sample high-dimensional data according to claim 5, characterized in that, Optimize the architecture of the real-time electricity price prediction model: Adopt a data processing method with batch priority; directly map the original features to the hidden dimension through the input projection layer; Remove the position encoding module and replace it with a dependence on the masking mechanism to maintain the temporal information; configure the number of encoder layers to 6; use 8 attention heads in each layer; adopt a feed-forward network with 4 times the hidden dimension.
7. A real-time price prediction method for the electricity spot market based on low-sample high-dimensional data according to claim 6, characterized in that, Optimize the prediction mechanism of the real-time electricity price prediction model: Integrate heuristic predictors to implement a hybrid prediction strategy; support batch prediction of multiple time points; adopt a two-stage output layer design, introduce nonlinear transformation through the ReLU activation function; the output dimension gradually decreases in the output layer; support the masking mechanism to mask the information of future time steps.
8. A real-time price prediction method for the electricity spot market based on low-sample high-dimensional data according to claim 7, characterized in that Optimize the training design of the real-time electricity price prediction model: Introduce the dropout mechanism, and randomly discard 0.1 of the neuron connections; adopt the square matrix type subsequent mask generation method; Support dynamic batch processing; support flexible customization of key hyperparameters, including hidden dimension, number of layers, number of attention heads, and dropout; maintain the flexibility of the input dimension to adapt to different feature combinations; support multi-model fusion prediction.
Citation Information
Cited By
Electric power spot market price abnormity early warning method, device, equipment and medium
CN121073521A
Electric power spot price time sequence prediction method
CN122453452A