A power spot market short-term electricity price prediction method, system, device and medium based on multi-scale decomposition and heterogeneous model fusion
Patent Information
- Application Number
- CN202611013273.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-07-08
- Publication Date
- 2026-10-23
AI Technical Summary
[0004]本发明针对电力现货市场短期电价预测方法在处理非平稳、非线性、高波动性和多尺度特征电价序列时存在的预测精度不足、模型适配性不强、对价格突变响应能力有限以及预测稳定性较差的问题,提供一种基于多尺度分解和异构模型融合的电力现货市场短期电价预测方法、系统、设备及介质;该方法通过对原始现货电价序列进行自适应分解,提取不同频率尺度下的波动成分,并依据分量复杂度对分解结果进行分类,再针对不同类别分量分别构建相适应的预测模型,最终通过分量预测结果重构得到短期电价预测值,从而提高现货电价预测的准确性、稳定性和对复杂市场波动的适应能力
(1) 本发明通过CEEMDAN自适应分解、排列熵下降比自动分类、Transformer与SARIMA异构模型分别预测、分量预测结果加权融合重构的技术路线,将复杂的现货电价预测问题转化为多个不同频率尺度分量的针对性预测问题。
Smart Images

Figure CN122965738A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of electricity price forecasting technology, and more specifically, to a method, system, device, and medium for forecasting short-term electricity prices in the electricity spot market based on multi-scale decomposition and heterogeneous model fusion. Background Technology
[0002] As the electricity market trading mechanism continues to improve, electricity retailers, as key market players connecting the wholesale market and electricity users, are gradually shifting their business models from traditional electricity agency services to comprehensive services including market-based electricity purchase and sale transactions and risk control. In the electricity spot market, electricity prices more directly reflect the electricity supply and demand status and system operation characteristics at different times and in different regions. Especially against the backdrop of continuously expanding renewable energy capacity, more complex user-side electricity consumption behavior, and increasingly diversified market participant bidding strategies, the correlation between spot electricity prices and renewable energy output, system load, unit operating status, transmission constraints, market supply and demand, and trading behavior is becoming closer, significantly increasing price volatility and uncertainty. For electricity retailers, short-term electricity price forecasting is crucial for formulating day-ahead and intraday electricity purchase strategies, optimizing the combination of medium- and long-term contracts and spot transactions, conducting user-side bidding, assessing deviation electricity risks, arranging energy storage charging and discharging plans, and implementing demand response management. If short-term spot electricity price changes cannot be accurately predicted, electricity retailers may face problems such as increased electricity purchase costs, fluctuating electricity sales revenue, increased contract performance risks, and decreased effectiveness of user energy management. Because spot electricity price sequences typically exhibit significant non-stationarity, non-linearity, high volatility, periodicity, and spikes, accurately depicting the complex changing patterns of spot electricity prices, and improving the accuracy, stability, and responsiveness to price fluctuations in short-term price forecasts, has become a crucial technical challenge for electricity retailers participating in the spot electricity market, optimizing their power purchase and sale decisions, and enhancing their market competitiveness, all while considering their operational decision-making and risk control needs.
[0003] In summary, while existing short-term electricity price forecasting technologies have developed into various schemes, including statistical time series models, traditional machine learning models, deep learning models, signal decomposition models, combined forecasting models, and rolling forecasting models, they still generally suffer from problems when dealing with complex electricity price sequences in the electricity spot market. These problems include insufficient handling of non-stationarity and multi-scale fluctuations, the inability of a single model to simultaneously account for high-frequency peaks and low-frequency trends, the lack of objective classification criteria for decomposed components, insufficient matching between model and component features, and low stability of forecast results. Therefore, it is necessary to propose a short-term electricity price forecasting method that can adaptively decompose the electricity price sequence, identify and automatically classify the complexity of the decomposed components, and select differentiated forecasting models based on the dynamic characteristics of different components. This would improve the accuracy, robustness, and engineering applicability of short-term electricity price forecasting in the electricity spot market. Summary of the Invention
[0004] This invention addresses the shortcomings of current short-term electricity price forecasting methods in the electricity spot market, such as insufficient prediction accuracy, poor model adaptability, limited response to price fluctuations, and poor prediction stability when dealing with non-stationary, nonlinear, highly volatile, and multi-scale characteristic price sequences. It provides a method, system, device, and medium for short-term electricity price forecasting in the electricity spot market based on multi-scale decomposition and heterogeneous model fusion. This method adaptively decomposes the original spot price sequence, extracts fluctuation components at different frequency scales, classifies the decomposition results according to component complexity, constructs appropriate prediction models for different component categories, and finally reconstructs the short-term electricity price forecast value through component prediction results. This improves the accuracy, stability, and adaptability to complex market fluctuations in spot price forecasting.
[0005] The specific implementation details of this invention are as follows: A method for predicting short-term electricity prices in the electricity spot market based on multi-scale decomposition and heterogeneous model fusion specifically includes the following steps: Step S1: Preprocess the acquired historical hourly electricity price data; Step S2: Adaptively decompose the preprocessed electricity price sequence using CEEMDAN to obtain the IMF component; Step S3: Calculate the permutation entropy of the IMF components, and identify the high-frequency components, mid-frequency components, low-frequency components, and residual terms based on the permutation entropy decrease ratio; Step S4: Input the high-frequency components and intermediate-frequency components into the constructed Transformer model to predict the high-frequency component prediction sequence and the intermediate-frequency component prediction sequence; Step S5: Input the low-frequency component and residual term into the constructed seasonal autoregressive integral moving average model to obtain the low-frequency component prediction sequence and the residual component prediction sequence. Step S6: Fuse and reconstruct the high-frequency component prediction sequence, the medium-frequency component prediction sequence, the low-frequency component prediction sequence, and the residual component prediction sequence to obtain the electricity price prediction value.
[0006] To better realize the present invention, step S1 further includes the following steps: Step S11: Obtain historical hourly electricity price data from the electricity spot market trading system, price release platform, or historical database to obtain the original electricity price sequence; Step S12: Determine whether there are missing values in the obtained original electricity price sequence. If there are missing values in the current electricity price and the electricity price data of the adjacent times are complete, then use linear interpolation to complete the original electricity price sequence. If there are missing values in the electricity price at consecutive times, then complete the original electricity price sequence based on the average electricity price of the same hour on a historical day. Step S13: Based on the set sliding window, calculate the standard deviation of electricity price within the sliding window corresponding to the current time after completion, identify abnormal candidate points, and call interpolation or similar daily average value correction. Step S14: Calculate the mean and standard deviation of the corrected original electricity price series, and convert it into a normalized electricity price series.
[0007] To better realize the present invention, step S2 further includes the following steps: Step S21: Add white noise to the normalized electricity price sequence according to the set noise amplitude coefficient to obtain a noisy electricity price sequence; Step S22: Perform EMD decomposition on the noisy electricity price sequence to obtain IMF components, and extract the residuals from the IMF components; Step S23: If the number of extreme points of the current residual is less than 2 or the residual no longer meets the IMF decomposition conditions, then stop the decomposition and obtain the decomposition result.
[0008] To better realize the present invention, step S3 further includes the following steps: Step S31: Based on the set embedding dimension, delay time, and IMF components, obtain the phase space reconstruction vector constructed from the current IMF components; Step S32: Sort the elements of the phase space reconstructed vector in ascending order according to their numerical values to obtain the corresponding arrangement pattern; Step S33: Calculate the probability of the permutation pattern appearing based on the number of times the permutation pattern appears and the total number of reconstructed vectors; Step S34: Calculate the permutation entropy of the IMF components based on the probability of the permutation pattern, and normalize it to obtain the normalized permutation entropy; Step S35: Based on the set minimum positive number, the normalized permutation entropy of the current IMF component, and the normalized permutation entropy of the adjacent IMF components, calculate the permutation entropy decrease ratio of the adjacent IMF components, and take the two positions with the largest permutation entropy decrease ratio as the classification boundary. Step S36: Based on the set threshold and classification boundary, obtain the high-frequency component set, the mid-frequency component set, the low-frequency component set, and the residual term set.
[0009] To better realize the present invention, step S4 further includes the following steps: Step S41: Map the high-frequency components and intermediate-frequency components to... The initial input to the Transformer model is obtained from the 3D space. Step S42: Calculate the query matrix Q, key matrix K, and value matrix V based on the initial input, and call the normalized exponential function to obtain the scaling point attention; Step S43: Obtain multi-head attention based on the scaling point attention and the number of attention heads; Step S44: Based on the multi-head attention, the weight matrix of the feedforward network, the bias vector of the feedforward network, and the feedforward neural network function, call the layer normalization function to obtain the hidden output; Step S45: Based on the hidden output, call the fully connected layer to obtain the high-frequency component prediction sequence and the mid-frequency component prediction sequence.
[0010] According to claim 1, the method for predicting short-term electricity prices in the electricity spot market based on multi-scale decomposition and heterogeneous model fusion is characterized in that step S5 specifically includes the following steps: Step S51: Construct the SARIMA model based on the non-seasonal autoregressive order, non-seasonal difference order, non-seasonal moving average order, seasonal autoregressive order, seasonal difference order, seasonal moving average order, seasonal cycle, set lag operator, random error term, and seasonal lag operator. Step S52: Based on the SARIMA model, low-frequency components, and residual terms, obtain the low-frequency component prediction sequence and the residual component prediction sequence.
[0011] To better realize the present invention, step S6 further includes the following steps: Step S61: Calculate the prediction errors of high-frequency components, mid-frequency components, low-frequency components, and residual terms, and calculate the fusion weights based on the prediction errors; Step S62: Based on the fusion weight, high-frequency component prediction sequence, medium-frequency component prediction sequence, low-frequency component prediction sequence, and residual component prediction sequence, obtain the normalized electricity price prediction value. Step S63: Based on the mean of the original electricity price series, the standard deviation of the original electricity price series, and the normalized electricity price prediction value, reverse normalize to obtain the actual electricity price prediction series.
[0012] Based on the aforementioned method for predicting short-term electricity prices in the electricity spot market based on multi-scale decomposition and heterogeneous model fusion, and to better realize this invention, a further proposed system for predicting short-term electricity prices in the electricity spot market based on multi-scale decomposition and heterogeneous model fusion is provided to execute the aforementioned method for predicting short-term electricity prices in the electricity spot market based on multi-scale decomposition and heterogeneous model fusion. This system includes a preprocessing unit, a decomposition unit, a classification unit, a first prediction unit, a second prediction unit, and a fusion output unit. The preprocessing unit is used to preprocess the acquired historical hourly electricity price data; The decomposition unit is used to adaptively decompose the preprocessed electricity price sequence using CEEMDAN to obtain the IMF component. The classification unit is used to calculate the permutation entropy of the IMF components and identify the high-frequency components, mid-frequency components, low-frequency components, and residual terms based on the permutation entropy decrease ratio. The first prediction unit is used to input high-frequency components and mid-frequency components into the constructed Transformer model to predict high-frequency component prediction sequences and mid-frequency component prediction sequences; The second prediction unit is used to input the low-frequency component and the residual term into the constructed seasonal autoregressive integral moving average model to obtain the low-frequency component prediction sequence and the residual component prediction sequence. The fusion output unit is used to fuse and reconstruct the high-frequency component prediction sequence, the medium-frequency component prediction sequence, the low-frequency component prediction sequence, and the residual component prediction sequence to obtain the electricity price prediction value.
[0013] Based on the above-mentioned method for predicting short-term electricity prices in the electricity spot market based on multi-scale decomposition and heterogeneous model fusion, in order to better realize the present invention, an electronic device is further proposed, including a memory and a processor; a computer program is stored in the memory; when the computer program is executed on the processor, the above-mentioned method for predicting short-term electricity prices in the electricity spot market based on multi-scale decomposition and heterogeneous model fusion is realized.
[0014] Based on the aforementioned method for predicting short-term electricity prices in the electricity spot market based on multi-scale decomposition and heterogeneous model fusion, to better realize this invention, a computer-readable storage medium is further proposed, on which computer instructions are stored; when the computer instructions are executed on the aforementioned electronic device, the aforementioned method for predicting short-term electricity prices in the electricity spot market based on multi-scale decomposition and heterogeneous model fusion is realized.
[0015] The present invention has the following beneficial effects: (1) This invention transforms the complex spot electricity price prediction problem into a targeted prediction problem with multiple components of different frequency scales by using the technical route of CEEMDAN adaptive decomposition, automatic classification of permutation entropy reduction ratio, prediction by Transformer and SARIMA heterogeneous models respectively, and weighted fusion reconstruction of component prediction results.
[0016] (2) This invention can utilize the Transformer's ability to model complex nonlinear fluctuations at high and medium frequencies, and the SARIMA's ability to stably predict low-frequency trends and residual periodic changes. By integrating the prediction results of each component through a weighted fusion method, it can improve the accuracy, stability, robustness and adaptability to complex market fluctuations in the short-term electricity price forecast of the electricity spot market. Attached Figure Description
[0017] Figure 1This is a schematic flowchart of the method for predicting short-term electricity prices in the electricity spot market based on multi-scale decomposition and heterogeneous model fusion provided by the present invention. Detailed Implementation
[0018] To more clearly illustrate the technical solutions of the embodiments of the present invention, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. It should be understood that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments, and therefore should not be regarded as a limitation on the scope of protection. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0019] In the description of this invention, it should be noted that, unless otherwise explicitly specified and limited, the terms "set up," "connected," and "linked" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; and they can refer to the internal connection of two components. Those skilled in the art can understand the specific meaning of the above terms in this invention based on the specific circumstances.
[0020] Example 1: This embodiment proposes a method for predicting short-term electricity prices in the electricity spot market based on multi-scale decomposition and heterogeneous model fusion, specifically including the following steps: Step S1: Preprocess the acquired historical hourly electricity price data; Step S1 specifically includes the following steps: Step S11: Obtain historical hourly electricity price data from the electricity spot market trading system, price release platform, or historical database to obtain the original electricity price sequence; Step S12: Determine whether there are missing values in the obtained original electricity price sequence. If there are missing values in the current electricity price and the electricity price data of the adjacent times are complete, then use linear interpolation to complete the original electricity price sequence. If there are missing values in the electricity price at consecutive times, then complete the original electricity price sequence based on the average electricity price of the same hour on a historical day. Step S13: Based on the set sliding window, calculate the standard deviation of electricity price within the sliding window at the current time, identify abnormal candidate points, and call interpolation or similar daily average value correction. Step S14: Calculate the mean and standard deviation of the corrected original electricity price series, and convert it into a normalized electricity price series.
[0021] Step S2: Adaptively decompose the preprocessed electricity price sequence using CEEMDAN to obtain the IMF component; Step S2 specifically includes the following steps: Step S21: Add white noise to the normalized electricity price sequence according to the set noise amplitude coefficient to obtain a noisy electricity price sequence; Step S22: Perform EMD decomposition on the noisy electricity price sequence to obtain IMF components, and extract the residuals from the IMF components; Step S23: If the number of extreme points of the current residual is less than 2 or the residual no longer meets the IMF decomposition conditions, then stop the decomposition and obtain the decomposition result.
[0022] Step S3: Calculate the permutation entropy of the IMF components, and identify the high-frequency components, mid-frequency components, low-frequency components, and residual terms based on the permutation entropy decrease ratio; Step S3 specifically includes the following steps: Step S31: Based on the set embedding dimension, delay time, and IMF components, obtain the phase space reconstruction vector constructed from the current IMF components; Step S32: Sort the elements of the phase space reconstructed vector in ascending order according to their numerical values to obtain the corresponding arrangement pattern; Step S33: Calculate the probability of the permutation pattern appearing based on the number of times the permutation pattern appears and the total number of reconstructed vectors; Step S34: Calculate the permutation entropy of the IMF components based on the probability of the permutation pattern, and normalize it to obtain the normalized permutation entropy; Step S35: Based on the set minimum positive number, the normalized permutation entropy of the current IMF component, and the normalized permutation entropy of the adjacent IMF components, calculate the permutation entropy decrease ratio of the adjacent IMF components, and take the two positions with the largest permutation entropy decrease ratio as the classification boundary. Step S36: Based on the set threshold and classification boundary, obtain the high-frequency component set, the mid-frequency component set, the low-frequency component set, and the residual term set.
[0023] Step S4: Input the high-frequency components and intermediate-frequency components into the constructed Transformer model to predict the high-frequency component prediction sequence and the intermediate-frequency component prediction sequence; Step S4 specifically includes the following steps: Step S41: Map the high-frequency components and intermediate-frequency components to... The initial input to the Transformer model is obtained from the 3D space. Step S42: Calculate the query matrix Q, key matrix K, and value matrix V based on the initial input, and call the normalized exponential function to obtain the scaling point attention; Step S43: Obtain multi-head attention based on the scaling point attention and the number of attention heads; Step S44: Based on the multi-head attention, the weight matrix of the feedforward network, the bias vector of the feedforward network, and the feedforward neural network function, call the layer normalization function to obtain the hidden output; Step S45: Based on the hidden output, call the fully connected layer to obtain the high-frequency component prediction sequence and the mid-frequency component prediction sequence.
[0024] Step S5: Input the low-frequency component and residual term into the constructed seasonal autoregressive integral moving average model to obtain the low-frequency component prediction sequence and the residual component prediction sequence. Step S5 specifically includes the following steps: Step S51: Construct the SARIMA model based on the non-seasonal autoregressive order, non-seasonal difference order, non-seasonal moving average order, seasonal autoregressive order, seasonal difference order, seasonal moving average order, seasonal cycle, set lag operator, random error term, and seasonal lag operator. Step S52: Based on the SARIMA model, low-frequency components, and residual terms, obtain the low-frequency component prediction sequence and the residual component prediction sequence.
[0025] Step S6: Fuse and reconstruct the low-frequency component prediction sequence and the residual component prediction sequence to obtain the electricity price prediction value.
[0026] Step S6 specifically includes the following steps: Step S61: Calculate the prediction errors of high-frequency components, mid-frequency components, low-frequency components, and residual terms, and calculate the fusion weights based on the prediction errors; Step S62: Based on the fusion weight, high-frequency component prediction sequence, medium-frequency component prediction sequence, low-frequency component prediction sequence, and residual component prediction sequence, obtain the normalized electricity price prediction value. Step S63: Based on the mean of the original electricity price series, the standard deviation of the original electricity price series, and the normalized electricity price prediction value, reverse normalize to obtain the actual electricity price prediction series.
[0027] Working principle: This embodiment adaptively decomposes the original spot electricity price sequence, extracts the fluctuation components at different frequency scales, classifies the decomposition results according to the component complexity, and then constructs corresponding prediction models for different categories of components. Finally, the short-term electricity price forecast is obtained by reconstructing the component prediction results, thereby improving the accuracy, stability and adaptability of spot electricity price forecasts to complex market fluctuations.
[0028] Example 2: This embodiment is based on the above embodiment 1, such as... Figure 1 As shown, a specific embodiment will be described in detail.
[0029] This embodiment first employs an adaptive noise complete ensemble empirical mode decomposition method to decompose the original electricity price sequence, obtaining multiple intrinsic mode components and residual terms at different frequency scales. Then, it introduces the permutation entropy reduction ratio as a component complexity criterion, automatically classifying the decomposed components into high-frequency, mid-frequency, low-frequency components and residual terms. For high-frequency and mid-frequency components, a Transformer model is used for prediction; for low-frequency components and residual terms, a seasonal autoregressive integral moving average (SARIMA) model is used for prediction. Finally, the prediction results of each component are fused and reconstructed to obtain the final electricity price prediction value. The specific process is as follows: Step 1: Obtain electricity price data Historical hourly electricity price data is obtained from the electricity spot market trading system, price release platform, or historical database. After reading the data, the electricity prices are arranged in chronological order. The continuity of timestamps is checked. If there are duplicate timestamps, the final clearing price of the same timestamp is retained. If there are missing timestamps, they are filled in during subsequent preprocessing steps.
[0030] Let the original electricity price sequence be: ,
[0031] In the formula: This represents the electricity price for hour t. This represents the total number of historical samples.
[0032] The forecasting objective is to predict the electricity price for the next U hours based on historical electricity price sequences: ,
[0033] In the formula: Indicates from the first Hours to the Hourly predicted electricity price sequence; Indicates the future number Hourly predicted electricity price; Indicates the predicted value; This indicates the prediction step size.
[0034] Step 2: Preprocess the raw electricity price data Because raw spot electricity price data may contain missing values, collection errors, and outliers, preprocessing of the price series is necessary before decomposition and prediction. The purpose of preprocessing is to improve data quality and reduce the impact of data anomalies on model training and prediction results.
[0035] (1) Handling missing values: When electricity price data is missing, different imputation methods need to be selected based on the degree of missing data. For a small number of missing points, interpolation between adjacent hours can be used; for multiple consecutive hours of missing data, data from the same hour on similar historical days can be used for imputation.
[0036] If the electricity price for hour t is missing, but the data for adjacent time periods are complete, then linear interpolation is used:
[0037] If there are many consecutive missing hours, the average electricity price for the same hour on similar historical days will be used:
[0038] In the formula: N represents the number of historically similar days selected; This represents the electricity price for the same hour on the j-th day preceding hour t.
[0039] (2) Outlier identification and handling: A sliding window method is used to identify outlier candidate points. Let the length of the sliding window be... Select 24 or 168, which correspond to hourly data for one day or one week, respectively.
[0040] The window mean is:
[0041] In the formula: This represents the average electricity price within the sliding window corresponding to hour t; i represents the time index within the sliding window. This represents the electricity price for the i-th hour.
[0042] The window standard deviation is:
[0043] In the formula: This represents the standard deviation of electricity prices within the sliding window corresponding to hour t.
[0044] If the following conditions are met:
[0045] Then Let k be an abnormal candidate point, where k is 3.
[0046] For abnormal candidate points, if they are significantly inconsistent with the upper and lower limits of market prices, price changes in adjacent time periods, and price differences in the same hour in history, and there is no corresponding market fluctuation reason, they are judged as data errors and corrected by interpolation or similar daily averages.
[0047] For actual peak electricity prices, negative electricity prices, or drastically fluctuating electricity prices, these should be retained without smoothing to avoid weakening the model's ability to learn from highly volatile features.
[0048] (3) Normalization process: Calculate the mean and standard deviation of the original electricity price series:
[0049]
[0050] In the formula: This represents the average value of the original electricity price series P; This represents the standard deviation of the original electricity price series P.
[0051] The preprocessed electricity price series, after imputation and outlier removal, is converted into a normalized series:
[0052] In the formula: This represents the normalized electricity price for the t-th hour.
[0053] The normalized electricity price sequence is denoted as: ,
[0054] Step 3: Adaptive decomposition of the electricity price series using CEEMDAN First, white noise is added to the normalized electricity price series:
[0055] In the formula: Represents the normalized electricity price series; This represents the noisy electricity price sequence after the b-th addition of white noise; This represents the white noise added in the b-th iteration. B represents the set degree; This is the noise amplitude coefficient.
[0056] Then, EMD decomposition is performed on each noisy sequence to extract the first-order IMF, and the average of all ensemble results is calculated:
[0057] In the formula: Indicates the first IMF component; This indicates the operation of extracting the first-order IMF after performing EMD decomposition on the sequence within the brackets.
[0058] The first-order residual is:
[0059] In the formula: This represents the first-order residual obtained after extracting the first-order IMF.
[0060] Continue iteratively to extract subsequent IMF components:
[0061] In the formula: This represents the i-th IMF component; i represents the IMF component number. ; This represents the residual sequence remaining after extracting the (i-1)th IMF component. Represents white noise The i-th order IMF component obtained after EMD decomposition.
[0062] The corresponding residual is:
[0063] In the formula: This represents the i-th order residual obtained after extracting the i-th IMF component.
[0064] When the number of extreme points in the residual term is less than 2, or the residual no longer satisfies the IMF decomposition conditions, stop the decomposition and set:
[0065] In the formula: Indicates the final residual term; This represents the residual remaining after extracting the Kth IMF; K represents the total number of IMF components obtained in the end.
[0066] Finally, the decomposition result is expressed as:
[0067] Step 4: Calculate the permutation entropy of each IMF component and classify them based on the permutation entropy decrease ratio. Different IMF components have varying degrees of complexity. High-frequency components are typically more random and volatile, while low-frequency components are generally more stable and trend-based. The IMF components obtained from CEEMDAN decomposition are usually arranged from high to low frequency, and the complexity varies between adjacent components. If the permutation entropy between two adjacent components decreases significantly, it indicates a large difference in their complexity, which can serve as a boundary for component classification. Therefore, to achieve automatic classification of each component, this step first calculates the permutation entropy of each IMF component to measure its complexity; then, it introduces the permutation entropy decrease ratio to automatically identify the division positions of high-frequency, mid-frequency, and low-frequency components.
[0068] Let the i-th IMF component be:
[0069] Phase space reconstruction of this component:
[0070] In the formula: m is the embedding dimension, ; To delay time, ; The phase space reconstruction vector constructed for the i-th IMF component at the j-th position; Let be the value of the i-th component at time j; j is the starting position of the reconstructed vector. Delay from position j Component values at each time point; This is the last element in the reconstructed vector.
[0071] For each reconstructed vector The elements in the array are sorted in ascending order of their numerical values to obtain the corresponding permutation patterns. When the embedding dimension is m, there are at most m! permutation patterns.
[0072] Let the probability of the l-th permutation pattern appear be:
[0073] In the formula: Let A represent the number of times the l-th permutation pattern appears; let A represent the total number of reconstructed vectors; and let l represent the permutation pattern number. .
[0074] The permutation entropy of the i-th IMF component is:
[0075] The normalized permutation entropy is:
[0076] In the formula: This represents the normalized permutation entropy of the i-th IMF component. .
[0077] For adjacent IMF components, calculate the permutation entropy decrease ratio:
[0078] In the formula: This represents the percentage decrease in permutation entropy from the i-th IMF component to the (i+1)-th IMF component; It is a very small positive number, used to avoid the denominator being zero. .
[0079] Calculate the decrease ratio of all adjacent IMF components: The two positions with the largest decrease ratio were selected as the classification boundaries.
[0080]
[0081] Then sort b1 and b2 so that b1 < b2.
[0082] To avoid misclassification caused by random fluctuations, a threshold is set:
[0083] In the formula: , This indicates the decrease compared to the mean; This indicates a decrease compared to the standard deviation; The adjustment coefficient is set to 0.5.
[0084] Based on the classification boundaries, the IMF components are divided into: High-frequency component set:
[0085] Mid-frequency component set:
[0086] Low-frequency component set:
[0087] Set of residual terms:
[0088] Step 5: Construct Transformer prediction models for high-frequency and mid-frequency components. For high-frequency and mid-frequency components, due to their frequent fluctuations and strong nonlinearity, the Transformer model is used for prediction.
[0089] Taking any component Z(t) as an example, where:
[0090] In the formula: This represents the value of any component in the high-frequency set and the mid-frequency set at hour t.
[0091] Construct the input window:
[0092] In the formula: represents the input window sample; C represents the input window length; t represents the end time of the input window.
[0093] The prediction target is:
[0094] In the formula: This represents the actual predicted target sequence; U represents the prediction step size.
[0095] (1) Input embedding and positional encoding: Map the input sequence to Dimensional space:
[0096] In the formula: This represents the initial input representation of the Transformer; Represents the input mapping matrix. This represents the position encoding matrix. Dimension represents the hidden feature dimension or embedding dimension in the Transformer model.
[0097] The specific formula for calculating the elements in the position coding matrix is as follows:
[0098]
[0099] In the formula: Indicates the position encoding matrix of the first... The element at the 2j-th time position and in the 2j-th dimension; Indicates the position encoding matrix of the first... The element at the 2j+1th time position and in the 2j+1th dimension; This indicates the time location, and j represents the location encoding dimension index.
[0100] (2) Calculation of multi-head self-attention: Calculate the query matrix Q, the key matrix K, and the value matrix V:
[0101]
[0102]
[0103] In the formula: This represents the trainable weight matrix corresponding to the query matrix Q; This represents the trainable weight matrix corresponding to the key matrix K; This represents the trainable weight matrix corresponding to the value matrix V.
[0104] Scaling dot product attention is:
[0105] In the formula: This represents the normalized exponential function, used to convert similarity into attention weights; This represents the transpose of the key matrix K; This represents the dimension of the key vector.
[0106] The bulls' focus is on:
[0107]
[0108] In the formula: Indicates the first h The output of each attention head; h Indicates the number of heads of attention; Indicates the first h The query matrix corresponding to each attention head. Indicates the first h The key matrix corresponding to each attention head Indicates the first h The value matrix corresponding to each attention head; This represents the multi-head attention output mapping matrix.
[0109] (3) Feedforward network, residual connection and normalization: The feedforward network is:
[0110] In the formula: This represents a feedforward neural network function; This represents the feature representation input to the feedforward network; and This represents the weight matrix of the feedforward network; and This represents the bias vector of the feedforward network.
[0111] Residual connectivity and layer normalization are as follows:
[0112]
[0113] In the formula: Indicates the layer normalization function; This represents the output after attention layer residual connections and layer normalization; Residual connections preserve the original input information, preventing information loss as the model depth increases, and also contributing to model training stability. This represents the final output of the current Transformer coding layer; This indicates the second residual connection, used to retain feature information before it enters the feedforward network.
[0114] After passing through several Transformer encoder layers, the hidden output is obtained:
[0115] In the formula: This represents the hidden representation of the Transformer model's output.
[0116] (4) Output component prediction results: To obtain the component prediction values for the next U hours, the hidden representation needs to be... Input-to-output mapping layer. The output mapping layer can be implemented using a fully connected layer, and its expression is:
[0117] In the formula: This represents the predicted sequence of component Z in the next U hours; This represents the weight matrix of the output layer corresponding to component Z. This represents the output layer bias term.
[0118] Through this output mapping layer, the hidden representation is... Converted to predicted values:
[0119] In the formula: This represents the predicted sequence of component Z in the next U hours.
[0120] The weighted mean square error loss function is used: ,
[0121] In the formula: This represents the true value of component Z corresponding to the f-th training sample; This represents the predicted value of component Z corresponding to the f-th training sample; The loss weight for the f-th sample is represented by ; F represents the number of training samples; Take 3; The 80% to 95% percentile of the absolute value of historical hourly electricity price changes can be used.
[0122] Step 6: Construct a SARIMA prediction model for low-frequency components and residual terms. For low-frequency components and residual terms, due to their obvious trends and seasonality, the SARIMA model is used for prediction.
[0123] With any component For example, where:
[0124] In the formula: This represents the value of any component in the low-frequency set and residual term at hour t.
[0125] The SARIMA model is represented as follows:
[0126] In the formula: For non-seasonal autoregressive order, For non-seasonal difference order, The order of the non-seasonal moving average. For the order of seasonal autoregression, Let the seasonal difference order be , The order of the seasonal moving average. It follows a seasonal cycle.
[0127] Its mathematical expression is:
[0128] In the formula: B represents the random error term or white noise residual; B is the lag operator, satisfying... ; The seasonal lag operator represents a lag of s time points; it is achieved through non-seasonal differencing. and seasonal difference For components The system is stabilized, and then modeled using non-seasonal autoregressive, non-seasonal moving average, seasonal autoregressive, and seasonal moving average terms to obtain predicted values for future low-frequency components or residual terms.
[0129] The non-seasonal autoregressive polynomial is:
[0130] The non-seasonal moving average polynomial is:
[0131] The seasonal autoregressive polynomial is:
[0132] The seasonal moving average polynomial is:
[0133] The future U-hour forecast results were obtained using the SARIMA model:
[0134] In the formula: This represents the predicted sequence of component G in the next U hours.
[0135] The model order is determined using either the Akaike Information Criterion (AIC) or the Bayesian Information Criterion (BIC), and the parameter combination that minimizes AIC or BIC is selected.
[0136]
[0137] In the formula: Indicates the number of model parameters; This represents the maximum likelihood function value; n represents the number of samples.
[0138] Step 7: Integrate the prediction results of each component and reconstruct the electricity price forecast. To improve prediction accuracy, a weighted fusion method is adopted, and the future... The predicted normalized electricity price for the hour is:
[0139] In the formula: This represents the fusion weighting coefficient for high-frequency components, mid-frequency components, low-frequency components, and the residual term. .
[0140] The fusion weighting coefficients can be adaptively determined based on the validation set error. Let the prediction errors for high-frequency, mid-frequency, low-frequency, and residual terms be respectively... The weights are: ,
[0141] In the formula: This represents the fusion weight of the j-th component; This represents the prediction error of the validation set for the j-th component.
[0142] The error is expressed as root mean square error:
[0143] In the formula: G represents the number of samples in the validation set; This represents the true value of the j-th component in the g-th sample; This represents the predicted value of the j-th class component in the g-th sample.
[0144] Step 8: Inverse normalization and output the final electricity price forecast. In Step 2, the original electricity price was normalized; therefore, Step 7 reconstructs the predicted value after normalization. To obtain the actual electricity price prediction, inverse normalization is required.
[0145] Inverse normalization is performed using the following formula:
[0146] In the formula: For the future The predicted actual electricity price for the hour; These are the normalized predicted values; and These are the mean and standard deviation of the original electricity price series, respectively.
[0147] The final output is the predicted electricity price sequence for the next U hours:
[0148] Electricity spot market price sequences typically contain short-term price spikes, random disturbances, and intraday cyclical fluctuations. Directly using a prediction model to forecast these sequences requires the model to learn the changing patterns across multiple frequency scales, leading to training difficulties, high prediction errors, and unstable results. This embodiment employs the CEEMDAN method for adaptive decomposition of the original price sequence before model prediction. This decomposes the complex sequence into multiple IMF components and residual terms, extracting the previously mixed high-frequency disturbances, mid-frequency fluctuations, low-frequency trends, and long-term changes. This reduces the difficulty of directly handling non-stationary, highly volatile sequences with a single model. Furthermore, this invention introduces permutation entropy and permutation entropy reduction ratio to quantitatively evaluate the complexity of each IMF component and the magnitude of complexity changes between adjacent components. The permutation entropy reduction ratio automatically determines the classification boundaries for high-frequency, mid-frequency, and low-frequency components. This approach reduces the subjectivity of manual, experience-based classification, making the component classification process more objective, stable, and repeatable, and improving the model's adaptability to price change characteristics at different frequency scales.
[0149] This embodiment classifies components by permutation entropy reduction ratio. High-frequency components mainly contain complex information such as electricity price spikes, random disturbances, and short-term sharp fluctuations, while mid-frequency components mainly contain intraday fluctuations, local periodic changes, and nonlinear fluctuations caused by supply and demand changes. Addressing the issues of frequent changes, strong nonlinear relationships, and difficulty in accurately fitting traditional linear models for high-frequency and mid-frequency components, this embodiment employs a Transformer model for prediction. It utilizes the multi-head self-attention mechanism to capture the correlation between different time points within the historical input window, thereby improving the model's ability to express complex time-series dependencies, price abrupt changes, and short-term fluctuations. Meanwhile, low-frequency components and residual terms typically reflect trend changes, price center changes, and relatively stable daily or weekly periodic characteristics in the electricity price series. Their fluctuation frequency is low and their changes are relatively gentle. Using complex deep learning models for prediction may introduce unnecessary model complexity and lead to overfitting. Therefore, this embodiment uses a SARIMA model for prediction of low-frequency components and residual terms, leveraging its advantages in handling trend-based, stationary, and seasonally periodic series to model low-frequency trends and residual changes.
[0150] This embodiment, after obtaining the prediction results of high-frequency components, mid-frequency components, low-frequency components, and residual terms, does not simply superimpose the prediction results of each component. Instead, it reconstructs the prediction results of each component using a weighted fusion method. Specifically, the fusion weight is determined based on the prediction error of each type of component on the validation set. Component categories with smaller prediction errors are assigned higher weights in the final reconstruction, while component categories with larger prediction errors are assigned lower weights. In this way, the contribution of each component's prediction result to the final electricity price prediction value can be adaptively adjusted according to the model's prediction performance, thereby reducing the impact of prediction bias of a single component or a single model on the final result. Compared to direct superposition reconstruction or single-model prediction methods, the weighted fusion reconstruction of this embodiment can further improve the accuracy, robustness, and prediction curve stability of the final hourly electricity price prediction result.
[0151] In summary, this embodiment transforms the complex problem of spot electricity price forecasting into a targeted forecasting problem for multiple components at different frequency scales through a technical approach that employs CEEMDAN adaptive decomposition, automatic classification based on permutation entropy reduction ratio, separate predictions using Transformer and SARIMA heterogeneous models, and weighted fusion reconstruction of component prediction results. This embodiment leverages both the Transformer's ability to model complex nonlinear fluctuations at high and mid-frequency frequencies and SARIMA's stable prediction capabilities for low-frequency trends and periodic changes in residuals. By integrating the prediction results of each component through weighted fusion, it improves the accuracy, stability, robustness, and adaptability to complex market fluctuations in short-term electricity price forecasting in the spot market.
[0152] The other parts of this embodiment are the same as those in Embodiment 1 above, so they will not be described again.
[0153] Example 3: Based on any one of Embodiments 1-2 above, this embodiment proposes a short-term electricity price forecasting system for the electricity spot market based on multi-scale decomposition and heterogeneous model fusion, used to execute the above-mentioned method for short-term electricity price forecasting in the electricity spot market based on multi-scale decomposition and heterogeneous model fusion; it includes a preprocessing unit, a decomposition unit, a classification unit, a first forecasting unit, a second forecasting unit, and a fusion output unit; The preprocessing unit is used to preprocess the acquired historical hourly electricity price data; The decomposition unit is used to adaptively decompose the preprocessed electricity price sequence using CEEMDAN to obtain the IMF component. The classification unit is used to calculate the permutation entropy of the IMF components and identify the high-frequency components, mid-frequency components, low-frequency components, and residual terms based on the permutation entropy decrease ratio. The first prediction unit is used to input high-frequency components and mid-frequency components into the constructed Transformer model to predict high-frequency component prediction sequences and mid-frequency component prediction sequences; The second prediction unit is used to input the low-frequency component and the residual term into the constructed seasonal autoregressive integral moving average model to obtain the low-frequency component prediction sequence and the residual component prediction sequence. The fusion output unit is used to fuse and reconstruct the high-frequency component prediction sequence, the medium-frequency component prediction sequence, the low-frequency component prediction sequence, and the residual component prediction sequence to obtain the electricity price prediction value.
[0154] This embodiment also proposes an electronic device, including a memory and a processor; a computer program is stored in the memory; when the computer program is executed on the processor, it implements the above-mentioned method for short-term electricity price forecasting in the electricity spot market based on multi-scale decomposition and heterogeneous model fusion.
[0155] This embodiment also proposes a computer-readable storage medium storing computer instructions; when the computer instructions are executed on the aforementioned electronic device, the aforementioned method for short-term electricity price forecasting in the electricity spot market based on multi-scale decomposition and heterogeneous model fusion is implemented.
[0156] The other parts of this embodiment are the same as any one of the above embodiments 1-2, so they will not be described again.
[0157] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention in any way. Any simple modifications or equivalent changes made to the above embodiments based on the technical essence of the present invention shall fall within the protection scope of the present invention.
Claims
1. A method for predicting short-term electricity prices in the electricity spot market based on multi-scale decomposition and heterogeneous model fusion, characterized in that, Specifically, the following steps are included: Step S1: Preprocess the acquired historical hourly electricity price data; Step S2: Call the CEEMDAN method to adaptively decompose the preprocessed electricity price sequence to obtain the IMF component; Step S3: Calculate the permutation entropy of the IMF components, and identify the high-frequency components, mid-frequency components, low-frequency components, and residual terms based on the permutation entropy decrease ratio; Step S4: Input the high-frequency components and intermediate-frequency components into the constructed Transformer model to predict the high-frequency component prediction sequence and the intermediate-frequency component prediction sequence; Step S5: Input the low-frequency component and residual term into the constructed seasonal autoregressive integral moving average model to obtain the low-frequency component prediction sequence and the residual component prediction sequence. Step S6: Fuse and reconstruct the high-frequency component prediction sequence, the medium-frequency component prediction sequence, the low-frequency component prediction sequence, and the residual component prediction sequence to obtain the electricity price prediction value.
2. The method for predicting short-term electricity prices in the electricity spot market based on multi-scale decomposition and heterogeneous model fusion as described in claim 1, characterized in that, Step S1 specifically includes the following steps: Step S11: Obtain historical hourly electricity price data from the electricity spot market trading system, price release platform, or historical database to obtain the original electricity price sequence; Step S12: Determine whether there are missing values in the obtained original electricity price sequence. If there are missing values in the current electricity price and the electricity price data of the adjacent times are complete, then use linear interpolation to complete the original electricity price sequence. If there are missing values in the electricity price at consecutive times, then complete the original electricity price sequence based on the average electricity price of the same hour on a historical day. Step S13: Based on the set sliding window, calculate the standard deviation of electricity price within the sliding window corresponding to the current time after completion, identify abnormal candidate points, and call interpolation or similar daily average value correction. Step S14: Calculate the mean and standard deviation of the corrected original electricity price series, and convert it into a normalized electricity price series.
3. The method for predicting short-term electricity prices in the electricity spot market based on multi-scale decomposition and heterogeneous model fusion as described in claim 1, characterized in that, Step S2 specifically includes the following steps: Step S21: Add white noise to the normalized electricity price sequence according to the set noise amplitude coefficient to obtain a noisy electricity price sequence; Step S22: Perform EMD decomposition on the noisy electricity price sequence to obtain IMF components, and extract the residuals from the IMF components; Step S23: If the number of extreme points of the current residual is less than 2 or the residual does not meet the IMF decomposition conditions, then stop the decomposition and obtain the decomposition result.
4. The method for predicting short-term electricity prices in the electricity spot market based on multi-scale decomposition and heterogeneous model fusion as described in claim 1, characterized in that, Step S3 specifically includes the following steps: Step S31: Based on the set embedding dimension, delay time, and IMF components, obtain the phase space reconstruction vector of the current IMF component; Step S32: Sort the elements of the phase space reconstructed vector in ascending order according to their numerical values to obtain the corresponding arrangement pattern; Step S33: Calculate the probability of the permutation pattern appearing based on the number of times the permutation pattern appears and the total number of reconstructed vectors; Step S34: Calculate the permutation entropy of the IMF components based on the probability of the permutation pattern, and normalize it to obtain the normalized permutation entropy; Step S35: Based on the set minimum positive number, the normalized permutation entropy of the current IMF component, and the normalized permutation entropy of the adjacent IMF components, calculate the permutation entropy decrease ratio of the adjacent IMF components, and take the two positions with the largest permutation entropy decrease ratio as the classification boundary. Step S36: Based on the set threshold and classification boundary, obtain the high-frequency component set, the mid-frequency component set, the low-frequency component set, and the residual term set.
5. The method for predicting short-term electricity prices in the electricity spot market based on multi-scale decomposition and heterogeneous model fusion as described in claim 1, characterized in that, Step S4 specifically includes the following steps: Step S41: Map the high-frequency components and mid-frequency components to the embedding dimension space of the Transformer model to obtain the initial input of the Transformer model; Step S42: Calculate the query matrix Q, key matrix K, and value matrix V based on the initial input, and call the normalized exponential function to obtain the scaling point attention; Step S43: Obtain multi-head attention based on the scaling point attention and the number of attention heads; Step S44: Based on the multi-head attention, the weight matrix of the feedforward network, the bias vector of the feedforward network, and the feedforward neural network function, call the layer normalization function to obtain the hidden output; Step S45: Call the fully connected layer to convert the hidden output into a high-frequency component prediction sequence and a mid-frequency component prediction sequence.
6. The method for predicting short-term electricity prices in the electricity spot market based on multi-scale decomposition and heterogeneous model fusion as described in claim 1, characterized in that, Step S5 specifically includes the following steps: Step S51: Construct the SARIMA model based on the non-seasonal autoregressive order, non-seasonal difference order, non-seasonal moving average order, seasonal autoregressive order, seasonal difference order, seasonal moving average order, seasonal cycle, set lag operator, random error term, and seasonal lag operator. Step S52: Based on the SARIMA model, low-frequency components, and residual terms, obtain the low-frequency component prediction sequence and the residual component prediction sequence.
7. The method for predicting short-term electricity prices in the electricity spot market based on multi-scale decomposition and heterogeneous model fusion as described in claim 1, characterized in that, Step S6 specifically includes the following steps: Step S61: Calculate the prediction errors of high-frequency components, mid-frequency components, low-frequency components, and residual terms, and calculate the fusion weights based on the prediction errors; Step S62: Based on the fusion weight, high-frequency component prediction sequence, medium-frequency component prediction sequence, low-frequency component prediction sequence, and residual component prediction sequence, obtain the normalized electricity price prediction value. Step S63: Based on the mean of the original electricity price series, the standard deviation of the original electricity price series, and the normalized electricity price prediction value, reverse normalize to obtain the actual electricity price prediction series.
8. A short-term electricity price forecasting system for the electricity spot market based on multi-scale decomposition and heterogeneous model fusion, used to execute the short-term electricity price forecasting method for the electricity spot market based on multi-scale decomposition and heterogeneous model fusion as described in claim 1; characterized in that, It includes a preprocessing unit, a decomposition unit, a classification unit, a first prediction unit, a second prediction unit, and a fusion output unit; The preprocessing unit is used to preprocess the acquired historical hourly electricity price data; The decomposition unit is used to adaptively decompose the preprocessed electricity price sequence using CEEMDAN to obtain the IMF component. The classification unit is used to calculate the permutation entropy of the IMF components and identify the high-frequency components, mid-frequency components, low-frequency components, and residual terms based on the permutation entropy decrease ratio. The first prediction unit is used to input high-frequency components and mid-frequency components into the constructed Transformer model to predict high-frequency component prediction sequences and mid-frequency component prediction sequences. The second prediction unit is used to input the low-frequency component and the residual term into the constructed seasonal autoregressive integral moving average model to obtain the low-frequency component prediction sequence and the residual component prediction sequence. The fusion output unit is used to fuse and reconstruct the first prediction result and the second prediction result to obtain the electricity price prediction value.
9. An electronic device, characterized in that, It includes a memory and a processor; the memory stores a computer program; when the computer program is executed on the processor, it implements a method for predicting short-term electricity prices in the electricity spot market based on multi-scale decomposition and heterogeneous model fusion as described in any one of claims 1-7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions; when the computer instructions are executed on the electronic device as described in claim 9, they implement the method for predicting short-term electricity prices in the electricity spot market based on multi-scale decomposition and heterogeneous model fusion as described in any one of claims 1-7.