Power spot transaction electricity quantity auxiliary decision method and system based on improved attention

By using a deep learning model that integrates multi-source features and improves the attention mechanism, the problems of single decision-making basis and insufficient adaptability in electricity trading decisions have been solved. This has enabled the stable operation of the electricity market and the scientific decision-making of trading volume, thereby improving the accuracy of electricity trading and the returns of market participants.

CN122155771APending Publication Date: 2026-06-05GUANGZHOU ELECTRIC POWER TRADING CENT CO LTD

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
GUANGZHOU ELECTRIC POWER TRADING CENT CO LTD
Filing Date
2026-02-13
Publication Date
2026-06-05

AI Technical Summary

Technical Problem

Existing electricity trading volume decision-making methods rely on single historical data and fail to fully incorporate diverse actual influencing factors such as renewable energy output fluctuations, user load changes, and fuel price fluctuations. This results in insufficient rationality of decisions under extreme weather and policy adjustments, and a lack of quantitative description of the dynamic correlation between features, making it difficult to support flexible adjustments to trading volume during peak and off-peak periods. Traditional models have weak adaptability and are unable to adapt to sudden changes in market supply and demand. There is a disconnect between auxiliary analysis and decision-making, and price forecasts are not directly related to trading volume, making it difficult to meet the actual trading needs of market participants.

Method used

By employing multi-source feature fusion and dynamic interactive analysis, and by improving the attention mechanism of a deep learning model, key features are screened. Combined with load demand forecasting and market trading rules, a transaction electricity decision model with the goal of maximizing revenue is constructed to determine the optimal transaction electricity.

Benefits of technology

It improves the accuracy and scientific nature of determining the trading volume, adapts to complex market environments, reduces decision-making biases in extreme scenarios, optimizes the trading revenue of market participants and the operating efficiency of the electricity market, and achieves dual optimization of the benefits of market participants and market order.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122155771A_ABST
    Figure CN122155771A_ABST
Patent Text Reader

Abstract

The application provides a power spot transaction electricity auxiliary decision-making method and system based on improved attention, and relates to the field of power transaction auxiliary decision-making. The correlation of multi-source features and spot prices is calculated, the dynamic interaction relationship between the multi-source features changing over time is calculated, and the key features are screened based on the correlation results and the dynamic interaction relationship. The key features are input into a deep learning model of an improved attention mechanism, and based on the processing of the feature attention layer, the local time attention layer and the long short-term memory network, the power spot price prediction result is obtained. Based on the spot price prediction result, combined with the load demand prediction, the power generation cost and the market transaction rules, a transaction electricity decision-making model with the maximum profit as the target is constructed, and the optimal transaction electricity is determined. The application determines the optimal transaction electricity based on multi-source features, improves the scientificity and rationality of transaction decision-making in a complex market environment, and guarantees the stable operation of the power market.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of power trading auxiliary decision-making technology, and in particular to a method and system for auxiliary decision-making of electricity spot trading based on improved attention. Background Technology

[0002] The decision on the amount of electricity to be traded is a core operation in the electricity market where market participants determine the scale of electricity to be traded based on their own needs, supply and demand and other factors in order to balance electricity demand and optimize revenue. Its rationality directly affects the operating efficiency of market participants and the supply and demand balance of the power system.

[0003] With the gradual development and improvement of regional electricity spot markets, transaction volume decisions based on reasonable auxiliary analysis have become a key means for market participants to avoid operational risks and improve transaction returns. Currently, although some research focuses on technologies related to transaction volume decisions, many practical problems still exist in actual applications, making it difficult to adapt to the complex and ever-changing spot market environment.

[0004] Current electricity trading decision-making suffers from several shortcomings: First, the decision-making basis is singular, relying heavily on limited historical data and failing to fully consider diverse practical influencing factors such as renewable energy output fluctuations, user load changes, and fuel price fluctuations. This leads to insufficient rationality in decision-making under extreme weather conditions and policy adjustments. Second, even with the introduction of multi-dimensional data, there is a lack of effective quantification of the dynamic correlations between features. For example, there is a lack of quantitative description of the correlation between peak and off-peak load periods and changes in the trading environment, making it difficult to support flexible adjustments to electricity trading volume during peak and off-peak periods and affecting the timeliness of decision-making. At the same time, traditional decision-making models have weak adaptability and are insufficiently fitted to nonlinear changes in the trading environment caused by sudden changes in market supply and demand. Decisions made during periods of supply and demand imbalance are prone to revenue losses or supply-demand mismatches. In addition, there is a disconnect between auxiliary analysis and decision-making. Existing research mostly stays at the price prediction level and does not directly link the prediction results to electricity trading decisions. Price prediction is treated as an isolated link and fails to fully leverage its auxiliary role in the allocation of core physical quantities of electricity trading volume in the power market, making it difficult to meet the actual trading needs of market participants. Summary of the Invention

[0005] To address the aforementioned issues, this invention proposes an auxiliary decision-making method and system for electricity spot trading based on improved attention. By accurately predicting electricity spot prices and using the prediction results to assist in determining the optimal trading volume, the method effectively improves the accuracy of determining the trading volume and enhances the scientific and rational nature of trading decisions in complex market environments, thereby ensuring the stable operation of the electricity market.

[0006] To achieve the above objectives, the present invention adopts the following technical solution: In a first aspect, the present invention provides a power spot trading electricity auxiliary decision-making method based on improved attention, comprising: Obtain multi-source features that influence spot prices and perform preprocessing; The correlation between the multi-source features and the spot price is calculated, and the dynamic interaction relationship between the multi-source features over time is calculated based on the sliding window mutual information; key features are selected based on the correlation results and the dynamic interaction relationship. The key features are input into a deep learning model with an improved attention mechanism. The feature dimension and time dimension are dynamically weighted based on the feature attention layer and the local temporal attention layer, respectively. The long short-term memory network is used to learn the long-term temporal dependence of the weighted features to obtain the prediction result of the spot price of electricity for a specified period in the future. Based on the electricity spot price forecast, combined with load demand forecast, generation costs and market trading rules, a transaction volume decision model with the goal of maximizing profits is constructed to determine the optimal transaction volume.

[0007] Secondly, the present invention provides an auxiliary decision-making system for electricity spot trading based on improved attention, comprising: The data acquisition module is used to acquire multi-source features that affect spot prices and perform preprocessing. The feature extraction module is used to calculate the correlation between the multi-source features and the spot price, and to calculate the dynamic interaction relationship between the multi-source features over time based on the sliding window mutual information; and to screen key features based on the correlation results and the dynamic interaction relationship. The price prediction module is used to input the key features into a deep learning model with an improved attention mechanism, dynamically weight the feature dimension and time dimension based on the feature attention layer and the local temporal attention layer respectively, and use a long short-term memory network to learn the long-term temporal dependence of the weighted features to obtain the prediction result of the spot price of electricity for a specified period in the future. The electricity volume auxiliary decision-making module is used to construct a transaction electricity volume decision-making model with the goal of maximizing profits, based on the electricity spot price forecast results, combined with load demand forecasts, generation costs and market transaction rules, and to determine the optimal transaction electricity volume.

[0008] Thirdly, the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the electricity spot trading power auxiliary decision-making method based on improved attention described in the first aspect.

[0009] Fourthly, the present invention provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the steps of the electricity spot trading electricity auxiliary decision-making method based on improved attention described in the first aspect.

[0010] Compared with the prior art, the beneficial effects of the present invention are as follows: This invention breaks away from reliance on single data sources by fusing multi-source features and performing dynamic interactive analysis. It accurately identifies key factors influencing prices and, combined with a deep learning model featuring an improved attention mechanism, strengthens the targeted weighting of features and time dimensions, enhancing the accuracy of price prediction. This provides support for electricity trading decisions, enabling more scientific adaptation to complex market scenarios such as renewable energy fluctuations and load changes. It ensures that the determination of optimal trading volume aligns more closely with actual supply, demand, and cost patterns, improving the accuracy of trading volume determination and effectively avoiding decision-making biases in extreme scenarios. Furthermore, this decision-making process, aiming for maximum profitability and anchored to market rules, helps market participants optimize trading revenue and reduce the risk of supply-demand mismatch. It also improves the operational efficiency and stability of the electricity market through reasonable electricity allocation, achieving a dual optimization of participant benefits and market order.

[0011] Advantages of additional aspects of the invention will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention. Attached Figure Description

[0012] The accompanying drawings, which form part of this invention, are used to provide a further understanding of the invention. The illustrative embodiments of the invention and their descriptions are used to explain the invention and do not constitute a limitation thereof.

[0013] Figure 1 The main flowchart of an electricity spot trading power auxiliary decision-making method based on improved attention provided in an embodiment of the present invention is shown. Detailed Implementation

[0014] The present invention will be further described below with reference to the accompanying drawings and embodiments.

[0015] Example 1 like Figure 1 As shown, this embodiment discloses a power spot trading electricity auxiliary decision-making method based on improved attention, including the following steps: S1: Obtain multi-source features that affect spot prices and perform preprocessing; S2: Calculate the correlation between the multi-source features and the spot price, and calculate the dynamic interaction relationship between the multi-source features over time based on the sliding window mutual information; based on the correlation results and the dynamic interaction relationship, select key features; S3: Input the key features into a deep learning model with an improved attention mechanism, dynamically weight the feature dimension and time dimension based on the feature attention layer and the local temporal attention layer respectively, and use a long short-term memory network to learn the long-term temporal dependence of the weighted features to obtain the prediction result of the spot price of electricity for a specified period in the future. S4: Based on the electricity spot price forecast results, combined with load demand forecasts, generation costs and market trading rules, construct a transaction volume decision model with the goal of maximizing profits, and determine the optimal transaction volume.

[0016] Next, combined Figure 1 This embodiment provides a detailed description of an electricity spot trading electricity volume auxiliary decision-making method based on improved attention.

[0017] In S1, a regional electricity spot market dataset with multi-source feature fusion is constructed.

[0018] By integrating various characteristic data that affect regional electricity spot prices, clarifying data preprocessing rules and feature definitions, a standardized, high-quality dataset is provided for subsequent feature interaction analysis and prediction model construction.

[0019] First, the characteristics affecting spot prices are divided into four categories, comprehensively covering market supply and demand, energy supply, macroeconomic factors, and external environmental factors. Specifically: (1) Historical price characteristics: Collect intraday hourly price data of the regional electricity spot market over the past 1-3 months, denoted as This includes day-ahead spot prices and real-time spot prices, reflecting the temporal correlation of prices themselves, such as intraday peak and trough patterns and weekly cycles.

[0020] (2) Renewable energy output characteristics: wind power collection ( ), photovoltaic ( The system provides hourly actual and forecasted power output data, where actual output reflects the impact of realized clean energy supply on prices, and forecasted output is used to predict future supply trends.

[0021] It should be understood that the forecast data for renewable energy output can be based on historical output data and meteorological forecast information, and can be used with time series forecasting methods such as LSTM models to achieve advance forecasting of wind power and photovoltaic output.

[0022] (3) Load demand characteristics: Total user load within the data collection area ( The hourly actual demand data, including detailed data on industrial load, residential load, and commercial load, reflects the driving effect of changes in demand from different user groups on prices.

[0023] (4) Macroeconomic and environmental characteristics: collect fuel prices, macroeconomic indicators and weather data.

[0024] Fuel prices include coal prices. Natural gas prices This affects the cost of thermal power generation; macroeconomic indicators include monthly GDP growth rate. Weather data includes temperature. Wind speed This affects load demand and renewable energy output.

[0025] Traditional datasets only contain historical price and total load data. This dataset adds renewable energy output, fuel price, and weather data, expanding the feature dimensions from 2-3 to 8-10, which can more comprehensively cover price influencing factors and lay a data foundation for subsequent accurate forecasting.

[0026] Furthermore, the data is preprocessed.

[0027] (1) Missing value imputation: Time series-based interpolation methods are used to handle missing data. For hourly continuous data (such as price and load), linear interpolation formulas are used: (1) in, For the missing value at time h, , The data are valid at times h-1 and h+1, respectively. For non-continuous data (such as GDP growth rate), the average of adjacent monthly data is used to fill the gaps to ensure data integrity.

[0028] (2) Outlier handling: through 3 The principle for identifying outliers is as follows: (2) in, This is the mean of the feature data. The standard deviation is used; for identified outliers (such as abnormal price spikes due to data transmission errors), the median of the data from the four adjacent time points is used to replace the outlier to avoid interference with model training.

[0029] (3) Feature standardization: The Z-score standardization method is used to map all feature data to the same order of magnitude, and the formula is as follows: (3) in, The standardized data eliminates the impact of differences in the dimensions of different features on model training.

[0030] The preprocessed dataset was then divided chronologically into a training set (70%), a validation set (15%), and a test set (15%). The training set was used for learning model parameters, the validation set was used to adjust model hyperparameters (such as the number of network layers and the size of the attention window), and the test set was used to evaluate the model's final prediction performance. The partitioning process strictly followed the chronological order to avoid data leakage (such as using future data to predict the past) and to ensure that the model's prediction results matched the actual application scenario.

[0031] The multi-source feature dataset established in this embodiment clarifies the basic data types, preprocessing rules, and partitioning methods required for price forecasting, providing standardized data support for subsequent analysis of the interaction relationships between features (such as the correlation between load and price, and the negative correlation between wind power output and price). Therefore, it is necessary to further construct a multi-source feature interaction analysis model.

[0032] In S2, a multi-source feature interaction analysis model is established. Based on the multi-source feature dataset, the correlation between different features and spot prices and the dynamic interaction between features are quantified. Key predictive features are selected, and redundant features are eliminated, providing a basis for the feature input and structural design of subsequent deep learning prediction models.

[0033] First, the Pearson correlation coefficient is used to quantify the linear correlation between a single feature and the spot price. The formula is as follows: (4) in, Let x be the correlation coefficient between feature x and spot price P (range [-1, 1]). Let x be the covariance of the characteristic x and the spot price P (reflecting the common trend of both). , These are the standard deviations of feature x and price P, respectively (reflecting their respective volatility).

[0034] For example, the correlation coefficient between load characteristics and price is typically 0.6-0.8 (positive correlation, the higher the load, the higher the price), while the correlation coefficient between wind power output characteristics and price is typically -0.4 to -0.6 (negative correlation, the higher the wind power output, the less thermal power is started, and the lower the price).

[0035] Traditional models rely solely on experience to select features. This embodiment, however, quantifies the correlation coefficient and removes redundant features with an absolute value less than 0.3 (such as "quarterly GDP growth rate," which has a weak correlation with prices), thereby reducing the dimensionality of the model input and improving training efficiency.

[0036] Then, the sliding window mutual information method is used to quantify the dynamic interaction relationship between different features over time, as shown in the formula: (5) in, The mutual information between feature x and feature y within the sliding window w (the larger the value, the stronger the interaction). Let x and y be the joint probability density function. , are the marginal probability densities of features x and y, respectively, and w is the sliding window size (set to 24 hours, corresponding to the intraday time scale).

[0037] For example, during peak and off-peak hours (e.g., 19:00-21:00), the mutual information value between load and price is significantly higher than during flat hours (e.g., 10:00-14:00), indicating that load has a stronger impact on price during this period. During periods of sharp drop in wind power output (e.g., after 22:00 at night), the mutual information value between wind power output and thermal power fuel price increases, indicating that the impact of fuel price on price replaces that of wind power output during this period.

[0038] Traditional models use fixed feature weights. This embodiment captures the temporal changes of feature interactions through dynamic mutual information, providing a basis for the design of attention mechanisms in subsequent prediction models (such as assigning higher attention weights to peak and valley periods).

[0039] Finally, based on the results of feature correlation analysis and dynamic interaction analysis, the recursive feature elimination (RFE) method was used to screen key features: 1) Initialize a feature set containing all preprocessed features; 2) Train a basic prediction model (such as a simple LSTM model) and calculate the importance score for each feature; It should be understood that those skilled in the art can input the initialized feature set into a trained basic prediction model (such as a simple LSTM) and obtain the importance score of each feature through feature contribution analysis of the model output (such as the change in prediction error based on model parameter weights or perturbation features).

[0040] 3) Remove the 1-2 features with the lowest importance scores to form a new feature set; 4) Repeat steps 2-3 until the model’s prediction error (e.g., MAE) on the validation set no longer decreases. The feature set at this point is the key feature set.

[0041] For example, the key features selected in the final screening may include spot prices in the previous 24 hours, real-time load, actual wind power output, natural gas prices, and real-time temperature. These features can achieve optimal price prediction performance with the fewest dimensions, provide accurate data support for electricity trading decisions, and avoid model overfitting and decision bias caused by feature redundancy.

[0042] This embodiment reveals the correlation between multi-source features and spot prices, as well as the dynamic interaction between features, and clarifies the key input features required for the prediction model. These results need to be integrated into the structural design of subsequent deep learning prediction models (such as feature input layer selection and local window settings for the attention mechanism). Therefore, it is necessary to further construct a deep learning price prediction model with an improved attention mechanism.

[0043] In S3, a deep learning price prediction model with an improved attention mechanism is constructed.

[0044] Based on the results of multi-source feature interaction analysis, a deep learning model structure integrating local temporal attention and feature attention is designed. A loss function is set with the goal of minimizing prediction error, so as to achieve accurate prediction of regional electricity spot market prices and provide core data support for electricity trading decisions.

[0045] First, the model adopts a five-level structure: input layer - feature attention layer - local temporal attention layer - LSTM layer - fully connected output layer. The functions of each layer are as follows: (1) Input layer: Receives the key feature data after screening. The input dimension is: time step × number of key features. The time step is set to 24, that is, the price of the next hour is predicted using the data of the previous 24 hours. The number of key features is determined according to the screening results.

[0046] (2) Feature attention layer: Differentiated weights are assigned to different features at each time step to highlight the impact of important features such as load and wind power output on prices and suppress the interference of secondary features.

[0047] (3) Local time attention layer: In view of the intraday time sequence characteristics of electricity spot price, attention weight is allocated within a local time window to enhance the feature capture of price inflection point periods (such as morning peak 7:00-9:00 and evening peak 19:00-21:00).

[0048] (4) LSTM layer: Learn the long-term temporal dependencies of feature data through gating mechanisms (input gate, forget gate, output gate), process the nonlinear and periodic features of price data, and provide accurate price references for the adjustment of trading volume during key periods.

[0049] (5) Fully connected output layer: The output of the LSTM layer is mapped to a single predicted value, namely the regional electricity spot price for the next hour, providing a direct basis for electricity trading decisions.

[0050] Traditional deep learning models only use a single temporal attention or no attention mechanism. This model uses a dual attention design of feature attention and local temporal attention, and optimizes the information weights of the feature dimension and the time dimension at the same time, thereby improving the model's sensitivity to key features and key time periods.

[0051] Among them, (2) the improvement of the feature attention layer is as follows: For the feature vector at each time step t k is the number of key features, and the feature attention weights are calculated. Where i is the feature index, the formula is: (6) (7) in, For feature scoring function, , These are learnable parameters.

[0052] The weighted eigenvectors are: (8) This vector highlights the features that have the greatest impact on prices at each time step, such as the load features with higher weights during peak load periods.

[0053] Traditional feature attention uses global feature weight allocation. This embodiment achieves dynamic adjustment of feature weights over time by scoring local features within a time step, which better reflects the changing pattern of feature importance at different times. Load features are more important during the day, while wind power output features are more important at night.

[0054] Meanwhile, the improvements to the local temporal attention layer in (3) specifically include: Set the local time window size to w, such as 6 hours. Then, for the current time step t, calculate the weighted feature vector within w / 2 time steps before and after it, i.e., from tw / 2 to t+w / 2. Assign attention weights The formula is: (9) in, , The tanh function is a learnable parameter used to map the score values ​​to the interval [-1, 1].

[0055] The weighted temporal feature vector is: (10) This vector enhances the feature weights for periods near price inflection points (such as the transition period between peaks and troughs), improving the model's ability to predict sudden price changes.

[0056] Traditional time attention uses a global time window (24 hours), which can easily dilute the features of key time periods. This embodiment restricts attention to the time period most closely related to the current prediction time by using a local time window, which can effectively improve prediction accuracy and thus better support the decision of trading electricity volume.

[0057] Furthermore, the LSTM layer and the output layer are specifically as follows: (1) LSTM layer: A two-layer LSTM structure is configured, with 64 neurons per layer. Dropout regularization is used with a dropout rate of 0.2 to prevent overfitting. The core calculation formulas for the LSTM layers include: 1) Gate of Oblivion: (11) The proportion of historical information to be discarded, among which It is the sigmoid activation function; The hidden state from the previous moment, dimension 64; This is the temporal feature vector output by the local temporal attention layer; , These are the parameters for the forget gate.

[0058] 2) Input Gate: (12) in The input gate output is in the range [0,1]. The closer the value is to 1, the more new information is updated. , Input gate parameters; (13) in The candidate cell state is in the range [-1, 1]. , These are the learnable parameters for the candidate states.

[0059] 3) Cell state update: (14) Integrating historical cell states with new candidate states, Given the cell state at the previous moment, this formula achieves dynamic fusion of historical and new information, adapting to the long-term temporal dependence of price data.

[0060] 4) Output gate: (15) in The output gate outputs information in the range [0,1]. The closer the value is to 1, the more cell state information is output. , The output gate can be learned parameters; (16) in The hidden state at the current moment is used as the temporal feature output of the LSTM layer.

[0061] Traditional single-layer LSTMs are insufficient in capturing the dependence of long-term time-series data. This embodiment uses a combination of two LSTM layers and Dropout regularization to enhance the model's ability to learn about long-term price cycles, such as the differences between weekdays and weekends, while effectively suppressing overfitting. The overfitting error on the test set is significantly reduced, making price predictions more reliable and providing stable support for trading electricity decisions.

[0062] (2) Output layer: A fully connected layer is used to map the final hidden state of the LSTM layer, which has a dimension of 64, to a single predicted value. The price for the next hour is calculated using the following formula: (17) in, For the predicted spot electricity price in the region at time t+1, This represents the hidden state at the last time step of the LSTM layer. , These are the learnable parameters for the output layer.

[0063] Furthermore, the loss function is defined. A composite loss function weighted by mean absolute error (MAE) and root mean square error (RMSE) is adopted, focusing on both the absolute deviation and extreme deviation between the predicted and actual values. The formula is as follows: (18) Mean absolute error: (19) Where N is the number of prediction samples; Let be the predicted price for the i-th sample; is the true price of the i-th sample; MAE reflects the overall level of prediction bias.

[0064] Root mean square error: (20) RMSE penalizes extreme biases, such as prediction errors during periods of price jumps, more significantly, thus preventing the model from failing to predict key outliers.

[0065] Weighting coefficient The value was set to 0.6 and determined through validation set optimization to balance the impact of MAE and RMSE, ensuring that the model has high prediction accuracy in both normal and extreme periods.

[0066] Traditional models often use a single MAE or RMSE as the loss function. A single MAE is not sensitive to extreme biases, while a single RMSE is easily affected by outliers. This composite loss function, through weighted fusion, significantly improves the overall prediction accuracy and can better support the decision-making of electricity trading.

[0067] The deep learning prediction model established in this embodiment, through a dual attention mechanism and a composite loss function, solves the problems of insufficient capture of key features and key time periods, and weak control of extreme biases in traditional models. It has high price prediction accuracy and strong stability, providing core support for subsequent electricity trading decisions. However, the model contains a large number of learnable parameters, and traditional fixed learning rate training is prone to slow convergence or getting stuck in local optima. Therefore, it is necessary to further design a model training and optimization method based on adaptive learning rate.

[0068] Furthermore, we designed a model training and optimization method based on an adaptive learning rate.

[0069] To address the high parameter complexity of deep learning models with improved attention mechanisms, a training optimization method is designed that integrates dynamic learning rate adjustment, gradient pruning, and early stopping strategies. This method enhances model training efficiency and generalization ability, ensuring that the price prediction model quickly converges to the global optimum, thus providing accurate and efficient price support for trading volume decisions.

[0070] First, the selection and improvement of adaptive learning rate optimization algorithms.

[0071] The improved AdamW algorithm is adopted, which introduces weight decay to suppress overfitting based on the adaptive learning rate of the traditional Adam algorithm, and optimizes the learning rate decay strategy: (1) Basic AdamW update rules: 1) First-order momentum (momentum term): (twenty one) in, Let t be the first-order momentum; The momentum coefficient is set to 0.9; Model parameters at time t-1 The gradient of the loss function.

[0072] 2) Second-order momentum (adaptive learning rate term): (twenty two) in, Let t be the second momentum; The second momentum coefficient is set to 0.999.

[0073] 3) Momentum deviation correction: (twenty three) Eliminate the initial momentum estimation bias.

[0074] 4) Parameter update: (twenty four) in Let t be the learning rate; This is a numerical stability term; This refers to the weight decay coefficient; the weight decay term. Implement parameter regularization to suppress overfitting.

[0075] Furthermore, the learning rate dynamic decay is improved.

[0076] Specifically, traditional AdamW uses a fixed learning rate or linear decay. This embodiment designs a learning rate decay strategy using cosine annealing and preheating, with the following formula: (1) Preheating stage: (25) in, The initial learning rate; To warm up, the number of epochs is set to 10. By gradually increasing the learning rate, parameter oscillations caused by an initial high learning rate can be avoided.

[0077] (2) Annealing stage: (26) in, Minimum learning rate; The total number of training epochs is set to 100. The learning rate is gradually reduced periodically using a cosine function to help the model search for the optimal solution in the later stages.

[0078] Traditional fixed-learning-rate training tends to result in slow convergence in the early stages and getting stuck in local optima in the later stages. The improved strategy in this embodiment accelerates initial convergence through the warm-up stage and improves the search accuracy in the later stages through the annealing stage. The model convergence speed is effectively improved, and the prediction error on the test set is effectively reduced.

[0079] Furthermore, gradient clipping strategies. To address the gradient explosion problem that may occur during deep learning model training, such as gradient accumulation in LSTM layers, a gradient norm clipping method is employed, with the following formula: (27) in, The gradient after clipping. Let L2 norm be the gradient vector. Set the cropping threshold to 5.0.

[0080] When the gradient norm exceeds a threshold, the gradient is proportionally reduced to within the threshold range to avoid excessive parameter updates and model training instability due to an excessively large gradient. Traditional models do not employ gradient pruning, which can easily lead to loss function oscillations in the later stages of training. This embodiment provides a strategy to effectively reduce the fluctuation of model training loss, resulting in a more stable training process.

[0081] To further suppress overfitting, the model's performance on the validation set is monitored. When the validation set loss does not decrease for 10 consecutive epochs, the model training is stopped, and the current optimal parameters, i.e., the parameters with the minimum validation set loss, are saved.

[0082] The specific logic for implementing the early stopping strategy is as follows: 1) Initialize the optimal verification loss The value is infinite, and the count is continuously increasing without any promotion; count = 0. 2) After each epoch of training, calculate the validation set loss. ; 3) If < Then update Save the current model parameters and reset count=0; 4) Otherwise, count += 1, if count If the score is 10, then training should be stopped.

[0083] Traditional models are prone to overfitting when trained to a fixed number of epochs. The early stopping strategy proposed in this embodiment stops training before the model overfits by monitoring the performance of the validation set in real time, thereby improving the model's generalization ability by more than 10%. The price prediction results are more practically valuable and can better support the decision-making of trading electricity volume.

[0084] Finally, the specific process for model training is as follows: 1) Load the pre-defined training and validation sets and initialize the model parameters; 2) Set the training hyperparameters: total number of epochs 100, batch size 32, number of warm-up epochs 10, gradient clipping threshold 5.0, number of early stop detections 10; 3) The improved AdamW algorithm is used for parameter updates, and gradient clipping is performed after each batch of data is trained; 4) After each epoch, calculate the training set loss and the validation set loss, and perform early stopping judgment; 5) After training, load the optimal model parameters, evaluate the model performance on the test set, and calculate MAE, RMSE, and mean absolute percentage error (MAPE).

[0085] The training optimization method designed in this embodiment solves the problems of low training efficiency, easy overfitting, and unstable training of high-complexity deep learning models through the synergistic effect of adaptive learning rate, gradient pruning, and early stopping strategy. This ensures that the price prediction model has high accuracy and high reliability, providing solid support for transaction electricity decisions.

[0086] S4, construct a transaction electricity decision model based on predicted prices.

[0087] The spot price for the next hour output by the price forecasting model Based on load demand forecasting, generation costs, and market trading rules, a decision-making model for trading electricity volume with the goal of maximizing revenue is constructed to determine the optimal trading volume. .

[0088] S401: Objective function of the decision model: (28) (29) Where: Profit is the transaction profit; The transaction volume at time t+1 is the transaction decision variable. The generation cost or purchase cost corresponding to the traded electricity volume; The market risk cost corresponding to the traded electricity volume. For risk coefficient, The variance for predicting prices.

[0089] S402: Constraints; (1) Power balance constraint: (30) in This represents the load forecast value at time t+1. The allowable load deviation is set according to market rules; (2) Power generation capacity constraints: (31) in , These represent the maximum and minimum tradable electricity volumes for market participants, respectively. (3) Timing constraints: (32) in The actual transaction volume at time t. This represents the maximum adjustment range for the trading volume in adjacent time periods.

[0090] By solving the above constrained objective function, the optimal trading volume at time t+1 is obtained. This enables scientific trading decisions based on accurate price forecasts, maximizing the returns for market participants while maintaining the stability of the physical operation of the electricity market.

[0091] This specific embodiment first constructs a regional electricity spot market dataset with multi-source feature fusion for basic data preparation, providing data support for subsequent price forecasting and electricity trading decisions. Second, it establishes a multi-source feature interaction analysis model to quantify feature correlations, providing a basis for feature selection in the prediction model. Then, it constructs a deep learning price prediction model with an improved attention mechanism, achieving accurate price prediction by setting price prediction targets and model structure. Furthermore, it designs a model training and optimization method based on adaptive learning rates to efficiently train the model and improve the timeliness and stability of price prediction. Finally, it constructs an electricity trading decision model based on the predicted price, determining the optimal electricity trading volume with the goal of maximizing profits.

[0092] This specific embodiment constructs a dataset that integrates multi-source features, designs a feature interaction analysis model, establishes a deep learning price prediction model with an improved attention mechanism, and combines an adaptive learning rate optimization strategy to achieve accurate prediction of electricity spot prices in complex market environments. Based on the predicted price, it assists in determining the optimal trading volume, solving the technical bottleneck of the lack of accurate price support and scientific method guidance for the decision-making of trading volume in the regional electricity spot market. This provides a scientific basis for the trading decisions of market participants and ensures the stable operation of the electricity market.

[0093] Example 2 This embodiment provides an electricity spot trading volume auxiliary decision-making system based on improved attention, including: The data acquisition module is used to acquire multi-source features that affect spot prices and perform preprocessing. The feature extraction module is used to calculate the correlation between the multi-source features and the spot price, and to calculate the dynamic interaction relationship between the multi-source features over time based on the sliding window mutual information; and to screen key features based on the correlation results and the dynamic interaction relationship. The price prediction module is used to input the key features into a deep learning model with an improved attention mechanism, dynamically weight the feature dimension and time dimension based on the feature attention layer and the local temporal attention layer respectively, and use a long short-term memory network to learn the long-term temporal dependence of the weighted features to obtain the prediction result of the spot price of electricity for a specified period in the future. The electricity volume auxiliary decision-making module is used to construct a transaction electricity volume decision-making model with the goal of maximizing profits, based on the electricity spot price forecast results, combined with load demand forecasts, generation costs and market transaction rules, and to determine the optimal transaction electricity volume.

[0094] Example 3 This embodiment provides a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps in the electricity spot trading power auxiliary decision-making method based on improved attention as described in Embodiment 1 above.

[0095] Example 4 This embodiment provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the program, it implements the steps in the electricity spot trading power auxiliary decision-making method based on improved attention as described in Embodiment 1 above.

[0096] The steps or modules involved in Embodiments 2 to 4 above correspond to those in Embodiment 1. For specific implementation details, please refer to the relevant description section of Embodiment 1. The term "computer-readable storage medium" should be understood as a single medium or multiple media including one or more instruction sets; it should also be understood as including any medium capable of storing, encoding, or carrying an instruction set for execution by a processor and enabling the processor to perform any of the methods in this invention.

[0097] The above description is merely a preferred embodiment of the present invention and is not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. 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 method for auxiliary decision-making in electricity spot trading based on improved attention, characterized in that, include: Obtain multi-source features that influence spot prices and perform preprocessing; The correlation between the multi-source features and the spot price is calculated, and the dynamic interaction relationship between the multi-source features over time is calculated based on the sliding window mutual information; key features are selected based on the correlation results and the dynamic interaction relationship. The key features are input into a deep learning model with an improved attention mechanism. The feature dimension and time dimension are dynamically weighted based on the feature attention layer and the local temporal attention layer, respectively. The long short-term memory network is used to learn the long-term temporal dependence of the weighted features to obtain the prediction result of the spot price of electricity for a specified period in the future. Based on the electricity spot price forecast, combined with load demand forecast, generation costs and market trading rules, a transaction volume decision model with the goal of maximizing profits is constructed to determine the optimal transaction volume.

2. The electricity spot trading power auxiliary decision-making method based on improved attention as described in claim 1, characterized in that, The multi-source characteristics include historical price characteristics, renewable energy output characteristics, load demand characteristics, and macroeconomic and environmental characteristics; the macroeconomic and environmental characteristics include fuel prices, macroeconomic indicators, and weather data, wherein the macroeconomic indicators include monthly GDP and GDP growth rate.

3. The electricity spot trading power auxiliary decision-making method based on improved attention as described in claim 1, characterized in that, The calculation of the dynamic interaction relationship between multi-source features over time based on sliding window mutual information is specifically as follows: ; in, For sliding windows Internal characteristics With features mutual information, Features and The joint probability density, , Features , The marginal probability density.

4. The electricity spot trading power auxiliary decision-making method based on improved attention as described in claim 1, characterized in that, The dynamic weighting of the feature dimension and time dimension through the feature attention layer and local temporal attention layer in the model specifically includes: In the feature attention layer, for multiple key features in each time step, the importance of different features in that time step is dynamically highlighted or suppressed by calculating their respective attention weights and summing them up. In the local time attention layer, a local time window is defined based on the current prediction time. Attention weights are assigned to the feature vectors of different time steps within the window and then weighted and fused to strengthen the features of neighboring time periods that are strongly correlated with the current prediction time.

5. The electricity spot trading power auxiliary decision-making method based on improved attention as described in claim 1, characterized in that, The method of learning the long-term temporal dependence of weighted features using a Long Short-Term Memory (LSTM) network to obtain the electricity spot price forecast for a specified future period specifically includes: The time-series feature sequences, after being weighted and fused using a dual attention mechanism, are input into an LSTM network with a multi-layer structure. By using the gating mechanism in LSTM, long-term temporal dependencies in the input sequence are modeled and learned; The output state of the LSTM network at the final time step is mapped to a single predicted spot electricity price for a specified future period through a fully connected layer.

6. The electricity spot trading power auxiliary decision-making method based on improved attention as described in claim 1, characterized in that, Based on the electricity spot price forecast, combined with load demand forecast, generation costs, and market trading rules, a transaction volume decision model is constructed with the objective of maximizing profits to determine the optimal transaction volume; wherein, the objective function of the decision model is: ; ; in, For transaction profits; This is the forecast result for the spot electricity price at time t+1; The transaction volume at time t+1; The generation cost or purchase cost corresponding to the traded electricity volume; The market risk cost corresponding to the traded electricity volume. For risk coefficient, The variance for predicting prices.

7. The electricity spot trading power auxiliary decision-making method based on improved attention as described in claim 6, characterized in that, The constraints of the electricity trading decision model include electricity balance constraints, generation capacity constraints, and time series constraints. The power balance constraint is: ; in, This represents the load forecast value at time t+1. The allowable load deviation is set according to market rules; The power generation capacity constraint is: ; in, , These represent the maximum and minimum tradable electricity volumes for market participants, respectively. The timing constraints are as follows: ; in, The actual transaction volume at time t. This represents the maximum adjustment range for the trading volume in adjacent time periods.

8. A power spot trading electricity volume auxiliary decision-making system based on improved attention, characterized in that, include: The data acquisition module is used to acquire multi-source features that affect spot prices and perform preprocessing. The feature extraction module is used to calculate the correlation between the multi-source features and the spot price, and to calculate the dynamic interaction relationship between the multi-source features over time based on the sliding window mutual information; and to screen key features based on the correlation results and the dynamic interaction relationship. The price prediction module is used to input the key features into a deep learning model with an improved attention mechanism, dynamically weight the feature dimension and time dimension based on the feature attention layer and the local temporal attention layer respectively, and use a long short-term memory network to learn the long-term temporal dependence of the weighted features to obtain the prediction result of the spot price of electricity for a specified period in the future. The electricity volume auxiliary decision-making module is used to construct a transaction electricity volume decision-making model with the goal of maximizing profits, based on the electricity spot price forecast results, combined with load demand forecasts, generation costs and market transaction rules, and to determine the optimal transaction electricity volume.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the steps in the electricity spot trading power auxiliary decision-making method based on improved attention as described in any one of claims 1-7.

10. A computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the steps in the electricity spot trading power auxiliary decision-making method based on improved attention as described in any one of claims 1-7.