Electricity market short-term price prediction method and device

Through the improved LSTM model and the multi-causal attention mechanism, combined with feedforward neural network and data smoothing processing technology, the complexity of short-term price prediction in the power market is solved, the prediction accuracy is improved, and a more reliable decision-making basis is provided for the power market.

CN119579229APending Publication Date: 2025-03-07STATE GRID TIANJIN ELECTRIC POWER COMPANY +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411635174.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-15
Publication Date
2025-03-07

AI Technical Summary

Technical Problem

Short-term price forecasts of the power market face challenges, especially in the case of market openness and increased investment in renewable energy, which leads to complex supply and demand relationships and increased electricity price volatility, which is difficult for existing technologies to effectively solve this problem.

Method used

The improved LSTM model is used to combine the multi-causal attention mechanism and feedforward neural network to construct a short-term price prediction model for power market by performing sequence decomposition and data smoothing of historical short-term price data, and using k-fold cross-validation method for model training and testing.

Benefits of technology

It improves the accuracy of short-term price forecasts of the power market and can more effectively provide decision-making basis for power market participants and support the healthy development of the power market.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119579229A_ABST
    Figure CN119579229A_ABST
Patent Text Reader

Abstract

The invention discloses a power market short-term price prediction method and device, and the method comprises the steps: obtaining a short-term price data sequence corresponding to a historical time sequence, and carrying out the sequence decomposition of the short-term price data sequence, and obtaining a power market short-term price decomposition sub-sequence; dividing the obtained short-term price decomposition sub-sequence of the electricity market into a training sample and a test sample, and smoothing the training sample and the test sample; constructing a power market short-term price prediction model based on an improved LSTM model, and training the power market short-term price prediction model by using the training sample; testing the trained power market short-term price prediction model by using a test sample, and obtaining the trained power market short-term price prediction model after the test is passed; the method is helpful for the decision making of the electricity market participants, and can provide support for the healthy development of the electricity market.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of power market price forecasting methods, and in particular relates to a power market short-term price forecasting method and device. Background Art

[0002] The short-term price of the electricity market plays an indispensable role in the decision-making process of the participants in the electricity market. On the one hand, accurate short-term price forecasts of the electricity market can help market participants make more reasonable and optimized decision-making plans, thereby reducing costs and improving benefits; on the other hand, inaccurate short-term price forecasts of the electricity market may lead to market participants making bad decisions, resulting in supply and demand imbalances, market fluctuations and other problems, thus affecting the stability and reliability of the entire electricity market. Therefore, short-term price forecasts in the electricity market have received more and more attention. However, the opening up of the electricity market and the large-scale investment in renewable energy have changed the pattern and operation of the market. The market supply and demand relationship has become more complex and unstable, which has led to increased volatility in electricity prices, bringing greater challenges and difficulties to the short-term price forecast of the electricity market. Therefore, it is necessary to propose a new short-term price forecasting method for the electricity market to improve the accuracy of short-term electricity price forecasts, provide decision-making basis for the participants in the electricity market, and provide support for the healthy development of the electricity market. Summary of the invention

[0003] The present invention adopts the following technical solutions:

[0004] A method for short-term price forecasting in an electricity market, the method comprising the following steps:

[0005] Obtain the short-term price data sequence corresponding to the historical time series, and perform sequence decomposition on the short-term price data sequence to obtain the short-term price decomposition subsequence of the power market;

[0006] The obtained short-term price decomposition subsequences of the electricity market are divided into training samples and test samples, and the training samples and the test samples are smoothed;

[0007] Construct a short-term price prediction model for the electricity market based on the improved LSTM model, and use the training samples to train the short-term price prediction model for the electricity market;

[0008] The trained short-term price forecasting model for the electricity market is tested using the test samples. After the test passes, the trained short-term price forecasting model for the electricity market is obtained.

[0009] Further, when the LSTM model is improved, the multi-head causal attention module connected to the power market short-term price forecasting model based on the improved LSTM model and the feedforward neural network is used to process the vector output by the feedforward neural network to obtain the output of the multi-head causal attention mechanism layer, and obtain the output of the multi-head causal attention mechanism through linear change and Softmax function, wherein the Softmax function is:

[0010]

[0011] Where: d k is the gradient factor, mask(·) represents the masking operation, which sets the upper triangular elements of the matrix to -∞, ensuring that the attention of a point can only be calculated through the elements before the point, preventing information leakage and making the correlation calculation in the historical direction; the output of the multi-head causal attention mechanism is:

[0012]

[0013] Where: W i Q , W i K , W i V The linear transformation weight matrices of Q, K and V for the i-th head respectively; W o It is the linear transformation weight matrix after concatenating multiple causal attention matrices; Concat is the concatenation of multiple Attention results;

[0014] After being calculated by the multi-head causal attention mechanism, the short-term price forecast samples of the electricity market enter a fully connected feedforward neural network layer for calculation; the two sub-layers of the multi-head causal attention and feedforward neural network are encoded, and normalized using residual connections to obtain the short-term price forecast results of the electricity market.

[0015] Furthermore, the method for performing sequence decomposition on the short-term price data sequence is:

[0016] 1) Add white noise to the short-term price data sequence x(t) corresponding to the historical time series obtained and convert it into:

[0017] x(t)+δ0w j

[0018] Where: δ0 is the amplitude of Gaussian white noise, w j is Gaussian white noise;

[0019] Perform Empirical Mode Decomposition (EMD) to extract the first-order power market short-term price series component IMF1(t) by performing EMD decomposition on the first residual power market short-term price subsequence r1(t), namely:

[0020]

[0021] r1(t)=x(t)-IMF1(t)

[0022] Where: I is the number of short-term price subsequences in the electricity market after decomposition, IMF1 i Decompose the components for the ith sequence.

[0023] 2) Continue to calculate the IMF component r of the nth electricity market short-term price n (t), that is:

[0024] r n (t) = r n-1 (t)-IMF I (t)

[0025] Where: r n-1 (t) is the IMF component of the n-1th electricity market short-term price.

[0026] The n+1th modal component IMF n+1 (t) is:

[0027]

[0028] Where: n is the expected weight coefficient, w i (t) is the weight of the ith IMF component, and E represents the expected value.

[0029] Repeat step 2) and stop decomposing when the residual signal becomes monotonic. Finally, the short-term price series of the electricity market becomes x(t), that is:

[0030]

[0031] Where: r(t) is the monotonic residual signal when the decomposition stops.

[0032] Furthermore, the method for smoothing the training samples and the test samples is to use the Savitzky-Golay filter formula to smooth the data. The main idea is to fit a polynomial near the data point and use the pre-calculated coefficients to perform weighted averaging on adjacent data points, which can smooth the data while maintaining the data shape without introducing too much phase delay. The smoothing process of short-term price data in the power market is:

[0033] First, select some parameters to configure how the Savitzky-Golay filter works, including the degree of the fitting polynomial (usually 2 to 4) and the window size (usually an odd number);

[0034] Secondly, according to the selected parameters, the coefficients required for Savitzky-Golay filtering are calculated. These coefficients are pre-calculated and used to weighted average adjacent data points.

[0035] Then, for each data point, the data points in the window (the number is the window size) and the corresponding coefficients are weighted averaged to generate a smoothed data sequence;

[0036] Finally, boundary processing is performed to ensure that boundary points can also be smoothed. The specific mathematical principles are as follows:

[0037] First, a total of 2n+1 observations before and after the current moment are filtered and fitted with a k-1 order polynomial. For the observations at the current moment, the following formula is used for fitting:

[0038] x t =a0+a1*t+a2*t 2 +...+a k-1 *t k-1

[0039] Secondly, the predicted values ​​of the previous and next moments (such as t-1, t+1, t-2, t+2, etc.) can also be calculated using the above formula, resulting in a total of 2n+1 formulas, forming a matrix:

[0040]

[0041] Simplify the above matrix:

[0042] X (2n+1)×1 =T (2n+1)×k +A k×1 +E (2n+1)×1

[0043] Where: The subscripts of each parameter represent their respective dimensions.

[0044] Then, calculate the filtered value of the model:

[0045] P=T·A=T·(T trans ·T) -1 ·T trans ·X=B·X

[0046] Where: A=(T trans ·T) -1 ·T trans·X, superscript trans means transpose;

[0047] Finally, the relationship matrix between the filtered values ​​and the observed values ​​is calculated:

[0048] B=T·(T trans ·T) -1 ·T trans

[0049] The Savitzky-Golay filtering formula can effectively remove the noise in the original data set and make the original data plot curve smooth, which is helpful to avoid overfitting or underfitting.

[0050] Through the above-mentioned data set division and data smoothing processing, the data is converted into a format suitable for model input, the improved LSTM model suitable for the task is selected, the preprocessed historical data of short-term prices in the electricity market is passed to the model as input variables, and the current value of short-term prices in the electricity market is used as the output variable. The model is used to predict short-term prices in the electricity market.

[0051] Furthermore, the obtained short-term price decomposition subsequences of the electricity market are divided into training samples and test samples, and the method is as follows:

[0052] The k-fold cross-validation method is used to divide the data set into k folds, and each fold is used as a test set in turn, and the remaining k-1 folds are used as training sets, and cross-validation is performed multiple times. The specific steps are:

[0053] First, the original data set is divided into k non-overlapping subsets, each of which is called a fold;

[0054] Second, for each fold i, the i-th fold is used as the test set and the remaining k-1 folds are used as the training set.

[0055] Again, train the model on the training set and evaluate the performance on the test set;

[0056] Then, the performance indicators of the model in the i-th cross-validation are calculated, such as accuracy, precision, recall, etc.

[0057] Finally, the above process is repeated until each fold is used as a test set, thus completing k cross-validations, and averaging the performance indicators of each cross-validation to obtain the average performance estimate of the model.

[0058] Furthermore, when using the test sample for validation, the root mean square error is used to measure the accuracy of the prediction;

[0059] The root mean square error RMSE is expressed as:

[0060]

[0061] Where: y i is the actual value, is the predicted value, and n is the predicted number.

[0062] A short-term price forecasting device for an electric power market, comprising:

[0063] The power market short-term price decomposition subsequence acquisition module is used to obtain the short-term price data sequence corresponding to the historical time series, and perform sequence decomposition on the short-term price data sequence to obtain the power market short-term price decomposition subsequence;

[0064] The training sample and test sample acquisition and processing module is used to divide the obtained power market short-term price decomposition subsequence into training samples and test samples, and perform smoothing on the training samples and test samples;

[0065] The power market short-term price prediction model construction and testing module is used to build a power market short-term price prediction model based on the improved LSTM model and train the power market short-term price prediction model using training samples;

[0066] The power market short-term price forecasting model acquisition module is used to test the trained power market short-term price forecasting model using test samples, and obtain the trained power market short-term price forecasting model after the test passes.

[0067] A non-transitory computer-readable storage medium stores a computer program, which, when executed by a processor, implements the above-mentioned method for short-term price forecasting in the electricity market.

[0068] An electronic device comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, a method for short-term price forecasting in an electricity market as described above is implemented.

[0069] The beneficial technical effects of the present invention are:

[0070] The method of the present invention fully considers the historical data information of short-term prices in the electricity market, decomposes the original sequence data, divides the data set and smoothes it, uses a multi-head causal attention mechanism and a feedforward neural network to "self-learn" and "self-adjust" the training samples, and establishes a short-term price forecasting model for the electricity market based on the improved LSTM, so as to obtain the short-term price forecasting data of the electricity market as accurate as possible, thereby facilitating the decision-making of the main participants in the electricity market and providing support for the healthy development of the electricity market. BRIEF DESCRIPTION OF THE DRAWINGS

[0071] Figure 1 This is the network structure of the LSTM model in the embodiment of the present invention. DETAILED DESCRIPTION

[0072] The following is a further clear and complete description of a method and device for clearing a power capacity market taking into account flexibility provided by the present invention in conjunction with the accompanying drawings:

[0073] Example 1

[0074] This embodiment provides a method for short-term price prediction in the power market, the method comprising the following steps:

[0075] Obtain the short-term price data sequence corresponding to the historical time series, and perform sequence decomposition on the short-term price data sequence to obtain the short-term price decomposition subsequence of the power market;

[0076] The obtained short-term price decomposition subsequences of the electricity market are divided into training samples and test samples, and the training samples and the test samples are smoothed;

[0077] Construct a short-term price prediction model for the electricity market based on the improved LSTM model, and use the training samples to train the short-term price prediction model for the electricity market;

[0078] The trained short-term price forecasting model for the electricity market is tested using the test samples. After the test passes, the trained short-term price forecasting model for the electricity market is obtained.

[0079] Specifically, the method for performing sequence decomposition on a short-term price data sequence is as follows:

[0080] 1) Add white noise to the short-term price data sequence x(t) corresponding to the historical time series obtained and convert it into:

[0081] x(t)+δ0w j

[0082] Where: δ0 is the amplitude of Gaussian white noise, w j is Gaussian white noise;

[0083] Perform Empirical Mode Decomposition (EMD) to extract the first-order power market short-term price series component IMF1(t) by performing EMD decomposition on the first residual power market short-term price subsequence r1(t), namely:

[0084]

[0085] r1(t)=x(t)-IMF1(t)

[0086] Where: I is the number of short-term price subsequences in the electricity market after decomposition, IMF1 i Decompose the components for the ith sequence.

[0087] 2) Continue to calculate the IMF component r of the nth electricity market short-term price n (t), that is:

[0088] r n (t) = r n-1 (t)-IMF I (t)

[0089] Where: r n-1 (t) is the IMF component of the n-1th electricity market short-term price.

[0090] The n+1th modal component IMF n+1 (t) is:

[0091]

[0092] Where: n is the expected weight coefficient, w i (t) is the weight of the ith IMF component, and E represents the expected value.

[0093] Repeat step 2) and stop decomposing when the residual signal becomes monotonic. Finally, the short-term price series of the electricity market becomes x(t), that is:

[0094]

[0095] Where: r(t) is the monotonic residual signal when the decomposition stops.

[0096] The method for smoothing the training samples and the test samples is as follows:

[0097] The collected short-term price data of the power market often have burrs and noise. It is not effective to use it directly for prediction and analysis. The original sample data needs to be smoothed and preprocessed. The Savitzky-Golay filter formula can be used for data smoothing. Its main idea is to fit a polynomial near the data point and use pre-calculated coefficients to perform weighted averaging on adjacent data points. This can smooth the data while maintaining the data shape without introducing too much phase delay. The smoothing process of short-term price data in the power market is as follows:

[0098] First, select some parameters to configure how the Savitzky-Golay filter works, including the degree of the fitting polynomial (usually 2 to 4) and the window size (usually an odd number);

[0099] Secondly, according to the selected parameters, the coefficients required for Savitzky-Golay filtering are calculated. These coefficients are pre-calculated and used to weighted average adjacent data points.

[0100] Then, for each data point, the data points in the window (the number is the window size) and the corresponding coefficients are weighted averaged to generate a smoothed data sequence;

[0101] Finally, boundary processing is performed to ensure that boundary points can also be smoothed. The specific mathematical principles are as follows:

[0102] First, a total of 2n+1 observations before and after the current moment are filtered and fitted with a k-1 order polynomial. For the observations at the current moment, the following formula is used for fitting:

[0103] x t =a0+a1*t+a2*t 2 +...+a k-1 *t k-1

[0104] Secondly, the predicted values ​​of the previous and next moments (such as t-1, t+1, t-2, t+2, etc.) can also be calculated using the above formula, resulting in a total of 2n+1 formulas, forming a matrix:

[0105]

[0106] Simplify the above matrix:

[0107] X (2n+1)×1 =T (2n+1)×k +A k×1 +E (2n+1)×1

[0108] Where: The subscripts of each parameter represent their respective dimensions.

[0109] Then, calculate the filtered value of the model:

[0110] P=T·A=T·(T trans ·T) -1 ·T trans ·X=B·X

[0111] Where: A=(T trans ·T) -1 ·T trans ·X, superscript trans means transpose;

[0112] Finally, the relationship matrix between the filtered values ​​and the observed values ​​is calculated:

[0113] B=T·(T trans ·T) -1 ·T trans

[0114] The Savitzky-Golay filtering formula can effectively remove the noise in the original data set and make the original data plot curve smooth, which is helpful to avoid overfitting or underfitting.

[0115] Through the above-mentioned data set division and data smoothing processing, the data is converted into a format suitable for model input, the improved LSTM model suitable for the task is selected, the preprocessed historical data of short-term prices in the electricity market is passed to the model as input variables, and the current value of short-term prices in the electricity market is used as the output variable. The model is used to predict short-term prices in the electricity market.

[0116] In addition, the obtained short-term price decomposition subsequences of the electricity market are divided into training samples and test samples, and the method is as follows:

[0117] The k-fold cross-validation method is used to divide the data set into k folds, and each fold is used as a test set in turn, and the remaining k-1 folds are used as training sets, and cross-validation is performed multiple times. The specific steps are:

[0118] First, the original data set is divided into k non-overlapping subsets, each of which is called a fold;

[0119] Secondly, for each fold i, the i-th fold is used as the test set and the remaining k-1 folds are used as the training set;

[0120] Again, train the model on the training set and evaluate the performance on the test set;

[0121] Then, calculate the performance indicators of the model in the i-th cross-validation, such as accuracy, precision, recall, etc.;

[0122] Finally, the above process is repeated until each fold is used as a test set, thus completing k cross-validations, and averaging the performance indicators of each cross-validation to obtain the average performance estimate of the model.

[0123] When using the test sample for validation, the root mean square error is used to measure the accuracy of the prediction;

[0124] The root mean square error RMSE is expressed as:

[0125]

[0126] Where: y i is the actual value, is the predicted value, and n is the predicted number.

[0127] When the LSTM model is improved, the multi-head causal attention module connected to the power market short-term price forecasting model based on the improved LSTM model and the feedforward neural network is used to process the vector output by the feedforward neural network to obtain the output of the multi-head causal attention mechanism layer, and obtain the output of the multi-head causal attention mechanism through linear change and Softmax function, wherein the Softmax function is:

[0128]

[0129] Where: d k is the gradient factor, and mask(·) represents the masking operation. The mask sets the upper triangular elements of the matrix (excluding the diagonal) to -∞, ensuring that the attention of a point can only be calculated through the elements before the point, preventing information leakage, and making the correlation calculation towards the historical direction; at the same time, it enhances / weakens the spatial characteristics of strong / weak correlation, which helps the model better focus on important information. The output of the multi-head causal attention mechanism is:

[0130]

[0131] Where: W i Q , W i K , W i V The linear transformation weight matrices of Q, K and V for the i-th head respectively; W o It is the linear transformation weight matrix after concatenating multiple causal attention matrices; Concat is the concatenation of multiple Attention results;

[0132] After the multi-head causal attention mechanism calculates the short-term price forecast sample of the electricity market, it enters a fully connected feedforward neural network layer for calculation, and the output is:

[0133] F FN (Z) = max(0,ZW1+b1)W2+b2

[0134] Where: b1, b2 represent bias.

[0135] The two sub-layers of multi-head causal attention and feedforward neural network are encoded and normalized using residual connection to obtain the short-term price forecast result of the electricity market:

[0136]

[0137] Where: s O ut is the short-term price value of the electricity market in the sample; LN is layer normalization; u L , are the mean and variance respectively; α and β represent the gain and bias respectively; is the adjustment parameter.

[0138] It should be noted that LSTM can be regarded as a special recurrent neural network (RNN). Traditional RNN models often face the problems of gradient explosion and gradient vanishing during training, especially when processing long sequences, which makes it difficult for RNN to capture long-term dependencies. To solve this problem, LSTM introduces the concept of cell state, which belongs to the hidden layer of the network. In LSTM, the flow and retention of information are controlled by cleverly designed gate mechanisms, especially the forget gate, input gate, and output gate, making the network more effective in processing dependencies over long time scales. The transfer of cell states helps to maintain long-term memory by performing linear operations. The network structure of the LSTM model is as follows: Figure 1 shown.

[0139] The first step of LSTM is to determine which information should be discarded in the cell state, which can be expressed mathematically as:

[0140] f t =σ(W f ×[h t-1 ,x t ]+b f )

[0141] Where: W f represents the weight matrix of the forget gate; b f is the forget gate bias term; x t and h t-1 is the input item; σ is a sigmoid function whose output range is between 0 and 1, which is used to control the degree of information transmission, where 0 means no information is allowed to be transmitted and 1 means all information is allowed to be transmitted; output f t is a vector of values ​​between 0 and 1;

[0142] In the second step of the LSTM, the new information is added to the cell state and a state update is performed.

[0143] First, the sigmoid layer of the input gate determines which information needs to be updated;

[0144] Then, the tanh layer creates a new candidate vector

[0145] Finally, these two parts are superimposed to update the cell status. This process helps the LSTM model better capture and update information when processing sequences, namely:

[0146] i t =σ(W i ×[h t-1 , x t]+b i )

[0147]

[0148] Where: W i represents the input gate weight matrix; b i is the input gate bias term, and the weight matrix used to calculate the unit state is given by W c Indicates; W c and b c is the bias term used to calculate the cell state;

[0149] The third step of LSTM is to determine the output value:

[0150] First, the sigmoid layer determines the update And pass it through the tanh layer for numerical normalization;

[0151] The output of the tanh layer is then multiplied by the weight of the sigmoid layer to obtain the final output. This process helps the LSTM network to efficiently capture long-term dependencies when processing time series data.

[0152] o t =σ(W o ×[h t-1 , x t ]+b o )

[0153] h t =o t ×tanh(C t )

[0154] Where: W o is the output gate weight matrix; b o is the output bias term.

[0155] Example 2

[0156] This embodiment provides a short-term price forecasting device for an electricity market, comprising:

[0157] The power market short-term price decomposition subsequence acquisition module is used to obtain the short-term price data sequence corresponding to the historical time series, and perform sequence decomposition on the short-term price data sequence to obtain the power market short-term price decomposition subsequence;

[0158] The training sample and test sample acquisition and processing module is used to divide the obtained power market short-term price decomposition subsequence into training samples and test samples, and perform smoothing on the training samples and test samples;

[0159] The power market short-term price prediction model construction and testing module is used to build a power market short-term price prediction model based on the improved LSTM model and train the power market short-term price prediction model using training samples;

[0160] The power market short-term price forecasting model acquisition module is used to test the trained power market short-term price forecasting model using test samples, and obtain the trained power market short-term price forecasting model after the test passes.

[0161] A non-transitory computer-readable storage medium stores a computer program, which, when executed by a processor, implements the above-mentioned method for short-term price forecasting in the electricity market.

[0162] An electronic device comprises a memory, a processor and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, a method for short-term price forecasting in an electricity market as described above is implemented.

[0163] Through the description of the above embodiments, it can be clearly understood by those skilled in the art that the facilities of the present invention can be implemented by means of software plus the necessary general hardware platform. The embodiments of the present invention can be implemented using an existing processor, or by a dedicated processor used for this purpose or other purposes for an appropriate system, or by a hard-wired system. The embodiments of the present invention also include a non-transitory computer-readable storage medium, which includes a machine-readable medium for carrying or having a machine-executable instruction or data structure stored thereon; such a machine-readable medium can be any available medium that can be accessed by a general or special-purpose computer or other machine with a processor. For example, such a machine-readable medium can include RAM, ROM, EPROM, EEPROM, CD-ROM or other optical disk storage, disk storage or other magnetic storage device, or any other medium that can be used to carry or store the required program code in the form of machine-executable instructions or data structures, and can be accessed by a general or special-purpose computer or other machine with a processor. When information is transmitted or provided to a machine via a network or other communication connection (hard wiring, or wireless, or a combination of hard wiring and wireless), the connection is also considered a machine-readable medium.

[0164] So far, the technical solutions of the present invention have been described in conjunction with the preferred embodiments shown in the accompanying drawings. However, it is easy for those skilled in the art to understand that the protection scope of the present invention is obviously not limited to these specific embodiments. Without departing from the principle of the present invention, those skilled in the art can make equivalent changes or substitutions to the relevant technical features, and the technical solutions after these changes or substitutions will fall within the protection scope of the present invention.

Claims

1. A method for short-term price forecasting in the electricity market, characterized in that: The method comprises the following steps: Obtain the short-term price data sequence corresponding to the historical time series, and perform sequence decomposition on the short-term price data sequence to obtain the short-term price decomposition subsequence of the power market; The obtained short-term price decomposition subsequences of the electricity market are divided into training samples and test samples, and the training samples and the test samples are smoothed; Construct a short-term price prediction model for the electricity market based on the improved LSTM model, and use the training samples to train the short-term price prediction model for the electricity market; The trained short-term price forecasting model for the electricity market is tested using the test samples. After the test passes, the trained short-term price forecasting model for the electricity market is obtained.

2. A method for short-term price forecasting in the power market according to claim 1, characterized in that: When the LSTM model is improved, the multi-head causal attention module connected to the power market short-term price forecasting model based on the improved LSTM model and the feedforward neural network is used to process the vector output by the feedforward neural network to obtain the output of the multi-head causal attention mechanism layer, and obtain the output of the multi-head causal attention mechanism through linear change and Softmax function, wherein the Softmax function is: Where: d k is the gradient factor, mask(·) represents the masking operation, which sets the upper triangular elements of the matrix to -∞, ensuring that the attention of a point can only be calculated through the elements before the point, preventing information leakage and making the correlation calculation in the historical direction; the output of the multi-head causal attention mechanism is: Where: W i Q , W i K , W i V The linear transformation weight matrices of Q, K and V for the i-th head respectively; W o It is the linear transformation weight matrix after concatenating multiple causal attention matrices; Concat is the concatenation of multiple Attention results; After being calculated by the multi-head causal attention mechanism, the short-term price forecast samples of the electricity market enter a fully connected feedforward neural network layer for calculation; the two sub-layers of the multi-head causal attention and feedforward neural network are encoded, and normalized using residual connections to obtain the short-term price forecast results of the electricity market.

3. A method for short-term price forecasting in the power market according to claim 1, characterized in that: The method for performing sequence decomposition on a short-term price data sequence is as follows: 1) Add white noise to the short-term price data sequence x(t) corresponding to the historical time series obtained and convert it into: x(t)+δ0w j Where: δ0 is the amplitude of Gaussian white noise, w j is Gaussian white noise; Perform Empirical Mode Decomposition (EMD) to extract the first-order power market short-term price series component IMF1(t) by performing EMD decomposition on the first residual power market short-term price subsequence r1(t), namely: r1(t)=x(t)-IMF1(t) Where: I is the number of short-term price subsequences in the electricity market after decomposition, IMF1 i Decompose the components for the ith sequence. 2) Continue to calculate the IMF component r of the nth electricity market short-term price n (t), that is: r n (t)=r n-1 (t)-IMF I (t) Where: r n-1 (t) is the IMF component of the n-1th electricity market short-term price. The n+1th modal component IMF n+1 (t) is: Where: n is the expected weight coefficient, w i (t) is the weight of the ith IMF component, and E represents the expected value. Repeat step 2) and stop decomposing when the residual signal becomes monotonic. Finally, the short-term price series of the electricity market becomes x(t), that is: Where: r(t) is the monotonic residual signal when the decomposition stops.

4. A method for short-term price forecasting in the power market according to claim 1, characterized in that: The method for smoothing the training samples and the test samples is: using the Savitzky-Golay filtering formula to smooth the data.

5. A method for short-term price forecasting in the power market according to claim 1, characterized in that: The obtained short-term price decomposition subsequences of the electricity market are divided into training samples and test samples. The method is as follows: The k-fold cross-validation method is used to divide the data set into k folds, each fold is used as a test set in turn, and the remaining k-1 folds are used as training sets, and cross-validation is performed multiple times.

6. A method for short-term price forecasting in the power market according to claim 5, characterized in that: When using the test sample for validation, the root mean square error is used to measure the accuracy of the prediction; The root mean square error RMSE is expressed as: Where: y i is the actual value, is the predicted value, and n is the predicted number.

7. A short-term price forecasting device for an electric power market, characterized in that: include: The power market short-term price decomposition subsequence acquisition module is used to obtain the short-term price data sequence corresponding to the historical time series, and perform sequence decomposition on the short-term price data sequence to obtain the power market short-term price decomposition subsequence; The training sample and test sample acquisition and processing module is used to divide the obtained power market short-term price decomposition subsequence into training samples and test samples, and perform smoothing on the training samples and test samples; The power market short-term price prediction model construction and testing module is used to build a power market short-term price prediction model based on the improved LSTM model and train the power market short-term price prediction model using training samples; The power market short-term price forecasting model acquisition module is used to test the trained power market short-term price forecasting model using test samples, and obtain the trained power market short-term price forecasting model after the test passes.

8. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, a method for short-term price forecasting in the electricity market as described in any one of claims 1 to 6 is implemented.

9. An electronic 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, a method for short-term price forecasting in the electricity market is implemented as described in any one of claims 1 to 6.