Power purchase prediction method for power spot market
By constructing an LSTM-based power purchase decision optimization model and combining relevant characteristic data of the power market, the shortcomings of the existing electricity price prediction methods in dealing with complexity and timing problems are solved, and higher prediction accuracy and risk control are achieved.
Patent Information
- Application Number
- CN202510017562.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-06
- Publication Date
- 2025-04-29
AI Technical Summary
Existing electricity price prediction methods have shortcomings in dealing with complexity and timing issues in the power market, especially in the selection of appropriate model structures, data selection and risk assessment.
Using an LSTM-based power purchase decision optimization model, combined with relevant characteristic data of the power market, through data collection, preprocessing, feature screening and model training, a model can accurately predict the direction of electricity prices, and estimate the predicted error risk through risk assessment indicators.
It improves the accuracy of electricity price prediction, reduces the calculation complexity and prediction error risk of the model, and enhances the scientificity and robustness of electricity purchase decisions.
Smart Images

Figure CN119903959A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the field of electric power technology, and in particular relates to a power purchase forecasting method for the electric power spot market. Background Art
[0002] The power market is a typical diversified, market-oriented and competitive market, and it is also a market with a large amount of information and high complexity. With the development of the power market, the demand for power price forecasting by market participants is increasing, and accurate power price forecasting has an important impact on the stable operation of the power market and the economic interests of market participants.
[0003] Generally, the prediction methods of electricity prices mainly include traditional statistical methods, prediction methods based on machine learning, and prediction methods based on artificial neural networks (ANN). Among them, statistical methods such as autoregressive models and moving average models are easily affected by data noise and are limited in dealing with nonlinear and complex problems; while machine learning methods such as decision trees and support vector machines can handle nonlinear and high-dimensional problems, but require a large amount of sample data and good feature representation, and have limited ability to handle time series problems; and although ANN can handle problems with strong time series, nonlinearity, and high dimensions, deep neural networks have certain defects in long-term dependency problems, such as gradient vanishing and gradient explosion problems. Therefore, how to overcome the shortcomings of the existing technology is a problem that needs to be solved urgently in this technical field. Summary of the invention
[0004] The purpose of the present invention is to solve the deficiencies of the prior art and provide a method for predicting electricity purchases in the electricity spot market.
[0005] To achieve the above purpose, the technical solution adopted by the present invention is as follows:
[0006] A method for predicting electricity purchases in a spot electricity market comprises the following steps:
[0007] S1. Data collection: Collect relevant characteristic data of the power market, including main transformer capacity, production capacity of self-provided power plants, load data of major equipment, production capacity and unit energy consumption of each power plant in the power market, historical electricity price data, and spot market transaction data;
[0008] S2. Data preprocessing: Dimensionality reduction of main equipment load data;
[0009] S3, feature screening: calculate the correlation coefficient between the main transformer capacity, the capacity of the self-provided power plant, the capacity and unit energy consumption of each power plant in the power market, the spot market transaction data, and the main equipment load data pre-processed by S2 and the historical electricity price data collected by S1, and screen the feature data with a correlation coefficient greater than the threshold;
[0010] S4. Construct an LSTM-based electricity purchase decision optimization model:
[0011] The characteristic data filtered by S3 is used as the input of the model, and the historical electricity price data for a period of time in the future is used as the output. The LSTM model is trained, tested and verified to obtain the LSTM-based electricity purchase decision optimization model.
[0012] S5. Real-time prediction and power purchase: The current feature data is obtained in real time and input into the LSTM-based power purchase decision optimization model to obtain the predicted electricity price data; then, the prediction error risk assessment index is calculated based on the trading rules of the power market and the company's actual power demand, and then a power purchase plan is generated. Then, according to the power purchase plan, the power purchase instruction is issued to the corresponding power trading system for trading.
[0013] Furthermore, preferably, in S2, a t-distributed random nearest neighbor embedding method is used to perform dimensionality reduction processing on the load data of the main equipment.
[0014] Further, preferably, in S2, the load data of the main equipment is 10-dimensional, and the dimension is reduced to 3-dimensional by dimensionality reduction;
[0015] The 10-dimensional main equipment load data include real-time load, predicted load, peak load, valley load, average load, load factor, load rate, load growth rate, load fluctuation degree and load curve slope.
[0016] Further, preferably, in S3, the correlation coefficient adopts the Pearson correlation coefficient.
[0017] Furthermore, preferably, in S3, the threshold is 0.5.
[0018] Furthermore, preferably, in S4, the ratio of the training set used for training the model, the test set used for testing, and the validation set used for validation is 70%:15%:15%.
[0019] Further, preferably, the method for calculating the prediction error risk assessment index is as follows:
[0020] Let X = {x t ,t=1,2,…,N} is the actual original time series, N represents the total number of samples;
[0021] The predicted value sequence of the m-time prediction of the electricity purchase decision optimization model based on LSTM is X i =x it ,t=1,2,…,N,i=1,2,…,m, m is the number of predictions;
[0022] At the same time, the corresponding weight coefficients for each prediction are set to w1, w2, ..., w m , and satisfy:
[0023]
[0024] According to the formula of weighted geometric mean, let:
[0025]
[0026] Then it is called is the combined prediction value of the weighted geometric mean, let is the multiple prediction sequence at time t;
[0027] Transform formula (3) into
[0028]
[0029] Among them, x it The predicted value of the i-th prediction at time t;
[0030] Let lnX = {lnx t ,t=1,2,…,N} is the actual value logarithmic sequence, x t The normalized value of the actual value at time t; the logarithmic sequence of the predicted value of the i-th prediction at time t is is the logarithmic sequence of multiple prediction values at time t
[0031]
[0032]
[0033] Then it is called E i is the sum of squared logarithmic errors of the i-th prediction; E is the sum of squared logarithmic errors of the multiple prediction methods; e it It represents the error between the predicted value and the actual value at the tth time of the i-th prediction.
[0034] The weighted geometric mean multiple predictions based on the sum of squared errors are expressed as:
[0035]
[0036] The final solution of formula (7) is the optimal weight coefficient, and minE(w) is the prediction error risk assessment index value.
[0037] Furthermore, preferably, when formulating a power purchase plan, the prediction result with the smallest prediction error risk assessment index value is preferably selected.
[0038] Further, preferably, the electricity purchase plan includes the electricity purchase amount, electricity purchase time and electricity purchase price.
[0039] In order to solve the above problems, many new electricity price prediction methods have emerged. Among them, the electricity price prediction method based on the long short-term memory network (LSTM) has attracted much attention because of its obvious advantages in dealing with long-term dependency problems. LSTM is a special recurrent neural network structure that aims to solve the long-term dependency problem, that is, when processing long sequence data, it can effectively capture the long-term dependency information in the sequence. However, although LSTM has advantages over other methods in electricity price prediction, it still faces many challenges, such as how to choose a suitable model structure, the selection of training data, and the assessment of the risk of model prediction results. The solution to these problems is of great significance to improving the accuracy of electricity price prediction and the decision-making of power suppliers and users in the electricity market. The main technical problem to be solved by the present invention is how to combine the relevant characteristic data of the electricity market to construct an electricity price prediction model based on LSTM, so as to accurately predict the trend of electricity prices, and formulate an optimized electricity purchase strategy based on the prediction results. At the same time, risk control needs to be considered, and the prediction error risk is evaluated by establishing a risk assessment index to improve the accuracy of electricity purchase decisions and reduce economic losses.
[0040] In the present invention, the specific method of generating a power purchase plan by combining the transaction rules of the power market with the actual power demand of the company can adopt the existing method, and the present invention does not limit this.
[0041] In S4 of the present invention, the specific time interval between the input data and the output data can be adjusted according to specific needs, for example, it can be set to predict the electricity price for the next day or even a week. In practical applications, this parameter can be adjusted according to the actual electricity purchase plan.
[0042] Compared with the prior art, the present invention has the following beneficial effects:
[0043] 1. By mining and screening the rich feature data of the power market, the features that have a significant impact on electricity price prediction are screened, a feature data set is constructed, and the LSTM prediction model is used to effectively improve the accuracy of electricity price prediction.
[0044] 2. The feature screening process aims to find the most representative features. Reasonable feature screening can reduce the complexity of the model and greatly improve the efficiency of model training and prediction. At the same time, the application of T-SN E technology to reduce the dimension of data also effectively reduces the computational complexity of the model and improves the calculation speed of the model.
[0045] 3. The prediction error risk assessment index of multivariate risks can evaluate the risk of model prediction, making the electricity price forecasting work more robust, thereby reducing risks in actual electricity market transactions.
[0046] 4. The input characteristics of the model are extensive, covering multiple aspects such as main transformer capacity, self-contained power plant conditions, main equipment load data, substation voltage data, production capacity and unit energy consumption, spot market transaction data, etc., making the model widely applicable and adaptable to different power market environments and corporate needs.
[0047] It can be seen from the application examples that compared with the existing prediction methods, the present invention can improve the prediction accuracy by about 10%. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] Figure 1 This is the internal structure diagram of the LSTM model. DETAILED DESCRIPTION
[0049] The present invention is further described in detail below in conjunction with embodiments.
[0050] Those skilled in the art will appreciate that the following examples are only used to illustrate the present invention and should not be considered to limit the scope of the present invention. If no specific techniques or conditions are specified in the examples, the techniques or conditions described in the literature in the art or the product specifications are used. If the manufacturer of the materials or equipment used is not specified, they are all conventional products that can be purchased.
[0051] Example 1
[0052] A method for predicting electricity purchases in the electricity spot market, characterized in that it comprises the following steps:
[0053] S1. Data collection: Collect relevant characteristic data of the power market, including main transformer capacity, production capacity of self-provided power plants, load data of major equipment, production capacity and unit energy consumption of each power plant in the power market, historical electricity price data, and spot market transaction data;
[0054] S2. Data preprocessing: Dimensionality reduction of main equipment load data;
[0055] S3, feature screening: calculate the correlation coefficient between the main transformer capacity, the capacity of the self-provided power plant, the capacity and unit energy consumption of each power plant in the power market, the spot market transaction data, and the main equipment load data pre-processed by S2 and the historical electricity price data collected by S1, and screen the feature data with a correlation coefficient greater than the threshold;
[0056] S4. Construct an LSTM-based electricity purchase decision optimization model:
[0057] The characteristic data filtered by S3 is used as the input of the model, and the historical electricity price data for a period of time in the future is used as the output. The LSTM model is trained, tested and verified to obtain the LSTM-based electricity purchase decision optimization model.
[0058] S5. Real-time prediction and power purchase: The current feature data is obtained in real time and input into the LSTM-based power purchase decision optimization model to obtain the predicted electricity price data; then, the prediction error risk assessment index is calculated based on the trading rules of the power market and the company's actual power demand, and then a power purchase plan is generated. Then, according to the power purchase plan, the power purchase instruction is issued to the corresponding power trading system for trading.
[0059] Example 2
[0060] A method for predicting electricity purchases in the electricity spot market, characterized in that it comprises the following steps:
[0061] S1. Data collection: Collect relevant characteristic data of the power market, including main transformer capacity, production capacity of self-provided power plants, load data of major equipment, production capacity and unit energy consumption of each power plant in the power market, historical electricity price data, and spot market transaction data;
[0062] S2. Data preprocessing: Dimensionality reduction of main equipment load data;
[0063] S3, feature screening: calculate the correlation coefficient between the main transformer capacity, the capacity of the self-provided power plant, the capacity and unit energy consumption of each power plant in the power market, the spot market transaction data, and the main equipment load data pre-processed by S2 and the historical electricity price data collected by S1, and screen the feature data with a correlation coefficient greater than the threshold;
[0064] S4. Construct an LSTM-based electricity purchase decision optimization model:
[0065] The characteristic data filtered by S3 is used as the input of the model, and the historical electricity price data for a period of time in the future is used as the output. The LSTM model is trained, tested and verified to obtain the LSTM-based electricity purchase decision optimization model.
[0066] S5. Real-time prediction and power purchase: The current feature data is obtained in real time and input into the LSTM-based power purchase decision optimization model to obtain the predicted electricity price data; then, the prediction error risk assessment index is calculated based on the trading rules of the power market and the company's actual power demand, and then a power purchase plan is generated. Then, according to the power purchase plan, the power purchase instruction is issued to the corresponding power trading system for trading.
[0067] In S2, the t-distributed random nearest neighbor embedding method is used to reduce the dimension of the load data of the main equipment.
[0068] In S2, the load data of the main equipment is 10-dimensional, which is reduced to 3 dimensions through dimensionality reduction;
[0069] The 10-dimensional main equipment load data include real-time load, predicted load, peak load, valley load, average load, load factor, load rate, load growth rate, load fluctuation degree and load curve slope.
[0070] In S3, the correlation coefficient uses the Pearson correlation coefficient.
[0071] In S3, the threshold is 0.5.
[0072] In S4, the ratio of the training set used for model training, the test set used for testing, and the validation set used for validation is 70%:15%:15%.
[0073] The method for calculating the forecast error risk assessment index is as follows:
[0074] Let X = {x t ,t=1,2,…,N} is the actual original time series, N represents the total number of samples;
[0075] The predicted value sequence of the m-time prediction of the electricity purchase decision optimization model based on LSTM is X i =x it ,t=1,2,…,N,i=1,2,…,m, m is the number of predictions;
[0076] At the same time, the corresponding weight coefficients for each prediction are set to w1, w2, ..., w m , and satisfy:
[0077]
[0078] According to the formula of weighted geometric mean, let:
[0079]
[0080] Then it is called is the combined prediction value of the weighted geometric mean, let is the multiple prediction sequence at time t;
[0081] Transform formula (3) into
[0082]
[0083] Among them, x it The predicted value of the i-th prediction at time t;
[0084] Let lnX = {lnx t ,t=1,2,…,N} is the actual value logarithmic sequence, x t The normalized value of the actual value at time t; the logarithmic sequence of the predicted value of the i-th prediction at time t is is the logarithmic sequence of multiple prediction values at time t
[0085]
[0086]
[0087] Then it is called E i is the sum of squared logarithmic errors of the i-th prediction; E is the sum of squared logarithmic errors of the multiple prediction methods; e it It represents the error between the predicted value and the actual value at the tth time of the i-th prediction.
[0088] The weighted geometric mean multiple predictions based on the sum of squared errors are expressed as:
[0089]
[0090] The final solution of formula (7) is the optimal weight coefficient, and minE(w) is the prediction error risk assessment index value.
[0091] When formulating a power purchase plan, it is preferred to select the forecast result with the smallest forecast error risk assessment index value.
[0092] The electricity purchase plan includes the amount of electricity purchased, the time of purchase and the price of electricity purchased.
[0093] Example 3
[0094] A method for predicting electricity purchases in a spot electricity market comprises the following steps:
[0095] S1. Data collection: Collect relevant characteristic data of the power market, including main transformer capacity, production capacity of self-provided power plants (i.e. maximum power output), load data of major equipment (important equipment for power production, transmission and consumption, including but not limited to generators, transformers, power lines, distribution equipment, important power equipment), production capacity and unit energy consumption of each power plant in the power market, historical industry electricity price data, and spot market transaction data. The most representative features are selected from the large amount of the above data to improve the accuracy and generalization ability of the model.
[0096] The data sources for this example include users in high-energy-consuming industries in Kunming and Yuxi, covering ten industries including steel, plastic products, cement, tobacco, lithium batteries, chemicals, textiles, food processing, papermaking, and ceramics.
[0097] From these data, we screen out the features that have a significant impact on electricity price prediction, and build a feature data set based on this. The screening process is a process aimed at finding the most representative features, and these features will have an important impact on the prediction results of the model. Due to the complexity of electricity price prediction, it is often determined by multiple features. Therefore, reasonable feature screening can not only significantly improve the effect of the model, but also effectively reduce the complexity of the model and greatly improve the efficiency of model training and prediction.
[0098] S2. Data preprocessing:
[0099] In order to eliminate unnecessary data noise and reduce computational complexity, we first use a dimensionality reduction algorithm to reduce the dimensionality of the load data of the main equipment. We use the t-distributed stochastic neighbor embedding (T-SNE) technology to reduce the dimensionality of the load data.
[0100] First, the t-distributed random neighbor embedding technology is used to reduce the dimension of the load data of the main equipment (the load data exists in the form of time series, and the power demand is recorded at different times (such as every minute, every hour, and every day). Therefore, the load data is multi-dimensional).
[0101] When reducing the dimension, it is necessary to find a balance between ensuring the validity of the data (that is, the data after dimensionality reduction can still reflect the main characteristics of the original data) and reducing the computational complexity. If the original equipment load data is 10-dimensional, then reduce it to 3 dimensions).
[0102] The 10-dimensional data includes:
[0103] Real-time load: the actual power consumption at that moment.
[0104] Forecasted load: The predicted amount of electricity consumption at a certain point in the future.
[0105] Peak load: The maximum electricity consumption within a certain period of time (such as a day, a month, etc.).
[0106] Valley load: the minimum electricity consumption within a certain period (such as a day or a month).
[0107] Average load: the average electricity consumption over a certain period of time (such as a day or a month).
[0108] Load factor: The ratio of average load to peak load, which reflects the uniformity of load.
[0109] Load rate: The ratio of real-time load to the nominal load of the equipment (the designed power consumption of the equipment), which reflects the degree of equipment usage.
[0110] Load growth rate: The increase in load per unit time reflects the growth rate of electricity demand.
[0111] Load fluctuation degree: The degree of instability of load changes may be quantified through statistics such as variance and standard deviation.
[0112] Load curve slope: An indicator that reflects the load change trend, such as the amount of load increase per unit time.
[0113] S3. Feature screening:
[0114] Next, correlation analysis is used to determine which features are most relevant to electricity price forecasts. All feature data except historical electricity price data are subjected to Pearson correlation coefficient analysis with historical electricity price data to select features that are significantly relevant to electricity price forecasts. Among them, the main equipment load data is the main equipment load data after dimensionality reduction processing;
[0115] Correlation analysis is used to identify features that are highly correlated with electricity price forecasts. To this end, we perform a Pearson correlation coefficient analysis on each type of feature data except the historical electricity price data and the historical electricity price data to select features that are significantly correlated with electricity price forecasts. This will serve as the main input to the model.
[0116] The calculation formula for the Pearson correlation coefficient is:
[0117]
[0118] Among them, X is a type of characteristic data other than historical electricity price data, including main transformer capacity, self-provided power plant conditions, main equipment load data after dimension reduction, production capacity and unit energy consumption, and spot market transaction data; x i is the i-th data of this type of feature data; mean(X) is the average value of this type of feature data;
[0119] Y is the historical electricity price data; i is the i-th historical electricity price data; mean(Y) is the average value of the historical electricity price data;
[0120] The value of r is [-1,1]. If r is 1, X and Y are said to be completely linearly correlated; if r is -1, X and Y are said to be completely linearly negatively correlated; if r is 0, X and Y are said to be linearly independent.
[0121] The present invention calculates the Pearson correlation coefficient between each type of feature data and the historical electricity price data except the historical electricity price data, so that we can get a correlation coefficient for each type of feature, and then we set a threshold (preferably 0.5) and select those features with correlation coefficients greater than this threshold as the input of the model. Through such processing, it can be ensured that the features input to the model are highly correlated with the electricity price prediction.
[0122] S4. Construct an LSTM-based electricity purchase decision optimization model:
[0123] A long short-term memory recursive neural network (LSTM) model was built to solve the timing problem of electricity price forecasting. LSTM is a special recurrent neural network that can effectively process longer sequence data and better preserve historical information on electricity prices.
[0124] First, the feature data closely related to the historical electricity price data prediction obtained in the previous step S3 is used as input and input into the model. The LSTM model contains forget gate, input gate, output gate, internal state and cell state. These gate structures can control the flow of information and can process long sequence time data and effectively prevent gradient vanishing and gradient explosion problems. The internal structure of the LSTM model is shown in the figure below. Figure 1 shown.
[0125] The forget gate is responsible for deciding when to discard past information, the input gate is responsible for deciding when to update new information, and the output gate is responsible for outputting a combination of past information and current information. These gate structures and the internal state of the model together enable the model to have the ability to adapt to both long-term and short-term dependencies.
[0126] (1) A long short-term memory recursive neural network (LSTM) model was built. The LSTM model uses a unique design (forget gate, input gate, and output gate) to process current input and historical information at the same time, thereby adjusting the model's weights. This design solves the gradient vanishing and explosion problems that may occur when traditional neural network models process time series data. LSTM is an optimized and improved algorithm for RNN based on time series. The use of LSTM effectively avoids the problem of too long input sequences in traditional neural network learning. The long short-term memory algorithm stores time series data through cell states, and long-term memory can be effectively preserved. This is the advantage of long short-term memory cell states over RNN neurons that cannot retain time series data. The output h of the long short-term memory algorithm is composed of the immediate input X and the short-term memory h. t-1 And the long-term memory C forms the forget gate, input gate and output gate.
[0127] Forget Gate t Controls the old memory unit c t-1 The information forgotten in the layer, the input is the input x of the current layer t And the output h of the previous layer t-1 After the Sigmoid layer, the output of the forget gate is:
[0128] f t =σ(W f x t +U f h t-1 +b f )
[0129] f t Represents the value of the forget gate at time t, which is used to control the degree of historical information that needs to be retained.
[0130] σ is the sigmoid activation function, which compresses each value in the matrix to between 0 and 1. The output result can be understood as the probability of something happening.
[0131] W f The weight matrix of the forget gate determines the current input x t Impact on the forget gate.
[0132] x t is the input for the current time step.
[0133] U f This is the concatenation of the hidden state h from the previous time step t-1 To the weight matrix of the forget gate.
[0134] h t-1 The hidden state at the previous time step.
[0135] b f Bias term for the forget gate.
[0136] The addition of long-term memory cells to the LSTM unit structure gives it long-term and short-term memory capabilities. Based on the LSTM structure, the connection between two LSTM units in the same layer contains both memory information and output information, and the connection between LSTMs in different layers only contains input and output connections. t It is a vector containing a set of signals. In time series prediction, it is convenient to express the relationship between time series. t-1 The specific length of time needs to be determined based on the application situation.
[0137] Regarding the application of LSTM, we choose a suitable LSTM structure. The input layer consists of 50 LSTM units. The input signal x of each LSTM is t , the number of LSTMs in the middle layer and the output layer, and then the weight system is obtained through training. It is precisely because of the characteristics of the LSTM unit structure that the reverse calculation in the training process can pass a smaller gradient value, which can be more accurate and effective when building error risk assessment indicators.
[0138] (2) The model is trained by backpropagating the error and updating the model parameters, so that the model's predicted value can be as close to the actual value as possible. After the training is completed, the model can generate a forecast curve for electricity prices in any future time interval.
[0139] (3) The model training process is as follows:
[0140] 1) Data preparation: Use the previously obtained feature data highly related to electricity price prediction as input, and the historical electricity price data as the target output. At the same time, divide these data into training set, validation set and test set. Divide them in the ratio of 70%, 15%, and 15%.
[0141] 2) Network construction: Set the number of hidden layers and the number of neurons in each layer to build an LSTM neural network. The LSTM unit can be set to one or more, and each LSTM unit contains a forget gate, an input gate, and an output gate for long-term and short-term memory.
[0142] 3) Parameter initialization: Set initial values for the weights and biases of the neural network. Generally, a small range of random numbers are used for initialization.
[0143] 4) Definition of loss function: Define the loss function to measure the gap between the predicted value and the actual value of the model. The present invention adopts weighted geometric mean combined mean square error.
[0144] 5) Optimization algorithm selection: Select an optimization algorithm to minimize the loss function. The present invention uses the stochastic gradient descent algorithm.
[0145] 6) Model training: Use training data to input the network, calculate the predicted electricity price through the forward propagation algorithm, and calculate the error with the loss function; then update the weights and bias parameters of the neural network through the back propagation algorithm to reduce the prediction error.
[0146] Finally, we make power purchase decisions based on the future electricity price forecasts generated by the forecast model, combined with the trading rules of the power market and the company's actual power demand. Power purchase decisions include the amount of power purchased, the time of purchase, and the price of power purchased. We hope to reduce the cost of power purchases as much as possible and improve the economic benefits of the company while ensuring a stable power supply.
[0147] During use, the model of the present invention can continuously add new historical data for continuous training and testing to achieve the best prediction effect.
[0148] S5. Establishing a multivariate risk prediction error risk assessment index
[0149] The purpose of this step is to establish a complete forecast error risk assessment system. Although the model only adopts one forecasting method (i.e., the LSTM-based power purchase decision optimization model), the establishment of forecast error risk assessment indicators will include multiple risk factors, not just the accuracy of the forecast model. We take into account various risk factors that may lead to forecast errors, including the model's own forecast accuracy, market price fluctuations, and uncertainty in electricity demand.
[0150] The prediction accuracy of the model itself is mainly reflected in the deviation between the prediction results output during the model training process and the actual results. The more commonly used measurement indicators are mean square error (MSE) and mean absolute error (MAE).
[0151] Market price fluctuations refer to the range of changes in electricity trading prices in the market. Larger price fluctuations mean greater market uncertainty, which will directly affect the prediction of electricity prices.
[0152] The uncertainty of electricity demand mainly refers to the short-term fluctuations in enterprises' electricity demand. Due to the instability of enterprise production, short-term electricity demand is often difficult to accurately predict.
[0153] Therefore, we need to quantify these risk factors that may affect the forecast error in order to form a unified forecast error risk assessment indicator. In other words, although we only use one model for forecasting, we need to evaluate various risk factors that may cause forecast errors in the current situation.
[0154] The use of weighted geometric mean combined mean square error for error risk assessment mentioned in the article is because the average mean square error will have an amplifying effect on biased data results when calculating the error. In order to avoid this problem, we introduced the concept of weight, that is, assigning a weight to the influence of each prediction result, making the error calculation fairer and ultimately obtaining a more accurate error prediction value.
[0155] To establish risk assessment indicators, first, various risk factors that may lead to prediction errors are quantified into a series of risk metrics. For example, the prediction accuracy of the model itself can be measured using the mean square error (MSE) and the mean absolute error (MAE); the volatility of market conditions can be measured by the fluctuation range of market prices; and the uncertainty of electricity demand can be measured by the fluctuation range of historical demand.
[0156] Then, these risk metrics are integrated into a unified prediction error risk assessment indicator. Specifically, the mean square error under the Metric evaluation indicator is used to perform error risk assessment to establish a prediction error risk assessment indicator based on multivariate risk. Mean Square Error (MSE) is the mean of the sum of squares of the errors of the sample points corresponding to the fitted data and the original data. The smaller the value, the better the fitting effect. MSE is used to calculate the average value of the difference between the predicted value and the true value. The formula is as follows:
[0157]
[0158] Y i Indicates the actual electricity price situation; It represents the electricity price predicted by the model; n is the actual electricity price quantity.
[0159] We use the weighted geometric mean combined mean square error to build the optimal combined prediction model for error risk assessment. When there is a deviation in the data set, the traditional mean square error calculation method will amplify this deviation, causing the model to be more inclined to predict specific results and ignore other possible results. For classification problems, MSE is not a commonly used loss function because it is not suitable for representing the error rate in classification problems. Therefore, we use the weighted geometric mean combined mean square error for optimization. The algorithm is as follows:
[0160] Let X = {x t ,t=1,2,…,N} is the actual original time series, and N represents the total number of samples.
[0161] The predicted value sequence of multiple predictions of the LSTM-based electricity purchase decision optimization model is X i =x it ,t=1,2,…,N,i=1,2,…,m, m is the number of predictions, and the corresponding weight coefficients for each prediction are w1,w2,…,w m , and satisfy:
[0162]
[0163] According to the formula of weighted geometric mean, let:
[0164]
[0165] Then it is called is the combined prediction value of the weighted geometric mean, let is the multiple prediction sequence at time t. The above formula (3) is changed to
[0166]
[0167] Among them, x it The predicted value of the i-th prediction at time t.
[0168] Let lnX = {lnx t ,t=1,2,…,N} is the actual value logarithmic sequence, x t The normalized value of the actual value at time t. The logarithmic sequence of the predicted value of the i-th prediction at time t is is the logarithmic sequence of multiple prediction values at time t
[0169]
[0170]
[0171] Then it is called E i is the sum of squared logarithmic errors of the i-th prediction; E is the sum of squared logarithmic errors of the multiple prediction method.it It represents the error between the predicted value and the actual value at the tth time of the i-th prediction.
[0172] Obviously, from the perspective of multiple prediction errors, the smaller the E, the higher the accuracy of multiple predictions. Therefore, to determine the weight coefficient of a single prediction in multiple predictions by the sum of squared errors, it is necessary to minimize the sum of squared errors. Therefore, the weighted geometric mean multiple predictions based on the sum of squared errors are expressed as:
[0173]
[0174] The final solution of formula (7) is the optimal weight coefficient, and minE(w) is the risk assessment index value. This formula and model are used to construct the optimal multiple predictions for error risk assessment.
[0175] Furthermore, this evaluation indicator can also be used as a reference when formulating electricity purchasing strategies. For example, one may tend to prefer prediction results with smaller risk values, thereby reducing economic losses caused by electricity price forecast errors.
[0176] In short, this forecast error risk assessment indicator can make our electricity price forecasting work more reliable and our electricity purchasing strategy more scientific.
[0177] Application Examples
[0178] For example, the following is a practical application example and a comparative model. Take an industrial enterprise as an example. The main purpose of their electricity purchase is to ensure production operation and reduce production costs. In this case, they need to predict the electricity price in the future to formulate a reasonable electricity purchase strategy. They collect data from high-energy-consuming industry users in Kunming and Yuxi areas and make predictions according to the model of the present invention.
[0179] The collected data include main transformer capacity (2MW), self-provided power plant conditions (800KW), main equipment load data (obtained from historical data, the amount of data is too large to list), the capacity of each power plant in the power market (listed in million KW), unit energy consumption (obtained from historical data), historical electricity price data (obtained from historical data), and spot market transaction data (listed in million KW·h).
[0180] After using the dimensionality reduction algorithm to reduce the dimensionality of the load data of the main equipment, correlation analysis and Pearson correlation coefficient analysis were used to determine the features most relevant to the electricity price forecast. These features include the main transformer capacity (0.6), the situation of the self-provided power plant (0.6), the load data of the main equipment after dimensionality reduction (0.8), the production capacity and unit energy consumption (0.7), and the spot market transaction data (0.85).
[0181] The long short-term memory recursive neural network (LSTM) model is used for prediction to obtain the electricity price forecast value. The power purchase decision is made by combining the trading rules of the power market with the actual power demand of the company. At the same time, a multi-risk prediction error risk assessment index is established, and the prediction error risk assessment index value of the model is 0.05.
[0182] The results are shown in Table 1. Compared with the existing prediction methods (such as ARIMA model and BP neural network model), the performance of this model is better in terms of prediction accuracy, stability and versatility.
[0183] Table 1 Comparison of prediction results with existing prediction methods
[0184]
[0185]
[0186] The above shows and describes the basic principles, main features and advantages of the present invention. It should be understood by those skilled in the art that the present invention is not limited to the above embodiments, and the above embodiments and descriptions are only for explaining the principles of the present invention. Without departing from the spirit and scope of the present invention, the present invention may have various changes and improvements, which fall within the scope of the present invention to be protected. The scope of protection of the present invention is defined by the attached claims and their equivalents.
Claims
1. A method for predicting electricity purchases in the electricity spot market, characterized in that: The steps include: S1. Data collection: Collect relevant characteristic data of the power market, including main transformer capacity, production capacity of self-provided power plants, load data of major equipment, production capacity and unit energy consumption of each power plant in the power market, historical electricity price data, and spot market transaction data; S2. Data preprocessing: Dimensionality reduction of main equipment load data; S3, feature screening: calculate the correlation coefficient between the main transformer capacity, the capacity of the self-provided power plant, the capacity and unit energy consumption of each power plant in the power market, the spot market transaction data, and the main equipment load data pre-processed by S2 and the historical electricity price data collected by S1, and screen the feature data with a correlation coefficient greater than the threshold; S4. Construct an LSTM-based electricity purchase decision optimization model: The characteristic data filtered by S3 is used as the input of the model, and the historical electricity price data for a period of time in the future is used as the output. The LSTM model is trained, tested and verified to obtain the LSTM-based electricity purchase decision optimization model. S5. Real-time prediction and power purchase: The current feature data is obtained in real time and input into the LSTM-based power purchase decision optimization model to obtain the predicted electricity price data; then, the prediction error risk assessment index is calculated based on the trading rules of the power market and the company's actual power demand, and then a power purchase plan is generated. Then, according to the power purchase plan, the power purchase instruction is issued to the corresponding power trading system for trading.
2. The method for predicting electricity purchases in the electricity spot market according to claim 1, characterized in that: In S2, the t-distributed random nearest neighbor embedding method is used to reduce the dimension of the load data of the main equipment.
3. The method for predicting electricity purchases in the electricity spot market according to claim 1, characterized in that: In S2, the load data of the main equipment is 10-dimensional, which is reduced to 3 dimensions through dimensionality reduction; The 10-dimensional main equipment load data include real-time load, predicted load, peak load, valley load, average load, load factor, load rate, load growth rate, load fluctuation degree and load curve slope.
4. The method for predicting electricity purchases in the electricity spot market according to claim 1, characterized in that: In S3, the correlation coefficient uses the Pearson correlation coefficient.
5. The method for predicting electricity purchases in the electricity spot market according to claim 1, characterized in that: In S3, the threshold is 0.
5.
6. The method for predicting electricity purchases in the electricity spot market according to claim 1, characterized in that: In S4, the ratio of the training set used for model training, the test set used for testing, and the validation set used for validation is 70%:15%:15%.
7. The method for predicting electricity purchases in the electricity spot market according to claim 1, characterized in that: The method for calculating the forecast error risk assessment index is as follows: Let X = {x t ,t=1,2,…,N} is the actual original time series, N represents the total number of samples; The predicted value sequence of the m-time prediction of the electricity purchase decision optimization model based on LSTM is X i =x it ,t=1,2,…,N,i=1,2,…,m, m is the number of predictions; At the same time, the corresponding weight coefficients for each prediction are set to w1, w2, ..., w m , and satisfy: According to the formula of weighted geometric mean, let: Then it is called is the combined prediction value of the weighted geometric mean, let is the multiple prediction sequence at time t; Transform formula (3) into Among them, x it The predicted value of the i-th prediction at time t; Let ln X = {ln x t ,t=1,2,…,N} is the actual value logarithmic sequence, x t The normalized value of the actual value at time t; the logarithmic sequence of the predicted value of the i-th prediction at time t is ln X i = {ln x it ,t=1,2,…,N},i=1,2,…,m, t=1,2,…,N is the logarithmic sequence of multiple prediction values at time t Then it is called E i is the sum of squared logarithmic errors of the i-th prediction; E is the sum of squared logarithmic errors of the multiple prediction methods; e it It represents the error between the predicted value and the actual value at the tth time of the i-th prediction. The weighted geometric mean multiple predictions based on the sum of squared errors are expressed as: The final solution of formula (7) is the optimal weight coefficient, and minE(w) is the prediction error risk assessment index value.
8. The method for predicting electricity purchases in the electricity spot market according to claim 1, characterized in that: When formulating a power purchase plan, it is preferred to select the forecast result with the smallest forecast error risk assessment index value.
9. The method for predicting electricity purchases in the electricity spot market according to claim 1, characterized in that: The electricity purchase plan includes the amount of electricity purchased, the time of purchase and the price of electricity purchased.
Citation Information
Patent Citations
Industrial load transaction decision and execution method, platform and system based on electric power spot market
CN118674489A