A source-load combination probability prediction method and device and a storage medium
By introducing a CNN feature extraction module and a Pinball loss function to optimize weights in the Transformer model, the ConvMT prediction model solves the problems of complex model training and difficult data processing in source load prediction, and achieves higher prediction accuracy and efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- NARI TECH CO LTD
- Filing Date
- 2022-08-08
- Publication Date
- 2026-04-10
AI Technical Summary
In existing technologies for source-load prediction, LSTM models suffer from training complexity and an inability to remember longer sequences, while Transformer models face difficulties in processing large amounts of power data, resulting in insufficient prediction accuracy.
A ConvMT prediction model is adopted, which replaces the multi-head attention module of the Transformer model with a CNN feature extraction module, and optimizes the weights using the Pinball loss function and genetic algorithm. The model is trained by combining historical source-load data and meteorological data to construct a source-load combination probability prediction method.
It improves the accuracy of source load prediction, avoids the difficulty in selecting feature parameters due to unclear data coupling relationships, simplifies the data processing process, and enhances the efficiency and accuracy of the prediction model.
Smart Images

Figure CN115375014B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application relates to a source-load combination probability prediction method and device and a storage medium, and belongs to the technical field of power systems. BACKGROUND
[0002] In the previous source-load prediction research, the new energy generation side and the load side are usually considered separately for prediction. The research improves the forgetting gate of LSTM (Long Short-Term Memory) to improve the accuracy of probability prediction, and introduces the concept of quantile regression. In the aspect of photovoltaic probability prediction, the probability prediction is realized through a non-parametric estimation method; in photovoltaic probability density prediction, a simulated annealing algorithm is usually used to obtain an approximate optimal solution; then, a kernel density estimation method is used to fit the conditional quantile prediction result and the probability density prediction result. Although the LSTM network can bypass the unit to remember longer time steps, thus eliminating some gradient disappearance problems, the LSTM does not solve all problems, and the LSTM still has a sequential path from the past unit to the current unit, which makes the model training more complex. In addition, although the LSTM and its derivatives can remember a large amount of longer-term information, they can only remember sequences of the order of 100, and cannot remember longer sequences.
[0003] The Transformer network proposed by the Google team abandons the RNN recurrent neural network model and completely relies on the attention mechanism to extract the relationship between sequences. An important feature of the Transformer is the attention mechanism, which enables the network to read and calculate data in parallel and solves the long-range dependency problem of RNN and its variants. The Transformer structure theoretically compresses the propagation path to the shortest, which enables the network to process more complex data information and shortens the calculation time. The Transformer network solves the problem of longer sequences, but the Transformer is usually used to process language problems, and when the Transformer is applied to power prediction, the Transformer often has a problem of processing input data when facing a large amount of data sets. SUMMARY
[0004] The application aims to overcome the deficiencies in the prior art and provide a source-load combination probability prediction method, device and storage medium, which can enhance the accuracy of source-load prediction.
[0005] To achieve the above object, the application adopts the following technical scheme:
[0006] In a first aspect, the application provides a source-load combination probability prediction method, comprising:
[0007] Collect source-load historical data and corresponding meteorological data;
[0008] Preprocessing the source load history data and the meteorological data to obtain a complete and available data combination;
[0009] Inputting the preprocessed data combination into a plurality of ConvMT prediction models pre-constructed and trained to obtain a plurality of source load combination prediction results;
[0010] Multiplying each source load combination prediction result by a corresponding weight and performing summation operation on the product to obtain a final source load combination probability prediction result;
[0011] The ConvMT prediction model is obtained by replacing the original multi-head attention module of the encoder in the Transformer model with a CNN feature extraction module and then training the source load history data and the meteorological data of the same time scale; and the weight is obtained by optimizing the Pinball loss function through a genetic algorithm.
[0012] In combination with the first aspect, further, the training method of the ConvMT prediction model comprises:
[0013] Collecting a plurality of sets of source load history data and corresponding meteorological data according to a preset time interval;
[0014] Constructing an original data set according to the collected plurality of sets of source load history data and corresponding meteorological data;
[0015] Preprocessing the original data set to obtain a plurality of sets of complete and available data combinations containing source load history data and corresponding meteorological data, forming a sample set;
[0016] Dividing the sample set into a training set and a test set according to the sampling time of the data combination, wherein the sampling time of the data combination in the test set is later than that in the training set;
[0017] Selecting a plurality of sets of data combinations from the training set and inputting them into a plurality of ConvMT prediction models for training to obtain training set source load prediction results of the plurality of ConvMT prediction models;
[0018] Taking the source load history data in the test set as the true value and the training set source load prediction result at the same time as the predicted value, and calculating the MAPE value according to the true value and the predicted value;
[0019] Optimizing the parameters of the ConvMT prediction model to minimize the MAPE value, and obtaining the final trained ConvMT prediction model.
[0020] In combination with the first aspect, further, the preprocessing comprises:
[0021] The source-load historical data and corresponding meteorological data are subjected to abnormal value detection, and if there is an abnormal value, a neighboring normal value is used to replace the abnormal value.
[0022] After processing abnormal data, the source-load historical data and corresponding meteorological data are subjected to normalization processing and linear transformation into the range of (1, 2).
[0023] In combination with the first aspect, further, the original data set is constructed by selecting multiple groups of data from the collected source-load historical data and corresponding meteorological data using a Bootstrap method.
[0024] In combination with the first aspect, further, the expression of the Pinball loss function is as follows:
[0025]
[0026] In the formula: is a Pinball loss function value; I is an indicator function; a is a distribution function of source-load combination probability prediction results at a preset quantile; y i,t is a true value of the load; is a sought quantile; when , that is, it is equivalent to the mean absolute error, and the obtained quantile is the median; N is the sample size; T is the output length of the day-ahead prediction.
[0027] In combination with the first aspect, further, the value of the distribution function a is determined by the following method:
[0028] (1) a pMAX + a pMIN = 1
[0029] (2) a pMAX - a pMIN = p%
[0030] In the formula, a pMAX is the a value corresponding to the pMAX curve, a pMIN is the a value corresponding to the pMIN curve, p is between 0-100, and p% represents the probability of the true value falling between the pMIN and pMAX curves.
[0031] In combination with the first aspect, further, the source-load historical data includes wind power generation and photovoltaic power generation on the power generation side of the power grid, and electricity consumption on the power load side; and the meteorological data includes temperature, humidity, pressure, irradiance, and wind speed related to the source-load data.
[0032] With the first aspect, further, the CNN feature extraction module is a 3x3 CNN feature extraction module, and correspondingly, the input of the encoder of the ConvMT prediction model adopts a 13x72 data matrix, which is a 13-dimensional matrix composed of the following eight kinds of data:
[0033] Wind power, photovoltaic, load, pressure, humidity, temperature, wind speed, irradiance.
[0034] In a second aspect, the application provides a source-load combination probability prediction device, comprising:
[0035] The acquisition module is configured to acquire source-load historical data and corresponding meteorological data.
[0036] The preprocessing module is configured to preprocess the source-load historical data and the meteorological data to obtain complete and available data combinations.
[0037] The prediction module is configured to input the preprocessed data combinations into a plurality of ConvMT prediction models that are pre-built and trained to obtain a plurality of source-load combination prediction results.
[0038] The acquisition module is configured to multiply each source-load combination prediction result by a corresponding weight and perform summation operation on the products to obtain a final source-load combination probability prediction result.
[0039] The ConvMT prediction model is obtained by replacing the original multi-head attention module of the encoder in the Transformer model with a CNN feature extraction module and then training the source-load historical data and meteorological data of the same time scale; and the weight is obtained by optimizing the Pinball loss function through a genetic algorithm.
[0040] With the second aspect, further, the device further comprises the training module, and the training module comprises:
[0041] The data set construction unit is configured to acquire a plurality of sets of source-load historical data and corresponding meteorological data according to a preset time interval, and construct an original data set according to the acquired plurality of sets of source-load historical data and corresponding meteorological data.
[0042] The sample set formation unit is configured to preprocess the original data set to obtain a plurality of complete and available data combinations containing source-load historical data and corresponding meteorological data, and form a sample set.
[0043] The sample set division unit is configured to divide the sample set into a training set and a test set according to the sampling time of the data combinations, and the sampling time of the data combinations in the test set is later than that in the training set.
[0044] The training unit is configured to input a plurality of groups of data combinations selected from the training set into a plurality of ConvMT prediction models respectively for training, and obtain training set source load prediction results of the plurality of ConvMT prediction models.
[0045] The MAPE value calculation unit is configured to take the source load historical data in the test set as a true value, take the training set source load prediction result at the same time as a prediction value, and calculate the MAPE value according to the true value and the prediction value.
[0046] The parameter optimization unit is configured to perform parameter optimization on the ConvMT prediction model with the minimum MAPE value as an optimization target, and obtain a final trained ConvMT prediction model.
[0047] In a third aspect, the present application provides a source load combination probability prediction device, comprising a processor and a storage medium.
[0048] The storage medium is configured to store instructions.
[0049] The processor is configured to operate according to the instructions to perform the steps of the method of any one of the first aspect.
[0050] In a fourth aspect, the present application provides a computer readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method of any one of the first aspect.
[0051] Compared with the prior art, the present application has the following beneficial effects:
[0052] The ConvMT prediction model adopted in the present application is obtained by replacing the original multi-head attention module of the encoder in the Transformer model with a CNN feature extraction module, and then training and obtaining the source load historical data and the meteorological data of the same time scale; the weight of the source load combination prediction result predicted by each ConvMT model is obtained by optimizing the minimum Pinball loss function through a genetic algorithm;
[0053] Replacing the original multi-head attention module of the encoder in the Transformer model with a CNN feature extraction module can extract data features, avoid the problem of being unable to manually select feature parameters due to the unclear internal coupling relationship between the source load and the meteorological data, and avoid early complex data processing operations. BRIEF DESCRIPTION OF DRAWINGS
[0054] Figure 1 is a flowchart of the source load combination probability prediction method provided by the embodiment of the present application;
[0055] Figure 2 is a structural schematic diagram of the ConvMT prediction model provided by the embodiment of the present application;
[0056] Figure 3 is a wind power prediction result chart predicted by the source-load combination probability prediction method provided by the embodiment of the present application;
[0057] Figure 4 is a photovoltaic prediction result chart predicted by the source-load combination probability prediction method provided by the embodiment of the present application;
[0058] Figure 5 is a load prediction result chart predicted by the source-load combination probability prediction method provided by the embodiment of the present application. DETAILED DESCRIPTION
[0059] The technical solutions of the present application will be described in detail below with the aid of the accompanying drawings and specific embodiments. It should be understood that the specific features in the embodiments and the specific embodiments of the present application are detailed descriptions of the technical solutions of the present application, and are not limitations of the technical solutions of the present application. In the case of no conflict, the technical features in the embodiments and the specific embodiments of the present application can be combined with each other.
[0060] Embodiment one:
[0061] Figure 1 is a flow chart of a source-load combination probability prediction method provided by the first embodiment of the present application. The flow chart only shows the logical order of the method described in the embodiment, and in the case of no conflict, the steps shown or described can be completed in an order different from that shown in other possible embodiments of the present application. Figure 1
[0062] The source-load combination probability prediction method provided by the embodiment can be applied to a terminal and can be executed by a source-load combination probability prediction device. The device can be realized by software and / or hardware, and the device can be integrated in a terminal, such as any smart phone, tablet computer or computer device with communication function. Referring to Figure 1 , the method of the embodiment specifically includes the following steps:
[0063] Step one: Collect source-load historical data and corresponding meteorological data;
[0064] The new energy power generation side and the load side are both affected by weather factors, such as solar radiation intensity, temperature, and other weather factors have a great influence on photovoltaic power generation; the power consumption of the load side will also change according to the weather conditions, such as the increase of air conditioner usage in summer leads to the increase of electricity consumption.
[0065] Therefore, in the embodiments of the present application, not only the source-load historical data is considered, but also the meteorological data is considered to further improve the accuracy of the prediction result. As an embodiment of the present application, the source-load historical data can include the wind power generation and the photovoltaic power generation on the power generation side of the power grid, and the power consumption on the power load side; and the meteorological data can include temperature, humidity, pressure, irradiance and wind speed. It should be noted that the source-load historical data and the meteorological data as a data combination should be of the same time scale, and the two correspond to each other.
[0066] Step two: pre-processing the source-load historical data and the meteorological data to obtain a complete and available data combination;
[0067] In some embodiments, there can be a small amount of abnormal data in the collected source-load historical data and corresponding meteorological data. Therefore, before the data is input into the ConvMT prediction model, the source-load historical data and the corresponding meteorological data need to be subjected to abnormal value detection, and the normal value adjacent to the abnormal value can be used to replace the abnormal value;
[0068] In order to eliminate the adverse effects caused by the singular data and accelerate the convergence of the subsequent loss function, in the embodiments of the present application, the data after the abnormality processing also needs to be further subjected to normalization processing to linearly transform the data into the range of (1, 2), and the specific formula of the normalization processing is shown in formula (1):
[0069]
[0070] In the formula, x' is the normalized data value, x is the original data value, x min is the minimum value of the data in the data set, and x max is the maximum value of the data in the data set.
[0071] Step three: inputting the pre-processed data combination into a plurality of ConvMT prediction models which are pre-constructed and trained to obtain a plurality of source-load combination prediction results;
[0072] The ConvMT (Probability-CNN-Multi-Transformer) prediction model described in the embodiments of the present application is constructed based on the Transformer model, and is obtained by training using the source-load historical data and the meteorological data of the same time scale. Specifically, the ConvMT prediction model is obtained by replacing the original multi-head attention module of the encoder in the Transformer model with a CNN feature extraction module.
[0073] As Figure 2As shown is a structural schematic diagram of a ConvMT prediction model provided by an embodiment of the present application, the ConvMT prediction model is constructed on the basis of a Transformer model, the Transformer model mainly includes position embedding, an encoder and a decoder part, wherein the encoder and the decoder both contain a multi-head attention layer, a forward propagation layer and a forward propagation layer with a mask, etc. The ConvMT prediction model removes the position embedding part of the Transformer model, adopts a CNN feature extraction module to replace the multi-head attention module of the encoder in the Transformer model, and is used to extract features between source load and meteorological data. Since the internal coupling relationship of the source load and the meteorological data is not clear, it is difficult to manually select features, after adding the CNN feature extraction module, the prediction model does not need to manually select feature parameters, after training the weight on the data set, the data features can be directly obtained through the CNN feature extraction module, and early complex data processing is avoided. As shown in Table 1, it is a ConvMT prediction model parameter table provided by an embodiment of the present application:
[0074] Table 1 ConvMT prediction model parameter table
[0075] Parameter type Parameter value Encoder layer number 8 Encoder output dimension 256 Decoder forward layer size 256 Decoder multi-head attention head number 8 Decoder layer number 8
[0076] Optionally, the CNN feature extraction module is a 3x3 CNN feature extraction module, the input of the encoder of the ConvMT prediction model adopts a 13x72 data matrix, and the data matrix is a 13-dimensional matrix composed of the following 8 kinds of data:
[0077] Wind power, photovoltaic, load, pressure, humidity, temperature, wind speed and irradiance.
[0078] The input 1, the input 2 and the input 3 of the three decoders in the ConvMT prediction model are historical data of wind power, photovoltaic, load and corresponding meteorological data. The two-dimensional matrix formed by merging the data of the input 1, the input 2 and the input 3 is the input part of the encoder. The ConvMT prediction model uses this input structure to put the correlation of the source load into the prediction model, and realizes the separate prediction of the active power of wind power, photovoltaic and load.
[0079] The forward propagation layer in the ConvMT prediction model is used to provide nonlinear feature transformation capability.
[0080] Step four: multiply each source load combination prediction result by the corresponding weight, and perform summation operation on the product to obtain the final source load combination probability prediction result;
[0081] It should be noted that the source load combination probability prediction result in the present application refers to: using a single encoder and multiple decoders to couple the source load into the ConvMT model for prediction, and using quantile to represent the prediction result.
[0082] In the embodiment of the present application, the weights are obtained by using a Pinball loss function, which is a function for measuring the accuracy of probability prediction results. The Pinball loss value is calculated according to the Pinball loss function formula, and the smaller the Pinball loss value, the more accurate the probability prediction result.
[0083] As the objective function of the genetic algorithm, the Pinball loss function needs to manually input the related information of the quantile in the optimization process. The Pinball loss function can be defined as
[0084]
[0085] In the formula: Pinball loss function value; I is an indicator function; α is the distribution function of the source load combination probability prediction result at the preset quantile; y i,t is the true value of the load; is the quantile to be solved; when , that is, it is equivalent to the mean absolute error, and the obtained quantile is the median; N is the sample size; T is the output length of the day-ahead prediction, which is 1h here.
[0086] The prediction results of multiple source load combinations can be regarded as a normal distribution. In the normal distribution, the midpoint is the probability of the true value being the largest, and the total probability of the true value falling within a certain interval can be obtained by expanding from the midpoint to both sides. Therefore, the value of the distribution function α is determined by the following method:
[0087] (1) α pMAX + α pMIN = 1
[0088] (2) α pMAX - α pMIN = p%
[0089] In the formula, α pMAX is the α value corresponding to the pMAX curve, α pMIN is the α value corresponding to the pMIN curve, p is between 0-100, and p% represents the probability of the true value falling between the pMIN and pMAX curves.
[0090] In the optimization process using the genetic algorithm, the calculation formula of the fitness function value is as follows:
[0091]
[0092] wherein, loss 10 is the Pinball Loss function result before optimization, loss i is the Pinball Loss function result of the trained model i; i = 1, 2, 3, … n, n represents the total number of ConvMT prediction models.
[0093] The voltage out-of-limit penalty function is:
[0094]
[0095]
[0096] wherein, F is the fitness function value after adding the out-of-limit penalty function; λ is a large value of a higher order than f, used to increase the value of the latter part of the formula, so that the individual is more easily eliminated in the subsequent steps; P i is the weight value given to the individual i; P il is an intermediate parameter, used to introduce the segmented function value, so as to distinguish the weight value in different cases, so that the weight value is punished when it is out of limit; P imax is the maximum value of the weight requirement range of the optimization object; P imin is the minimum value of the weight requirement range of the optimization object;
[0097] The fitness of the genetic algorithm is:
[0098]
[0099] The ConvMT prediction model is taken as an individual, the roulette method is used for the genetic operation method in the genetic algorithm, the individual with the maximum fitness is reserved, and the probability P i of selecting the individual i is:
[0100]
[0101] wherein: F i is the fitness function value of the i-th ConvMT prediction model after adding the out-of-limit penalty function;
[0102] Two individuals are taken in the genetic algorithm, and it is judged whether the crossover operation needs to be performed according to the crossover probability, if the crossover probability requirement is met, the crossover operation is performed, and the crossover probability formula is:
[0103]
[0104] wherein, P c is the crossover operation probability of the individual i; P c1 , P c2 are two set values, in the embodiment of the present application, P c1= 0.9, P c2 = 0.6; f avg is the average fitness value of the current population; f max is the maximum individual fitness value of the current population; f' is the larger fitness value of the two individuals that need to be crossed.
[0105] In the genetic algorithm, a individual is taken, and it is judged whether mutation operation is needed according to mutation probability. If the mutation probability requirement is met, mutation operation is performed. The mutation probability formula is:
[0106]
[0107] In the formula, P m is the probability that the individual needs to perform mutation operation; P m1 , P m2 are two set values, P m1 = 0.1, P m2 = 0.01; f avg is the average fitness value of the current population; f max is the maximum individual fitness value of the current population; f" is the fitness value of the mutated individual.
[0108] The probability of elimination operation is set to P tt = 0.1, and the number of individuals N tt that need to be eliminated is obtained. The value of the N tt th individual is used to cover the values of the previous N tt individuals.
[0109] Suppose that the wind power result in the 3 groups of results of the source load combination predicted by the ConvMT prediction model is (unit: MWh):
[0110] 1001, 895, 1102, 1233
[0111] 999, 897, 1101, 1235
[0112] 1000, 896, 1100, 1232
[0113] The true value of the wind power is: 1000, 897, 1102, 1234
[0114] At the 90th percentile, when calculating the 90MIN curve result, the parameters in the Pinball loss loss function formula are
[0115]
[0116] N = 3, T = 4, a = 5%, y i,1 = 1000, y i,2 = 897, y i,3= 1102, y i,4 = 1234.
[0117] At the same time, assuming that the weights after optimizing the Pinball loss by the genetic algorithm are respectively:
[0118] 0.32, 0.34, 0.32, 0.33
[0119] 0.35, 0.33, 0.33, 0.33
[0120] 0.33, 0.33, 0.35, 0.32
[0121] Then the final 90MIN curve corresponding point result 4 data are respectively:
[0122] 0.32x1001+0.35x999+0.33x1000=999.97
[0123] 0.34x895+0.33x897+0.33x896=895.99
[0124] 0.32x1102+0.33x1101+0.35x1100=1100.97
[0125] 0.33x1233+0.33x1235+0.34x1232=1233.32
[0126] The calculation method of other probability prediction curves is the same.
[0127] As an embodiment of the application, the training method of the ConvMT prediction model comprises:
[0128] Step A: according to a preset time interval, a plurality of source load history data and corresponding meteorological data are collected, and an original data set is constructed according to the collected data;
[0129] The time interval is a preset time, and in the embodiment of the application, the total length of data collection can be two years, and the time interval can be set to 1 hour.
[0130] Step B: the original data set is preprocessed to obtain a plurality of complete and available data combinations containing source load history data and corresponding meteorological data, and a sample set is formed;
[0131] The method of preprocessing the original data set is the same as the method described in step two in the foregoing, that is, it includes outlier processing, and the data after outlier processing is normalized, so that the data in the original data set is linearly transformed into the range of (1, 2).
[0132] Step C: dividing the sample set into a training set and a test set according to the sampling time of the data combination, the sampling time of the data combination in the test set being later than the sampling time of the data combination in the training set;
[0133] Taking the total length of the sampling time of two years as an example, the training set can include source load history data and corresponding meteorological data of the previous 23 months, and the test set includes source load history data and corresponding meteorological data of the last month. The purpose of such division is that when the data combination in the training set is used to predict the source load combination probability of the last month, the source load history data in the test set can be used as the true value to verify the prediction result.
[0134] Step D: selecting multiple data combinations from the training set and inputting them into multiple ConvMT prediction models for training to obtain multiple trained ConvMT prediction models and corresponding source load prediction results of the training set;
[0135] As an embodiment of the present application, the data combination used to train the ConvMT prediction model can be selected by using the Bootstrap method. The Bootstrap method is a statistical estimation method. Multiple data combinations are selected from the training set by using the Bootstrap method and input into the ConvMT prediction model for training. This method does not require other assumptions for the ConvMT prediction model and does not need to add new observation values, and has the characteristics of strong robustness and high efficiency.
[0136] Step E: taking the source load history data in the test set as the true value, taking the source load prediction result of the training set at the same time as the predicted value, and calculating the MAPE value according to the true value and the predicted value;
[0137] The source load prediction result obtained by the trained ConvMT prediction model needs to be further optimized. In the embodiment of the present application, the average absolute percentage error (MAPE) function is used for optimization, and the MAPE value calculation formula is as follows:
[0138]
[0139] In the formula, y is the predicted value, y i is the true value, and m is the total number of data points of the ConvMT prediction model. In prediction, it is generally considered that when the MAPE value is less than 10, the corresponding prediction value has high accuracy. If there is a true value of 0, the MAPE cannot be calculated. Therefore, the data after abnormal processing is normalized so that the source load history data is scaled to between 1 and 2, which facilitates the use of the MAPE function for optimization to obtain the final prediction result. The MAPE value can be used to judge the accuracy of the final prediction result.
[0140] Step F: Optimize the parameters of the ConvMT prediction model with the minimum MAPE value as the optimization objective, and obtain the final trained ConvMT prediction model.
[0141] During training, when validating the prediction results using a test set, if the current prediction model's result is better than the prediction result obtained in the previous training, the prediction model parameters are saved; otherwise, the prediction model is discarded. After multiple training iterations, the prediction model that performs best on the test set data is selected as the final trained prediction model.
[0142] like Figures 3-5 As shown, the Bootstrap method was used to select 20 data combinations from the sample set to train 20 ConvMT prediction models. Then, a genetic optimization algorithm was used to optimize the bouncing loss function to obtain the final probability prediction results. In the three graphs, the horizontal axis represents time in hours (h); the vertical axis represents wind power, photovoltaic power, and load power, respectively, in MWh, depending on the type of predicted data; the True curve represents the power data of the actual validation set. 90MAX and 90MIN represent the upper and lower limits of the probability that the true value falls within the interval between the 90MAX and 90MIN curves, respectively. In the source-load combination probability prediction results, the 90MIN curve corresponds to the case of α = 5%, the 90MAX curve to the case of α = 95%, the 60MIN curve to the case of α = 20%, and the 60MAX curve to the case of α = 80%. It can be seen from the graphs that the True curve is basically surrounded by the maximum and minimum power values at the 90th percentile, and the probability interval in the load prediction graph is relatively narrow. This may be because the uncertainty of load power is less than that of new energy sources. New energy power generation is strongly influenced by weather factors and fluctuates significantly with weather changes. Photovoltaic power generation is primarily dependent on solar radiation intensity, with relatively less uncertainty. Wind power generation, however, is also affected by factors such as wind speed and air pressure, resulting in greater uncertainty. In actual forecasting, the inherent uncertainty of meteorological forecasts further amplifies the forecasting error. The combined effect of these factors makes new energy power generation highly volatile and irregular, increasing the uncertainty of new energy forecasting. While load is also affected by weather factors, the impact is less pronounced, and overall load power still exhibits relatively clear regularities. Therefore, load forecasting results are generally better than new energy forecasting results.
[0143] Example 2:
[0144] This embodiment provides a source-load combination probability prediction device, the device comprising:
[0145] Acquisition module: Used to collect historical source load data and corresponding meteorological data;
[0146] a preprocessing module configured to preprocess the source-load historical data and the meteorological data to obtain a complete and available data combination;
[0147] a prediction module configured to input the preprocessed data combination into a plurality of ConvMT prediction models that are pre-constructed and trained to obtain a plurality of source-load combination prediction results;
[0148] an acquisition module configured to multiply each source-load combination prediction result by a corresponding weight and to perform summation operation on the products to obtain a final probability prediction result;
[0149] The ConvMT prediction model is constructed based on a Transformer model and is obtained by training the source-load historical data and the meteorological data of the same time scale. Specifically, the ConvMT prediction model is obtained by replacing the original multi-head attention module of the encoder in the Transformer model with a CNN feature extraction module. The weight is obtained by optimizing the Pinball loss function through a genetic algorithm. When the weight is obtained, a predetermined quantile is input into the Pinball loss function in advance.
[0150] The device provided by the embodiment of the application further includes the training module, and the training module includes:
[0151] a data set construction unit configured to collect a plurality of groups of source-load historical data and corresponding meteorological data according to a predetermined time interval to construct an original data set;
[0152] a sample set formation unit configured to preprocess the original data set to obtain a plurality of groups of complete and available data combinations containing source-load historical data and corresponding meteorological data, and form a sample set;
[0153] a sample set division unit configured to divide the sample set into a training set and a test set according to the sampling time of the data combinations, wherein the sampling time of the data combinations in the test set is later than the sampling time of the data combinations in the training set;
[0154] a training unit configured to select a plurality of groups of data combinations from the training set and input them into a plurality of ConvMT prediction models for training to obtain a plurality of trained ConvMT prediction models and corresponding training set source-load prediction results;
[0155] an MAPE value calculation unit configured to take the source-load historical data in the test set as a true value, take the training set source-load prediction result of the same moment as a predicted value, and calculate an MAPE value according to the true value and the predicted value;
[0156] The parameter optimization unit is configured to optimize parameters of the ConvMT prediction model with the minimum MAPE value as an optimization target, and obtain a final trained ConvMT prediction model.
[0157] The source-load combination probability prediction device provided by the embodiments of the present application can perform the source-load combination probability prediction method provided by any of the embodiments of the present application, and has the corresponding function modules and beneficial effects of performing the method.
[0158] Embodiment three:
[0159] The embodiments of the present application further provide a source-load combination probability prediction device, comprising a processor and a storage medium.
[0160] The storage medium is configured to store instructions.
[0161] The processor is configured to operate according to the instructions to perform the steps of the method in Embodiment One.
[0162] Embodiment four:
[0163] The embodiments of the present application further provide a computer readable storage medium having a computer program stored thereon, and the program is executed by a processor to implement the steps of the method in Embodiment One.
[0164] Those skilled in the art should understand that the embodiments of the present application can be provided as a method, a system, or a computer program product. Therefore, the present application can be in the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Moreover, the present application can be in the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0165] The present application is described with reference to flowcharts and / or block diagrams according to the methods, devices (systems), and computer program products of the embodiments of the present application. It should be understood that each flow and / or block in the flowcharts and / or block diagrams, and the combination of flows and / or blocks in the flowcharts and / or block diagrams can be implemented by computer program instructions. These computer program instructions can be provided to a general-purpose computer, a special-purpose computer, an embedded processor, or other programmable data processing devices to produce a machine, so that the instructions executed by the computer or other programmable data processing devices produce a device that implements the functions specified in the flowcharts and / or block diagrams. Figure 1 The device that implements the functions specified in one flow or multiple flows and / or blocks Figure 1 The device that implements the functions specified in one flow or multiple flows and / or blocks
[0166] These computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture including instructions which implement the flow Figure 1 The functions of a flow or multiple flows and / or a block or multiple blocks in accordance with the present application can be implemented with software, hardware or with a combination of software and / or firmware. Figure 1
[0167] The software can form one or more modules of the application. The software can also hide from the user that the input data is being processed. Figure 1 The functions of a flow or multiple flows and / or a block or multiple blocks in accordance with the present application can be implemented with software, hardware or with a combination of software and / or firmware. Figure 1
[0168] The above description is only preferred embodiments of the present application. It should be noted that those skilled in the art can make several improvements and modifications without departing from the technical principles of the present application, and these improvements and modifications should also be considered as falling within the scope of the present application.
Claims
1. A source-load combination probability prediction method, characterized in that, include: Collect historical data on load and corresponding meteorological data; The historical source load data and meteorological data are preprocessed to obtain a complete and usable data combination; The preprocessed data is combined and input into multiple pre-built and trained ConvMT prediction models to obtain multiple source-load combination prediction results; The prediction results of each source load combination are multiplied by their respective weights, and the products are summed to obtain the final source load combination probability prediction results. The ConvMT prediction model is obtained by replacing the original multi-head attention module of the encoder in the Transformer model with a CNN feature extraction module, and then training it with historical source payload data and meteorological data at the same time scale; the Transformer model does not contain a position embedding layer; the weights are obtained by optimizing the Pinball loss function using a genetic algorithm. The expression for the Pinball loss function is as follows: ; In the formula: α is the Pinball loss function value; I is the indicator function; α is the distribution function of the source-load combination probability prediction result under the preset quantile; y i,t This represents the actual load value. For the desired quantile; when hour, This is equivalent to the mean absolute error, and the quantile obtained is the median; N is the number of samples; T is the output length of the day-ahead prediction; The fitness of the genetic algorithm is: ; In the formula, F is the fitness function value after adding the voltage over-limit penalty function; The voltage over-limit penalty function is: ; In the formula, f is the fitness function value; λ is a large value, an order of magnitude higher than f, used to increase the value of the later parts of the formula; P i P represents the weight assigned to individual i; n represents the total number of ConvMT prediction models; P il It is an intermediate parameter used to introduce piecewise function values, thereby distinguishing weight values under different conditions and penalizing weight values that exceed the limit; P imax It is the maximum value within the required range of the weights of the optimized object; P imin It is the minimum value within the required range of the weights of the optimized object; In the genetic algorithm, two individuals are selected, and the crossover probability is used to determine whether a crossover operation is needed. If the crossover probability requirement is met, the crossover operation is performed. The crossover probability formula is as follows: ; In the formula, P c It is the probability that individual i will perform a crossover operation; P c1 , P c2 These are two pre-defined values; f avg It is the average fitness value of the current population; f max It is the maximum individual fitness value in the current population; f' It is the larger fitness value among the two individuals that need to be crossed; In the genetic algorithm, an individual is selected, and the mutation probability is used to determine whether a mutation operation is needed. If the mutation probability requirement is met, the mutation operation is performed. The mutation probability formula is: ; In the formula, P m The probability that an individual needs to undergo mutation operations; P m1 , P m2 These are two pre-defined values; f'' It is the fitness value of the mutated individual.
2. The source-load combination probability prediction method according to claim 1, characterized in that, The training method for the ConvMT prediction model includes: Multiple sets of historical source-load data and corresponding meteorological data are collected according to preset time intervals; The original dataset was constructed based on multiple sets of historical source load data and corresponding meteorological data. The original dataset is preprocessed to obtain multiple sets of complete and usable data combinations containing historical source load data and corresponding meteorological data, forming a sample set; The sample set is divided into a training set and a test set according to the sampling time of the data combinations, wherein the sampling time of the data combinations in the test set is later than the sampling time of the data combinations in the training set. Multiple sets of data combinations are selected from the training set and input into multiple ConvMT prediction models for training, and the source load prediction results of the training set of multiple ConvMT prediction models are obtained. The historical source load data in the test set is used as the true value, and the source load prediction results of the training set at the same moment are used as the predicted value. The MAPE value is calculated based on the true value and the predicted value. The parameters of the ConvMT prediction model are optimized with the minimum MAPE value as the optimization objective to obtain the final trained ConvMT prediction model.
3. The source-load combination probability prediction method according to claim 1 or 2, characterized in that, The preprocessing includes: Anomaly detection is performed on the historical data of the source load and the corresponding meteorological data. If anomalies are found, the nearest normal value is used to replace the anomalies. After processing the abnormal data of the source load historical data and the corresponding meteorological data, normalization is performed and linear transformation is applied to the range (1, 2).
4. The source-load combination probability prediction method according to claim 2, characterized in that, The original dataset was constructed by using the Bootstrap method to select multiple sets of data from the collected historical source load data and corresponding meteorological data.
5. The source-load combination probability prediction method according to claim 1, characterized in that, The value of the distribution function α is determined by the following method: (1)α nMAX +α nMIN =1; (2)α nMAX -α nMIN =n%; In the formula, α nMAX Let α be the value corresponding to the nMAX curve. nMIN Let α be the value corresponding to the nMIN curve, where n is between 0 and 100, and n% represents the probability that the true value falls between the nMIN and nMAX curves.
6. The source-load combination probability prediction method according to claim 1, characterized in that, The historical source-load data includes wind power generation and photovoltaic power generation on the grid generation side, as well as electricity consumption on the grid load side; the meteorological data includes temperature, humidity, pressure, irradiance, and wind speed related to the source-load data.
7. The source-load combination probability prediction method according to claim 1, characterized in that, The CNN feature extraction module is a 3×3 CNN feature extraction module. Correspondingly, the input of the encoder of the ConvMT prediction model adopts a 13×72 data matrix, which is a 13-dimensional matrix composed of the following 8 types of data: Wind power, photovoltaics, load, pressure, humidity, temperature, wind speed, and irradiance.
8. A source-load combination probability prediction device, characterized in that, include: Acquisition module: Used to collect historical source load data and corresponding meteorological data; Preprocessing module: used to preprocess the source load historical data and meteorological data to obtain a complete and usable data combination; Prediction module: Used to input preprocessed data into multiple pre-built and trained ConvMT prediction models to obtain prediction results of multiple source-load combinations; Acquisition module: This module multiplies the prediction results of each source load combination with their respective weights, sums the products, and obtains the final source load combination probability prediction result. The ConvMT prediction model is obtained by replacing the original multi-head attention module of the encoder in the Transformer model with a CNN feature extraction module, and then training it with historical source payload data and meteorological data at the same time scale; the weights are obtained by optimizing the Pinball loss function with the goal of minimizing the Pinball loss function. The expression for the Pinball loss function is as follows: ; In the formula: α is the Pinball loss function value; I is the indicator function; α is the distribution function of the source-load combination probability prediction result under the preset quantile; y i,t This represents the actual load value. For the desired quantile; when hour, This is equivalent to the mean absolute error, and the quantile obtained is the median; N is the number of samples; T is the output length of the day-ahead prediction; The fitness of the genetic algorithm is: ; In the formula, F is the fitness function value after adding the voltage over-limit penalty function; The voltage over-limit penalty function is: ; In the formula, f is the fitness function value; λ is a large value, an order of magnitude higher than f, used to increase the value of the later parts of the formula; P i P represents the weight assigned to individual i; n represents the total number of ConvMT prediction models; P il It is an intermediate parameter used to introduce piecewise function values, thereby distinguishing weight values under different conditions and penalizing weight values that exceed the limit; P imax It is the maximum value within the required range of the weights of the optimized object; P imin It is the minimum value within the required range of the weights of the optimized object; In the genetic algorithm, two individuals are selected, and the crossover probability is used to determine whether a crossover operation is needed. If the crossover probability requirement is met, the crossover operation is performed. The crossover probability formula is as follows: ; In the formula, P c It is the probability that individual i will perform a crossover operation; P c1 , P c2 These are two pre-defined values; f avg It is the average fitness value of the current population; f max It is the maximum individual fitness value in the current population; f' It is the larger fitness value among the two individuals that need to be crossed; In the genetic algorithm, an individual is selected, and the mutation probability is used to determine whether a mutation operation is needed. If the mutation probability requirement is met, the mutation operation is performed. The mutation probability formula is: ; In the formula, P m The probability that an individual needs to undergo mutation operations; P m1 , P m2 These are two pre-defined values; f'' It is the fitness value of the mutated individual.
9. The source-load combination probability prediction device according to claim 8, characterized in that, The device also includes a training module, which comprises: Dataset construction unit: used to collect multiple sets of historical source load data and corresponding meteorological data according to a preset time interval, and to construct the original dataset based on the collected multiple sets of historical source load data and corresponding meteorological data; Sample set formation unit: used to preprocess the original dataset to obtain multiple complete and usable data combinations containing historical source load data and corresponding meteorological data, forming a sample set; Sample set partitioning unit: used to divide the sample set into a training set and a test set according to the sampling time of the data combinations, wherein the sampling time of the data combinations in the test set is later than the sampling time of the data combinations in the training set; Training unit: Used to select multiple sets of data from the training set and input them into multiple ConvMT prediction models for training, so as to obtain the training set source load prediction results of multiple ConvMT prediction models; MAPE value calculation unit: Used to take the historical source load data in the test set as the true value and the source load prediction result of the training set at the same time as the predicted value, and calculate the MAPE value based on the true value and the predicted value. Parameter optimization unit: Used to optimize the parameters of the ConvMT prediction model with the goal of minimizing the MAPE value, and obtain the final trained ConvMT prediction model.
10. A source-load combination probability prediction device, characterized in that, Including processor and storage media; The storage medium is used to store instructions; The processor is configured to operate according to the instructions to perform the steps of the method according to any one of claims 1 to 7.
11. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the program implements the steps of the method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Atmospheric ozone concentration prediction method based on mixed CNN-Transformer model
CN114611792A