Electric power spot market day-ahead price prediction method and related equipment
By using a CNN-GRU model with sparse-constrained linear regression and attention mechanism, the problem of declining prediction accuracy in day-ahead price forecasting of the electricity spot market is solved, achieving accurate fitting and efficient prediction of complex electricity price fluctuations.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- HUNAN CLEAN ENERGY BRANCH OF HUANENG INT POWER CO LTD
- Filing Date
- 2026-01-20
- Publication Date
- 2026-04-28
AI Technical Summary
In the current technology for predicting day-ahead electricity spot market prices, the prediction accuracy gradually decreases as the market matures. Traditional statistical models are not good at capturing sudden changes in electricity prices, and classic machine learning models have limited ability to generalize to highly volatile data and have defects in dynamic adaptability.
A linear regression model with sparse constraints is used to screen features of multi-dimensional influencing factor data. It is then combined with a CNN-GRU model based on attention mechanism for prediction. The CNN extracts local spatial features, the GRU learns long-term temporal variation patterns, and the attention mechanism is used to dynamically weight key information points.
It significantly improves the accuracy and stability of day-ahead price forecasts in the electricity spot market, overcomes the shortcomings of traditional methods in data preprocessing and model adaptability, and achieves higher forecast accuracy and stability.
Smart Images

Figure CN121937162A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of energy price forecasting technology, specifically to a method and related equipment for forecasting day-ahead prices in the electricity spot market. Background Technology
[0002] Against the backdrop of the deepening power market reform, electricity spot market price forecasting has become a core technical support for power generation companies to optimize power generation plans and for electricity users to adjust load strategies. Accurate forecasting of time-of-use electricity price fluctuations is of significant value for achieving optimal resource allocation across society. When market information is sufficient and competition is effective, coordinated regulation based on price signals can drive resource allocation to Pareto optimality. Currently, the commonly used techniques mainly include the individual application or simple combination of traditional statistical models (such as ARIMA) and classic machine learning models (such as SVM). Statistical models model time series data through processing methods such as autoregression, differencing, and moving averages. Their core assumption is that the linear trends and periodic characteristics in historical electricity price data can be characterized by parametric methods. Machine learning models, on the other hand, map the original data to a high-dimensional space using kernel functions (such as RBF) and use support vector regression (SVR) to handle nonlinear relationships, demonstrating strong learning capabilities in small sample scenarios.
[0003] However, the aforementioned existing technologies have significant limitations in practical applications. Specifically, traditional statistical models are insufficient in capturing sudden electricity price events (such as policy adjustments and supply-demand imbalances caused by extreme weather) and struggle to effectively model nonlinear characteristics. Classical machine learning models have limited generalization ability for highly volatile data, with prediction errors reaching 15%-20% in practical applications in the European electricity market. At the time-series feature extraction level, statistical models rely on difference stabilization, which may lose key time-series patterns in the original data, while classical machine learning models ignore long-term dependencies and cannot adapt to the multi-scale fluctuations of the electricity market across daily, weekly, and monthly scales. Furthermore, traditional models have inherent defects in dynamic adaptability, requiring frequent retraining to cope with changes in market structure (such as the integration of new power sources). In practical applications, parameter solidification is a prominent issue, leading to a gradual decline in prediction accuracy as market maturity increases. Summary of the Invention
[0004] The technical problem to be solved by the present invention is to provide a method and related equipment for predicting the day-ahead price of the electricity spot market, in order to address the shortcomings of the prior art and solve the technical problem that the prediction accuracy gradually decreases as the market matures.
[0005] The objective of this invention is achieved through the following technical solutions: In a first aspect, the present invention provides a method for predicting day-ahead prices in the electricity spot market, comprising: Obtain day-ahead electricity price data for the target region, as well as multi-dimensional data on factors influencing electricity prices. A linear regression model with sparse constraints is used to perform feature filtering on the multidimensional influencing factor data to eliminate multicollinearity and obtain feature vectors. The feature vector and the day-ahead electricity price data are input into a pre-trained prediction model to predict the future day-ahead electricity price and obtain the prediction result. The prediction model is a CNN-GRU model based on the attention mechanism.
[0006] As a further improvement of the present invention, the multi-dimensional influencing factor data includes at least one of the following: central dispatch load, interconnection line output, new energy output, non-market-based output, and hydropower output.
[0007] As a further improvement of the present invention, the linear regression model of the sparse constraint is the Lasso model.
[0008] As a further improvement to the present invention, the Lasso model is as follows:
[0009]
[0010] In the formula, For constant terms; These are the regression coefficients of the regression model; For random disturbance terms, , For Lasso parameters , The estimated value; For variables Group of observations, among which ; This is the penalty parameter.
[0011] As a further improvement of the present invention, the prediction model includes an input layer, a CNN convolutional layer, a GRU hidden layer, an Attention layer, and an output layer; The input layer is used to input day-ahead electricity price data and feature vectors; The CNN convolutional layer is used to extract local spatial features from the data in the input layer; The GRU hidden layer is used to learn the temporal variation pattern of electricity prices based on local spatial features extracted by CNN; The Attention layer is used to assign dynamic weights to different features according to the weight allocation principle; The output layer is used to calculate the prediction information after assigning dynamic weights and obtain the prediction result.
[0012] As a further improvement of the present invention, the CNN convolutional layer is:
[0013]
[0014]
[0015]
[0016]
[0017] In the formula, This is the output of the CNN layer; , These are the outputs of the corresponding convolutional layers; , These are the outputs of the corresponding pooling layers; to This is the corresponding deviation amount; , , This is the weight matrix.
[0018] As a further improvement of the present invention, the prediction model uses the Adam optimizer to iteratively optimize the weights and bias parameters.
[0019] Secondly, the present invention provides a day-ahead price forecasting system for the electricity spot market, comprising: The data acquisition module is used to acquire day-ahead electricity price data for the target area, as well as multi-dimensional influencing factors related to electricity prices. The data processing module is used to perform feature filtering on the multidimensional influencing factor data using a linear regression model with sparse constraints, and to eliminate multicollinearity to obtain feature vectors. The prediction module inputs the feature vector and the day-ahead electricity price data into a pre-trained prediction model to predict the future day-ahead electricity price and obtain the prediction result. The prediction model is a CNN-GRU model based on the attention mechanism.
[0020] Thirdly, the present invention provides a computer-readable storage medium for storing one or more programs, the one or more programs including instructions that, when executed by a computing device, cause the computing device to perform the above-described method for predicting day-ahead electricity spot market prices.
[0021] Fourthly, the present invention provides a computing device, comprising: One or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, the one or more programs including steps for performing the above-described electricity spot market day-ahead price forecasting method.
[0022] The beneficial effects of this invention are as follows: This invention provides a method for predicting day-ahead electricity prices in the spot market. By acquiring day-ahead electricity price data and multi-dimensional influencing factor data related to electricity prices in the target area, it provides a comprehensive and diverse input basis for the prediction process, thereby expanding the coverage of prediction information and helping to capture more potential price drivers. A linear regression model with sparse constraints is used to perform feature filtering on the multi-dimensional influencing factor data, eliminating multicollinearity and obtaining simplified feature vectors. This significantly reduces model instability and computational burden caused by feature redundancy, improving the efficiency and reliability of feature selection. The feature vectors and day-ahead electricity price data are then input into a CNN-GRU prediction model based on an attention mechanism. This model extracts local temporal features through a convolutional neural network and learns long-range dependencies by combining gated recurrent units. Simultaneously, it dynamically weights key information points using an attention mechanism, thereby enhancing the model's recognition and prediction accuracy of complex electricity price fluctuation patterns. Through the synergistic cooperation of these features, a highly efficient and integrated prediction process is formed. Each feature contributes to targeted improvements and overcomes the shortcomings of traditional methods in data preprocessing and model adaptability, ultimately achieving higher accuracy and stability in day-ahead electricity price prediction. Attached Figure Description
[0023] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0024] Figure 1 This is a flowchart of the CNN-GRU-Attention process in an embodiment of the present invention; Figure 2 This is a schematic diagram of the internal structure of a computer device according to an embodiment of the present invention. Detailed Implementation
[0025] To make the objectives and technical solutions of this invention clearer and easier to understand, the invention will be further described in detail below with reference to the accompanying drawings and embodiments. The specific embodiments described herein are for illustrative purposes only and are not intended to limit the invention.
[0026] The technical solution of the present invention will be clearly and completely described below with reference to the accompanying drawings and specific embodiments. The described embodiments are only some embodiments of the present invention, and not all embodiments.
[0027] Example 1 Existing day-ahead price forecasting methods for the electricity spot market suffer from several problems, including input bias due to a lack of targeted data acquisition, multicollinearity interference in model learning caused by multidimensional influencing factors, and the inability of forecasting models to simultaneously and effectively capture both local spatial and long-term temporal characteristics of electricity prices. These issues ultimately result in low forecast accuracy and an inability to meet the decision-making needs of market participants. Therefore, a complete forecasting method is needed to address these problems. This embodiment provides a day-ahead price forecasting method for the electricity spot market.
[0028] The method for predicting day-ahead electricity prices in the spot market mainly includes the following steps: acquiring day-ahead electricity price data and multi-dimensional influencing factor data related to electricity prices in the target region; using a linear regression model with sparse constraints to perform feature filtering on the multi-dimensional influencing factor data, eliminating multicollinearity to obtain feature vectors; inputting the feature vectors and day-ahead electricity price data into a pre-trained prediction model to predict future day-ahead electricity prices and obtain prediction results; the prediction model is a CNN-GRU model based on an attention mechanism.
[0029] The solution in this embodiment acquires day-ahead electricity price data and multi-dimensional influencing factor data related to electricity prices in the target area. This provides fundamental data directly correlated with electricity prices in the target area for subsequent predictive modeling, avoiding prediction input bias caused by mismatched data regions or missing dimensions of influencing factors. Compared to existing technologies that do not explicitly target the target area or have incomplete influencing factor dimensions, this embodiment makes the input data more closely match the actual correlation scenario of electricity price fluctuations in the target area, thereby improving the accuracy of the prediction data foundation. By employing a linear regression model with sparse constraints to perform feature filtering on the multi-dimensional influencing factor data, the model's sparse constraint characteristics are used to set the coefficients of redundant influencing factors with weak correlation to electricity prices to 0, thereby eliminating multicollinearity and obtaining a refined feature vector. Compared to existing technologies that directly use all influencing factors or simple filtering, this effectively solves the problem of decreased model explanatory power caused by feature redundancy and multicollinearity, providing high-quality input features for subsequent predictive models. By inputting feature vectors and day-ahead electricity price data into a pre-trained CNN-GRU prediction model based on an attention mechanism, the model achieves accurate fitting of complex electricity price fluctuations. This addresses the limitations of existing technologies, such as statistical models (e.g., ARIMA) failing to capture nonlinear fluctuations and traditional machine learning models (e.g., SVM) having limited generalization capabilities. The model effectively adapts to the nonlinear and multi-scale time-series characteristics of electricity prices, significantly improving the accuracy of prediction results. These technologies work in tandem, forming a complete optimization chain from the accuracy of data acquisition and the refinement of feature input to the adaptability of model modeling. This comprehensively avoids problems such as data bias, feature redundancy, and insufficient model adaptation, ultimately achieving more stable and accurate predictions of future day-ahead electricity prices, significantly outperforming existing technologies.
[0030] The day-ahead electricity price data for the target region is sourced from the day-ahead market transaction results disclosed on the official website of the target region's power trading center. The data time granularity is set to 1 hour (i.e., 24 data points per day), and the unit is yuan / MWh. This granularity is perfectly matched with the trading cycle of time-of-use electricity prices in the domestic electricity spot market and can be directly used for subsequent time series modeling. In practical applications, a time granularity of 15 minutes or 30 minutes can also be used, but this embodiment does not limit this.
[0031] The multi-dimensional influencing factors data include at least one of the following: central dispatch load, tie line output, renewable energy output, non-market power output, and hydropower output. Data sources include official disclosure channels such as the target area power dispatch center, renewable energy plants, and hydropower plants. Specifically, it covers central dispatch load, tie line output, renewable energy output, non-market power output, and hydropower output. The time granularity of each data point is consistent with the day-ahead electricity price data (1 hour), and the unit is megawatts (MW) to ensure data synchronization in the time dimension.
[0032] The linear regression model with sparse constraints specifically employs the Lasso model. The model implementation is based on the Lasso class in Python's scikit-learn library. Before use, the data of multi-dimensional influencing factors are standardized (using the formula "(original data - mean) / standard deviation") to ensure that all influencing factors are of the same order of magnitude, avoiding the impact of unit differences on model parameter calculations. When standardized multi-dimensional influencing factor data is input into the Lasso model, the model will automatically set the regression coefficients of influencing factors with weak correlation to electricity prices to 0, and only retain influencing factors with non-zero coefficients. These retained influencing factors form a feature vector. For example, if 5 influencing factors are input, and after filtering, 3 factors are retained: central dispatch load, new energy output, and hydropower output, then the feature vector dimension is "3 × time series length".
[0033] The Lasso model is:
[0034]
[0035] In the formula, For constant terms; These are the regression coefficients of the regression model; For random disturbance terms, , For Lasso parameters , The estimated value; For variables Group of observations, among which ; The parameter is used as a penalty parameter. In this embodiment, the coordinate descent method is used to solve for the minimum value of the objective function. This method optimizes each regression coefficient in a loop (keeping other coefficients unchanged) until all coefficients converge. Compared with the gradient descent method, it is more efficient in computation and more stable in convergence when dealing with L1 regularization problems, and is suitable for parameter estimation of Lasso models. In practical applications, the least angle regression method (LARS) can also be used to solve the problem, but this embodiment does not limit it.
[0036] Furthermore, the prediction model comprises an input layer, a CNN convolutional layer, a GRU hidden layer, an Attention layer, and an output layer. The input layer takes day-ahead electricity price data and feature vectors as input; the CNN convolutional layer extracts local spatial features from the input data; the GRU hidden layer learns the temporal variation pattern of electricity prices based on the local spatial features extracted by the CNN; the Attention layer assigns dynamic weights to different features according to a weight allocation principle; and the output layer calculates the prediction information after assigning dynamic weights to obtain the prediction result.
[0037] The input layer receives the combined input data, which consists of a feature vector and day-ahead electricity price data. If the feature vector contains three influencing factors (e.g., unified dispatch load, new energy output, and hydropower output) and the time series length is 24 (1 day), then the dimension of the input data is 4×24, and the data format is a two-dimensional matrix (feature dimension and time dimension).
[0038] The input layer normalizes the data (processing method is "(original data - minimum data value) / (maximum data value - minimum data value)"), compressing the data to the [0,1] range to avoid the impact of data magnitude differences on the calculation of subsequent convolution and GRU layers; in practical applications, standardization processing can also be used, but this application embodiment does not limit this.
[0039] The CNN convolutional layer contains two convolutional blocks, each consisting of a 1D convolutional layer and a 1D max-pooling layer, finally connected by a fully connected layer. The number of convolutional kernels is set to 32 (representing the extraction of 32 local features), the kernel size is set to 3 (representing that each sliding window covers 3 time steps, such as hours 1-3, 2-4), the stride is set to 1 (representing that the sliding window moves 1 time step at a time), the padding method is set to "same" (meaning that the output feature map has the same time dimension as the input feature map), and the activation function is ReLU. This parameter setting effectively extracts locally correlated features within three adjacent time steps (such as the short-term coupling relationship between load and electricity price). The pooling kernel size is set to 2 (representing that each pooling window covers 2 time steps), and the stride is set to 2. By taking the maximum value within the window, the feature dimension is compressed, reducing computation and enhancing the model's generalization ability; for example, if the input time dimension is 24, after pooling, the time dimension becomes 12. The number of neurons in the fully connected layer is set to 128, and the activation function is the Sigmoid function. The pooled high-dimensional features are mapped to a 1-dimensional feature vector (dimension "128×1") to prepare for the input of the subsequent GRU layer.
[0040] The formula for CNN convolutional layers is:
[0041]
[0042]
[0043]
[0044]
[0045] In the formula, This is the output of the CNN layer; , These are the outputs of the corresponding convolutional layers; , These are the outputs of the corresponding pooling layers; to This is the corresponding deviation amount; , , This is the weight matrix. This is for convolution calculation.
[0046] The GRU hidden layer uses one GRU unit layer with 128 hidden units (matching the output dimension of a fully connected CNN layer) and a dropout rate of 0.2 (randomly dropping 20% of neurons during training to prevent overfitting). It includes a ResetGate and an UpdateGate. The ResetGate controls the degree of forgetting of historical information, while the UpdateGate controls the degree of integration between historical and current information. Through the synergistic effect of these two gates, GRU can effectively learn the long-term time-series changes of local features extracted by the CNN (such as the periodic changes in daily peak and off-peak electricity prices and the weekly trend changes in electricity prices). The output dimension of the GRU hidden layer is "128 × time series length" (here, the time series length is 12 after CNN pooling), and this output contains long-term temporal information of the local features.
[0047] The attention layer employs an additive attention mechanism, consisting of a fully connected layer and a softmax function. First, the output of the GRU hidden layer (128×12) is mapped to 64 dimensions (64 neurons) through the fully connected layer. Then, the softmax function normalizes the mapped features to obtain the attention weights for each time step (the sum of the weights is 1). The output layer consists of a single fully connected layer with one neuron (corresponding to the electrical value to be predicted), and the sigmoid function is used as the activation function. The weighted feature vector (128×12) output from the Attention layer is first flattened into a 1D vector (dimension "1536×1"), then input into the fully connected layer, outputting a single predicted value in the interval [0,1]. The input layer feeds the preprocessed combined data into the CNN convolutional layer. The CNN extracts local spatial features from the data and compresses the dimensionality through convolution and pooling. The GRU hidden layer learns long-term temporal variation patterns based on local features, capturing the periodicity and trend of electricity prices. The Attention layer assigns dynamic weights to the temporal features output by the GRU, focusing on information at key time steps. The output layer maps the weighted features to the actual electricity price prediction value. The layers work together to achieve accurate fitting of complex fluctuations in electricity prices.
[0048] Furthermore, the prediction model employs the Adam optimizer to iteratively optimize the weights and bias parameters. During model training, the Adam optimizer smooths the gradient direction changes through the first-order momentum coefficient, avoiding convergence instability caused by gradient oscillations; it adaptively adjusts the learning rate of each parameter through the second-order momentum coefficient, reducing the learning rate of parameters with large gradients (such as the weights of CNN convolutional layers) and increasing the learning rate of parameters with small gradients (such as the weights of Attention layers), thus achieving refined parameter optimization; at the same time, regularization is added through weight decay to prevent the model from overfitting; finally, through multiple iterations, the model's weights and bias parameters converge to the optimal values that minimize the loss function, ensuring that the model has high-precision prediction capabilities.
[0049] Example 2 This embodiment provides a specific implementation method for forecasting day-ahead prices in the electricity spot market. The specific embodiment is as follows.
[0050] Based on information disclosed by the trading center, day-ahead price forecast influencing factors are generated and collected, including centrally dispatched load, interconnection line output, renewable energy output, non-market-based output, and hydropower output. Considering the geographical location of the required forecast price within the province, day-ahead electricity prices at the forecast nodes are collected and mapped to the forecast influencing factors.
[0051] In the prediction process, factors such as multicollinearity among variables are considered, which affect the accuracy of prediction. Too many explanatory variables will lead to a decrease in the explanatory power of the model. In this embodiment, a Lasso model is constructed to screen explanatory factors. Its essence is to construct a penalty function to obtain a compressed model. Variable screening is performed by determining that the coefficients of some variables are 0.
[0052] The basic logic of the Lasso model is as follows. Assume a linear regression function:
[0053] In the formula, For constant terms; These are the regression coefficients of the regression model; This represents a random perturbation term. The basic principle of the Lasso model is to construct a first-order penalty function to obtain a refined model, and then perform feature selection by finally determining that the coefficients of some variables are 0.
[0054]
[0055] In the formula, For constant terms; These are the regression coefficients of the regression model; For random disturbance terms, , For Lasso parameters , The estimated value; For variables Group of observations, among which ; This is the penalty parameter.
[0056] make Represented as The least squares estimate, .when When, the optimal solution in the formula is ,when When the optimal solution in the formula is equal to 0, the variable will be removed from the model, thus achieving the purpose of variable selection.
[0057] This embodiment constructs a prediction model based on the CNN-GRU model with an attention mechanism. The model mainly includes an input layer, a CNN convolutional layer, a GRU hidden layer, an attention layer, and an output layer.
[0058] Historical data on current-day electricity prices and influencing factors are input into a CNN convolutional layer. Convolutional operations primarily extract local features, while pooling compresses these extracted features to form more crucial local feature information. Fully connected layers transform the extracted features into a one-dimensional data structure, completing time-series feature extraction. GRU hidden layers learn the internal patterns of current-day electricity price changes based on the key feature information extracted by the CNN, thus enabling prediction and ultimately outputting the predicted information. Attention layers assign weights to different features according to weight allocation principles. Finally, the output layer uses fully connected layers to calculate the weighted prediction information, yielding the overall prediction result of the model.
[0059] The training process of the attention-based CNN-GRU model is as follows: Figure 1 As shown.
[0060] The input data for the CNN-GRU-Attention model is a multi-dimensional vector composed of historical day-ahead electricity prices and various influencing factors. Column data matrix, composed of × The vector form, This indicates that the number of selected influencing factors has been increased by one. For sequence length, this paper uses express.
[0061] CNNs are used to extract spatial features from sequential data. They can perform filtering, downsampling, and other operations on the input sequence, transforming the data into high-dimensional feature vectors that can effectively describe the spatial characteristics of the sequential data. Based on the current price fluctuation characteristics, this paper sets the convolutional layer to one-dimensional convolution, selects max pooling for the pooling layer, and chooses the ReLU activation function. After processing by the convolutional and pooling layers, a fully connected layer transforms it into an output vector, using the Sigmoid activation function. The specific formula is as follows:
[0062]
[0063]
[0064]
[0065]
[0066] In the formula, This is the output of the CNN layer; , These are the outputs of the corresponding convolutional layers; , These are the outputs of the corresponding pooling layers; to This is the corresponding deviation amount; , , This is the weight matrix.
[0067] The GRU hidden layer learns the patterns of daily price changes by extracting key feature information from the CNN, thereby achieving predictive functionality. The specific formula is:
[0068] In the formula: For the GRU layer at the 1st The output of the step.
[0069] The Attention layer assigns weights to different features based on weighting principles. It learns the importance of different parts of the data, automatically selects key parts, and calculates their weighted contributions, thereby improving prediction accuracy. The specific formula is as follows:
[0070]
[0071]
[0072] In the formula: This is the output of the Attention layer; express At each time, based on the output vector of the previous layer The calculated attention probability distribution value; , These are the weighting coefficients; This is the bias value.
[0073] The output layer calculates the final predicted output through a fully connected layer, and the Dense layer uses the sigmoid activation function. The calculation formula is as follows:
[0074] In the formula, for The predicted output value at time step; These are the weighting coefficients; This is the bias value.
[0075] Furthermore, this embodiment selects the Adam optimizer (adaptive moment estimation) to iteratively optimize the neural network weights and bias parameters of the prediction model. This algorithm can iteratively update the neural network weights based on training data, maximizing the output value of the loss function. The loss function utilizes the mean squared error (MSE) function, calculated using the following formula:
[0076] In the formula: The number of samples; This is the actual value; Output values for the model.
[0077] This invention employs three error evaluation metrics to quantify the model's prediction accuracy: Mean Absolute Error (MAE), Root Mean Square Error (RMSE), and Mean Absolute Error (MAPE). The model parameters are then continuously adjusted in real-time based on the difference between the predicted and actual values. These adjustments primarily involve the initial learning rate, the number of convolutional layers, the number of pooling layers, the number of GRU layers, the number of iterations, the stride, and the batch size. The comparison results are shown in Table 1.
[0078] Table 1 Comparison of accuracy of different prediction models
[0079] As shown in Table 1, the prediction method in this embodiment fully leverages the feature extraction capabilities of the CNN convolutional network and the weighting effect of the attention mechanism on the data, optimizes the ability of the GRU model to perform deep learning on historical data, and through comparative analysis of the results of different prediction models, it was found that the CNN-GRU model based on the attention mechanism has high accuracy in predicting day-to-day prices, and is a feasible technical method.
[0080] Example 3 Based on the day-ahead price forecasting method for the electricity spot market in Example 1, this example provides a day-ahead price forecasting system for the electricity spot market, characterized by comprising: The data acquisition module is used to acquire day-ahead electricity price data for the target area, as well as multi-dimensional influencing factors related to electricity prices. The data processing module is used to perform feature filtering on multidimensional influencing factor data using a linear regression model with sparse constraints, and to eliminate multicollinearity to obtain feature vectors. The prediction module inputs the feature vector and the day-ahead electricity price data into a pre-trained prediction model to predict the future day-ahead electricity price and obtain the prediction result. The prediction model is a CNN-GRU model based on the attention mechanism.
[0081] The data acquisition module regularly retrieves electricity price and multi-dimensional influencing factor data for the target area from various official channels, stores it in the database, and triggers the data processing module. The data processing module uses the Lasso model to filter features from the influencing factor data, obtains feature vectors, and then notifies the prediction module. The prediction module loads the trained CNN-GRU model, inputs the feature vectors and electricity price data to make predictions, outputs the prediction results, and provides query services. All modules achieve automatic data flow through the database and message queue, without manual intervention, forming a complete automated prediction process.
[0082] Example 4 In another embodiment of the present invention, a computer-readable storage medium is provided as a storage component within a terminal device, the function of which is to store programs and data. It should be noted that the computer-readable storage medium here encompasses not only the built-in storage components of the terminal device but also extended storage components supported by the device. Essentially, it is a tangible medium capable of containing or storing programs that can be invoked by or in conjunction with an instruction execution system, device, or apparatus. This storage medium provides storage areas for the terminal's operating system and stores one or more instructions suitable for processor loading and execution, which can constitute one or more computer programs containing program code.
[0083] Specifically, examples of computer-readable storage media (a non-exclusive list) include: electrical connections with one or more wires, portable disks, hard disks, random access memory, read-only memory, erasable programmable read-only memory, optical fibers, portable optical disc read-only memory, optical storage devices, magnetic storage devices, or any reasonable combination of the above types.
[0084] The storage medium may also include data signals propagated as part of a baseband portion or a carrier wave, carrying readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any reasonable combination of both. Furthermore, computer-readable storage medium may also refer to other readable media besides conventional readable storage media, capable of sending, propagating, or transmitting programs for use or operation by an instruction execution system, apparatus, or device. Program code on the storage medium can be transmitted via any suitable medium, including but not limited to wireless, wired, optical fiber, or any reasonable combination thereof.
[0085] The program code used to implement the operations of this invention can be written in any combination of one or more programming languages, including object-oriented programming languages such as Java and C++, as well as conventional procedural programming languages such as C. The execution modes of the program code include: running entirely on the user's computing device, running partially on the user's device as a standalone software package, running partially in a distributed manner on both the user's device and a remote computing device, or running entirely on a remote computing device or server. When a remote computing device is involved, the device can be connected to the user's computing device via any type of network such as a local area network (LAN) or a wide area network (WAN), or connected to an external computing device via the Internet through an Internet service provider.
[0086] The processor is capable of loading and executing one or more instructions stored in a computer-readable storage medium to implement the corresponding steps of the day-ahead price forecasting method for the electricity spot market described in Example 1.
[0087] Example 5 Figure 2This is a schematic diagram of a computer device provided according to an embodiment of the present invention.
[0088] Please see Figure 2 The terminal device is a computer device. In this embodiment, the computer device 60 includes a processor 61, a memory 62, and a computer program 63 stored in the memory 62 and executable on the processor 61. When executed by the processor 61, the computer program 63 implements the day-ahead price forecasting method for the electricity spot market in this embodiment. To avoid repetition, these details are not elaborated here. Alternatively, when executed by the processor 61, the computer program 63 implements the functions of each model / unit in the computational system constituting the day-ahead price forecasting method for the electricity spot market in this embodiment. To avoid repetition, these details are not elaborated here.
[0089] Computer device 60 can be a desktop computer, laptop, handheld computer, cloud server, or other computing device. Computer device 60 may include, but is not limited to, a processor 61 and a memory 62. Those skilled in the art will understand that... Figure 2 This is merely an example of computer device 60 and does not constitute a limitation on computer device 60. It may include more or fewer components than shown, or combine certain components, or different components. For example, computer device may also include input / output devices, network access devices, buses, etc.
[0090] The processor 61 may be a central processing unit (CPU), or other general-purpose processors, CPUs, graphics processing units (GPUs), digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, quantum computing-based data processing logic units, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor.
[0091] The memory 62 can be an internal storage unit of the computer device 60, such as a hard disk or RAM of the computer device 60. The memory 62 can also be an external storage device of the computer device 60, such as a plug-in hard disk, Smart Media Card (SMC), Secure Digital (SD) card, Flash Card, etc., equipped on the computer device 60.
[0092] Furthermore, the memory 62 may include both internal storage units of the computer device 60 and external storage devices. The memory 62 is used to store computer programs and other programs and data required by the computer device. The memory 62 can also be used to temporarily store data that has been output or will be output.
[0093] Any references to memory, databases, or other media used in the embodiments provided in this application may include at least one of non-volatile and volatile memory. Non-volatile memory may include read-only memory (Read-Only Memory). Memory includes ROM, magnetic tape, floppy disk, flash memory, optical storage, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).
[0094] The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc., and are not limited to these.
Claims
1. A method for predicting day-ahead prices in the electricity spot market, characterized in that, include: Obtain day-ahead electricity price data for the target region, as well as multi-dimensional data on factors influencing electricity prices. A linear regression model with sparse constraints is used to perform feature filtering on the multidimensional influencing factor data to eliminate multicollinearity and obtain feature vectors. The feature vector and the day-ahead electricity price data are input into a pre-trained prediction model to predict the future day-ahead electricity price and obtain the prediction result. The prediction model is a CNN-GRU model based on the attention mechanism.
2. The method for forecasting day-ahead electricity spot market prices according to claim 1, characterized in that, The multi-dimensional influencing factors data include at least one of the following: central dispatch load, interconnection line output, new energy output, non-market-based output, and hydropower output.
3. The method for forecasting day-ahead electricity spot market prices according to claim 1, characterized in that, The linear regression model with sparse constraints is the Lasso model.
4. The method for forecasting day-ahead electricity spot market prices according to claim 3, characterized in that, The Lasso model is as follows: In the formula, For constant terms; These are the regression coefficients of the regression model; For random disturbance terms, , For Lasso parameters , The estimated value; For variables Group of observations, among which ; This is the penalty parameter.
5. The method for forecasting day-ahead electricity spot market prices according to claim 1, characterized in that, The prediction model includes an input layer, a CNN convolutional layer, a GRU hidden layer, an Attention layer, and an output layer. The input layer is used to input day-ahead electricity price data and feature vectors; The CNN convolutional layer is used to extract local spatial features from the data in the input layer; The GRU hidden layer is used to learn the temporal variation pattern of electricity prices based on local spatial features extracted by CNN; The Attention layer is used to assign dynamic weights to different features according to the weight allocation principle; The output layer is used to calculate the prediction information after assigning dynamic weights and obtain the prediction result.
6. The method for forecasting day-ahead electricity spot market prices according to claim 5, characterized in that, The CNN convolutional layer is: In the formula, This is the output of the CNN layer; , These are the outputs of the corresponding convolutional layers; , These are the outputs of the corresponding pooling layers; to This is the corresponding deviation amount; , , This is the weight matrix.
7. The method for forecasting day-ahead electricity spot market prices according to claim 5, characterized in that, The prediction model uses the Adam optimizer to iteratively optimize the weights and bias parameters.
8. A day-ahead price forecasting system for the electricity spot market, characterized in that, include: The data acquisition module is used to acquire day-ahead electricity price data for the target area, as well as multi-dimensional influencing factors related to electricity prices. The data processing module is used to perform feature filtering on the multidimensional influencing factor data using a linear regression model with sparse constraints, and to eliminate multicollinearity to obtain feature vectors. The prediction module inputs the feature vector and the day-ahead electricity price data into a pre-trained prediction model to predict the future day-ahead electricity price and obtain the prediction result. The prediction model is a CNN-GRU model based on the attention mechanism.
9. A computer-readable storage medium for storing one or more programs, characterized in that, The one or more programs include instructions that, when executed by a computing device, cause the computing device to perform the day-ahead price forecasting method for the electricity spot market as described in any one of claims 1 to 7.
10. A computing device, characterized in that, include: One or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, the one or more programs including steps for performing the day-ahead price forecasting method for the electricity spot market according to any one of claims 1 to 7.