Electric power spot price prediction method and system based on similar day probability correction

Through the power spot price prediction method with similar daily probability correction, the LightGBM model and Bayesian algorithm optimization are used, combined with similar daily characteristics and probability distribution matrix correction, the problem of insufficient prediction in the existing technology in extreme scenarios is solved, and high-precision and robust electricity price prediction is achieved.

CN120410595AInactive Publication Date: 2025-08-01BEIJING INSTITUTE OF PETROCHEMICAL TECHNOLOGY
View PDF 0 Cites 4 Cited by

Patent Information

Application Number
CN202510515947.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-23
Publication Date
2025-08-01
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

When faced with extreme scenarios such as sudden load fluctuations and drastic changes in renewable output, the existing power spot price prediction methods are insufficient, making it difficult to meet the market players' demand for high-precision and high-stability electricity price prediction.

Method used

Using a method based on similar day probability correction, the LightGBM model training and Bayesian algorithm optimization are used, and similar days are screened in combination with the weighted Pearson correlation coefficient, and the interval probability distribution matrix between the bidding space and the recent electricity price is constructed to correct the electricity price prediction results.

Benefits of technology

It improves the fitting ability and generalization performance of the model in a complex market environment, enhances the stability and adaptability of electricity price trend modeling, effectively makes up for the problem of deviation accumulation in extreme electricity price scenarios, and outputs a more stable recent electricity price prediction sequence.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120410595A_ABST
    Figure CN120410595A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of electric power market price prediction, in particular to an electric power spot price prediction method and system based on similar day probability correction, and the method comprises the following steps: S1, electric power data collection: obtaining historical market information of a day-ahead spot market and day-ahead electric power spot price data; s2, feature engineering construction: performing feature engineering construction on the collected power data; s3, data preprocessing: forming a data set; s4, performing model training: performing training on the LightGBM model; s5, similar day matching: screening k historical days with the highest similarity with the prediction day; s6, performing interval probability distribution modeling of the bidding space and the day-ahead electricity price: establishing a probability mapping matrix of the bidding space interval and the day-ahead electricity price interval; and S7, prediction result correction and final electricity price prediction: generating a final day-ahead spot electricity price prediction sequence. According to the invention, the method is closer to the actual market situation when the prediction logic is constructed, and the stability and adaptability of electricity price trend modeling are enhanced.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of power market price prediction, and particularly to a method and system for predicting power spot price based on probability correction of similar days. Background Art

[0002] As an important part of the power market reform, the price fluctuation of the power spot market is directly related to the revenue level and risk control ability of power generation enterprises, power sales companies and large electricity customers. Especially in the day-ahead trading stage, accurate electricity price prediction is crucial for formulating reasonable bidding strategies, optimizing power generation scheduling and power purchase decisions. Since the power market is jointly driven by multiple complex factors such as supply-demand balance, renewable energy fluctuation, load change and scheduling mechanism, electricity price prediction has gradually become one of the most challenging tasks in the power system.

[0003] Currently, the widely used electricity price prediction methods mainly include traditional statistical regression models, machine learning models and deep learning models. Although these methods have certain prediction capabilities in some stable scenarios, they generally have problems such as high dependence on feature engineering and difficulty in depicting extreme price changes in the model structure. Especially in the face of extreme scenarios such as sudden load fluctuations and drastic changes in renewable power generation, the generalization ability and robustness of existing models are significantly insufficient, the prediction error increases significantly, and it is difficult to meet the electricity price prediction requirements of market players for high accuracy and high stability. Summary of the Invention

[0004] The present invention provides a method and system for predicting power spot price based on probability correction of similar days, providing high-precision electricity price prediction results to support market players in formulating scientific and reasonable strategies and reducing their revenue risks.

[0005] A method for predicting power spot price based on probability correction of similar days includes the following steps:

[0006] S1, power data collection: Obtain historical market information and day-ahead power spot price data of the day-ahead spot market through the power trading platform;

[0007] S2, feature engineering construction: Conduct feature engineering construction on the collected power data, including bidding space features and time features;

[0008] S3, data preprocessing: Preprocess the collected power data and form a data set;

[0009] [[ID=३१]]S4, model training: Divide the data set into a training set and a test set, train the LightGBM model, and optimize the hyperparameters in the LightGBM model using the Bayesian algorithm;

[0010] S5, Similar Day Matching: The weighted Pearson correlation coefficient is used to calculate the similarity coefficient between the predicted day and each day in the historical days for similar day matching, and the k historical days with the highest similarity to the predicted day are selected;

[0011] S6, Interval Probability Distribution Modeling of Bidding Space and Day-Ahead Electricity Price: Based on the selected k historical days, the 24-hour bidding space data sequence Q and the corresponding day-ahead electricity price data sequence P are respectively extracted, and the data points in Q and P are discretized by percentile to generate m bidding space and l day-ahead electricity price bin boundary sets, and a probability mapping matrix M of the bidding space interval and the day-ahead electricity price interval is established m×l ;

[0012] S7, Prediction Result Correction and Final Electricity Price Prediction: The discretized bidding space data sequence Q and the corresponding day-ahead electricity price data sequence P are input into the trained LightGBM model to output a preliminary price prediction sequence For the bidding space corresponding to each price moment, locate its bin interval in the probability mapping matrix M m×l Extract the electricity price probability corresponding to this bin, judge whether the probability is higher than the set threshold, correct the predicted price, and generate the final day-ahead spot electricity price prediction sequence Y by integrating the correction results of the predicted prices at all moments pred .

[0013] Optionally, the power data collection in S1 includes:

[0014] S11, Historical Market Information Data Collection: The historical market information every day includes 96 data (one data every 15 minutes), constituting the historical data set [date, time, load, line, wind, pv, nuc, sy, zb, loc] n×96 , where date represents the date, time represents the time, load represents the directly regulated load of the system, line represents the power receiving tie line, wind represents the wind power output, pv represents the photovoltaic power output, nuc represents the nuclear power output, sy represents the output of the test unit, zb represents the output of the self-provided power plant, loc represents the output of the local power plant, and n represents the number of days;

[0015] S12, Power Spot Price Data Collection: Obtain the historical day-ahead power spot price data p n×24 , and the day-ahead power spot price data includes 24 data every day.

[0016] Optionally, the feature engineering construction in S2 includes: S21, Bidding Space Feature Calculation: Based on the collected historical market information data, calculate the bidding space feature q, expressed as: ; S22, Time Feature Processing: Process the dates and times in the historical dataset. For dates, the data format is YYYY-MM-DD (e.g., 2024-05-01), corresponding to year-month-day respectively. Extract the values of year, month, and day to form independent fields for year (y), month (m), and day (d). For times, the data format is HH:MM (e.g., 13:15), corresponding to hour:minute. Extract the data at the hour position to form an independent hour field (h). The judgment of the date as a working day or a holiday includes: Judgment of working days: If the date range belongs to Monday to Friday, form an independent field is_wday and assign it a value of 1, otherwise 0. Judgment of holidays: If the date range belongs to any day in Chinese holidays (New Year's Day, Spring Festival, Tomb-Sweeping Day, Labor Day, Dragon Boat Festival, Mid-Autumn Festival, National Day), form an independent field is_hday and assign it a value of 1, otherwise 0.

[0023] The data preprocessing in S3 includes: Optionally,

[0024] S31, Data Aggregation and Representative Value Calculation per Hour: Based on the constructed feature engineering, convert the 96 data points per day into 24 data points. Take the arithmetic mean of the 4 fifteen-minute data points per hour as the representative value for that hour.

[0025] S32, Construction of Input and Output Datasets: Process the feature engineering as input X, denoted as X=(X1,X2,…,X n ) T , where X n represents the input formed by the feature data on the nth day of the feature engineering. The set of day-ahead electricity spot prices p is processed as output Y, denoted as Y=(Y1,Y2,…,Y n ) T , where Y n represents the day-ahead electricity spot price on the nth day.

[0026] S33, Normalization Processing: Use the maximum-minimum method to normalize each column vector in X and Y, obtaining the normalized X scaled and Y scaled .

[0027] Optionally, the model training in S4 includes:

[0028] S41, Dataset Partitioning and Model Fitting: Partition the normalized X scaled and Y scaled into a training set and a test set, and use the regression algorithm in the LightGBM model to fit the relationship between X scaled and Y scaled ;

[0029] S42, Hyperparameter Optimization: Optimize the hyperparameters in the LightGBM model. The hyperparameters include learning rate (learning_rate), number of iterations (n_estimators), maximum number of leaf nodes per decision tree (num_leaves), maximum depth of the tree (max_depth), and proportion of training data randomly sampled in each iteration (subsample), and set the search range for the hyperparameters;

[0030] S43, Bayesian Algorithm Optimization and Performance Evaluation: Randomly select and apply multiple sets of hyperparameter combinations to the LightGBM model for fitting, record the performance of each set of parameters, use the Bayesian algorithm to iteratively optimize the hyperparameters, and evaluate the performance of the LightGBM model by calculating the mean absolute error;

[0031] S44, Hyperparameter Saving: Save the hyperparameters of the LightGBM according to the optimization results of the Bayesian algorithm.

[0032] Optionally, the similar day matching in S5 includes:

[0033] S51, Selection of Similar Day Features: Select the calculation basis for the features of similar days, including selecting the bidding space q, system direct regulation load load, power receiving tie line line, wind power output wind, and photovoltaic power output pv;

[0034] S52, Extraction of Historical Day Feature Matrix: Extract the bidding space features and time features in X scaled , and generate n historical day feature matrices C n according to the number of days;

[0035] S53, Standardization of Prediction Day Feature Data: Obtain the bidding space features and time features of the prediction day, and perform normalization processing using the maximum-minimum method to obtain the prediction day feature matrix P;

[0036] S54, Similarity Calculation and Weighted Summation: Calculate the correlation coefficient between each column in the prediction day feature P and the corresponding column of each day in C n , and perform weighted summation on the calculated correlation coefficients to form a comprehensive similarity coefficient sequence Corr = (corr1, corr2,..., corr n ) of the prediction day and each historical day, which is expressed as:

[0037]

[0038] wherein, δ k is the weight value of the k-th feature similarity coefficient, represents the t-th element value in the k-th feature column of the feature matrix C on the n-th historical day n in, represents the arithmetic mean of all elements in the k-th feature column of the feature matrix C on the n-th historical day, P n k,t represents the t-th element value in the k-th feature column on the prediction day,

[0039]

[0040] Optionally, the interval probability distribution modeling of the bidding space and the day-ahead electricity price in S6 includes:

[0041] S61, similarity ranking and index selection: Sort the elements in Corr in descending order to form a new sequence corr_sort, and obtain the indexes of the first g correlation coefficient values to form an index sequence I;

[0042] S62, extract the bidding space and electricity price subsets of similar dates: Based on each index {i1, i2,..., i g} in the index sequence I, extract the subsets of the bidding space q and the day-ahead electricity spot price data p corresponding to the corresponding dates to form a new bidding space sequence load and a day-ahead price sequence price;

[0042] S63, probability distribution modeling: Discretize the bidding space sequence load and the day-ahead price sequence price into equal-probability intervals through quantile discretization, and establish a conditional probability matrix M from each bidding space interval to the electricity price interval m×l .

[0043] Optionally, the probability distribution modeling in S63 includes:

[0044] S631, construct the binning boundary sets of the bidding space and the electricity price: Construct the binning boundary set B load of the bidding space and the binning boundary set B price of the day-ahead electricity price, expressed as:

[0045] B load ={b i |b i =Q load (p i )}, p i ∈{0, 0 + m, 0 + 2m,..., 1.0};

[0046] Bprice ={b i |b i =Q price (p i )},p i ∈{0,0 + l,0 + 2l,...,1.0};

[0047] where Q load (p i ) and Q price (p i ) are the p-th percentiles of the sequences load and price respectively, and m and l are the number of bins respectively;

[0048] S632, Match the bidding space interval and the electricity price interval: According to the bin boundaries B load and B price , match the m bidding space intervals and the n price intervals to generate the matching relationship between the bidding space interval and the electricity price interval;

[0049] S633, Establish the conditional probability matrix: According to the matching relationship between the bidding space and the day-ahead electricity price bin data, establish the conditional probability matrix M m×l , and each element in M m×l is expressed as:

[0050] and

[0051] Optionally, the prediction result correction and the final electricity price prediction in S7 include:

[0052] S71, Match the predicted price and the bidding space: For the day-ahead spot price predicted by the LightGBM model at each moment, simultaneously obtain the predicted bidding space sequence For each time period t ∈ [1, 24], according to the generated bidding space bin boundaries, determine the belonging bin interval Extract the probability π of the corresponding electricity price interval of this bin interval t ;

[0053] S72, Judgment of predicted electricity price correction: Judge the predicted electricity price at each moment, and compare the probability value π t with the preset threshold π threshold . When π t ≥ π threshold , keep the original predicted value unchanged. When πt <π threshold When, in the conditional probability matrix M m×l search for the highest probability price bin interval corresponding to the current bidding space feature, and use the average electricity prices on both sides of the interval as the corrected prediction value

[0054] S73, Correction and integration of full-time prediction results: Repeat the judgment of predicted electricity price correction for all moments of the prediction day, integrate the correction results of all moments, and generate the final day-ahead spot electricity price prediction sequence Y pred 。

[0055] A power spot price prediction system based on similar-day probability correction for implementing the above-mentioned power spot price prediction method based on similar-day probability correction, including the following modules:

[0056] Data acquisition module: Collect historical data required for model prediction and disclosed market information of the prediction day, including date, time, directly regulated load, tie-line received load, wind power, photovoltaic power, non-marketized nuclear power, test units, self-spare, local power plants, and day-ahead spot price;

[0057] Data preprocessing module: Extract features from historical data, perform normalization processing, and construct a data set;

[0058] Model training module: Train the LightGBM model and optimize the hyperparameters of the LightGBM model through the built-in Bayesian optimization algorithm;

[0059] Model prediction module: Predict the day-ahead spot price of the prediction day based on the trained LightGBM model;

[0060] Similar-day correction module: Generate a probability distribution matrix of the bidding space and electricity price based on the selected similar-day data with similar features to the prediction day, and correct the prediction value of the LightGBM model according to the matching relationship between the electricity price predicted by the LightGBM model and the bidding space to form the final prediction result.

[0061] Advantages of the present invention:

[0062] The present invention constructs a bidding space model that includes multi-source market data features, combines the structured time features of date and time, aggregates and standardizes the high-frequency data at 96 points per day, introduces the LightGBM model as the basic predictor, and uses the Bayesian algorithm for hyperparameter optimization, which effectively improves the model's fitting ability and generalization performance in complex market environments. At the same time, a similar day matching mechanism is designed, and the weighted Pearson coefficient is combined to screen out the most valuable historical periods from historical data, so that the model is closer to the actual market situation when constructing the prediction logic, thereby enhancing the stability and adaptability of electricity price trend modeling.

[0063] The present invention constructs an interval probability mapping relationship between the bidding space and the day-ahead electricity price, and corrects the basic prediction results based on the probability matrix, thereby effectively compensating for the deviation accumulation problem of the traditional prediction model in extreme electricity price scenarios. The correction process makes full use of the electricity price distribution characteristics of historical high-similarity dates, so that the model can maintain the overall prediction accuracy while improving the response ability to abnormal price fluctuations. Finally, through binning and probability judgment, the dynamic correction of the prediction value at each moment is achieved, thereby outputting a more robust day-ahead electricity price prediction sequence that is consistent with realistic constraints, thereby enhancing its practical value in strategic decision-making and risk control in the power market. BRIEF DESCRIPTION OF THE DRAWINGS

[0064] In order to more clearly illustrate the technical solutions in the present invention or the prior art, the following briefly introduces the drawings required for use in the embodiments or the description of the prior art. Obviously, the drawings described below are only for the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative work.

[0065] Figure 1 Schematic diagram of the prediction method flow in an embodiment of the present invention;

[0066] Figure 2 Schematic diagram of the hyperparameter optimization process of the LightGBM model based on the Bayesian algorithm in an embodiment of the present invention;

[0067] Figure 3 A schematic diagram showing a comparison of prediction effects according to an embodiment of the present invention;

[0068] Figure 4 Schematic diagram of the probability distribution of the matching between the bidding space and the electricity price range according to an embodiment of the present invention;

[0069] Figure 5 This is a schematic diagram of the revised prediction results according to an embodiment of the present invention;

[0070] Figure 6 Schematic diagram of system function modules according to an embodiment of the present invention. Detailed implementation manners

[0071] The present invention will be described in detail below with reference to the accompanying drawings and specific embodiments. It should be noted here that in order to make the embodiments more detailed, the following embodiments are the best and preferred embodiments. For some well-known technologies, those skilled in the art can also adopt other alternative methods for implementation; moreover, the accompanying drawings are only for more specifically describing the embodiments, and are not intended to specifically limit the present invention.

[0072] It should be pointed out that in the specification, when referring to "an embodiment", "embodiment", "exemplary embodiment", "some embodiments", etc., it indicates that the described embodiment may include specific features, structures or characteristics, but not necessarily every embodiment includes such specific features, structures or characteristics. Additionally, when combining an embodiment to describe a specific feature, structure or characteristic, implementing such feature, structure or characteristic in combination with other embodiments (whether explicitly described or not) should be within the knowledge scope of those skilled in the relevant art.

[0073] Generally, terms can be understood at least in part from their use in the context. For example, at least in part depending on the context, the term "one or more" used herein can be used to describe any feature, structure or characteristic in a singular sense, or can be used to describe a combination of features, structures or characteristics in a plural sense. Additionally, the term "based on" can be understood as not necessarily intended to convey a set of exclusive factors, but instead, at least in part depending on the context, allowing for the existence of other factors that may not be explicitly described.

[0074] As Figures 1 - 5 shown, a method for predicting electricity spot price based on similar-day probability correction includes the following steps:

[0075] S1: Obtain historical market information and day-ahead electricity spot price data of the day-ahead spot market through the power trading platform.

[0076] S11: The historical market information contains 96 data every day (one data every 15 minutes), constituting a historical dataset [date, time, load, line, wind, pv, nuc, sy, zb, loc] n×96 , where date represents the date, in the format of year-month-day, time represents the time, in the format of hour:minute, load represents the directly regulated load of the system, line represents the power receiving tie line, wind represents the wind power output, pv represents the photovoltaic power output, nuc represents the nuclear power output, sy represents the output of the test unit, zb represents the output of the self-provided power plant, loc represents the output of the local power plant, and p represents the day-ahead electricity spot price. n represents the number of days, with 96 data every day, and the total number of data is n×96, and n can take 365.

[0077] S12: Obtain the historical daily electricity spot price data p n×24 , and there are 24 pieces of electricity price data per day.

[0078] S2: According to the historical data obtained in S1, calculate the bidding space characteristics and time characteristics at each moment respectively. The calculation steps are as follows:

[0079] S21: Calculate the values at each moment in the following way to form the bidding space characteristic q:

[0080] q = load - lind - wind - pv - nuc - sy - zb - loc;

[0081] where load represents the directly regulated load of the system, line represents the power receiving tie line, wind represents the wind power output, pv represents the photovoltaic power output, nuc represents the nuclear power output, sy represents the output of the test unit, zb represents the output of the self - owned power plant, and loc represents the output of the local power plant.

[0082] S22: Process the date and time fields in the historical data set obtained in S1.

[0083] For the date data, its data format is YYYY - MM - DD (e.g., 2024 - 05 - 01), corresponding to year - month - day respectively. Extract the values of its year, month, and day to form independent year (y), month (m), and day (d) fields.

[0084] For the date data, judge whether it is a working day or a holiday. If the date range belongs to Monday to Friday, form an independent field is_wday and assign a value of 1, otherwise 0; if the date range belongs to any day in Chinese holidays (New Year's Day, Spring Festival, Tomb - Sweeping Day, Labor Day, Dragon Boat Festival, Mid - Autumn Festival, National Day), form an independent field is_hday and assign a value of 1, otherwise 0.

[0085] For the time data, its data format is HH:MM (e.g., 13:15), corresponding to hour: minute. Extract the data at the hour position to form an independent hour field (h).

[0086] S3: Pre - process the data and form a training set for the LightGBM model. The specific steps are as follows:

[0087] S31: Based on the feature data extracted in step S2, convert the 96 - point data per day into 24 - point data, and take the arithmetic mean of the 4 15 - minute data per hour as the representative value of that hour.

[0088] S32: The constructed feature engineering data is processed as input X, and the set of the day-ahead electricity spot price p is processed as output Y. The input part is recorded as X = (X1, X2, ..., X n ) T , the output part is recorded as Y=(Y1,Y2,…,Y n ) T Among them, X n The input of the feature data of the nth day of feature engineering is represented as follows:

[0089]

[0090] Y n The electricity spot price on the nth day is expressed as Y n =(p n×24+1 ,p n×24+2 ,…,p n×24+24 ) T .

[0091] S33: Normalize each column vector in X and Y respectively, and use the maximum and minimum method to normalize them to obtain the normalized X scaled and Y scaled , the normalization method is as follows:

[0092]

[0093] Where X′ is a column vector of X, min(X') is the minimum value of the column vector, and max(X') is the maximum value of the column vector.

[0094] S4: Train the LightGBM model. The specific steps are as follows:

[0095] S41: X obtained in step S3 scaled and Y scaled Divide into training set and test set, and the recommended ratio is 9:1. Use the regression algorithm in the LightGBM model to scaled and Y scaled Fitting the relationship between them.

[0096] S42: During the training process, the key hyperparameters in the LightGBM model are optimized to improve the model's fitting effect. The hyperparameters include the learning rate (learning_rate), the number of iterations (n_estimators), the maximum number of leaf nodes per decision tree (num_leaves), the maximum depth of the tree (max_depth), and the proportion of training data randomly sampled in each iteration (subsample). The search range is set for the above hyperparameters. When demarcating the hyperparameter range, it is formulated according to the following principles:

[0097] 1) Among them, the lower limit of 10 ensures the basic splitting ability, and the upper limit of 150 prevents overfitting.

[0098] 2) Among them, when the depth is less than 3, the model is underfitted, and when it is greater than 50, the computational complexity increases exponentially. Usually, num_leaves and max_depth satisfy the following formula:

[0099] 2 max_depth -1 ≥ num_leaves;

[0100] 3) learning_rate ∈ (0.005, 0.3);

[0101] 4)

[0102] 5) subsample ∈ [0.5, 1.0]. The lower limit of 0.5 ensures the effectiveness of bootstrap. When the sampling ratio ≥ 0.5, the Bootstrap subset can better retain the statistical characteristics of the original data.

[0103] S43: In multiple groups of combined parameter intervals, randomly select multiple groups of parameter combinations and apply them to the LightGBM model for fitting. Record the performance of each group of parameters, and use the Bayesian algorithm to iteratively optimize the hyperparameters of the model. This process can be implemented using the BayesianOptimization function in the python open-source library bayes_opt. Evaluate the parameter performance using the mean absolute error MAE:

[0104]

[0105] In the formula, T represents the number of time moments, represents the predicted price obtained by the LightGBM model at time t, represents the actual day-ahead spot price.

[0106] S44: Save the hyperparameters of LightGBM according to the optimization results of the Bayesian algorithm.

[0107] S5: Calculate the similarity coefficient between each day of the predicted day and the historical days, and use the weighted Pearson correlation coefficient for calculation. The specific steps are as follows:

[0108] S51: Select the basis for calculating the characteristics of similar days, and select the bidding space q, the directly regulated load of the system load, the power receiving tie line line, the wind power output wind, and the photovoltaic power output pv as the key characteristics.

[0109] S52: Extract Key feature columns in : S53: Obtain the key feature data of the prediction date, and standardize it using the normalization parameters in step S3 to obtain the feature matrix of the prediction date : S54: Calculate the features of the prediction date for each column in and the corresponding columns of each day in , where the calculation method is as follows: ; In the formula, is the weight value of the k-th feature similarity coefficient, with a range of [0, 1], used to characterize the contribution degree of this feature in the overall similarity calculation. The distribution of weights satisfies . In the case of the auction space q can be set to a larger weight value, and this weight parameter can be adjusted according to actual needs. represents the t-th element value in the k-th feature column of the n-th historical date feature matrix represents the n-th historical date feature matrix the arithmetic mean of all elements in the k-th feature column of represents the t-th element value of the k-th feature column of the prediction date, represents the arithmetic mean of all elements in the k-th feature column of the prediction date.

[0116] S6: In the process of calculating the volume-price distribution probability, proceed according to the following steps:

[0117] S61: Sort the elements in Corr from largest to smallest to form a new sequence corr_sort, obtain the indexes of the first g correlation coefficient values, and the value of g can be 30% of the total sample size. Form the index sequence I.

[0118] S62: Based on each index {i1, i2,..., i g}, extract the bidding space q and the day-ahead price p subset of the corresponding date to form a new bidding space sequence load and day-ahead price sequence price,

[0119]

[0120]

[0121] in, Indicates the i g The 24-hour bidding space sequence of the index day, Indicates that the i g The 24-hour day-ahead spot price for the index day.

[0122] S63: Divide the bidding space sequence load and electricity price sequence price into equal probability intervals through quantile discretization, and establish the conditional probability matrix M from each bidding space interval to the electricity price interval m×l .

[0123] First, construct the bidding space bin boundary set B load and the day-ahead electricity price bin boundary set B price as follows:

[0124] B load ={b i |b i =Q load (p i )},p i ∈{0,0+m,0+2m,...,1.0};

[0125] B price ={b i |b i =Q price (p i )},p i ∈{0,0+l,0+2l,...,1.0};

[0126] Where Q load (p i ) and Q price (p i ) are the pth percentiles of the sequence load and price, m and l are the number of bins. load and B price m bidding space intervals can be obtained and n price ranges According to the matching relationship between the bidding space and the day-ahead electricity price bin data, the conditional probability matrix M from each bidding space interval to the electricity price interval can be established. m×l , indicating the bidding space binning To the electricity price bin The conditional probability distribution, that is, when the bidding space is in the probability interval Inside, the price interval is in the probability interval The probability value inside, M m×l Each element inside can be expressed as:

[0127] And

[0128] S7: In the process of correcting the electricity price prediction result, execute according to the following steps:

[0129] S71: For the day-ahead spot price predicted by the LightGBM model at each moment At the same time, obtain the predicted bidding space sequence for the corresponding period For each period t∈[1,24], according to the bidding space bin boundary generated in step S6, determine The bin interval to which it belongs Extract the corresponding electricity price interval for this bin interval Probability π t ;

[0130] S72: Judge the predicted electricity price at each moment Compare the probability value π t With the preset threshold π threshold When π t ≥π threshold Keep the original predicted value Unchanged; when π t <π threshold Search for the highest probability price bin interval corresponding to the current bidding space feature in the probability matrix M m×l And use the average value of the electricity prices on both sides of its interval as the corrected predicted value

[0131] S73: Repeat step S72 for all moments of the predicted day, integrate the correction results of all moments, and generate the final day-ahead spot electricity price prediction sequence Y pred .

[0132] Example:

[0133] As mentioned above, it is only the preferred specific implementation manner of the present invention, but the protection scope of the present invention is not limited thereto. Any changes or substitutions that can be easily thought of by those skilled in the art within the technical scope disclosed by the present invention should be covered within the protection scope of the present invention. Therefore, the protection scope of the present invention should be subject to the protection scope of the claims.

[0134] In this embodiment, first, historical market information of the day-ahead spot market in a certain province is obtained through the power trading platform. The historical data obtained has a range of 1 year, and the format of the obtained data is shown in Table 1. The start and end times of each day are 00:15 and 24:00 respectively, with an interval of 15 minutes, and there are 96 numbers per day.

[0135] Table 1 Historical market data

[0136]

[0137] Historical day-ahead electricity price data of a certain province is obtained through the power trading platform. The obtained range corresponds to the historical market data, and the format of the obtained data is as shown in the following table. The start and end times of each day are 01:00 and 24:00 respectively, with an interval of 1 hour, and there are 24 numbers per day.

[0138] Table 2 Historical day-ahead electricity price data

[0139] data time p 2024-01-01 01:00 304.997 2024-01-01 02:00 293.25 2024-01-01 03:00 290.86 2024-01-01 04:00 291.965 …… …… …… 2024-01-01 24:00 278.317 …… …… …… 2024-12-31 24:00 147.06

[0140] Furthermore, feature extraction is performed on the obtained data. The bidding space feature at each moment is obtained through q = load - lind - wind - pv - nuc - sy - zb - loc. According to the feature engineering extraction method of the date, data of y, m, d, is_wday, and is_hday are extracted, and each piece of data is converted into feature data. Among them, y is the 4-digit year value corresponding to the date, m is the month value corresponding to the date (the month value corresponding to the date is extracted (1 - 12)), and d is the sequential day number of the date in that year. The format of the converted data is as follows:

[0141] Table 3 Data table after feature extraction

[0142] date time q y m d h is_wday is_hday 2024 / 1 / 1 0:15 26611.32262 2024 1 1 0 0 1 2024 / 1 / 1 0:30 25673.57343 2024 1 1 0 0 1 2024 / 1 / 1 0:45 25661.56146 2024 1 1 0 0 1 2024 / 1 / 1 1:00 25830.21576 2024 1 1 0 0 1 …… …… …… …… …… …… …… …… …… 2024 / 1 / 1 24:00 25742.3151 2024 1 1 23 0 1 …… …… …… …… …… …… …… …… …… 2024 / 12 / 31 24:00 20253.48535 2024 12 366 23 0 1

[0143] Furthermore, the feature data is processed. The arithmetic mean of the 4 15-minute data per hour is taken, and datasets are constructed respectively. According to the 1-year historical data in this embodiment, it can be divided into 366 datasets, and the format of each dataset is shown in Table 4:

[0144] Table 4 Example of a one-day dataset

[0145]

[0146] Furthermore, all datasets are normalized column by column. The range of the processed data is between 0 and 1, and the processed data is as follows:

[0147] Table 5 Normalized data

[0148]

[0149]

[0150] Parameter optimization is performed on the application of the Bayesian algorithm according to the set parameter range, and the parameter process is as Figure 2 shown. After 60 iterations, the parameter combination with the smallest MAE value (since the Bayesian algorithm aims at maximization, the opposite value is taken) is used as the prediction parameter of the LightGBM model. The value of the 29th iteration is the optimal value, where n_estimators = 66.54, learning_rate = 0.02543, num_leaves = 147.3, max_depth = 32.04, subsample = 0.5814. Among them, n_estimators, num_leaves, and max_depth are rounded down, and the final values are 66, 147, and 32 respectively.

[0151] Based on the optimized LightGBM, the electricity price of the prediction day is predicted. The market disclosure information of the prediction day is normalized based on the normalizer in S3, and then the LightGBM model is applied to predict the electricity spot price of the next day. Here, a comparison is made with the support vector machine regression (SVR) and random forest (RF) models (see Figure 3 ). The predicted MAE values are shown in Table 6. The lower the MAE, the better the prediction effect of the model. For this scenario, the LightGBM model is better than the SVR and RF models.

[0152] Table 6 Comparison of Model Prediction Results

[0153]

[0154]

[0155] Similar days are selected, and the similarity degrees of each feature between the prediction day and the historical days are calculated respectively. The features selected are the bidding space q, the directly regulated load of the system load, the receiving tie line line, the wind power output wind, and the photovoltaic output pv. The similarity is calculated using the Pearson correlation coefficient as shown in Table 7:

[0156] Table 7 Example of Feature Similarity Calculation

[0157]

[0158] Furthermore, weighted calculations are performed on each feature. The weights of each feature are taken as 0.7, 0.1, 0.1, 0.05, and 0.05 in turn. This weight can be adjusted according to the experience value of professional and technical personnel. The correlation coefficients after weighted calculation are sorted to obtain the top 100 similar dates, as shown in Table 8:

[0159] Table 8 Screened Similar Dates

[0160] rank similar date similarity score 1 2024-12-06 0.9210 2 2024-03-10 0.9160 3 2024-11-27 0.9153 …… …… …… 98 2024-09-01 0.7833 99 2024-12-15 0.7819 100 2024-12-17 0.7813

[0161] Furthermore, extract the bidding space q and the subset of the day-ahead price p corresponding to the similar days, and bin the sequence of the bidding space load and the sequence of electricity prices price separately. Assume that the number of bins for the bidding space and electricity prices are 50 and 50 respectively. According to the following formula, the conditional probability matrix M from each bidding space interval to the electricity price interval i,j , and the result is as shown in Figure 4 .

[0162]

[0163] Furthermore, match the bidding space at each moment with the probability binning result. Take the 12th moment of the prediction day as an example. The bidding space at this moment is 9612.9489, and the bidding space interval it belongs to is (9387.306, 10583.369]. The probability of the electricity price interval corresponding to the bidding space is as follows:

[0164] Table Probability of Electricity Price Interval Corresponding to Bidding Space

[0165] sorting electricity price range probability 1 (-83.31,-80.0] 31.63% 2 (-39.227,27.742] 8.71% 3 (27.742,71.89] 7.62% 4 (-80.0,-39.227] 6.20% 5 (-100.001,-83.31] 5.16% 6 (71.89,103.199] 5.10% 7 (103.199,140.819] 4.59% 8 (171.234,198.565] 3.06% 9 (198.565,223.728] 3.06% 10 (223.728,244.426] 2.04%

[0166] The predicted value of the LightGBM model at this moment is -30.22, which belongs to the price interval (-39.227, 27.742]. The probability corresponding to this interval is 8.71%, which is less than the set probability threshold of 10%. Then it is determined that the predicted value at this moment needs to be corrected. The correction value uses the average of both sides of the electricity price interval with the highest probability, that is, uses the average of 81.65 on both sides of the electricity price interval (-83.31, -80.0] ranked first to replace the original predicted value of -30.22. Similarly, other moments are corrected according to this logic, and the correction results are as follows:

[0167] Correction of Predicted Results at Each Moment

[0168]

[0169]

[0170] After calculation, the corrected predicted values are as shown in Figure 5 . Compared with the LightGBM and other methods, the overall prediction accuracy has been improved, and the MAE value has been reduced to 28.79. Especially in the extreme negative electricity price period (from the 11th moment to the 14th moment), the deviation value has been reduced from 49.78 to 1.65.

[0171] As shown in Figure 6As shown, a power spot price prediction system based on similar day probability correction is used to implement the above-mentioned power spot price prediction method based on similar day probability correction, and includes the following modules:

[0172] Data acquisition module: Collect historical data required for model prediction and disclosed market information on the prediction day, including date, time, directly regulated load, tie-line received load, wind power, photovoltaic power, non-marketized nuclear power, test units, self-spare, local power plants, and day-ahead spot price;

[0173] Data preprocessing module: Extract features from historical data, perform normalization processing, and construct a data set;

[0174] Model training module: Train the LightGBM model and optimize the hyperparameters of the LightGBM model through the built-in Bayesian optimization algorithm;

[0175] Model prediction module: Predict the day-ahead spot price on the prediction day based on the trained LightGBM model;

[0176] Similar day correction module: Based on the selected similar day data with similar characteristics to the prediction day, generate a probability distribution matrix of the bidding space and electricity price, and correct the prediction value of the LightGBM model according to the matching relationship between the electricity price predicted by the LightGBM model and the bidding space to form the final prediction result.

[0177] The present invention covers any substitutions, modifications, equivalent methods, and solutions made on the essence and scope of the present invention. In order to enable the public to have a thorough understanding of the present invention, specific details are described in detail in the following preferred embodiments of the present invention, and those skilled in the art can fully understand the present invention without these detailed descriptions. In addition, well-known methods, processes, procedures, components, and circuits are not described in detail to avoid unnecessary confusion to the essence of the present invention.

[0178] The above are only the preferred embodiments of the present invention. It should be noted that for those of ordinary skill in the art, without departing from the principle of the present invention, several improvements and refinements can be made, and these improvements and refinements should also be regarded as the protection scope of the present invention.

Claims

1. A method for predicting electricity spot price based on probability correction of similar days, characterized in that It includes the following steps: S1, Power data collection: Obtain historical market information and day-ahead power spot price data of the day-ahead spot market through the power trading platform; S2, Feature engineering construction: Conduct feature engineering construction on the collected power data, including bidding space features and time features; S3, Data preprocessing: Preprocess the collected power data and form a data set; S4, Model training: Divide the data set into a training set and a test set, train the LightGBM model, and optimize the hyperparameters in the LightGBM model using the Bayesian algorithm; S5, Similar day matching: Calculate the similarity coefficient between the prediction day and each historical day using the weighted Pearson correlation coefficient for similar day matching, and screen the k historical days with the highest similarity to the prediction day; S6. Interval probability distribution modeling of bidding space and day-ahead electricity price: Based on the selected k historical days, extract the 24-hour bidding space data sequence Q and the corresponding day-ahead electricity price data sequence P respectively, and perform percentile discretization processing on the data points in Q and P to generate m bidding space and l day-ahead electricity price bin boundary sets, and establish a probability mapping matrix M between the bidding space interval and the day-ahead electricity price interval m×l ; S7, Prediction result correction and final day-ahead electricity price prediction: Input the discretized bidding space data sequence Q and the corresponding day-ahead electricity price data sequence P at each moment into the trained LightGBM model, and output the preliminary price prediction sequence For the bidding space at each price corresponding moment, locate its bin interval in the probability mapping matrix M m×l Extract the electricity price probability corresponding to this bin, determine whether this probability is higher than the set threshold, correct the predicted price, and generate the final day-ahead spot electricity price prediction sequence Y by integrating the correction results of the predicted prices at all moments pred .

2. A method for predicting electricity spot price based on similarity day probability correction according to claim 1, characterized in that The power data collection in S1 includes: S11, Historical Market Information Data Collection: The historical market information for each day includes 96 data items, forming a historical data set [date, time, load, line, wind, pv, nuc, sy, zb, loc] n×96 , where date represents the date, time represents the time, load represents the directly regulated load of the system, line represents the power receiving tie line, wind represents the output of wind power, pv represents the output of photovoltaic power, nuc represents the output of nuclear power, sy represents the output of test units, zb represents the output of self - owned power plants, loc represents the output of local power plants, and n represents the number of days; S12, Electricity Spot Price Data Collection: Obtain historical day-ahead electricity spot price data p n×24 , and the day-ahead electricity spot price data includes 24 data every day.

3. A method for predicting electricity spot price based on similar day probability correction according to claim 2, characterized in that The feature engineering construction in S2 includes: S21, Bidding space feature calculation: Based on the collected historical market information data, calculate the bidding space feature q, expressed as: ; S22, Time feature processing: Process the date and time in the historical data set. For the date, its data format is YYYY-MM-DD, corresponding to year-month-day respectively. Extract the values of its year, month, and day to form independent year, month, and day fields. For the time, its data format is HH:MM, corresponding to hour:minute respectively. Extract the data at its hour position to form an independent hour field; The judgment of the date as a working day or a holiday includes: Working day judgment: If the date range belongs to Monday to Friday, form an independent field is_wday and assign a value of 1, otherwise 0; Holiday judgment: If the date range belongs to any day in Chinese holidays, form an independent field is_hday and assign a value of 1, otherwise 0.

4. A method for predicting electricity spot price based on similar day probability correction according to claim 3, characterized in that The data preprocessing in S3 includes: S31, Data aggregation and hourly representative value calculation: Based on the constructed feature engineering, convert the 96 data of each day into 24-point data, and take the arithmetic mean of the 4 15-minute data of each hour as the representative value of that hour; S32, input and output data set construction: feature engineering is processed into input X, denoted as X = (X1, X2, ..., X n ) T , where X n The input of the feature data of the nth day of feature engineering is formed, and the set of the day-ahead electricity spot price p is processed into the output Y, which is recorded as Y = (Y1, Y2, ..., Y n ) T , where Y n represents the day-ahead electricity spot price on day n; S33, Normalization processing: The maximum-minimum method is used to perform normalization processing on each column vector in X and Y, and the normalized X scaled and Y scaled .

5. A method for predicting electricity spot price based on similar day probability correction according to claim 4, characterized in that, The model training in S4 includes: S41, Dataset Partitioning and Model Fitting: The normalized X scaled and Y scaled are partitioned into a training set and a test set, and the relationship between X scaled and Y scaled is fitted through the regression algorithm in the LightGBM model; S42, Hyperparameter optimization: Optimize the hyperparameters in the LightGBM model. The hyperparameters include learning rate, number of iterations, maximum number of leaf nodes of each decision tree, maximum depth of the tree, and proportion of training data randomly sampled in each round of iteration, and set the search interval for the hyperparameters; S43, Bayesian algorithm optimization and performance evaluation: Randomly select and apply multiple groups of hyperparameter combinations to the LightGBM model for fitting, record the performance of each group of parameters, use the Bayesian algorithm to iteratively optimize the hyperparameters, and evaluate the performance of the LightGBM model by calculating the mean absolute error; S44, Hyperparameter saving: Save the hyperparameters of the LightGBM according to the optimization results of the Bayesian algorithm.

6. A method for predicting electricity spot price based on similar day probability correction according to claim 5, characterized in that The similar day matching in S5 includes: S51, Similar day feature selection: Select the feature calculation basis for similar days, including selecting the bidding space q, system directly regulated load load, power receiving tie line line, wind power output wind, and photovoltaic power output pv; S52, Historical Day Feature Matrix Extraction: Extract the bidding space features and time features in X scaled to generate n historical day feature matrices C according to the number of days n ; S53, Standardization of predicted day feature data: Obtain the bidding space features and time features of the predicted day, and perform normalization processing using the maximum-minimum method to obtain the predicted day feature matrix P; S54, Similarity calculation and weighted summation: Calculate the correlation coefficient of each column in the predicted day feature P with the corresponding column of each day in C n and perform weighted summation on the calculated correlation coefficients to form a comprehensive similarity coefficient sequence Corr = (corr1, corr2,..., corr n ) for each day between the predicted day and historical days, expressed as: Among them, δ k is the weight value of the k-th feature similarity coefficient, represents the t-th element value in the k-th feature column of the feature matrix C on the n-th historical day n in the feature matrix C, represents the arithmetic mean of all elements in the k-th feature column of the feature matrix C on the n-th historical day n P, k,t represents the t-th element value in the k-th feature column on the prediction day, represents the arithmetic mean of all elements in the k-th feature column on the prediction day.

7. A method for predicting electricity spot price based on similar day probability correction according to claim 6, characterized in that, The interval probability distribution modeling of the bidding space and the day-ahead electricity price in S6 includes: S61, Similarity ranking and index selection: Sort the elements in Corr in descending order to form a new sequence corr_sort, and obtain the indexes of the first g correlation coefficient values to form an index sequence I; S62, Extract the bid space and electricity price subsets for similar dates: Based on each index {i1, i2, …, i g} in the index sequence I, extract the bid space q and the subset of day-ahead electricity spot price data p for the corresponding dates to form a new bid space sequence load and a day-ahead price sequence price; S63, Probability distribution modeling: By discretizing quantiles, the bidding space sequence load and the day-ahead price sequence price are respectively divided into equal-probability intervals, and a conditional probability matrix M from each bidding space interval to the electricity price interval is established. m×l .

8. A method for predicting electricity spot price based on similar day probability correction according to claim 7, characterized in that The probability distribution modeling in S63 includes: S631. Construct the bidding space and the set of electricity price bin boundaries: Construct the set of bidding space bin boundaries B load and the set of day-ahead electricity price bin boundaries B price , which is expressed as: B load = {b i | b i = Q load (p i )}, p i ∈ {0, 0 + m, 0 + 2m,..., 1.0}; B price = {b i | b i = Q price (p i )}, p i ∈ {0, 0 + l, 0 + 2l,..., 1.0}; Among them, Q load (p i ) and Q price (p i ) are the p-th percentiles of the sequences load and price respectively, and m and l are the number of bins respectively; S632, Matching the bid space interval and the electricity price interval: According to the bin boundary B load and B price , match the m bid space intervals and the n price intervals to generate the matching relationship between the bid space interval and the electricity price interval; S633. Establish a conditional probability matrix: According to the matching relationship between the bidding space and the bin data of the day-ahead electricity price, establish a conditional probability matrix M from each bidding space interval to the electricity price interval. m×l , M m×l The elements in it are expressed as: and 9. A method for predicting electricity spot price based on similarity day probability correction according to claim 8, characterized in that, The prediction result correction and final electricity price prediction in S7 include: S71, Predict price and bid space matching: For the day-ahead spot price predicted by the LightGBM model at each moment Meanwhile, obtain the predicted bid space sequence for the corresponding period For each period t ∈ [1, 24], determine according to the generated bid space bin boundaries The belonging bin interval Extract the corresponding electricity price interval of this bin interval The probability π t ; S72, Prediction electricity price correction judgment: For the predicted electricity price at each moment make a determination, and compare the probability value π t with the preset threshold π threshold When π t ≥ π threshold , keep the original predicted value unchanged. When π t < π threshold , search for the highest probability price bin interval corresponding to the current bidding space feature in the conditional probability matrix M m×l , and use the average electricity prices on both sides of the interval as the corrected predicted value S73, Correction and Integration of Full-Time Prediction Results: Repeatedly judge the correction of the predicted electricity price for all moments of the prediction day, integrate the correction results of all moments, and generate the final day-ahead spot electricity price prediction sequence Y pred 。 10. A power spot price prediction system based on similar day probability correction, which is used to implement a power spot price prediction method based on similar day probability correction according to any one of claims 1-9, characterized in that, Include the following modules: Data acquisition module: Collect historical data required for model prediction and disclosed market information on the predicted day, including date, time, directly regulated load, power receiving load of the tie line, wind power, photovoltaic power, non-marketized nuclear power, test units, self-spare, local power plants, and day-ahead spot price; Data preprocessing module: Extract features from historical data, perform normalization processing, and construct a data set; Model training module: Train the LightGBM model and optimize the hyperparameters of the LightGBM model through the built-in Bayesian optimization algorithm; Model prediction module: Predict the day-ahead spot price on the predicted day based on the trained LightGBM model; Similar day correction module: Based on the selected similar day data with similar features to the predicted day, generate a probability distribution matrix of the bidding space and the electricity price, and correct the predicted value of the LightGBM model according to the matching relationship between the electricity price predicted by the LightGBM model and the bidding space to form the final prediction result.

Citation Information

Cited By

  • Distributed photovoltaic power distribution network shared energy storage optimization method

    CN120914866A

  • Electric power spot day-ahead electricity price prediction method based on bidding space analysis

    CN121526688A

  • Similar day retrieval method and device, computer equipment, storage medium and product

    CN121614522A

  • Similar day retrieval method and device, computer device, storage medium and product

    CN121614522B