A day-ahead electricity price forecasting method and system based on similar day operation deviation

By screening target similar days and constructing similar day operation deviation characteristics, combined with preliminary and error prediction models, the deviation problem caused by multiple factors in day-ahead electricity price forecasting was solved, and the accuracy and stability of the forecast were improved.

CN123141019APending Publication Date: 2026-11-20HUADIAN ELECTRIC POWER SCI INST CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611386567.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-08
Publication Date
2026-11-20

AI Technical Summary

Technical Problem

Existing day-ahead electricity price forecasting methods are insufficient to fully represent the combined effects of multiple influencing factors, leading to significant biases in forecast results and affecting accuracy and stability.

Method used

By acquiring multidimensional target features and historical features, determining feature weights, screening target similar days, and constructing similar day operation deviation features, the preliminary electricity price prediction results are corrected by combining the preliminary prediction model and the error prediction model.

Benefits of technology

It improves the accuracy and stability of day-ahead electricity price forecasts, reduces forecast errors caused by single forecast models not fully extracting complex variable relationships, and enhances the model's generalization ability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123141019A_ABST
    Figure CN123141019A_ABST
Patent Text Reader

Abstract

The application discloses a day-ahead electricity price prediction method and system based on similar day operation deviation, and the method comprises the following steps: obtaining multi-dimensional target features of a target prediction day and multi-dimensional historical features and day-ahead electricity price data of a plurality of historical days, determining feature weights according to the correlation between the multi-dimensional historical features and the day-ahead electricity price data, and determining a target similar day based on the feature weights; determining similar day electricity price features according to the target similar day, and constructing similar day operation deviation features in combination with the deviation of each dimension feature of the target prediction day and the target similar day; obtaining a preliminary electricity price prediction result through a preliminary prediction model, then predicting the prediction error of the target prediction day based on the similar day operation deviation features and a historical prediction error sequence, and correcting the preliminary electricity price prediction result to obtain a day-ahead electricity price prediction result. The application can improve the accuracy and stability of day-ahead electricity price prediction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of power system data processing technology, and in particular relates to a day-ahead electricity price forecasting method and system based on similar daily operating deviations. Background Technology

[0002] As the proportion of renewable energy connected to the grid continues to increase, the output of renewable energy sources such as wind power and photovoltaics exhibits strong volatility and intermittency. Factors such as load levels, renewable energy output, unit operating status, and inter-provincial power exchange within the power system are undergoing more complex dynamic changes, resulting in significant volatility and non-stationarity in day-ahead electricity prices. Therefore, the accuracy of day-ahead electricity price forecasts is of great importance for power system operation analysis.

[0003] Current day-ahead electricity price forecasting methods typically construct forecast samples based on historical electricity prices, load, time information, and other relevant data, and then use machine learning or deep learning models to predict day-ahead electricity prices for future periods. Some forecasting methods also select historical dates with a certain similarity to the date to be predicted from historical data, in order to improve the forecasting effect by utilizing the data corresponding to similar historical dates.

[0004] However, current electricity prices are influenced by a variety of factors, and the correlation between these factors and price changes varies. Furthermore, the load, renewable energy output, and market supply and demand conditions may differ significantly across different dates. Existing methods struggle to fully represent the combined effects of multiple influencing factors when selecting historical samples and constructing predictive features, potentially leading to substantial discrepancies between the selected historical samples and the actual scenario to be predicted.

[0005] In addition, day-ahead electricity price changes have strong time-series, nonlinear and multivariate coupling characteristics. A single forecasting model usually cannot fully extract the changing patterns at different time scales and the complex relationships between different variables at the same time, which can easily lead to certain deviations in the forecast results and affect the accuracy and stability of day-ahead electricity price forecasts. Summary of the Invention

[0006] This invention provides a day-ahead electricity price forecasting method and system based on similar day operating deviations, aiming to improve the accuracy and stability of day-ahead electricity price forecasting results.

[0007] To achieve the above objectives, the present invention employs the following technical solution:

[0008] In a first aspect, the present invention provides a day-ahead electricity price forecasting method based on similar day operating deviations, comprising:

[0009] Obtain the multidimensional target features corresponding to the target prediction date, as well as the multidimensional historical features and day-ahead electricity price data corresponding to multiple historical days prior to the target prediction date;

[0010] The feature weights corresponding to each feature are determined based on the correlation between the multidimensional historical features and the day-ahead electricity price data, and based on the feature weights, a target similar day matching the target prediction day is determined from the multiple historical days.

[0011] Based on the day-ahead electricity price data corresponding to the target similar days, determine the electricity price characteristics of similar days;

[0012] Based on the deviation between the multidimensional target features and the multidimensional historical features corresponding to the target similar day, and combined with the feature weights corresponding to each feature, a similar day operation deviation feature is constructed.

[0013] Based on the multidimensional target features and the similar daily electricity price features, a preliminary electricity price prediction result corresponding to the target prediction date is obtained through a preliminary prediction model.

[0014] Obtain the historical prediction error sequence based on the preliminary prediction model, and input the similar day operation deviation characteristics and the historical prediction error sequence into the error prediction model to obtain the prediction error corresponding to the target prediction day;

[0015] The preliminary electricity price forecast result is corrected based on the forecast error to obtain the day-ahead electricity price forecast result corresponding to the target forecast date.

[0016] Optionally, both the multidimensional target features and the multidimensional historical features include market bidding space features, original static features, time cycle features, and price lag features;

[0017] The market bidding space characteristics are determined based on the total market demand, non-market-based unit output, and new energy output on the corresponding date. The total market demand is determined based on the electricity load and inter-provincial power transmission demand on the corresponding date.

[0018] The original static features include at least one of the following: date attribute, weekday attribute, holiday attribute, month attribute, quarter attribute, and time period attribute;

[0019] The time periodicity feature is obtained by performing sine and cosine encoding on a periodic time variable.

[0020] Optionally, the feature weights corresponding to each dimension are determined based on the correlation between the multidimensional historical features and the day-ahead electricity price data, including:

[0021] For each dimension of the multidimensional historical features, a historical feature sequence is formed based on the feature values ​​of that dimension corresponding to multiple historical days, and a historical daily average electricity price sequence is formed based on the daily average electricity price corresponding to the multiple historical days.

[0022] Calculate the Pearson correlation coefficient between the historical feature sequence and the historical daily average electricity price sequence, and normalize the Pearson correlation coefficients corresponding to each feature dimension to obtain the feature weights corresponding to each feature dimension.

[0023] Optionally, based on the feature weights, determining a target similar day matching the target predicted day from the plurality of historical days includes:

[0024] The most recent preset number of historical days before the target prediction date are identified as candidate similar days;

[0025] The multidimensional target features and the multidimensional historical features corresponding to each candidate similar day are standardized. For each candidate similar day, the similarity score between the candidate similar day and the target prediction day is determined based on the difference between the standardized feature values ​​corresponding to each feature and the corresponding feature weights.

[0026] The target similar day is determined from the candidate similar days based on the similarity scores corresponding to each candidate similar day.

[0027] Optionally, similar daily operational deviation characteristics are constructed, including:

[0028] For each dimension of the multidimensional target features and the multidimensional historical features corresponding to the target similarity days, determine the feature deviation between the target prediction day and the target similarity day in the corresponding dimension features;

[0029] Based on the feature weights corresponding to each feature dimension, the feature deviations are weighted to obtain the weighted operating deviations corresponding to each feature dimension.

[0030] Based on the weighted operational deviations corresponding to each dimension of the features, the similar daily operational deviation features are constructed.

[0031] Optionally, the similar electricity price feature includes the day-ahead electricity value corresponding to multiple consecutive prediction times of the target similar day, and each day-ahead electricity value corresponds one-to-one with the corresponding prediction time in the target prediction day;

[0032] The preliminary prediction model is a time-patched Transformer model;

[0033] Based on the multidimensional target features and the similar daily electricity price features, a preliminary electricity price prediction result corresponding to the target prediction date is obtained through a preliminary prediction model, including:

[0034] Multiple variable sequences are formed based on the multidimensional target features and the similar daily electricity price features, and each variable sequence is divided into multiple time patches;

[0035] Each time patch is subjected to feature projection and combined with position encoding. The processed time patches are then input into the Transformer backbone for temporal feature extraction to obtain the temporal features corresponding to each variable sequence.

[0036] Based on the temporal characteristics corresponding to each variable sequence, the preliminary electricity price prediction value corresponding to multiple prediction times on the target prediction date is obtained through the prediction head.

[0037] Optionally, obtaining the historical prediction error sequence based on the preliminary prediction model includes:

[0038] Obtain the historical preliminary electricity price forecasts and corresponding actual day-ahead electricity values ​​obtained by the preliminary forecast model for multiple historical forecast times;

[0039] The difference between the actual daily electricity value and the corresponding historical preliminary electricity price forecast value is determined for each of the aforementioned historical forecast times to obtain the historical forecast error.

[0040] The historical prediction errors are arranged in chronological order according to the historical prediction time to obtain the historical prediction error sequence.

[0041] Optionally, the error prediction model is an iTransformer model;

[0042] By inputting the similar day operational deviation characteristics and the historical prediction error sequence into the error prediction model, the prediction error corresponding to the target prediction day is obtained, including:

[0043] Multiple variable sequences are constructed based on the similar daily operational deviation characteristics and the historical prediction error sequence;

[0044] Each of the variable sequences is embedded to obtain the corresponding variable embedding features;

[0045] The embedded features of each variable are input into the encoder of the iTransformer model for feature extraction to obtain the correlation features between the variables.

[0046] The associated features are projected to obtain the prediction error of the target prediction date at multiple prediction times.

[0047] Optionally, the preliminary prediction model and the error prediction model are trained in the following manner:

[0048] Obtain multidimensional historical features and day-ahead electricity price data corresponding to multiple historical training days. For each historical training day, determine the corresponding historical similar day from the historical days preceding the historical training day, and determine the historical similar day electricity price features based on the day-ahead electricity price data corresponding to the historical similar day.

[0049] Based on the multidimensional historical features and historical similar daily electricity price features corresponding to each historical training day, and using the corresponding daily electricity price data as training labels, the preliminary prediction model is trained.

[0050] The historical preliminary electricity price prediction results corresponding to each of the historical training days are obtained using the trained preliminary prediction model, and the historical prediction error corresponding to each of the historical training days is determined based on the historical preliminary electricity price prediction results and the corresponding day-ahead electricity price data.

[0051] For each of the historical training days, the historical prediction errors prior to the historical training days are obtained and a historical prediction error sequence is formed;

[0052] Based on the deviation between the multidimensional historical features corresponding to each historical training day and the multidimensional historical features of the corresponding historical similar days, and combined with the feature weights corresponding to each feature, the running deviation features of the historical similar days corresponding to each historical training day are constructed.

[0053] The error prediction model is trained by using the historical similar day operation deviation characteristics corresponding to the historical training day and the historical prediction error sequence as model inputs, and using the historical prediction error corresponding to the historical training day as training labels.

[0054] Secondly, the present invention provides a day-ahead electricity price forecasting system based on similar day operating deviations, comprising:

[0055] The feature acquisition module is used to acquire the multi-dimensional target features corresponding to the target prediction date, as well as the multi-dimensional historical features and day-ahead electricity price data corresponding to multiple historical days before the target prediction date.

[0056] The similarity day determination module is used to determine the feature weights corresponding to each dimension feature based on the correlation between the multidimensional historical features and the current day electricity price data, and to determine the target similar day that matches the target prediction day from the multiple historical days based on the feature weights.

[0057] The feature construction module is used to determine the similar day electricity price feature based on the day-ahead electricity price data corresponding to the target similar day; and to construct the similar day operation deviation feature based on the deviation between each feature in the multidimensional historical feature corresponding to the target similar day and the deviation between each feature in the multidimensional target feature and the feature weights corresponding to each feature.

[0058] The preliminary prediction module is used to obtain the preliminary electricity price prediction result corresponding to the target prediction date through a preliminary prediction model based on the multidimensional target features and the similar daily electricity price features.

[0059] The error prediction module is used to obtain the historical prediction error sequence based on the preliminary prediction model, and input the similar day operation deviation characteristics and the historical prediction error sequence into the error prediction model to obtain the prediction error corresponding to the target prediction day;

[0060] The prediction correction module is used to correct the preliminary electricity price prediction result based on the prediction error, so as to obtain the day-ahead electricity price prediction result corresponding to the target prediction date.

[0061] Compared with the prior art, the beneficial effects achieved by the present invention are as follows:

[0062] This invention provides a day-ahead electricity price forecasting method and system based on similar day operational deviations. The method analyzes the correlation between multidimensional historical features and day-ahead electricity prices, determines corresponding feature weights for different features, and uses the feature weights to determine target similar days that match the target forecast day. This allows the similar day selection process to comprehensively consider the influence of different features on day-ahead electricity price changes, which is beneficial to improving the matching degree between historical reference data and target forecast scenarios.

[0063] Furthermore, after determining the target similar day, this invention not only extracts the day-ahead electricity price data corresponding to the target similar day as the similar day electricity price feature, but also constructs the similar day operation deviation feature based on the deviation of the target prediction day and the target similar day in multi-dimensional features and the corresponding feature weights, thereby preserving the multi-dimensional differences that still exist between the target prediction day and the target similar day, and providing further data basis for the determination of subsequent prediction errors.

[0064] In the prediction process, this invention first obtains preliminary electricity price prediction results based on multidimensional target features and similar daily electricity price features. Then, it uses similar daily operational deviation features and historical prediction error sequences to predict the prediction error corresponding to the target prediction day, and uses the prediction error to correct the preliminary electricity price prediction results. Therefore, based on the preliminary time-series prediction, it can further utilize the correlation information between different variables to compensate for prediction deviations, reduce prediction errors caused by a single prediction model not fully extracting complex variable relationships, and improve the accuracy, stability, and generalization ability of day-ahead electricity price prediction. Attached Figure Description

[0065] Figure 1 The diagram shown is a flowchart illustrating a day-ahead electricity price forecasting method based on similar day operating deviations in one embodiment of the present invention.

[0066] Figure 2 The diagram shown is a schematic diagram of the combined structure of the preliminary prediction model and the error prediction model in one embodiment of the present invention. Detailed Implementation

[0067] The present invention will be further described below with reference to the accompanying drawings. The following embodiments are only used to more clearly illustrate the technical solution of the present invention, and should not be used to limit the scope of protection of the present invention.

[0068] Example 1

[0069] This embodiment provides a day-ahead electricity price forecasting method based on similar day operating deviations, which can be applied to day-ahead electricity price forecasting scenarios in the electricity spot market. Specifically, it can forecast the day-ahead electricity price corresponding to multiple consecutive forecast times within the target forecast day, using a daily forecast period, based on the unified settlement reference point electricity price of the target region. For example, a 15-minute forecast period can be used, then the target forecast day includes 96 consecutive forecast times, corresponding to 96 day-ahead electricity price forecast values.

[0070] See Figure 1 The day-ahead electricity price forecasting method based on similar day operating deviation provided in this embodiment includes steps S1 to S6.

[0071] Step S1: Obtain the multi-dimensional target features corresponding to the target prediction date, as well as the multi-dimensional historical features and day-ahead electricity price data corresponding to multiple historical days prior to the target prediction date;

[0072] Among them, the multidimensional target features refer to features with multiple dimensions used to characterize the market supply and demand status, time attributes, and recent electricity price changes on the target prediction date. The multidimensional historical features refer to features with multiple dimensions constructed based on the data corresponding to each historical date, using the same feature construction method as the multidimensional target features. Thus, there are corresponding feature dimensions between the target prediction date and each historical date, which facilitates subsequent feature comparison.

[0073] In this embodiment, both the multidimensional target features and the multidimensional historical features can include market bidding space features, original static features, time cycle features, and price lag features.

[0074] The market bidding space characteristic reflects the market supply and demand status on the corresponding date. The market bidding space can be represented as:

[0075]

[0076] in, To create room for market competition; The total market demand can be determined based on the electricity load and inter-provincial power transmission demand for the corresponding date. To provide power to non-market-based generating units; This includes contributing to new energy sources, such as wind power and solar power. The aforementioned market bidding space comprehensively reflects the combined impact of factors such as electricity load, inter-provincial power exchange, new energy output, and non-market-based unit output on market supply and demand.

[0077] It should be noted that, for the target forecast date, the electricity load, non-market unit output, and new energy output can be the corresponding forecast values ​​obtained when forecasting the electricity price before the execution date, and the inter-provincial power transmission demand can be the corresponding planned or forecast values; for historical days, the corresponding multi-dimensional historical features can be determined according to the archived operation data of the corresponding historical days and the same feature construction method as the target forecast date.

[0078] Furthermore, a market bidding space lag sequence can be constructed based on the market bidding spaces corresponding to multiple consecutive historical moments to characterize the recent trend of changes in market supply and demand.

[0079] The original static features may include at least one of the following: year, month, date, mid-year day, hour, minute, weekday attribute, holiday marker, whether it is the beginning of the month, whether it is the end of the month, quarter marker, and time period marker, used to characterize the inherent time attributes of different prediction times.

[0080] Time periodicity features are used to characterize the cyclical changes of time variables. For time variables with periodicity, such as hours, months, days of the week, and days in the year, sine and cosine encoding can be used for conversion to ensure the continuity of time points at the beginning and end of the cycle in the feature space.

[0081] Price lag characteristics can be constructed from day-ahead electricity price data from one or more historical moments prior to the target forecast date, and are used to characterize the recent trend of electricity price changes before the target forecast date.

[0082] The multidimensional target features corresponding to the target prediction date are formed by combining the aforementioned market bidding space characteristics, original static characteristics, time cycle characteristics, and price lag characteristics. Using the same method, multidimensional historical features for each historical day are constructed based on data from multiple historical days.

[0083] Step S2: Determine the feature weights corresponding to each feature based on the correlation between the multidimensional historical features and the day-ahead electricity price data. Then, based on the features, standardize the weights of the multidimensional target features corresponding to the target prediction date and the multidimensional historical features corresponding to each candidate similar date, and determine the target similar date that matches the target prediction date from the multiple historical dates.

[0084] In this embodiment, a combination of time proximity filtering and weighted feature filtering is used to determine the target similar days.

[0085] First, based on the time distance between historical dates and the target prediction date, a predetermined number of historical days closest to the target prediction date can be selected as candidate similar days from a pool of historical days. For example, the five most recent historical days before the target prediction date can be selected as candidate similar days, thus prioritizing historical samples that are close to the target prediction date in time and can reflect recent market changes.

[0086] Furthermore, for each dimension of the multidimensional historical features, a historical feature sequence is formed based on the feature values ​​of that dimension corresponding to multiple historical days, and the daily average electricity price of each historical day is calculated based on the daily electricity price data corresponding to multiple historical days, thereby forming a historical daily average electricity price sequence.

[0087] Calculate the first The Pearson correlation coefficient between the historical feature sequence corresponding to each dimension and the historical daily average electricity price sequence is calculated, and the degree of correlation between that dimension and the day-ahead electricity price is determined based on the absolute value of the correlation coefficient. The feature weights corresponding to each dimension can be expressed as:

[0088]

[0089] in, For the first Feature weights corresponding to dimensional features; The total number of features; For the first The historical feature sequence corresponding to the dimensional feature; This is a historical daily average electricity price series; This represents the Pearson correlation coefficient between the two. Through the above normalization process, features with a higher correlation to day-ahead electricity prices are given larger feature weights.

[0090] When performing feature comparisons, for sequential features that include values ​​at multiple times, the feature values ​​corresponding to each time point in the sequential feature can be used as independent feature dimensions to form a multi-dimensional feature vector for similar day selection; for single-value features, the corresponding single value can be directly used as a feature dimension. Thus, the target prediction day and each candidate similar day can form feature vectors with the same feature dimension.

[0091] Next, the multi-dimensional target features corresponding to the target prediction date and the multi-dimensional historical features corresponding to each candidate similar date are standardized. For each candidate similar date, a similarity score is determined based on the differences between the standardized features of each dimension and the feature weights corresponding to each dimension. Similarity Score It can be represented as:

[0092]

[0093] in, Indicates the target forecast date. Indicates candidate similarity dates, and ) represent the target prediction date and the candidate similar date, respectively. Standardized eigenvalues ​​in dimension 1, i.e., the eigenvalues ​​in the 1st dimension Standardized feature values ​​across multiple feature dimensions. A higher similarity score indicates a smaller overall difference between the candidate similar day and the target predicted day across multiple feature dimensions.

[0094] Compare the similarity scores of each candidate similar day, and determine the candidate similar day with the highest similarity score as the target similar day.

[0095] Step S3: Determine the daily electricity price characteristics of the similar day based on the daytime electricity price data corresponding to the target similar day; construct the similar day operation deviation characteristics based on the deviation between each dimension of the multidimensional target characteristics and the multidimensional historical characteristics corresponding to the target similar day, and in combination with the feature weights corresponding to each dimension.

[0096] Specifically, after determining the target similarity date, the day-ahead electricity value corresponding to multiple consecutive forecast times is extracted from the day-ahead electricity price data corresponding to the target similarity date according to the forecast time scale of the target forecast date, forming the similarity day electricity price characteristics.

[0097] For example, when using a 15-minute forecast timescale, the target forecast day contains 96 forecast times. Therefore, the 96 day-ahead electricity price sequences corresponding to similar target days can be extracted as similar day electricity price features. The day-ahead electricity value corresponding to the first forecast time of the similar target day corresponds to the first forecast time of the target forecast day, the day-ahead electricity value corresponding to the second forecast time corresponds to the second forecast time of the target forecast day, and so on.

[0098] After determining the target similarity date, the similarity date operation deviation feature is constructed based on the multidimensional target features and the multidimensional historical features corresponding to the target similarity date.

[0099] Specifically, regarding the multidimensional target features and the multidimensional historical features corresponding to target similarity days, the first... The feature deviation between the two in the corresponding feature dimension is determined, and then combined with the first feature dimension. The feature weights corresponding to the dimensional features determine the weighted operational bias. For example, it can be represented as:

[0100]

[0101] in, Indicates the date of similarity of the target. Indicates the first Weighted operational bias corresponding to dimensional features.

[0102] In this embodiment, the positive and negative directions of the feature deviation can be preserved. For example, if the operational feature of a certain dimension corresponding to the target prediction date is higher than that of the target similar date, then the operational deviation of that dimension can be a positive value; otherwise, it can be a negative value. Therefore, the similarity date operational deviation feature can not only represent the magnitude of the deviation between the target prediction date and the target similar date, but also the corresponding deviation direction.

[0103] By combining the weighted operational deviations corresponding to each dimension of the feature, we obtain the operational deviation features for similar days. For features with values ​​at multiple consecutive times, we can calculate the weighted operational deviation for each corresponding time, thereby constructing the corresponding operational deviation sequence.

[0104] Therefore, the similar day electricity price feature is used to provide historical electricity price change patterns that match the target forecast day, while the similar day operating deviation feature is used to characterize the differences that still exist between the target forecast day and the target similar day under multidimensional conditions.

[0105] Step S4: Based on the multidimensional target features and the similar daily electricity price features, obtain the preliminary electricity price prediction result corresponding to the target prediction date through the preliminary prediction model;

[0106] See Figure 2 In this embodiment, the preliminary prediction model can be the PatchTST model. The PatchTST model is used to extract the time series variation pattern from multidimensional target features and similar daily electricity price features, and output the preliminary electricity price prediction value corresponding to each prediction time of the target prediction day.

[0107] Specifically, multiple variable sequences are formed based on multidimensional target features and similar daily price features. PatchTST uses a channel-independent approach to process different variable sequences, that is, splitting the multivariate time series into multiple univariate variable sequences and extracting time-series features from each variable sequence separately, in order to reduce the direct information mixing between different variables.

[0108] Taking any variable sequence as an example, let the input length of the variable sequence be... The variable sequence is divided into multiple time patches, each time patch having a length of [length missing]. The step size between two adjacent time patches is Then the number of time patches It can be represented as:

[0109]

[0110] It should be noted that the time patch length and step length It can be preset based on the length of the input sequence and the model training results.

[0111] In one implementation, before dividing the variable sequence into time patches, data can be padded at the ends of the variable sequence according to a preset padding method, so that the data at the end of the sequence can be covered by at least one time patch; the padded variable sequence is then divided according to the time patch length and step size, thereby determining the number of time patches according to the above formula. .

[0112] After completing the time patch division, feature projection is performed on each time patch. Let the th... The first variable in the sequence of variables One time patch is Then, the time patch can be mapped to a feature space of a preset dimension using a mapping matrix, and added to the feature space of the first dimension. The location code corresponding to each time patch is obtained as follows:

[0113]

[0114] in, Represents the feature mapping matrix, Indicates the first The location code corresponding to each time patch This represents the time patch features after feature projection and positional encoding. By adding positional encoding, the model can retain the temporal order information of each time patch in the original variable sequence when processing different time patches.

[0115] The first The corresponding variable sequences The time patch features are combined in chronological order to obtain the time patch feature matrix corresponding to the variable sequence. .

[0116] Subsequently, the time patch feature matrix Temporal feature extraction is performed using the Transformer backbone. In the multi-head attention processing of the Transformer backbone, for the ... Each attention head determines the query matrix, key matrix, and value matrix based on the time patch feature matrix:

[0117]

[0118]

[0119]

[0120] in, , and They represent the first The query transformation matrix, key transformation matrix, and value transformation matrix corresponding to each attention head; , and They represent the first The sequence of variables in the th variable is at the th ... The query matrix, key matrix, and value matrix obtained under each attention head.

[0121] Based on the query matrix and key matrix, attention weights are determined among patches at different times, and the value matrix is ​​weighted using these attention weights to obtain the first... Attention output corresponding to each attention head:

[0122]

[0123] in, This represents the dimension of the key vector. Indicates the first The sequence of variables in the th variable is at the th ... The attention output obtained under each attention head.

[0124] For the same variable sequence, temporal correlation information between different time patches can be extracted using multiple attention heads, and the outputs of the multiple attention heads can be combined to obtain the temporal features corresponding to the variable sequence. Each variable sequence is processed in the same way to obtain the temporal features corresponding to each variable sequence.

[0125] Next, the time-series features corresponding to each variable sequence are input into the prediction head. The prediction head may include a fully connected layer, which is used to map the time-series features output by the Transformer backbone to the electricity price prediction space corresponding to the target prediction date, thereby obtaining the preliminary electricity price prediction values ​​corresponding to the target prediction date at multiple prediction times.

[0126] Taking 15 minutes as a forecast period as an example, and the target forecast day includes 96 forecast times, the preliminary electricity price forecast result can be expressed as:

[0127]

[0128] in, This indicates the preliminary electricity price forecast result. Indicates the target prediction for the middle of the day The preliminary electricity price forecast for each forecast time point. .

[0129] Therefore, by extracting the time-series change features within each variable sequence using the PatchTST model and combining them with the historical electricity price change patterns provided by similar daily electricity price features, a preliminary electricity price prediction result corresponding to the target prediction date can be obtained, which can then be used in the subsequent step S5 to further determine the prediction error.

[0130] Step S5: Obtain the historical prediction error sequence based on the preliminary prediction model, and input the similar day operation deviation characteristics and the historical prediction error sequence into the error prediction model to obtain the prediction error corresponding to the target prediction day;

[0131] In this embodiment, the error prediction model can be an iTransformer model, which is used to predict the preliminary prediction error corresponding to the target prediction date based on the similar day deviation characteristics and the error changes of the preliminary prediction model in the historical prediction process.

[0132] First, obtain the historical preliminary electricity price forecasts obtained by the preliminary forecast model for multiple historical forecast times, as well as the actual day-ahead electricity value corresponding to each historical forecast time.

[0133] For any historical prediction time The difference between the actual day-ahead electricity value and the historical preliminary electricity price forecast can be defined as the historical forecast error, i.e.:

[0134]

[0135] in, Indicates the first The actual day-ahead electricity value corresponding to each historical prediction moment. This indicates that the preliminary prediction model is for the first... Historical preliminary electricity price forecasts obtained at historical forecast points. Indicates the first The historical prediction error corresponding to each historical prediction time.

[0136] By arranging multiple historical prediction errors in chronological order according to their respective prediction times, a historical prediction error sequence can be obtained. For example, the historical prediction error sequence can be constructed by taking multiple historical prediction errors within a preset historical time window prior to the target prediction date.

[0137] Furthermore, the similar daily operational deviation features constructed after step S3, together with the historical prediction error sequence, are used as inputs to the error prediction model. For ease of explanation, the error prediction input data constructed based on the similar daily operational deviation features and the historical prediction error sequence can be denoted as... .

[0138] In constructing the error prediction input data At the same time, the operational deviation data of each dimension in the similar daily operational deviation characteristics and the historical prediction error can be time-aligned according to the same time scale and preset historical time window, so that the data at corresponding positions in different variable sequences have a corresponding time relationship.

[0139] The weighted operational deviations of each dimension in the similar daily operational deviation characteristics and the historical prediction error sequence can each form a corresponding variable sequence. For example, different variable sequences can correspond to market bidding space deviation, time characteristic deviation, price lag deviation, and historical prediction error, respectively.

[0140] Embedding is performed on each variable sequence separately to map different variable sequences aligned to the same time scale to a unified feature space and reduce the impact of numerical scale differences between different variables on feature extraction. For the first... A sequence of variables, whose variable embedding features can be represented as:

[0141]

[0142] in, Indicates the input data for error prediction The first in A sequence of variables, Indicates the first The variable embedding features are obtained by embedding a sequence of variables.

[0143] The embedded features of each variable are used to form the input feature set of the encoder. The features are then sequentially input into multiple encoder layers within the iTransformer model for feature extraction. The processing of a layer encoder can be represented as:

[0144]

[0145] in, Indicates the first Input features of the layer encoder Indicates the first Output characteristics of the layer encoder Indicates the number of encoder layers.

[0146] Unlike the preliminary prediction model in step S4, which mainly extracts features from the time-series changes of each variable, the iTransformer model uses an encoder to perform correlation analysis on the variable embedding features corresponding to different variables, in order to extract the correlation features between the similar day operational deviation and the historical prediction error. For example, when the market bidding space, new energy output-related features, or recent price features of the target prediction day deviate from those of the target similar day, the correlation features can be used to characterize the correspondence between the corresponding operational deviation and the preliminary prediction error.

[0147] By projecting the associated features output from the last encoder layer, the prediction errors for the target prediction date at multiple prediction times can be obtained. ;

[0148] Taking a target prediction date that includes 96 prediction times as an example, the prediction error can be expressed as:

[0149]

[0150] in, Indicates the target prediction for the middle of the day The prediction error corresponding to each prediction time.

[0151] Therefore, the error prediction model does not directly predict the day-ahead electricity price again. Instead, it uses the operational deviation between the target prediction date and the target similar date, as well as the historical prediction error change pattern generated by the preliminary prediction model, to predict the possible residual error in the preliminary electricity price prediction result. This prediction error is then provided to the subsequent step S6 to correct the preliminary electricity price prediction result.

[0152] Step S6: Correct the preliminary electricity price forecast result according to the forecast error to obtain the day-ahead electricity price forecast result corresponding to the target forecast date.

[0153] Specifically, in step S5, the historical forecast error is determined by the difference between the actual day-ahead electricity price and the corresponding historical preliminary electricity price forecast. Therefore, the forecast error output by the error forecast model is used to characterize the possible residual deviation of the preliminary electricity price forecast result relative to the actual electricity price on the target forecast day. Based on this error definition, the forecast error can be superimposed on the preliminary electricity price forecast result to obtain the corrected day-ahead electricity price forecast result.

[0154] Let the preliminary electricity price forecast obtained in step S4 be: The prediction error obtained in step S5 is The day-ahead electricity price forecast result corresponding to the target forecast date. It can be represented as:

[0155]

[0156] in, This indicates the preliminary electricity price forecast result. This represents the prediction error output by the error prediction model. This indicates the day-ahead electricity price forecast result after error correction.

[0157] Furthermore, both the preliminary electricity price forecast result and the forecast error include values ​​corresponding to multiple forecast times within the target forecast date. Therefore, corrections can be made one-to-one according to the forecast times. For the first... For each forecast point, the final day-ahead electricity price forecast can be expressed as:

[0158]

[0159] in, Indicates the first The preliminary electricity price forecast for each forecast time point. Indicates the first The prediction error corresponding to each prediction time. Indicates the first The revised day-ahead electricity price forecast for each forecast point.

[0160] For example, when a 15-minute forecast period is used, the target forecast day includes 96 forecast times. The 96 preliminary electricity price forecasts are then superimposed with the corresponding 96 forecast errors on a time-by-time basis to obtain the day-ahead electricity price forecast results for the 96 forecast times throughout the target forecast day.

[0161] Therefore, the preliminary prediction model mainly extracts the main electricity price change patterns of the target prediction day based on multidimensional target features and similar daily electricity price features. The error prediction model further uses similar daily operation deviation features and historical prediction error sequences to determine the possible residual errors in the preliminary prediction results. Finally, the residual errors are compensated through step S6 to obtain the day-ahead electricity price prediction results corresponding to the target prediction day.

[0162] Furthermore, the preliminary prediction model in step S4 and the error prediction model in step S5 can be trained using historical data before performing the day-ahead electricity price forecast for the target prediction date. The two models are trained in the order of first training the preliminary prediction model and then training the error prediction model.

[0163] First, acquire multidimensional historical features and day-ahead electricity price data corresponding to multiple historical training days. For each historical training day, use it as the target prediction day for the simulation, and determine the corresponding historical similar days using only historical data prior to that historical training day.

[0164] The method for determining historical similar days can be the same as step S2, that is, first determine candidate similar days from the preset number of historical days most recent to the historical training date, then calculate the similarity score according to the feature weights corresponding to each dimension of features, and select the historical day with the highest similarity score as the corresponding historical similar day.

[0165] Based on the day-ahead electricity price data corresponding to historical similar days, historical similar day-ahead electricity price features are formed. The multi-dimensional historical features and historical similar day-ahead electricity price features corresponding to the historical training days are used as inputs to the preliminary prediction model, and the actual day-ahead electricity price data corresponding to the historical training days are used as training labels to train the PatchTST model.

[0166] During training, the training error is determined based on the difference between the predicted electricity price output by the PatchTST model and the actual day-ahead electricity price, and the trainable parameters in the PatchTST model are adjusted according to the training error. After meeting preset training termination conditions, a preliminary prediction model is obtained. The preset training termination conditions may include at least one of the following: the number of training epochs reaches a preset number, the training error is below a preset threshold, or the validation error tends to stabilize.

[0167] After obtaining the preliminarily trained prediction model, the model is used to make predictions for multiple historical training days to obtain the historical preliminary electricity price prediction results for each historical training day.

[0168] The historical forecast error is determined by the difference between the actual day-ahead electricity price and the historical preliminary electricity price forecast for each historical training day.

[0169] For any given historical training day, obtain multiple historical prediction errors prior to that historical training day and form a historical prediction error sequence in chronological order.

[0170] Meanwhile, based on the multidimensional historical features corresponding to the historical training day and the multidimensional historical features corresponding to its historical similar days, the operating deviation features of the historical similar days corresponding to the historical training day are constructed in accordance with the method of constructing similar day operating deviation features in step S3.

[0171] The iTransformer model is trained by using the historical similar day operation deviation features corresponding to the historical training day and the historical prediction error sequence located before the historical training day as inputs, and using the actual historical prediction error generated on the historical training day as training labels.

[0172] This allows the iTransformer model to learn the correspondence between different operational deviation states and changes in historical prediction errors with subsequent prediction errors. After meeting the preset training termination conditions, the trained error prediction model is obtained.

[0173] It should be noted that the training of the error prediction model takes place after the training of the preliminary prediction model. This is because the historical prediction errors used in the training samples of the error prediction model need to be determined based on the historical prediction results of the preliminary prediction model.

[0174] Example 2

[0175] This embodiment provides a specific example of a day-ahead electricity price forecasting method based on similar day operating deviations:

[0176] In one specific application, the forecast verification was carried out using the day-ahead unified settlement reference point electricity price data of a certain region from January 1, 2026 to June 30, 2026. The data was divided into 15-minute time scales, and included 96 electricity price data points per day. The electricity price unit was yuan / MWh.

[0177] The following results were obtained by comparing the combined prediction models of GRU, LSTM, iTransformer, PatchTST, and only using basic weather and load characteristics, as well as the combined prediction model of this embodiment:

[0178]

[0179] The results above show that the MAE, RMSE, and MAPE of the combined prediction model in this embodiment are all lower than those of the comparison models, indicating that the combination of similar day features, PatchTST preliminary prediction, and iTransformer error prediction can reduce the day-ahead electricity price prediction error.

[0180] Example 3

[0181] This embodiment provides a day-ahead electricity price forecasting system based on similar day operating deviation, used to implement the day-ahead electricity price forecasting method based on similar day operating deviation in Embodiment 1, including: a feature acquisition module, a similar day determination module, a feature construction module, a preliminary forecasting module, an error forecasting module, and a forecast correction module.

[0182] The feature acquisition module is used to acquire the multidimensional target features corresponding to the target prediction date, as well as the multidimensional historical features and day-ahead electricity price data corresponding to multiple historical days prior to the target prediction date.

[0183] The similarity day determination module is used to determine the feature weights corresponding to each feature based on the correlation between multidimensional historical features and day-ahead electricity price data, and to determine the target similar day that matches the target prediction day from multiple historical days based on the feature weights.

[0184] The feature construction module is used to determine the daily electricity price features of similar days based on the day-ahead electricity price data corresponding to the target similar day, and to construct the similar day operation deviation features based on the deviation between each dimension of the multidimensional target features and the multidimensional historical features corresponding to the target similar day, combined with the feature weights corresponding to each dimension.

[0185] The preliminary prediction module is used to obtain the preliminary electricity price prediction results for the target prediction date based on multidimensional target features and similar daily electricity price features through a preliminary prediction model.

[0186] The error prediction module is used to obtain the historical prediction error sequence based on the preliminary prediction model, and input the similar day operation deviation characteristics and the historical prediction error sequence into the error prediction model to obtain the prediction error corresponding to the target prediction day.

[0187] The forecast correction module is used to correct the preliminary electricity price forecast results based on the forecast error, so as to obtain the day-ahead electricity price forecast result corresponding to the target forecast date.

[0188] The specific functions of each module described above are explained in the relevant content of the method in Embodiment 1, and will not be repeated here.

[0189] Example 4

[0190] This embodiment provides a computer-readable storage medium storing a computer program that, when executed, implements the day-ahead electricity price forecasting method based on similar day operating deviations described in Embodiment 1.

[0191] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0192] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0193] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0194] The embodiments of the present invention have been described above with reference to the accompanying drawings. However, the present invention is not limited to the specific embodiments described above. The specific embodiments described above are merely illustrative and not restrictive. Those skilled in the art can make many other forms under the guidance of the present invention without departing from the spirit and scope of the claims. All of these forms are within the protection scope of the present invention.

Claims

1. A day-ahead electricity price forecasting method based on similar day operating deviations, characterized in that, include: Obtain the multidimensional target features corresponding to the target prediction date, as well as the multidimensional historical features and day-ahead electricity price data corresponding to multiple historical days prior to the target prediction date; The feature weights corresponding to each feature are determined based on the correlation between the multidimensional historical features and the day-ahead electricity price data, and based on the feature weights, a target similar day matching the target prediction day is determined from the multiple historical days. Based on the day-ahead electricity price data corresponding to the target similar days, determine the electricity price characteristics of similar days; Based on the deviation between the multidimensional target features and the multidimensional historical features corresponding to the target similar day, and combined with the feature weights corresponding to each feature, a similar day operation deviation feature is constructed. Based on the multidimensional target features and the similar daily electricity price features, a preliminary electricity price prediction result corresponding to the target prediction date is obtained through a preliminary prediction model. Obtain the historical prediction error sequence based on the preliminary prediction model, and input the similar day operation deviation characteristics and the historical prediction error sequence into the error prediction model to obtain the prediction error corresponding to the target prediction day; The preliminary electricity price forecast result is corrected based on the forecast error to obtain the day-ahead electricity price forecast result corresponding to the target forecast date.

2. The day-ahead electricity price forecasting method based on similar day operating deviations according to claim 1, characterized in that, Both the multidimensional target features and the multidimensional historical features include market bidding space features, original static features, time cycle features, and price lag features; The market bidding space characteristics are determined based on the total market demand, non-market-based unit output, and new energy output on the corresponding date. The total market demand is determined based on the electricity load and inter-provincial power transmission demand on the corresponding date. The original static features include at least one of the following: date attribute, weekday attribute, holiday attribute, month attribute, quarter attribute, and time period attribute; The time periodicity feature is obtained by performing sine and cosine encoding on a periodic time variable.

3. The day-ahead electricity price forecasting method based on similar day operating deviations according to claim 1, characterized in that, The feature weights corresponding to each dimension are determined based on the correlation between the multidimensional historical features and the day-to-day electricity price data, including: For each dimension of the multidimensional historical features, a historical feature sequence is formed based on the feature values ​​of that dimension corresponding to multiple historical days, and a historical daily average electricity price sequence is formed based on the daily average electricity price corresponding to the multiple historical days. Calculate the Pearson correlation coefficient between the historical feature sequence and the historical daily average electricity price sequence, and normalize the Pearson correlation coefficients corresponding to each feature dimension to obtain the feature weights corresponding to each feature dimension.

4. The day-ahead electricity price forecasting method based on similar day operating deviations according to claim 1, characterized in that, Based on the feature weights, a target similar day matching the target predicted day is determined from the plurality of historical days, including: The most recent preset number of historical days before the target prediction date are identified as candidate similar days; The multidimensional target features and the multidimensional historical features corresponding to each candidate similar day are standardized. For each candidate similar day, the similarity score between the candidate similar day and the target prediction day is determined based on the difference between the standardized feature values ​​corresponding to each feature and the corresponding feature weights. The target similar day is determined from the candidate similar days based on the similarity scores corresponding to each candidate similar day.

5. The day-ahead electricity price forecasting method based on similar day operating deviations according to claim 1, characterized in that, Construct similar daily operational deviation characteristics, including: For each dimension of the multidimensional target features and the multidimensional historical features corresponding to the target similarity days, determine the feature deviation between the target prediction day and the target similarity day in the corresponding dimension features; Based on the feature weights corresponding to each feature dimension, the feature deviations are weighted to obtain the weighted operating deviations corresponding to each feature dimension. Based on the weighted operational deviations corresponding to each dimension of the features, the similar daily operational deviation features are constructed.

6. The day-ahead electricity price forecasting method based on similar day operating deviations according to claim 1, characterized in that, The similar electricity price feature includes the day-ahead electricity value corresponding to multiple consecutive prediction times of the target similar day, and each day-ahead electricity value corresponds one-to-one with the corresponding prediction time in the target prediction day; The preliminary prediction model is a time-patched Transformer model; Based on the multidimensional target features and the similar daily electricity price features, a preliminary electricity price prediction result corresponding to the target prediction date is obtained through a preliminary prediction model, including: Multiple variable sequences are formed based on the multidimensional target features and the similar daily electricity price features, and each variable sequence is divided into multiple time patches; Each time patch is subjected to feature projection and combined with position encoding. The processed time patches are then input into the Transformer backbone for temporal feature extraction to obtain the temporal features corresponding to each variable sequence. Based on the temporal characteristics corresponding to each variable sequence, the preliminary electricity price prediction value corresponding to multiple prediction times on the target prediction date is obtained through the prediction head.

7. The day-ahead electricity price forecasting method based on similar day operating deviations according to claim 1, characterized in that, The step of obtaining the historical prediction error sequence based on the preliminary prediction model includes: Obtain the historical preliminary electricity price forecasts and corresponding actual day-ahead electricity values ​​obtained by the preliminary forecast model for multiple historical forecast times; The difference between the actual daily electricity value and the corresponding historical preliminary electricity price forecast value is determined for each of the aforementioned historical forecast times to obtain the historical forecast error. The historical prediction errors are arranged in chronological order according to the historical prediction time to obtain the historical prediction error sequence.

8. The day-ahead electricity price forecasting method based on similar day operating deviations according to claim 7, characterized in that, The error prediction model is the iTransformer model; By inputting the similar day operational deviation characteristics and the historical prediction error sequence into the error prediction model, the prediction error corresponding to the target prediction day is obtained, including: Multiple variable sequences are constructed based on the similar daily operational deviation characteristics and the historical prediction error sequence; Each of the variable sequences is embedded to obtain the corresponding variable embedding features; The embedded features of each variable are input into the encoder of the iTransformer model for feature extraction to obtain the correlation features between the variables. The associated features are projected to obtain the prediction error of the target prediction date at multiple prediction times.

9. The day-ahead electricity price forecasting method based on similar day operating deviations according to claim 1, characterized in that, The preliminary prediction model and the error prediction model are trained in the following manner: Obtain multidimensional historical features and day-ahead electricity price data corresponding to multiple historical training days. For each historical training day, determine the corresponding historical similar day from the historical days preceding the historical training day, and determine the historical similar day electricity price features based on the day-ahead electricity price data corresponding to the historical similar day. Based on the multidimensional historical features and historical similar daily electricity price features corresponding to each historical training day, and using the corresponding daily electricity price data as training labels, the preliminary prediction model is trained. The historical preliminary electricity price prediction results corresponding to each of the historical training days are obtained using the trained preliminary prediction model, and the historical prediction error corresponding to each of the historical training days is determined based on the historical preliminary electricity price prediction results and the corresponding day-ahead electricity price data. For each of the historical training days, the historical prediction errors prior to the historical training days are obtained and a historical prediction error sequence is formed; Based on the deviation between the multidimensional historical features corresponding to each historical training day and the multidimensional historical features of the corresponding historical similar days, and combined with the feature weights corresponding to each feature, the running deviation features of the historical similar days corresponding to each historical training day are constructed. The error prediction model is trained by using the historical similar day operation deviation characteristics corresponding to the historical training day and the historical prediction error sequence as model inputs, and using the historical prediction error corresponding to the historical training day as training labels.

10. A day-ahead electricity price forecasting system based on similar day operating deviations, characterized in that, include: The feature acquisition module is used to acquire the multi-dimensional target features corresponding to the target prediction date, as well as the multi-dimensional historical features and day-ahead electricity price data corresponding to multiple historical days before the target prediction date. The similarity day determination module is used to determine the feature weights corresponding to each dimension feature based on the correlation between the multidimensional historical features and the current day electricity price data, and to determine the target similar day that matches the target prediction day from the multiple historical days based on the feature weights. The feature construction module is used to determine the similar day electricity price feature based on the day-ahead electricity price data corresponding to the target similar day; and to construct the similar day operation deviation feature based on the deviation between each feature in the multidimensional historical feature corresponding to the target similar day and the deviation between each feature in the multidimensional target feature and the feature weights corresponding to each feature. The preliminary prediction module is used to obtain the preliminary electricity price prediction result corresponding to the target prediction date through a preliminary prediction model based on the multidimensional target features and the similar daily electricity price features. The error prediction module is used to obtain the historical prediction error sequence based on the preliminary prediction model, and input the similar day operation deviation characteristics and the historical prediction error sequence into the error prediction model to obtain the prediction error corresponding to the target prediction day; The prediction correction module is used to correct the preliminary electricity price prediction result based on the prediction error, so as to obtain the day-ahead electricity price prediction result corresponding to the target prediction date.