A capacity and mileage joint optimization decision method and system for energy storage participating in frequency modulation market

CN122905464APending Publication Date: 2026-10-13SICHUAN JIEWUJI TECHNOLOGY CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611107519.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-24
Publication Date
2026-10-13

AI Technical Summary

Technical Problem

然而,现有电价预测方法大多仅关注负荷、气象等传统特征,忽视了调频容量与里程对电价的协同驱动作用

Benefits of technology

1、本发明提供的一种储能参与调频市场的容量和里程联合优化决策方法,首先利用分发聚合机制GD和傅里叶变换FT增强TimesMixer模型对电价序列中高频突变与低频趋势的分离能力,使模型能够同时学习线性规律、周期规律和大波动规律而不互相干扰;继而通过SHAP分析确认调频里程与调频容量对电价的关键影响,并以PCA消除二者耦合,确保特征独立性;然后针对负电价、低电价、正常电价、高电价四个区段分别设计专用专家模型,利用门控机制按电价区段调用对应模型,避免单一模型在不同区段间的性能折中;最后结合卡方检验置信度与用户电量余量,制定分级交易策略,提升了电价预测的准确率和交易收益的稳定性。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122905464A_ABST
    Figure CN122905464A_ABST
Patent Text Reader

Abstract

The application discloses a kind of capacity and mileage joint optimization decision method and system of energy storage participation frequency modulation market, it is related to electric power analysis technical field, its technical solution key points are: obtaining historical electric power data, construct TimesMixer electricity price prediction model based on distribution aggregation mechanism and fourier transform improvement;Extract frequency modulation mileage and frequency modulation capacity as key features, eliminate coupling after input model by principal component analysis;Electricity price is divided into negative electricity price, low electricity price, normal electricity price, high electricity price four sections, respectively ARIMA-LSTM, DM-TCN-LSTM, TM-GD-FT, SCNN-LSTM expert model is used for partition prediction;According to chi-square test confidence and user electric quantity balance, formulate hierarchical transaction strategy.The application comprehensively considers the synergistic effect of frequency modulation capacity and mileage, realizes accurate electricity price prediction and transaction decision optimization.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of power analysis technology, and more specifically, to a method and system for joint optimization decision-making on capacity and mileage for energy storage participation in the frequency regulation market. Background Technology

[0002] With the continuous increase in the proportion of renewable energy generation, the frequency stability of the power system faces severe challenges. Energy storage, due to its rapid response characteristics, has become an important participant in the frequency regulation ancillary services market. In the electricity spot market, the charging and discharging behavior of energy storage directly affects the fluctuation pattern of the electricity price curve, and frequency regulation capacity and frequency regulation mileage are two core parameters for measuring the frequency regulation capability of energy storage. However, most existing electricity price forecasting methods only focus on traditional characteristics such as load and weather, neglecting the synergistic driving effect of frequency regulation capacity and mileage on electricity prices.

[0003] Currently, existing technologies document the use of XGBoost models to predict peak-shaving markets, but they suffer from significant biases in predicting the high-frequency components of the electricity price curve. Furthermore, some existing technologies study the impact of air conditioning load on output and cost, but fail to consider the effects of frequency regulation capacity and mileage on electricity prices. Additionally, some existing technologies establish distribution network economic dispatch models using virtual power plant frequency regulation revenue allocation methods that incorporate DLMP, completely ignoring the influence of energy storage's own characteristics. All of these studies fail to incorporate frequency regulation capacity and mileage as key features into electricity price prediction models, resulting in predictions that cannot accurately reflect the true impact of energy storage frequency regulation behavior on electricity price fluctuations. On the other hand, existing electricity price prediction models have significant limitations in handling the nonlinear patterns of different electricity price ranges. Common deep learning models such as TimesMixer and LSTM are prone to causing gaps in the division of electricity price ranges during normalization, leading to positive prediction errors in negative price ranges and an inability to control the degree of price jumps in high price ranges. Existing technologies use historical similarity day matching and KNN algorithms to predict transaction categories, but completely lack the ability to capture the impact of long-distance power transmission. Furthermore, while some technologies consider the impact of load and coordinated thermal power operation, they lack consideration of boundary constraints on the energy storage capacity of power plants. Additionally, existing technologies typically use a single model to uniformly predict all electricity price ranges, failing to perform segmented and detailed modeling for the different patterns of negative, low, normal, and high electricity prices. This results in the model completely failing under abrupt changes in price patterns or extreme conditions, thus failing to provide users with reliable transaction decision support.

[0004] Therefore, researching and designing a joint optimization decision-making method and system for energy storage to participate in the frequency regulation market that can overcome the above-mentioned defects is an urgent problem to be solved. Summary of the Invention

[0005] To address the shortcomings of existing technologies, the purpose of this invention is to provide a joint optimization decision-making method and system for energy storage participation in the frequency regulation market, which improves the accuracy of electricity price prediction and optimizes energy storage frequency regulation pricing through collaborative feature analysis of frequency regulation capacity and mileage, multi-expert modeling of different segments, and confidence-driven trading decisions.

[0006] The above-mentioned technical objective of the present invention is achieved through the following technical solution: Firstly, a joint optimization decision-making method for capacity and mileage of energy storage participating in the frequency regulation market is provided, including the following steps: Acquire historical electricity data, which includes at least time-series electricity price data and multi-dimensional features related to electricity prices; Frequency regulation mileage and frequency regulation capacity are extracted from the multidimensional features as candidate features for electricity price prediction. The contribution of frequency regulation mileage and frequency regulation capacity to electricity price prediction is determined by SHAP analysis. After eliminating the coupling between frequency regulation mileage and frequency regulation capacity using principal component analysis, they are retained as key features. The key features and the remaining multidimensional features constitute the final input feature set. Based on the final input feature set, multiple expert prediction models are constructed for different electricity price segments. The multiple expert prediction models include a first expert model for negative electricity price segments, a second expert model for low electricity price segments, a third expert model for normal electricity price segments, and a fourth expert model for high electricity price segments. The electricity price range is determined by the auxiliary features at the current prediction time through the gating mechanism, the corresponding expert prediction model is called, the corresponding features in the final input feature set are used as input to predict the electricity price value, and a transaction decision is generated based on the prediction result.

[0007] Furthermore, the first expert model is a fusion model of ARIMA and LSTM; The ARIMA is used to capture the time-dependent features of negative electricity price segments, and the LSTM is used to learn the nonlinear fluctuation pattern. During training, pseudo-random negative electricity price information and random noise are added to the negative electricity price segments to balance the number of samples in each electricity price segment.

[0008] Furthermore, the second expert model is a temporal convolutional network model embedded with a duck curve template, wherein the duck curve template uses an adaptive parameter learning method to iteratively update the weights; The duck curve template is used to guide the temporal convolutional network model to learn the typical daily cycle pattern of the low electricity price segment.

[0009] Furthermore, the third expert model is a multi-scale electricity price prediction model based on TimesMixer. The multi-scale electricity price prediction model introduces Fourier transform to capture frequency domain features on the basis of TimesMixer, and introduces a distribution aggregation mechanism to fuse multi-scale features and correct residuals. The distribution and aggregation mechanism is derived from the Gold-YOLO object detection model. In the time-series prediction scenario, it learns features at each scale by pooling according to the least squares rule, and then distributes the features to the corresponding level according to the scale for residual correction and alignment fusion.

[0010] Furthermore, the fourth expert model is an SCNN-LSTM model based on an interactive attention mechanism, wherein the interactive attention mechanism is a CASM module, and the CASM module is composed of a dual-branch attention DCA and an improved cross-attention SAFM. The improved cross-attention SAFM is achieved by placing a convolutional module with padding function before each of the two branch inputs, adding a Sigmoid activation function, and then aggregating the two signals before inputting them into the cross-attention mechanism.

[0011] Furthermore, the gating mechanism uses unique thermal coding to classify electricity price segments. The classification criteria include meteorological forecast conclusions, water season changes, time characteristics, and peak-valley patterns. The electricity price segment at each forecast point is predicted according to the time point. In addition, the auxiliary features include at least temperature, precipitation, cloud cover, wind speed, water season, peak period identifier, and power structure code.

[0012] Furthermore, the generation of transaction decisions includes: A chi-square test is performed on the predicted electricity price curve and the actual electricity price curve to obtain the confidence level; When the confidence level is higher than the first threshold, a low-buy-high-sell trading strategy dominated by the generation model is adopted. When the confidence level is lower than the second threshold, a trading strategy is generated to stop trading or trigger a stop loss. When the confidence level is between the first threshold and the second threshold, a trading strategy of either half-position trading or observation is generated.

[0013] Furthermore, the buy-low-sell-high strategy includes: The peak and valley sets are determined by the first and second differences of the predicted electricity price curve. The maximum profit trading strategy is then solved by ridge regression optimization, taking into account the user's current electricity surplus and electricity demand.

[0014] Furthermore, the method also includes data preprocessing of the historical power data, specifically: Electricity prices are normalized according to the price limit range, temperature is normalized according to the temperature range, and other numerical features are normalized to the zero-to-one interval. Among them, the electricity price tier characteristics, power supply structure characteristics, and water season characteristics in the historical electricity data are converted into numerical values ​​using unique thermal encoding or dictionary encoding.

[0015] Secondly, a joint optimization decision-making system for capacity and mileage of energy storage participating in the frequency regulation market is provided, including: The data acquisition module is used to acquire historical electricity data, which includes at least electricity price time-series data and multi-dimensional features related to electricity prices; The feature analysis module is used to extract frequency regulation mileage and frequency regulation capacity from the multidimensional features as candidate features for electricity price prediction. The contribution of the frequency regulation mileage and frequency regulation capacity to electricity price prediction is determined by SHAP analysis. After eliminating the coupling between the frequency regulation mileage and frequency regulation capacity by principal component analysis, the key features are retained. The key features and the other multidimensional features constitute the final input feature set. The expert prediction module is used to construct multiple expert prediction models for different electricity price segments based on the final input feature set. The multiple expert prediction models include a first expert model for negative electricity price segments, a second expert model for low electricity price segments, a third expert model for normal electricity price segments, and a fourth expert model for high electricity price segments. The gating decision module is used to determine the electricity price segment based on the auxiliary features at the current prediction time through a gating mechanism, call the corresponding expert prediction model, use the corresponding features in the final input feature set as input to predict the electricity price value, and generate a transaction decision based on the prediction result.

[0016] Compared with the prior art, the present invention has the following beneficial effects: 1. This invention provides a joint optimization decision-making method for capacity and mileage of energy storage participating in the frequency regulation market. First, it utilizes the distribution aggregation mechanism GD and Fourier transform FT to enhance the ability of the Times Mixer model to separate high-frequency mutations and low-frequency trends in the electricity price sequence, enabling the model to simultaneously learn linear, periodic, and large fluctuation patterns without mutual interference. Next, it uses SHAP analysis to confirm the key impacts of frequency regulation mileage and capacity on electricity prices, and uses PCA to eliminate their coupling, ensuring feature independence. Then, it designs dedicated expert models for four price segments: negative, low, normal, and high electricity prices, and uses a gating mechanism to call the corresponding model according to the price segment, avoiding performance trade-offs between different segments for a single model. Finally, it combines chi-square test confidence and user electricity reserves to formulate a tiered trading strategy, improving the accuracy of electricity price prediction and the stability of trading revenue.

[0017] 2. This invention introduces a distribution aggregation mechanism and Fourier transform on the basis of the Times Mixer model to construct a TM-GD-FT electricity price prediction model. Specifically, the FT uses a 16-point Fourier transform to map the electricity price sequence from the time domain to the frequency domain, extracting frequency features decoupled from the fundamental frequency, enabling the model to detect periodic and abrupt components that are difficult to detect in the time domain. The GD mechanism decomposes the electricity price curve into three levels according to complexity: linear small fluctuations, low-exponential periodicity, and large fluctuations. Within each level, it fills the curve using least-squares pooling, and before cross-level aggregation, it corrects numerical errors caused by integer-scale discretization through residual matching. This hierarchical processing avoids the drawback of high- and low-frequency features being overwhelmed by each other in traditional multi-scale splicing, allowing the model to capture both long-term trends and short-term spikes.

[0018] 3. This invention incorporates frequency regulation mileage and capacity as joint features into the electricity price prediction model and employs principal component analysis to eliminate the strong coupling between them, thus achieving a complete characterization of energy storage frequency regulation capabilities. This invention enables the model to accurately capture the driving effect of energy storage charging and discharging behavior on electricity price fluctuations, providing crucial causal feature support for trading decisions.

[0019] 4. This invention proposes a multi-expert coordinated prediction framework based on electricity price segment division. It first identifies the electricity price segment of the point to be predicted through a gating mechanism, and then calls the corresponding expert model for single-point prediction. The patterns of different electricity price segments differ significantly. Negative electricity price ranges are affected by policy shocks and supply-demand imbalances, exhibiting strong randomness and sparse samples, making them suitable for the fusion of statistical models like ARIMA and LSTM. Low electricity price ranges often exhibit a duck curve pattern, requiring template-guided TCN networks. Normal electricity price ranges have relatively stable patterns, suitable for the general prediction capabilities of TM-GD-FT. High electricity price ranges fluctuate wildly and have sparse samples, requiring a CASM attention mechanism to enhance feature interaction. If all segments are predicted using a single model, the model will sacrifice the accuracy of extreme segments to pursue the overall average error, leading to underestimation of high electricity prices and misjudgment of negative electricity prices. The dynamic decision-making mechanism of this invention effectively addresses extreme situations such as sudden changes in electricity price patterns or model failure. Attached Figure Description

[0020] The accompanying drawings, which are included to provide a further understanding of embodiments of the invention and form part of this application, do not constitute a limitation thereof. In the drawings: Figure 1 This is a flowchart from Embodiment 1 of the present invention; Figure 2 This is the correlation analysis heatmap in Embodiment 1 of the present invention; Figure 3 This is the feature correlation SHAP analysis diagram in Embodiment 1 of the present invention; Figure 4This is a schematic diagram of the DM-TCN-LSTM in Embodiment 1 of the present invention; Figure 5 This is a diagram of the electricity price prediction structure based on the improved GD mechanism in Embodiment 1 of the present invention; Figure 6 This is a schematic diagram of the CASM attention mechanism in Embodiment 1 of the present invention; Figure 7 This is a schematic diagram of the SCNN-LSTM model in Embodiment 1 of the present invention; Figure 8 This is a backtesting record of the TM-GD-FT algorithm in Embodiment 1 of the present invention; Figure 9 This is a prediction result diagram of the SCNN-LSTM model in Embodiment 1 of the present invention; Figure 10 This is a backtesting result diagram after adding ARIMA in Embodiment 1 of the present invention; Figure 11 This is an analysis diagram of the impact of the duck curve template on the prediction results in Embodiment 1 of the present invention, where a is a schematic diagram of the prediction effect without introducing the duck curve template, and b is a schematic diagram of the prediction effect after introducing the duck curve template. Figure 12 This is a comparison diagram of the long-term prediction results under different strategies in Embodiment 1 of the present invention, where a is a schematic diagram of the long-term prediction results under the equal-weight prediction strategy and b is a schematic diagram of the long-term prediction results under the prior prediction strategy. Figure 13 This is a system block diagram in Embodiment 2 of the present invention. Detailed Implementation

[0021] To make the objectives, technical solutions, and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the embodiments and accompanying drawings. The illustrative embodiments and descriptions of the present invention are only used to explain the present invention and are not intended to limit the present invention.

[0022] Example 1: A joint optimization decision-making method for capacity and mileage of energy storage participating in the frequency regulation market, such as... Figure 1 As shown, it includes the following steps: S1: Obtain historical electricity data, which must include at least time-series electricity price data and multi-dimensional features related to electricity prices; S2: Frequency regulation mileage and frequency regulation capacity are extracted from multidimensional features as candidate features for electricity price prediction. The contribution of frequency regulation mileage and frequency regulation capacity to electricity price prediction is determined by SHAP analysis. After eliminating the coupling between frequency regulation mileage and frequency regulation capacity by principal component analysis, they are retained as key features. The key features and the remaining multidimensional features constitute the final input feature set. S3: Based on the final input feature set, construct multiple expert prediction models for different electricity price segments. The multiple expert prediction models include a first expert model for negative electricity price segments, a second expert model for low electricity price segments, a third expert model for normal electricity price segments, and a fourth expert model for high electricity price segments. S4: The electricity price segment is determined based on the auxiliary features at the current prediction time through the gating mechanism, the corresponding expert prediction model is called, the corresponding features in the final input feature set are used as input to predict the electricity price value, and a transaction decision is generated based on the prediction result.

[0023] In step S1, the acquired historical electricity data includes electricity price time-series data and multi-dimensional features related to electricity prices. These multi-dimensional features specifically include: time and date features, such as prediction timestamps and whether it is a working day; weather features, including precipitation, cloud cover, temperature, solar irradiance, and wind speed; electricity price tier features, which use unique thermal coding to classify electricity prices into four categories: negative, low, normal, and high; power structure features, using dictionary coding to map wind power, solar power, hydropower, thermal power, and energy storage to values ​​from 1 to 5; water season features, also using dictionary coding to map the wet season, normal season, and dry season to 1, 2, and 3; renewable energy output features, i.e., the total output of photovoltaic and wind power; load features, i.e., the actual net load; and two key features: frequency regulation mileage and frequency regulation capacity. Frequency regulation mileage is defined as the sum of the absolute values ​​of the actual power changes adjusted due to receiving automatic generation control commands within a certain time interval, and frequency regulation capacity is defined as the power capacity range promised and reserved by the grid-connected entity to respond to automatic generation control at any time. All of the above features together constitute the original input feature set, which is used for subsequent training of the electricity price prediction model.

[0024] To ensure the robustness and stability of model training, the original data is normalized. Electricity prices are normalized according to the price cap range; the normalization formula is as follows: ; in, The original electricity price is expressed in yuan / MWh, ranging from -50 yuan / MWh to 800 yuan / MWh. The normalized electricity price is dimensionless and ranges from 0 to 1.

[0025] Temperature is normalized according to temperature range; the normalization formula is: ; in, The original temperature is expressed in °C, and the effective range is -15°C to 45°C. The normalized temperature is dimensionless. Other numerical features, including precipitation, cloud cover, solar irradiance, wind speed, renewable energy output, and load, are all normalized using a zero-to-one interval normalization method, mapping the minimum value of each feature to 0 and the maximum value to 1. Categorical features such as electricity price tiers, power supply structure, and water season are converted to numerical values ​​using one-hot encoding or dictionary encoding and are not included in the normalization process.

[0026] After completing basic normalization, we further constructed electricity price differential characteristics and interaction variables. The electricity price differential characteristics include 15-minute, 1-hour, 6-hour, and 1-day differentials to characterize the changes in electricity prices over different time scales. In addition, we introduced penetration rate as an interaction variable, defined as the ratio of total renewable energy output to total load, reflecting the proportion of renewable energy installed capacity in the total load and embodying the system's volatility.

[0027] Regarding wind speed characteristics, since measured wind speeds typically come from anemometer towers at different heights, they need to be uniformly converted to the standard wind speed at a height of 10m. The conversion process is as follows: First, calculate the surface roughness coefficient based on the measured wind speeds at 1m and 5m heights. The specific formula is as follows: ; in, The wind speed at a height of 5m. The wind speed at a height of 1m , Then calculate the wind speed V at a height of 10m: ; in, The corrected wind speed at a height of 10m is used as one of the input features of the model.

[0028] In step S2, the contribution of FM mileage and FM capacity is evaluated using the SHAP analysis method. SHAP, short for Shapley Additive Interpretation, is a feature importance interpretation method based on game theory Shapley values. It can fairly allocate the model prediction results to each input feature according to their contribution, thereby quantifying the marginal impact of each feature on the predicted output. In practice, a baseline prediction model is first trained using all the preprocessed features from step S1 as input. The gradient boosting tree model is chosen as the baseline model because of its good feature importance interpretation ability. After training, the SHAP value of each feature is calculated for the test set samples.

[0029] The SHAP value is calculated as follows: For each sample, the difference between the predicted value when the feature is included and the predicted value when the feature is not included is calculated across all possible feature subsets, and a weighted average is taken over all subsets. The sign of the SHAP value indicates the direction of the feature's contribution to the prediction result, and the absolute value indicates the strength of the contribution. By averaging the SHAP values ​​of all test samples, the global importance score of each feature is obtained.

[0030] like Figure 3 As shown, the SHAP value distribution for FM mileage, FM capacity, and other key characteristics is illustrated. From... Figure 3 It can be observed that the absolute values ​​of the SHAP values ​​for both frequency regulation mileage and frequency regulation capacity are among the highest, indicating that both have a significant contribution to electricity price forecasting.

[0031] After confirming that FM mileage and FM capacity make significant contributions, the correlation between the two was further analyzed. The Pearson correlation coefficient was used to calculate the degree of linear correlation between FM mileage and FM capacity, and a correlation heatmap was plotted, as shown below. Figure 2 As shown. Figure 2 The horizontal and vertical axes represent the names of the features, and the color intensity indicates the absolute value of the correlation coefficient; the darker the color, the stronger the correlation.

[0032] The calculation results show a strong positive correlation between frequency regulation mileage and frequency regulation capacity. This is because in the actual frequency regulation market, frequency regulation mileage and capacity are often affected by similar market rules and unit operating conditions, resulting in a clear coupling relationship between the two. Directly inputting these two strongly correlated features into the prediction model would lead to multicollinearity, reducing the model's stability and generalization ability. Therefore, it is necessary to eliminate the coupling while preserving the information of both.

[0033] To eliminate the coupling between FM mileage and FM capacity, principal component analysis (PCA) is used to reduce the dimensionality of these two features. PCA is a statistical method that transforms a set of potentially correlated variables into a set of linearly uncorrelated principal component variables through orthogonal transformation. The specific steps are as follows: First, the frequency modulation mileage C and the frequency modulation capacity Q are combined into a two-dimensional matrix. Each row represents a sample at a given time point, and each column represents a feature. The matrix is ​​then centered by subtracting the mean of each feature: , ; in, and These are the mean values ​​of FM mileage and FM capacity over the entire training set, respectively. Then, the covariance matrix is ​​calculated: ; Where n is the total number of samples. Eigenvalue decomposition is performed on the covariance matrix to obtain the eigenvalues. and And its corresponding eigenvector. Since the two features are strongly correlated, the variance contribution rate of the first principal component usually exceeds 95%. Therefore, the first principal component is selected as the new feature after dimensionality reduction, denoted as... The formula for calculating the first principal component is: ; in, and The weight coefficients in the first feature vector satisfy the following condition: The first principal component is approximately a weighted linear combination of frequency modulation mileage and frequency modulation capacity.

[0034] New features obtained by principal component analysis As a key feature, it, together with the other multidimensional features preprocessed in step S1, constitutes the final input feature set. The other multidimensional features include date and time features, weather features, electricity price tier features, power supply structure features, water season features, renewable energy output features, load features, electricity price differential features, and penetration rate. Compared to the original multidimensional features that included independent inputs of frequency regulation mileage and frequency regulation capacity, this invention reduces one dimension while retaining effective information on frequency regulation mileage and capacity, and avoids interference from multicollinearity.

[0035] In step S3, the first expert model employs a fusion model of ARIMA and LSTM for the negative electricity price segment. ARIMA, or Autoregressive Integral Moving Average, is a classic linear time series forecasting method suitable for capturing linear dependencies in stationary time series. LSTM, or Long Short-Term Memory, is a variant of recurrent neural networks that effectively learns long-term nonlinear dependencies in time series data. By fusing the two, ARIMA can be used to extract the linear trend and periodic components of the negative electricity price segment, while LSTM can be used to learn the nonlinear fluctuations in negative electricity prices caused by factors such as market shocks and overcapacity of new energy sources.

[0036] The mathematical form of the ARIMA model is: ; in, Let be the negative charge value at time t. express The order difference operation is used to transform a non-stationary sequence into a stationary sequence; For constant terms; to These are the autoregressive coefficients. The order of autoregression; This is the white noise error term; to The moving average coefficient, This represents the order of the moving average. In this embodiment, the optimal parameters are determined using the Bayesian information criterion. , , The ARIMA model outputs a linear prediction component. .

[0037] The LSTM model accepts the same input feature sequence as ARIMA, including historical data corresponding to negative electricity price segments in the final input feature set of step S2. The internal structure of the LSTM unit includes a forget gate, an input gate, and an output gate, enabling selective memorization and forgetting of historical information. The LSTM model outputs a nonlinear residual prediction component. .

[0038] The final fusion prediction result is as follows: ; During training, since the number of samples in the negative electricity price segment is much smaller than in other segments, data augmentation is required. Specifically, pseudo-random negative electricity price information is added to the original negative electricity price samples, and Gaussian random noise with a mean of zero and a standard deviation of 0.05 is superimposed to simulate the actual situation of negative price limits caused by market factors or sudden policy changes. The data-augmented negative electricity price samples, together with samples from other segments, constitute a balanced training dataset, avoiding the impact on model performance due to an insufficient number of samples of a certain feature type.

[0039] The second expert model, targeting low-electricity-price areas, employs a temporal convolutional network model embedded with a duck curve template. The duck curve template is a classic load curve shape that describes the afternoon trough and evening surge in net load after large-scale photovoltaic power generation integration. In this embodiment, the duck curve template is not fixed but iteratively updates its weights using adaptive parameter learning to adapt to the unique electricity price patterns in some regions affected by the high and low periods of hydropower.

[0040] The duck curve template is initialized using a typical duck curve shape, containing standardized template values ​​for 24 time points, denoted as . Where t=1,2,…,96 corresponds to 96 15-minute intervals per day. During training, template weights… As a learnable parameter, it participates in backpropagation, and the template value is updated according to the gradient after each iteration. : ; in, The values ​​of the model parameters or feature tensors before the update at time t. For learning rate, The loss function is used for prediction. Through adaptive learning, the template gradually fits the typical daily cycle pattern of the local low-electricity-price area.

[0041] The temporal convolutional network model employs a one-dimensional convolutional structure, with input consisting of historical data corresponding to low-electricity-price segments from the final input feature set in step S2. After inputting the data, a duck curve template is used. As additional prior information, after superimposing the target output based on the batch-processed convolutional layer output and adding an activation function, and discarding some learned erroneous information, it is fed into a two-layer LSTM network for subsequent parameter iterations. The convolutional layers use kernels of size 3 with a stride of 1 and the same padding method to maintain temporal length. After two convolutional layers and one global average pooling layer, the predicted electricity price for the low-price segment is output. Figure 4 As shown, Batch Normalization (BN) is the batch normalization layer, GeLU is the activation function, DM-ATTN is the adaptive learning duck curve template, and Dual-LSTM is a two-layer LSTM network structure. The duck curve template is embedded between the input layer and the convolutional layer, guiding the network to learn the typical daily cycle pattern of low-electricity-price segments. Figure 4 The entire structure is the network model used during training; the TCN temporal convolutional network model is the part enclosed by the dashed box.

[0042] The third expert model, denoted as TM-GD-FT, is used for normal electricity price ranges and employs a multi-scale electricity price prediction model based on TimesMixer. This model introduces Fourier transform to capture frequency domain features on top of TimesMixer and incorporates a distribution aggregation mechanism to fuse multi-scale features and correct residuals. For example... Figure 5As shown, this is a 25-layer deep learning network. This network consists of four parts: Gather (feature aggregation), Distribution (feature distribution), Residual Learning (residual learning), and ShapeAdjustment (feature dimension adjustment). These four parts have 3, 3, 4, and 10 layers respectively. The Gather and Distribution parts together form the GD mechanism (feature distribution-aggregation mechanism), and there are 5 layers of connection modules for feature adjustment and feature dimension concatenation between these two parts. During the initial input transmission, Norm represents normalization preprocessing of the data. The feature aggregation part includes a Conv1D convolution module, BN (batch normalization), ReLU activation function, Dropout (randomly discarding some invalid parameters), UPSAMPLE (upsampling), and Downsample (downsampling). The meanings of the transfer layer and feature connection mechanism module between the feature aggregation part (Gather) and the feature distribution mechanism (Distribution): CONCAT represents feature concatenation, GlobalAveragePooling1D represents the global average pooling module, Dense represents the feature aggregation module, and RepeatVector represents the parameter size being restored to the input scale. In the feature distribution mechanism (Distribution): W represents feature weight information; W1, W2, and W3 have similar meanings. For example, (0:64) indicates taking the first 64 features of the learned sequence; MULTIFLY represents dot product operation, meaning the weight information and feature information are multiplied by corresponding points and stored in the original position; ADD means the features of this sequence are added point by point and then saved to the original position. Residual Learning Network: MovingAvg indicates rolling average, Residue indicates residual block, ADD_DOWNSAMPLE indicates downsampling module with feature stacking (feature operation in corresponding dimension at the same scale), ADD_UPSAMPLE indicates upsampling module with feature stacking (feature operation in corresponding dimension at the same scale), and the meanings of ADD, DOWNSAMPLE, and UPSAMPLE modules are the same as above. Feature Dimension Adjustment Mechanism: LN indicates linear layer, BILSTM indicates bidirectional LSTM network module, and the meanings of the remaining modules are the same as described above. Denorm Output after the four stages indicates the output prediction result after denormalization to restore the parameter range of the original sequence.

[0043] The input layer reads the final input feature set obtained in step S2, where the feature vector dimension is 31 and the target electricity price sequence is y. The model first performs three upscaling downsampling operations with downsampling sizes of 64, 128, and 192, respectively. After each downsampling, a 5x5 template is used for feature extraction, which is then halved according to the window length and sorted, with zero padding used for empty spaces. Subsequently, moving average pooling is performed with a 3x3 receptive field and a stride of 1, and the moving average pooling fill value is calculated. During multi-scale concatenation, the input features of the previous layer are upsampled and extracted, and then downsampled according to the feature dimension size for restoration. Feature fusion uses a residual stacking method and introduces a spatiotemporal attention mechanism module to optimize the control of cross-scale residual features, increasing the ratio of residual repair to feature restoration.

[0044] Building upon the aforementioned feature collection and concatenation mechanism, a distribution aggregation mechanism, GD, is introduced. The GD mechanism originates from the Gold-YOLO object detection model and, in this time-series prediction scenario, fills in the learned features at each scale using least-squares pooling. Specifically, the electricity price curve is decomposed into three components: ,in, This represents the actual electricity price sequence or label value. Including linear patterns or small-amplitude random variations, This includes cyclical patterns combined with low-exponential patterns. This includes large fluctuation patterns. The GD mechanism learns to fill in curve patterns using pooling according to feature scale, adapting to the complexity of the curve patterns. After feature processing and before aggregation, the features issued according to scale requirements are scaled and the residuals are matched to correct numerical errors in the curve patterns caused by integer scale discretization. The pattern changes are then injected into the corresponding feature fusion scale layer according to the feature level. Finally, the scales are aligned according to time patterns to output high-dimensional fused features.

[0045] High-dimensional fused features are fed into a bidirectional LSTM network to learn and retain effective temporal features. The output of the bidirectional LSTM enters the Dense module for feature aggregation. The parameter 1 of the Dense module indicates that the full-dimensional feature alignment output dimension is 1-dimensional. The final output contains only the electricity value vector of the time-domain electricity price curve. The model training uses a two-sided loss function, defined as the absolute difference between the predicted electricity price and the actual electricity price. This loss function can effectively alleviate the problem of the model overestimating low electricity prices and underestimating high electricity prices, thus accelerating network convergence.

[0046] The fourth expert model targets high-electricity-price areas and employs an SCNN-LSTM model based on an interactive attention mechanism. The interactive attention mechanism is the CASM module, which stands for Combined Attention Space Module. CASM is composed of dual-branch attention (DCA) and an improved cross-attention module (SAFM). DCA, or dual-branch channel attention, is used to extract importance weights of features from the channel dimension; SAFM, or scale-adaptive feature modulation module, is used to enhance feature representation in the spatial dimension.

[0047] like Figure 6 As shown in the diagram, Decomposion is the feature separation module, FeatureAlone is the independent feature parameter information of the original input, DYJG-Structure is the encoded information of the power structure, DCA is the dual-branch feature fusion attention, PadConv is a convolutional module with pooling and padding properties, CAFM is an interactive attention mechanism, and SAFM is the overall structure name of the improved CAFM in this invention. The input features first pass through the dual-branch attention DCA, which contains two parallel branches: one branch generates channel weights through global average pooling and a fully connected layer, and the other branch generates channel weights through global max pooling and a fully connected layer. The two weights are added together and activated by a Sigmoid function to obtain the channel attention weights, which are then multiplied by the original features to obtain the channel-enhanced features. The channel-enhanced features are then fed into the improved cross-attention SAFM. SAFM prepends each of the dual-branch inputs with a padding function and applies a Sigmoid activation function to the output of the convolutional modules. The two signals are then aggregated and input into the cross-attention mechanism. The cross-attention mechanism calculates the correlation weights between the two signals, achieving a recalibration of the spatial location.

[0048] The output of the CASM module is residually concatenated with the original input and then fed into the CNN-LSTM main network. The CNN part uses two one-dimensional convolutional layers with a kernel size of 3, a stride of 1, and the same padding method to extract local temporal patterns. The output of the convolutional layers is flattened and then fed into the LSTM layer, which has 64 hidden units. The output of the LSTM is then passed through a fully connected layer to obtain the predicted electricity price for high-price areas. Figure 7 As shown, the CASM module is located before the CNN and is used to enhance the model's ability to perceive abrupt changes in high-electricity-price segments. The CNN mechanism includes a Conv-AvgPooling1D-Conv cascade structure, where Conv represents the convolutional module and AvgPooling1D represents the average pooling module. Additionally, ZeroPad represents the zero-padding pooling mechanism, and the other meanings are consistent with those described above. Four expert models were trained independently using training data for their respective electricity price zones. An early stopping mechanism was employed during training: training was halted when the validation set loss stopped decreasing for 10 consecutive rounds to prevent overfitting. After each model was trained, its parameters and normalization parameters were saved.

[0049] In step S4, the gating mechanism uses unique thermal coding to classify electricity price segments. The classification criteria include meteorological forecasts, rainfall variations, temporal characteristics, and peak-valley patterns, predicting the electricity price segment affiliation for each forecast point based on time. Auxiliary features include at least temperature, precipitation, cloud cover, wind speed, rainfall period, peak hour identifiers, and power supply structure coding.

[0050] Specifically, for each forecast time, auxiliary features for that time are first collected. These include: meteorological forecasts derived from weather forecast data, including point-by-point forecasts of temperature, precipitation, cloud cover, and wind speed for the next 24 hours; water season variations determined by monthly and historical hydrological data to identify the current water season type (high-water, normal, or low-water); time characteristics including the hour, day of the week, and whether it is a public holiday; peak-valley patterns based on local electricity market data, marking each 15-minute interval as a peak, normal, or low period; and power structure coding, based on the expected output percentage of various power sources at that time, converted into numerical values ​​using dictionary encoding.

[0051] These auxiliary features are concatenated into a feature vector and input into a pre-trained segment classifier. This classifier uses a lightweight gradient boosting decision tree model and outputs probability values ​​for four segments. The segment with the highest probability is selected as the electricity price segment to which the prediction point belongs. The training data for the segment classifier comes from historical electricity price data, using the actual electricity price segment at each time point as the label and the corresponding auxiliary features as input.

[0052] Based on the electricity price range determined by the gating mechanism, the corresponding expert prediction model is invoked to predict the electricity price value. If the range is determined to be a negative electricity price range, the first expert model, namely the fusion model of ARIMA and LSTM, is invoked; if the range is determined to be a low electricity price range, the second expert model, namely the temporal convolutional network model with embedded duck curve template, is invoked; if the range is determined to be a normal electricity price range, the third expert model, namely the multi-scale electricity price prediction model TM-GD-FT based on TimesMixer, is invoked; if the range is determined to be a high electricity price range, the fourth expert model, namely the SCNN-LSTM model based on the interactive attention mechanism, is invoked.

[0053] Each expert model takes the features corresponding to the prediction time from the final input feature set obtained in step S2 as input and outputs the predicted electricity price value for that time. For each prediction day, segment determination and model invocation are performed point by point, ultimately forming a complete 96-point electricity price prediction curve, denoted as [missing information]. .

[0054] After generating the complete prediction curve, a chi-square test is performed on the predicted electricity price curve and the actual electricity price curve to obtain the confidence level. The chi-square test is used to evaluate the goodness of fit between the predicted curve and the actual curve. Specifically, the predicted electricity price and the actual electricity price are discretized into... We calculate the frequency distribution within each of several intervals. Let the frequency distribution of the predicted electricity price be... The frequency distribution of real electricity prices is Then the chi-square statistic is: ; in, To determine the number of intervals, in this embodiment, K=10, dividing the electricity price range from -50 yuan / MWh to 800 yuan / MWh into 10 evenly spaced intervals. A smaller chi-square statistic indicates that the predicted distribution is closer to the actual distribution. The chi-square statistic is converted to a confidence level using the following formula: ; in, Let K be the cumulative distribution function of the chi-square distribution, with K degrees of freedom. 1 = 9. The confidence level ranges from 0 to 1, with values ​​closer to 1 indicating a more reliable prediction.

[0055] Based on the confidence level obtained from the chi-square test, a corresponding transaction decision is generated. A first threshold and a second threshold are set, with the first threshold being higher than the second threshold. In this embodiment, the first threshold is set to 70%, and the second threshold is set to 70%.

[0056] When the confidence level is above the first threshold, a model-driven buy-low-sell-high trading strategy is generated. At this point, the prediction is considered highly reliable, and active trading can be initiated based on the prediction curve. When the confidence level is below the second threshold, a stop-loss or stop-loss trading strategy is generated. At this point, the prediction is considered unreliable, and trading should be avoided or an immediate stop-loss should be implemented. When the confidence level is between the first and second thresholds, a half-position trading or wait-and-see trading strategy is generated. At this point, the prediction is considered partially reliable, and a conservative strategy should be adopted, involving only half-position trading or temporary observation.

[0057] When the confidence level is higher than the first threshold, a buy-low-sell-high trading strategy is executed. The core of this strategy is to determine the optimal buying and selling opportunities based on the predicted electricity price curve. The specific steps are as follows: First, based on the predicted electricity price curve Calculate the first and second differences. The first difference represents the rate of change in electricity prices, and the formula is: ; The second-order difference represents the acceleration of the rate of change in electricity prices, and the calculation formula is: ; The sets of peaks and valleys are determined by the signs of the first and second-order differences. A point is a peak when the first-order difference changes from positive to negative and the second-order difference is negative; a point is a valley when the first-order difference changes from negative to positive and the second-order difference is positive. All peaks are denoted as a set. All valley points are denoted as set. .

[0058] Then, combining the user's current remaining battery power and electricity demand, a ridge regression optimization is used to generate a maximum-profit trading strategy. Let the user's current remaining battery power be... The daily electricity demand is The maximum amount of electricity that can be used for trading is... A negative number indicates that electricity needs to be purchased. The goal of the trading strategy is to maximize profits by buying low and selling high while meeting electricity demand.

[0059] The objective function for ridge regression optimization is: ; in, Let t represent the transaction volume at time t, where a positive number indicates a purchase and a negative number indicates a sale; These are transaction penalties used to limit frequent transactions; Let be the weight vector to be optimized; The regularization coefficient is set to 0.1. The optimization process obtains the optimal electricity trading sequence by solving the closed-form solution of ridge regression. This maximizes total profit while satisfying power constraints. The formula for calculating total profit is: ; The negative sign indicates expenditure upon purchase and revenue upon sale. The final output trading strategy includes the recommended trading direction and electricity consumption at each moment, as well as the expected total profit. This strategy can be provided to users as a trading decision suggestion, which users can manually confirm or automatically execute based on actual circumstances.

[0060] Experimental verification To verify the effectiveness of the capacity and mileage joint optimization decision-making method for energy storage participation in the frequency regulation market proposed in this invention, this experiment conducted ablation experiments and comparative experiments on each model and strategy in steps S1 to S4 based on historical data from the XX electricity spot market. The training rounds consisted of 100 rounds, with a training set to validation set length ratio of 19:1, a sliding window length of 96 time points, and a time granularity of 15 minutes per interval.

[0061] This experiment aims to verify the predictive performance of the TM-GD-FT model, which is an improvement on the TimesMixer model. Using the original TimesMixer model as a baseline, a Fourier Transform (FT) module and a distribution aggregation mechanism (GD) module were sequentially introduced, resulting in two enhanced versions: TM-FT and TM-GD-FT. Experimental metrics included Mean Absolute Percentage Error (MAPE), Coefficient of Determination (R²), and Trend Capture Rate (TCR). The typical day selected was the actual electricity price curve on May 4th. The experimental results are shown in Table 1.

[0062] Table 1. Ablation Experiment Comparison Table

[0063] Experimental results show that each improved module has a positive impact on model performance. Regarding prediction accuracy, the original TimesMixer's MAPE was 55.60%, which TM-FT significantly reduced to 33.01%, a decrease of 22.59 percentage points. This indicates that introducing frequency domain features effectively enhances the model's ability to capture periodic signals. After further adding the GD mechanism, the MAPE of TM-GD-FT decreased to 30.94%, a further reduction of 2.07 percentage points compared to TM-FT. This demonstrates that the global-local distribution mechanism can effectively integrate multi-scale information and improve the model's ability to represent price fluctuation patterns. In terms of goodness of fit, TM-GD-FT achieved an R² of 0.6527, an improvement of 0.2750 and 0.3847 compared to the original TimesMixer's 0.3777 and TM-FT's 0.2680, respectively. This indicates that the introduction of the GD mechanism significantly improves the model's ability to explain the variance of electricity price changes. In terms of trend prediction, the TCRs of the three modules were 61.70%, 62.60%, and 63.19%, respectively, showing a steady upward trend, indicating that each module maintained a stable positive contribution in judging the trend direction. Overall, the FT module significantly improved the basic level of prediction accuracy, while the GD module achieved a qualitative breakthrough in goodness of fit. The synergistic effect of the two modules enabled TM-GD-FT to achieve optimal results in accuracy, goodness of fit, and trend capture, validating the effectiveness of combining multi-scale frequency domain feature extraction with a global-local information interaction mechanism.

[0064] like Figure 8 The figure shows the backtesting data of the TM-GD-FT algorithm on the test set. The blue curve represents the actual electricity price, and the orange curve represents the model's predicted electricity price. As can be seen from the figure, although there is some random error, the overall curve pattern is close to the actual curve pattern. FT improves the ability to control the curve structure, while the GD mechanism helps the model grasp prior information about recent electricity price patterns. The combination of the two greatly reduces the probability of misjudging electricity price trends and improves the model's ability to control market patterns.

[0065] This experiment aims to verify the necessity of using frequency regulation mileage and frequency regulation capacity as input features for electricity price prediction, as proposed in step S2, and the effect of eliminating their coupling through principal component analysis. The experiment fixed the network model as DM-TCN-LSTM, with seven essential features including permeability, water season, temperature, actual load, and peak hours. Under the same typical daily conditions, the experiment tested the prediction performance under four configurations: no frequency regulation mileage and capacity, only frequency regulation capacity, only frequency regulation mileage, and both. The experimental results are shown in Table 2.

[0066] Table 2. Results of the impact of adding frequency regulation mileage and frequency regulation capacity on electricity price forecasting

[0067] Experimental results show that both frequency regulation mileage and frequency regulation capacity are effective input features for electricity price prediction, but they need to be introduced together to achieve optimal results. Introducing frequency regulation capacity alone does not improve model performance; instead, the MAPE increases from 39.60% to 57.23%. Introducing frequency regulation mileage alone improves prediction accuracy, but the MAPE decreases to 38.44%. However, when both features are included in the model simultaneously, the MAPE drops sharply to 8.33%, R² jumps to 0.6652, and TCR increases to 62.50%, with all indicators being the best among the four experimental groups. This indicates a significant synergistic effect between frequency regulation mileage and frequency regulation capacity: the former characterizes the system's regulation depth, while the latter represents the adjustable capacity boundary. Together, they constitute a complete picture of frequency regulation capability and are strongly correlated with electricity prices. Therefore, when constructing an electricity price prediction model, both should be included as combined features to fully capture the deep coupling relationship between frequency regulation ancillary service market information and electricity market prices.

[0068] This experiment focuses on the CASM module used in the fourth expert model in step S3, verifying its improvement in predicting high-electricity-price areas. Using CNN-LSTM as the baseline model, CAFM attention mechanism, DCA dual-branch attention mechanism, and the CASM module were gradually introduced. Experimental results are shown in Table 3.

[0069] Table 3 Ablation Experiment Results of the Improved CASM Module in the High Electricity Price Model

[0070] Experimental results show that the CASM attention mechanism brings a significant performance leap in predicting high electricity prices. The baseline model CNN-LSTM has extremely limited predictive ability in high electricity price scenarios, with a MAPE of 26.03% and an R² of only 0.0750, offering almost no explanatory power. After gradually introducing the CAFM module, the MAPE drops significantly to 20.73%, a relative decrease of 20.4%, and the R² increases to 0.4931, indicating that the channel attention mechanism can effectively capture the key features of electricity price fluctuations. After further superimposing the DCA dual-branch attention, the MAPE drops to 15.34%, a relative decrease of 11.49% compared to the baseline, but the R² falls back to 0.2432, and the TCR decreases from 65.00% to 58.75%, indicating that there is redundant conflict between the two feature signals output by the dual-branch structure, and direct superposition interferes with the stable convergence of the model. Finally, by aligning the input and output of DCA and CAFM and employing an optimization strategy of pre-filling convolutions with Sigmoid activation, a CASM module was formed. This resulted in an optimal MAPE of 10.96%, a 57.9% reduction from the baseline, a jump in R² to 0.6438, and an improvement in TCR to 81.67%. This result fully validates the superiority of CASM in high-electricity-price regions: its dual-branch interactive attention mechanism not only compensates for the inference delay and information splicing errors caused by PCA dimensionality reduction but also effectively resolves the parameter conflict problem of the two-path features through the SAFM aggregation strategy, integrating the two enhanced signals into a unified feature stream that meets the parameter transmission requirements of convolutional networks. This achieves higher-precision fitting and more robust training convergence in the high-electricity-price sub-region, where samples are scarce and fluctuations are drastic.

[0071] like Figure 9 As shown in the figure, the two segments highlighted in brown represent high electricity price areas. The figure demonstrates that the improved model can essentially fit or overlap with the original high electricity price curve, accurately estimate the trend of high electricity prices, has strong explanatory power for low-value patterns, and improves the predictive ability for low-price regions.

[0072] This experiment examines the improvement of the ARIMA-LSTM fusion model used in the first expert model in step S3 for predicting negative electricity price ranges. Using pure LSTM as a baseline, the PCA-LSTM and ARIMA-LSTM schemes are compared. The experimental results are shown in Table 4.

[0073] Table 4 Comparison of Ablation Experiments Using Negative Electricity Price Model

[0074] Experimental results show that the ARIMA-LSTM scheme performs best across all evaluation metrics. In terms of prediction accuracy, the MAPE of ARIMA-LSTM is only 18.76%, a decrease of 6.08 percentage points compared to the pure LSTM's 24.84%, and a decrease of 20.19 percentage points compared to the PCA-LSTM's 38.95%, indicating that ARIMA can more accurately capture the temporal fluctuation characteristics of negative electricity price ranges. Regarding goodness of fit, the R² of pure LSTM is -0.1554, indicating that its prediction performance is even worse than simple mean estimation. PCA-LSTM improves the R² to 0.3961, and ARIMA-LSTM further improves it to 0.6441, demonstrating that ARIMA's ability to model the temporal dependence of electricity price series is significantly better than the linear dimensionality reduction method of PCA. In terms of trend-capturing ability, ARIMA-LSTM achieved a TCR of 64.58%, significantly higher than PCA-LSTM's 58.33% and pure LSTM's 45.83%, indicating that ARIMA can more accurately identify changes in the direction of electricity price increases and decreases.

[0075] like Figure 10 The figure shows the backtesting results after adding ARIMA. As can be seen from the figure, the ARIMA-LSTM prediction curve in the negative electricity price region has the highest accuracy to the actual curve, reaching 95.3%. It exhibits particularly good response at the abrupt change point where electricity prices turn from positive to negative, verifying the effectiveness and superiority of the ARIMA mathematical model in predicting negative electricity prices.

[0076] This experiment examines the duck curve template used in the second expert model in step S3 to verify its improvement in predicting performance for low-electricity-price areas. Based on a single-layer TCN-LSTM network, the results are compared with and without the duck curve template. The experimental results are shown in Table 5.

[0077] Table 5 Comparison of ablation experiments using the low electricity price model

[0078] Experimental results show that after adding the duck curve template, the model achieved significant improvements in all evaluation indicators: MAPE decreased from 18.95% to 13.84%, a relative improvement of 26.9%; R² jumped from -0.3882 to 0.664, improving the model from ineffective prediction to having strong explanatory power; TCR increased from 50.98% to 61.36%, indicating that the introduction of the template effectively guided the network to learn the typical daily cycle pattern of the electricity price curve, and the prediction accuracy and trend capture ability in the low electricity price range were significantly enhanced.

[0079] like Figure 11As shown, the influence of the duck curve template on the prediction results is analyzed, with subplot a representing the case without a template and subplot b representing the case with a template. The comparison reveals that the template improves the grasp of the overall trend of electricity prices and reduces the accumulation of systematic errors. For real-time predictions of continuously rising electricity prices throughout the day, the template-based curve is more accurate, while the template-free curve, although relatively better for nighttime electricity price predictions, struggles to completely eliminate the problems of incorrectly judging peak and off-peak periods and misjudging low prices.

[0080] This experiment compares two multi-expert model integration strategies—equivalent prediction and prior prediction—based on the gating mechanism proposed in step S4. Equal prediction superimposes the four expert models E1 to E4 with equal weights of 0.25; prior prediction uses a gating mechanism to first determine the electricity price range and then selects the corresponding expert model for single-point prediction. The experimental results are shown in Table 6.

[0081] Table 6. Comparison of Validation Strategies Using Multi-Expert Models for Different Methods

[0082] Experimental results show that prior prediction outperforms equal-weighted prediction in all indicators: MAPE decreased from 26.14% to 22.96%, R² increased significantly from 0.3920 to 0.9725, and TCR increased from 58.82% to 61.97%. This significant difference indicates that the effectiveness of multi-expert models depends on a reasonable weight allocation strategy. Equal-weighted superposition introduces noise interference from irrelevant models, while the gating mechanism based on electricity price segment identification can fully leverage the local advantages of each expert model, achieving specialized models for specific purposes, thereby significantly improving prediction accuracy and goodness of fit.

[0083] like Figure 12 As shown, the graphs compare the long-term prediction results under different strategies. Subplot a represents the equal-weighted prediction, and subplot b represents the prior prediction. It can be seen that the prior prediction method yields more conservative results and fits the true curve better, while the equal-weighted prediction method causes the model to learn the average effect, making it difficult to capture the true fluctuation patterns of the data.

[0084] This experiment tested the AI ​​trading system's decision-making results under six typical scenarios, focusing on the chi-square test confidence strategy in step S4. The system automatically executed the optimal trading strategy based on the chi-square test confidence and the user's remaining battery power. The experimental results are shown in Table 7.

[0085] Table 7 Model-Based Trading Decision Table

[0086] Experimental results show that the AI ​​trading performance is excellent in high-confidence scenarios: Scenario 1, with a 92% confidence level and a remaining capacity of 2000 kWh, profits of 320 yuan were made by selling with high confidence; Scenario 6, with an 88% confidence level and a remaining capacity of 4500 kWh, profits of 580 yuan were made by selling to the green electricity market, verifying the effectiveness of the AI ​​model's trading decisions in the high-confidence range. In medium-confidence scenarios, Scenario 5, with a 78% confidence level and a remaining capacity of -1000 kWh, incurred a loss of 120 yuan through a low-price pre-stored electricity strategy, which is an active cost optimization behavior. In the long run, electricity costs can be reduced by hedging against peak-valley price differences. In low-confidence scenarios, Scenario 3 only profited 5 yuan at a 45% confidence level, and Scenario 4 directly triggered a stop-trading or stop-loss strategy at a 28% confidence level, resulting in zero profit, indicating that the system can effectively avoid risks when the model is unreliable. In summary, the optimal approach is as follows: when the confidence level is greater than or equal to 85%, the AI ​​model dominates the trading process and executes trades fully; when the confidence level is between 70% and 85%, a robust strategy is implemented; when the confidence level is less than 50%, the system automatically stops trading and prompts for manual intervention, thus achieving a balance between maximizing profits and minimizing risks.

[0087] Through the above series of experiments, the capacity and mileage joint optimization decision-making method for energy storage participation in the frequency regulation market proposed in this invention has been fully verified in each stage. In step S1, the TM-GD-FT model significantly improved the accuracy of electricity price prediction through Fourier transform and distribution aggregation mechanism; in step S2, after the synergistic introduction of frequency regulation mileage and frequency regulation capacity and the elimination of coupling by principal component analysis, the predicted MAPE decreased from 39.60% to 8.33%; in step S3, the four expert models achieved optimal performance in their respective electricity price segments. The CASM module improved R² from 0.0750 to 0.6438 in the high electricity price segment, the ARIMA-LSTM improved R² from -0.1554 to 0.6441 in the negative electricity price segment, and the duck curve template improved R² from -0.3882 to 0.664 in the low electricity price segment; in step S4, the prior prediction strategy of the gating mechanism improved R² to 0.9725, and the trading decision achieved stable positive profitability in the high confidence scenario. The above results fully demonstrate the effectiveness and superiority of the present invention.

[0088] Example 2: A joint optimization decision-making system for capacity and mileage of energy storage participating in the frequency regulation market. This system is used to implement the joint optimization decision-making method for capacity and mileage of energy storage participating in the frequency regulation market described in Example 1, such as... Figure 13 As shown, it includes a data acquisition module, a feature analysis module, an expert prediction module, and a gating decision module.

[0089] The system comprises the following modules: a data acquisition module for acquiring historical electricity data, which includes at least time-series electricity price data and multi-dimensional features related to electricity prices; a feature analysis module for extracting frequency regulation mileage and capacity as candidate features for electricity price prediction from the multi-dimensional features, determining the contribution of frequency regulation mileage and capacity to electricity price prediction through SHAP analysis, and retaining key features after eliminating the coupling between frequency regulation mileage and capacity using principal component analysis, which, along with other multi-dimensional features, constitutes the final input feature set; an expert prediction module for constructing multiple expert prediction models for different electricity price segments based on the final input feature set, including a first expert model for negative electricity price segments, a second expert model for low electricity price segments, a third expert model for normal electricity price segments, and a fourth expert model for high electricity price segments; and a gating decision module for determining the electricity price segment based on auxiliary features at the current prediction time through a gating mechanism, calling the corresponding expert prediction model, using the corresponding features in the final input feature set as input to predict the electricity price value, and generating a trading decision based on the prediction results.

[0090] Working principle: First, the distribution aggregation mechanism GD and Fourier transform FT are used to enhance the TimeMixer model's ability to separate high-frequency abrupt changes and low-frequency trends in the electricity price sequence, enabling the model to learn linear, periodic, and large fluctuation patterns simultaneously without mutual interference. Next, SHAP analysis is used to confirm the key impacts of frequency regulation mileage and capacity on electricity prices, and PCA is used to eliminate their coupling, ensuring feature independence. Then, dedicated expert models are designed for four price segments: negative, low, normal, and high. A gating mechanism is used to call the corresponding model according to the price segment, avoiding performance trade-offs between different segments for a single model. Finally, a tiered trading strategy is formulated by combining chi-square test confidence and user electricity reserves, improving the accuracy of electricity price prediction and the stability of trading returns.

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

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

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

[0094] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0095] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.

Claims

1. A joint optimization decision-making method for capacity and mileage of energy storage participating in the frequency regulation market, characterized in that, Includes the following steps: Acquire historical electricity data, which includes at least time-series electricity price data and multi-dimensional features related to electricity prices; Frequency regulation mileage and frequency regulation capacity are extracted from the multidimensional features as candidate features for electricity price prediction. The contribution of frequency regulation mileage and frequency regulation capacity to electricity price prediction is determined by SHAP analysis. After eliminating the coupling between frequency regulation mileage and frequency regulation capacity using principal component analysis, they are retained as key features. The key features and the remaining multidimensional features constitute the final input feature set. Based on the final input feature set, multiple expert prediction models are constructed for different electricity price segments. The multiple expert prediction models include a first expert model for negative electricity price segments, a second expert model for low electricity price segments, a third expert model for normal electricity price segments, and a fourth expert model for high electricity price segments. The electricity price range is determined by the auxiliary features at the current prediction time through the gating mechanism, the corresponding expert prediction model is called, the corresponding features in the final input feature set are used as input to predict the electricity price value, and a transaction decision is generated based on the prediction result.

2. The capacity and mileage joint optimization decision-making method for energy storage participating in the frequency regulation market according to claim 1, characterized in that, The first expert model is a fusion model of ARIMA and LSTM; The ARIMA is used to capture the time-dependent features of negative electricity price segments, and the LSTM is used to learn the nonlinear fluctuation pattern. During training, pseudo-random negative electricity price information and random noise are added to the negative electricity price segments to balance the number of samples in each electricity price segment.

3. The capacity and mileage joint optimization decision-making method for energy storage participating in the frequency regulation market according to claim 1, characterized in that, The second expert model is a temporal convolutional network model embedded with a duck curve template, wherein the duck curve template uses an adaptive parameter learning method to iteratively update the weights; The duck curve template is used to guide the temporal convolutional network model to learn the typical daily cycle pattern of the low electricity price segment.

4. The capacity and mileage joint optimization decision-making method for energy storage participating in the frequency regulation market according to claim 1, characterized in that, The third expert model is a multi-scale electricity price prediction model based on TimesMixer. The multi-scale electricity price prediction model introduces Fourier transform to capture frequency domain features on the basis of TimesMixer, and introduces a distribution aggregation mechanism to fuse multi-scale features and correct residuals. The distribution and aggregation mechanism is derived from the Gold-YOLO object detection model. In the time-series prediction scenario, it learns features at each scale by pooling according to the least squares rule, and then distributes the features to the corresponding level according to the scale for residual correction and alignment fusion.

5. The capacity and mileage joint optimization decision-making method for energy storage participating in the frequency regulation market according to claim 1, characterized in that, The fourth expert model is an SCNN-LSTM model based on an interactive attention mechanism, which is a CASM module. The CASM module is composed of a dual-branch attention DCA and an improved cross-attention SAFM. The improved cross-attention SAFM is achieved by placing a convolutional module with padding function before each of the two branch inputs, adding a Sigmoid activation function, and then aggregating the two signals before inputting them into the cross-attention mechanism.

6. The capacity and mileage joint optimization decision-making method for energy storage participating in the frequency regulation market according to claim 1, characterized in that, The gating mechanism uses unique thermal coding to classify electricity price segments. The classification criteria include meteorological forecast conclusions, water season changes, time characteristics, and peak-valley patterns. The electricity price segment at each forecast point is predicted according to the time point. In addition, the auxiliary features include at least temperature, precipitation, cloud cover, wind speed, water season, peak period identifier, and power structure code.

7. The capacity and mileage joint optimization decision-making method for energy storage participating in the frequency regulation market according to claim 1, characterized in that, The generation of transaction decisions includes: A chi-square test is performed on the predicted electricity price curve and the actual electricity price curve to obtain the confidence level; When the confidence level is higher than the first threshold, a low-buy-high-sell trading strategy dominated by the generation model is adopted. When the confidence level is lower than the second threshold, a trading strategy is generated to stop trading or trigger a stop loss. When the confidence level is between the first threshold and the second threshold, a trading strategy of either half-position trading or observation is generated.

8. The capacity and mileage joint optimization decision-making method for energy storage participating in the frequency regulation market according to claim 7, characterized in that, The buy-low-sell-high strategy includes: The peak and valley sets are determined by the first and second differences of the predicted electricity price curve. The maximum profit trading strategy is then solved by ridge regression optimization, taking into account the user's current electricity surplus and electricity demand.

9. The capacity and mileage joint optimization decision-making method for energy storage participating in the frequency regulation market according to claim 1, characterized in that, The method also includes data preprocessing of the historical power data, specifically: Electricity prices are normalized according to the price limit range, temperature is normalized according to the temperature range, and other numerical features are normalized to the zero-to-one interval. Among them, the electricity price tier characteristics, power supply structure characteristics, and water season characteristics in the historical electricity data are converted into numerical values ​​using unique thermal encoding or dictionary encoding.

10. A joint optimization decision-making system for capacity and mileage of energy storage participating in the frequency regulation market, characterized in that, include: The data acquisition module is used to acquire historical electricity data, which includes at least electricity price time-series data and multi-dimensional features related to electricity prices; The feature analysis module is used to extract frequency regulation mileage and frequency regulation capacity from the multidimensional features as candidate features for electricity price prediction. The contribution of the frequency regulation mileage and frequency regulation capacity to electricity price prediction is determined by SHAP analysis. After eliminating the coupling between the frequency regulation mileage and frequency regulation capacity by principal component analysis, the key features are retained. The key features and the other multidimensional features constitute the final input feature set. The expert prediction module is used to construct multiple expert prediction models for different electricity price segments based on the final input feature set. The multiple expert prediction models include a first expert model for negative electricity price segments, a second expert model for low electricity price segments, a third expert model for normal electricity price segments, and a fourth expert model for high electricity price segments. The gating decision module is used to determine the electricity price segment based on the auxiliary features at the current prediction time through a gating mechanism, call the corresponding expert prediction model, use the corresponding features in the final input feature set as input to predict the electricity price value, and generate a transaction decision based on the prediction result.