Modeling method of ultra-short-term wind power prediction model based on MGWO optimization Informer
By optimizing the hyperparameters of the Informer model through the improved gray wolf algorithm (MGWO), the problem that the existing wind power power prediction model easily falls into the local optimal solution is solved, the prediction accuracy is improved, and higher search accuracy and convergence speed are achieved.
Patent Information
- Application Number
- CN202410774457.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-17
- Publication Date
- 2024-10-18
AI Technical Summary
Existing ultra-short-term wind power prediction models are prone to falling into local optimal solutions during the optimization process, resulting in low prediction accuracy. This is mainly because the convergence factor and overall position update formula of the gray wolf algorithm cannot be adaptively updated, which affects the search accuracy of the algorithm. .
The improved gray wolf algorithm (MGWO) is used to enhance the algorithm's global search capability and local solution capability through new convergence factor formulas and staged position update formulas, and is combined with the Informer model to optimize hyperparameters and improve prediction accuracy.
The accuracy of the wind power power prediction model is improved. Through adaptive convergence factor update and staged position update, the search accuracy and convergence speed of the algorithm are enhanced to find the optimal solution.
Smart Images

Figure CN118798024A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of renewable energy power generation, and in particular to a modeling method of an ultra-short-term wind power prediction model based on MGWO optimized Informer. Background Art
[0002] With the emergence of energy crisis, greenhouse effect, environmental pollution and other issues, it is of great significance to accelerate the construction of a new power system with new energy as the main body. Among them, wind power generation is considered to be one of the important ways to promote energy transformation and sustainable development, and the proportion of wind power generation in the power grid will continue to increase in the future. However, due to the high randomness and volatility of wind energy, large-scale wind power grid connection may cause harmonic pollution of the power grid and the deterioration of power quality, and even affect the safety of the power system. Therefore, in order to alleviate the pressure of peak load and frequency regulation of the power system when wind power is connected to the grid, and to help power grid dispatchers make plans and reasonably arrange backup, it is necessary to make ultra-short-term predictions of wind power.
[0003] Among the existing modeling methods of ultra-short-term wind power prediction models, the most advanced artificial intelligence method represented by deep learning is favored by the industry because it can mine the deep features and nonlinear relationships of data. Among them, the Informer model is a deep learning model based on the Transformer architecture. It adopts an adaptive length attention mechanism, which can automatically adjust the attention range according to the sequence length. At the same time, it uses a mask mechanism to automatically handle missing values during training. It has the advantages of reducing time and space complexity, memory usage and encoding and decoding time. However, due to the large number of hyperparameters, it is easy to fall into the local optimal solution, which affects the accuracy of the prediction model.
[0004] Therefore, in order to further improve the prediction accuracy, combined models combining evolutionary algorithms with prediction models have emerged one after another; among them, the Grey Wolf Optimizer (GWO) is one of the most popular evolutionary algorithms, which is mainly derived from the behavior of grey wolves hunting animals in the grey wolf population. In GWO, the entire grey wolf population is divided into four levels, namely: α wolf, β wolf, δ wolf and ω wolf, among which α wolf is the king of the wolf pack and has absolute leadership rights. The entire hunting activity is carried out in an orderly manner under the leadership of α wolf; β wolf is the military advisor in the wolf pack, second only to α wolf, and provides assistance to α wolf in the hunting process to help α wolf make decisions; δ wolf is the general in the wolf pack, responsible for cooperating with α wolf and β wolf to realize the encirclement and search of prey; ω wolf is the soldier in the wolf pack, obeying the instructions of α wolf, β wolf and δ wolf, approaching the prey and encircling it. In order to distinguish the four levels in the wolf pack, it is necessary to first calculate the fitness values of all gray wolf individuals according to the fitness function and sort them from small to large. Among them, the first, second and third ranked are α wolf, β wolf and δ wolf respectively, and the rest are ω wolf.
[0005] In the prior art, during the optimization process of the gray wolf algorithm, on the one hand, the convergence factor a is obtained by the formula a=2×(1-t / T), where t is the current iteration number and T is the maximum iteration number; since the convergence factor in the gray wolf algorithm is responsible for allocating the global search and local solution, but the above-mentioned convergence factor formula changes linearly in the entire iteration cycle, it cannot be adaptively updated based on the current iteration number, resulting in low algorithm search accuracy; on the other hand, since α wolves, β wolves and δ wolves are more sensitive to the potential position of the target, the overall position of the gray wolf population is updated using the formula X′(t+1)=
[0006] [X α ′(t+1)+X β ′(t+1)+X δ ′(t+1)] / 3, where X′(t+1) is the overall position of the gray wolf population, X α ′(t+1), X β ′(t+1), X δ ′(t+1) is the position vector of α wolf, β wolf and δ wolf after iteration respectively; because the overall position update formula of the gray wolf population adopts the average value of the iterative positions of α wolf, β wolf and δ wolf to solve, it is unable to highlight the importance of each of α wolf, β wolf and δ wolf, which makes the algorithm easy to fall into the local optimal solution during the optimization process. Summary of the invention
[0007] In view of this, it is necessary to provide a modeling method for an ultra-short-term wind power prediction model based on the modified Grey Wolf algorithm (MGWO, Modified GreyWolfOptimizer) to optimize the Informer, which can improve the search accuracy and find the optimal solution when optimizing the hyperparameters of the existing Informer model, thereby improving the prediction accuracy of the model for wind power.
[0008] A modeling method for an ultra-short-term wind power prediction model based on MGWO optimized informer includes the following steps:
[0009] S1. Obtain historical power data of wind farms and supporting weather data within the collection period;
[0010] S2. Process the above historical power data and the supporting weather data, and divide them into a training set and a validation set respectively; and construct the data of the training set and the validation set as the input and output sample set of the Informer model according to the requirements of the input and output sample set of the Informer model;
[0011] S3, initializing the Grey Wolf Optimizer (GWO) population, using a new convergence factor formula to replace the initial convergence factor formula, using a new Grey Wolf population overall position update formula to replace the initial Grey Wolf population overall position update formula, and obtaining an improved Grey Wolf Optimizer (MGWO);
[0012] S4. Initialize the hyperparameters of the Informer model and set the key parameters; define the generation range of the remaining parameters except the key parameters, and randomly generate the remaining parameter combinations; use the training set and the validation set to conduct several experiments, select the optimal initial hyperparameter combination, and obtain the first pre-optimization model of the Informer ultra-short-term wind power forecast;
[0013] S5. Using the training set and the validation set, and adopting MGWO to optimize the key parameters of the first pre-optimization model of ultra-short-term wind power prediction of Informer, the optimal hyperparameter combination is selected to obtain the ultra-short-term wind power prediction model based on MGWO optimized Informer.
[0014] Preferably, the weather data includes: wind speed, wind direction, temperature, humidity, air density and air pressure.
[0015] Preferably, the step S2 comprises the following steps:
[0016] S20, using the 3σ method to detect the historical power data and weather data, remove abnormal values, set them as missing values, and obtain first historical power data and matching first weather data;
[0017] S21, using linear interpolation to supplement the missing values in the first historical power data and the first weather data, to obtain second historical power data and matching second weather data;
[0018] S22, normalizing the second historical power data and the second weather data to obtain third historical power data and matching third weather data;
[0019] S23, dividing the third historical power data and the matching third weather data into a training set and a validation set respectively according to a ratio of 8:2;
[0020] S24. According to the requirements of the input and output sample sets of the Informer model, the data of the training set and the validation set are reconstructed to obtain the training set and the validation set that meet the requirements of the input and output sample sets of the Informer model.
[0021] Preferably, in step S24, the requirements for the input and output sample sets of the Informer model are as shown in formula (1):
[0022]
[0023] Where M represents the sample set based on time series; x i The 24*7 input matrix represents the sequence of wind speed, wind direction, temperature, humidity, air density, air pressure and power data in the first 24 time points of the i-th sample; y i It represents a 4*1 output matrix composed of the sequence of power data at the last 4 time points in the i-th sample; S represents the capacity of each sample; m represents the total number of samples.
[0024] Preferably, the step S3 comprises the following steps:
[0025] S30, initializing the grey wolf algorithm population, including:
[0026] Set the spatial dimension to d, and randomly generate several gray wolf individuals from the gray wolf population in the d-dimensional space. Calculate the fitness values of all gray wolf individuals according to the fitness function formula, and sort them from small to large according to the fitness values. The first, second, and third ranked ones are α wolf, β wolf, and δ wolf respectively, and the rest are ω wolf;
[0027] S31. Obtain the distance between the individual gray wolf and the prey according to formula (2), where C is a coefficient vector, C=2*γ, γ is a random number between 0 and 1; X p (t) is the current position of the prey, X(t) is the current position of the individual gray wolf, and D is the distance between the individual gray wolf and the prey;
[0028] D=|C·X p (t)-X(t)| Formula (2)
[0029] S32, obtaining the position X(t+1) of each individual gray wolf after iteration according to formula (3), wherein A is a coefficient vector obtained by formula (4), and a is a convergence factor;
[0030] X(t+1)=X p (t)-A·D Formula (3)
[0031] A=2·a·γ-a Formula (4)
[0032] S33. During the iteration process, the convergence factor a is updated according to formula (5), where T represents the maximum number of iterations and t represents the current number of iterations;
[0033]
[0034] S34. In the first half of the iteration cycle and the second half of the iteration cycle, the overall position X′(t+1) of the gray wolf population is updated using formula (6) and formula (7) respectively to obtain an improved gray wolf algorithm, where X α (t+1), X β (t+1), X δ (t+1) represents the iterated position vectors of α wolf, β wolf, and β wolf, respectively, which can be obtained by formula (3):
[0035] X′(t+1)=0.3X α (t+1)+0.35X β (t+1)+0.35X δ (t+1) Formula (6)
[0036] X′(t+1)=0.4X α (t+1)+0.3X β (t+1)+0.3X δ (t+1) Formula (7)
[0037] Preferably, the step S4 comprises the following steps:
[0038] S40, initialize the hyperparameters of the Informer model, set the learning rate, batch size, maximum number of iterations and drop rate as key parameters, and keep the values of the key parameters unchanged, which are: learning rate = 0.0001, batch size = 32, maximum number of iterations = 10, drop rate = 0.1;
[0039] S41. Define the generation range of the remaining parameters except the key parameters, which are: label sequence length = [4, 20], d_model layer size = [128, 1024], ffc_channels layer size = [512, 4096], encoder layer number = [1, 3], decoder layer number = [1, 3], multi-head attention mechanism number = [4, 16];
[0040] S42, randomly generating a hyperparameter combination of the Informer model according to the value of the key parameter set in step S40 and the generation range of the remaining parameters set in step S41;
[0041] S43, training the Informer model using the training set to obtain an Informer model capable of predicting ultra-short-term wind power;
[0042] S44. Using the validation set, optimize the hyperparameter combination of the Informer model capable of predicting ultra-short-term wind power obtained in step S43 to obtain the optimal hyperparameter combination, and obtain the first pre-optimization model of the Informer ultra-short-term wind power prediction.
[0043] Preferably, the step 5 comprises the following steps:
[0044] S50, initialize the pre-parameters of the first pre-optimization model of the ultra-short-term wind power forecast of Informer obtained in S4, the pre-parameters are the remaining parameters except the key parameters, set the number of gray wolf individuals in the gray wolf population to N, the spatial dimension to D, the maximum number of iterations to T, and set the four key parameters in turn, the learning rate, the number of iterations, the discard rate and the upper and lower bounds of the batch size in the search interval to u b and l b , randomly generate the position vector of the individual gray wolf containing key parameter information;
[0045] S51, using the training set to train the first pre-optimization model of ultra-short-term wind power forecasting of Informer obtained based on the parameters set in step S50, to obtain the second pre-optimization model of ultra-short-term wind power forecasting of Informer;
[0046] S52, input the value of the input sample set in the validation set into the second pre-optimization model of the ultra-short-term wind power forecast of Informer to obtain the predicted value of wind power t i ;
[0047] S53, according to formula (8), the fitness value fitness of each gray wolf in the gray wolf population is obtained, where y i for and t iThe corresponding validation set outputs the actual value of the sample set, and R is the number of output samples in the validation set;
[0048]
[0049] S54. Sort the wolves according to their fitness from small to large, where the first, second, and third ranked alpha wolf, beta wolf, and delta wolf are respectively, and save the position vector corresponding to the alpha wolf to the variable T d middle;
[0050] S55, continue to iterate in the search interval, and determine whether the number of iterations t reaches the maximum number of iterations. If so, execute step S59, otherwise execute step S56;
[0051] S56, determining whether the current iteration is in the first half of the iteration cycle or in the second half of the iteration cycle. If the number of iterations t is less than or equal to T / 2, the iteration is determined to be in the first half of the iteration cycle, and the overall position X′(t+1) of the gray wolf population is updated according to formula (6); if the number of iterations t is greater than T / 2, the iteration is determined to be in the second half of the iteration cycle, and the overall position X′(t+1) of the gray wolf population is updated according to formula (7);
[0052] S57, according to the overall position of the gray wolf population after the update, use the training set to retrain the first pre-optimization model of the ultra-short-term wind power forecast of Informer, and obtain the second pre-optimization model of the ultra-short-term wind power forecast of Informer based on the overall position of the current gray wolf population;
[0053] S58, input the value of the input sample set in the validation set into the second pre-optimization model of the Informer ultra-short-term wind power forecast based on the overall position of the current gray wolf population, and obtain the updated wind power forecast value t i According to formula (8), the fitness value of each gray wolf in the updated gray wolf population is obtained, and the fitness values are sorted from small to large. The first, second, and third wolves are α wolf, β wolf, and δ wolf respectively. The fitness value of the current α wolf is compared with the previous variable T d The corresponding fitness values are compared. If the current fitness value of wolf α is less than the previous variable T d The corresponding fitness value is updated to the variable T. d , continue to execute step S55;
[0054] S59, from variable T d The optimal combination of key parameters is extracted and combined with other parameters to form the optimal parameter combination, and the ultra-short-term wind power prediction model based on MGWO optimized Informer is obtained.
[0055] Preferably, the normalization process is performed according to formula (9), where x is the data before normalization, y is the data after normalization, and x max and x min are the maximum and minimum values of the data before normalization, and the normalization range is [0, 1].
[0056]
[0057] Compared with the prior art, the modeling method of the ultra-short-term wind power prediction model based on MGWO optimized Informer improves the prediction accuracy of the model for wind power from the following four aspects during the modeling process: First, when optimizing to obtain MGWO, a new convergence factor formula is used to replace the original convergence factor formula for GWO. Compared with the situation that the original convergence factor formula changes linearly throughout the iteration cycle and cannot be adaptively updated based on the current number of iterations, the new convergence factor formula can be adaptively updated based on the current number of iterations. In the early stage of the iteration, the new convergence factor value is large, and the global search ability of the algorithm is strong, which is conducive to a more comprehensive search of the algorithm. At the end of the iteration, the new convergence factor value decreases rapidly, the global search ability of the algorithm becomes weaker, and the local solution ability becomes stronger, which can effectively speed up the convergence speed of the algorithm, thereby improving the search accuracy of the algorithm; Second, when optimizing to obtain MGWO, the overall position update formula of the gray wolf population adopts a staged position update formula updated according to different iteration cycles to replace the original In the whole iteration cycle, only the average value of the positions of wolf a, wolf β and wolf δ after iteration is used to solve the problem. In the early stage of iteration, wolf β and wolf δ are given slightly larger update weights, which can realize the search in a wider range of the gray wolf population, enhance the global search ability, and avoid falling into the local optimum. In the later stage of iteration, wolf a is assigned a larger weight to highlight the leadership role of the wolf, accelerate the convergence speed, and find the optimal solution. Third, before using MGWO to optimize Informer, the parameters of the Informer model are first classified into key parameters and other parameters, and the other parameters are pre-optimized to prepare for the optimization of Informer by MGWO, so that MGWO can focus on optimizing the key parameters of Informer. Fourth, MGWO is used to optimize only the key parameters of the pre-optimized Informer model. During the optimization process, the key parameters are optimized by applying the new convergence factor formula and the staged position update formula, which improves the prediction accuracy of the model. BRIEF DESCRIPTION OF THE DRAWINGS
[0058] Figure 1 It is the overall flow chart of the present invention. DETAILED DESCRIPTION
[0059] The technical solutions and technical effects of the embodiments of the present invention are further described in detail below in conjunction with the accompanying drawings of the present invention.
[0060] The specific embodiment of the present invention takes the measured data of a wind farm in northwest my country for one consecutive year from October 2019 to September 2020 as an example to perform an example simulation to verify the effect of the present invention.
[0061] Please see Figure 1 As shown, a modeling method of an ultra-short-term wind power prediction model based on MGWO optimized Informer includes the following steps:
[0062] S1. Obtain the historical power data and supporting weather data of the wind farm within the collection period, that is, the power data and supporting weather data for one consecutive year from October 2019 to September 2020, with a sampling time resolution of 15 minutes;
[0063] S2. Process the above historical power data and the supporting weather data, and divide them into training set and validation set respectively. According to the requirements of the input and output sample set of the Informer model, the data of the training set and validation set are constructed as the input and output sample set of the Informer, which specifically includes:
[0064] S20, using the 3σ method to detect the historical power data and weather data, remove abnormal values, set them as missing values, and obtain first historical power data and matching first weather data;
[0065] S21, using linear interpolation to supplement the missing values in the first historical power data and the first weather data, to obtain second historical power data and matching second weather data;
[0066] S22, normalizing the second historical power data and the second weather data to obtain third historical power data and matching third weather data;
[0067] S23, dividing the third historical power data and the matching third weather data into a training set and a validation set respectively according to a ratio of 8:2; wherein the first 28032 groups of data are divided into the training set, and the last 7008 groups of data are divided into the validation set;
[0068] S24, according to the requirements of the input and output sample sets of the informer model, reconstruct the data of the training set and the validation set to obtain the training set and the validation set that meet the requirements of the input and output sample sets of the informer model;
[0069] S3, initialize the GWO population, use a new convergence factor formula to replace the initial convergence factor formula, use a new gray wolf population overall position update formula to replace the initial gray wolf population overall position update formula, and obtain MGWO, specifically including:
[0070] S30, initializing the GWO population, including:
[0071] Set the spatial dimension to d, and randomly generate several gray wolf individuals from the gray wolf population in the d-dimensional space. Calculate the fitness values of all gray wolf individuals according to the fitness function formula, and sort them from small to large according to the fitness values. The first, second, and third ranked are wolf, β wolf, and δ wolf respectively, and the rest are ω wolf;
[0072] S31. Obtain the distance between the individual gray wolf and the prey according to formula (2), where C is a coefficient vector, C=2*γ, γ is a random number between 0 and 1; X p (t) is the current position of the prey, X(t) is the current position of the individual gray wolf, and D is the distance between the individual gray wolf and the prey;
[0073] D=|C·X p (t)-X(t)| Formula (2)
[0074] S32, obtaining the position X(t+1) of each individual gray wolf after iteration according to formula (3), wherein A is a coefficient vector obtained by formula (4), and a is a convergence factor;
[0075] X(t+1)=X p (t)-A·D Formula (3)
[0076] A=2·a·γ-a Formula (4)
[0077] S33. During the iteration process, the convergence factor a is updated according to formula (5), where T represents the maximum number of iterations and t represents the current number of iterations;
[0078]
[0079] S34. In the first half of the iteration cycle and the second half of the iteration cycle, the overall position X′(t+1) of the gray wolf population is updated using formula (6) and formula (7) respectively to obtain an improved gray wolf algorithm, where X α (t+1), X β (t+1), X δ (t+1) represents the iterated position vectors of α wolf, β wolf, and β wolf, respectively, which can be obtained by formula (3):
[0080] X′(t+1)=0.3X α (t+1)+0.35Xβ (t+1)+0.35X δ (t+1) Formula (6)
[0081] X′(t+1)=0.4X α (t+1)+0.3X β (t+1)+0.3X δ (t+1) Formula (7)
[0082] S4. Initialize the hyperparameters of the Informer model and set the key parameters; define the generation range of the remaining parameters except the key parameters, and randomly generate the remaining parameter combinations; use the training set and the validation set to conduct several experiments, select the optimal initial hyperparameter combination, and obtain the first pre-optimization model of the Informer ultra-short-term wind power forecast, which specifically includes:
[0083] S40, initialize the hyperparameters of the Informer model, set the learning rate, batch size, maximum number of iterations and drop rate as key parameters, and keep the values of the key parameters unchanged, which are: learning rate = 0.0001, batch size = 32, maximum number of iterations = 10, drop rate = 0.1;
[0084] S41. Define the generation range of the remaining parameters except the key parameters, which are: label sequence length = [4, 20], d_model layer size = [128, 1024], ffc_channels layer size = [512, 4096], encoder layer number = [1, 3], decoder layer number = [1, 3], multi-head attention mechanism number = [4, 16];
[0085] S42, randomly generating a hyperparameter combination of the Informer model according to the value of the key parameter set in step S40 and the generation range of the remaining parameters set in step S41;
[0086] S43, training the Informer model using the training set to obtain an Informer model capable of predicting ultra-short-term wind power;
[0087] S44, using the validation set to optimize the hyperparameter combination of the Informer model capable of predicting ultra-short-term wind power obtained in step S43, to obtain the optimal hyperparameter combination, and to obtain the first pre-optimization model of the Informer ultra-short-term wind power prediction, as shown in Table 1, which is the parameters of the first pre-optimization model of the Informer ultra-short-term wind power prediction;
[0088] S5. Using the training set and the validation set, and using MGWO to optimize the key parameters of the first pre-optimization model of ultra-short-term wind power prediction of Informer, select the optimal hyperparameter combination, and obtain the ultra-short-term wind power prediction model based on MGWO optimized Informer, specifically including:
[0089] S50, initialize the pre-parameters of the first pre-optimization model of the ultra-short-term wind power forecast of Informer obtained in S4, the pre-parameters are the remaining parameters except the key parameters, set the number of gray wolf individuals in the gray wolf population to N = 30, the spatial dimension to D = 4, the maximum number of iterations to T = 30, and set the four key parameters in turn, the learning rate, the number of iterations, the discard rate and the upper and lower bounds of the batch size in the search interval to u b and l b ,u b =[0.01,128,0.2,30], l b =[0.0005,8,0.02,3], randomly generate the position vector of the gray wolf individual containing key parameter information;
[0090] S51, using the training set to train the first pre-optimization model of ultra-short-term wind power forecasting of Informer obtained based on the parameters set in step S50, to obtain the second pre-optimization model of ultra-short-term wind power forecasting of Informer;
[0091] S52, input the value of the input sample set in the validation set into the second pre-optimization model of the ultra-short-term wind power forecast of Informer to obtain the predicted value of wind power t i ;
[0092] S53, according to formula (8), the fitness value fitness of each gray wolf in the gray wolf population is obtained, where y i for and t i The corresponding validation set outputs the actual value of the sample set, and R is the number of output samples in the validation set;
[0093]
[0094] S54. Sort the wolves according to their fitness from small to large, where the first, second, and third ranked alpha wolf, beta wolf, and delta wolf are respectively, and save the position vector corresponding to the alpha wolf to the variable T d middle;
[0095] S55, continue to iterate in the search interval, and determine whether the number of iterations t reaches the maximum number of iterations. If so, execute step S59, otherwise execute step S56;
[0096] S56, determining whether the current iteration is in the first half of the iteration cycle or in the second half of the iteration cycle. If the number of iterations t is less than or equal to T / 2, the iteration is determined to be in the first half of the iteration cycle, and the overall position X′(t+1) of the gray wolf population is updated according to formula (6); if the number of iterations t is greater than T / 2, the iteration is determined to be in the second half of the iteration cycle, and the overall position X′(t+1) of the gray wolf population is updated according to formula (7);
[0097] S57, according to the overall position of the gray wolf population after the update, use the training set to retrain the first pre-optimization model of the ultra-short-term wind power forecast of Informer, and obtain the second pre-optimization model of the ultra-short-term wind power forecast of Informer based on the overall position of the current gray wolf population;
[0098] S58, input the value of the input sample set in the verification set into the second pre-optimization model of the Informer ultra-short-term wind power prediction based on the overall position of the current gray wolf population, obtain the updated wind power prediction value ti, obtain the fitness value fitness of each gray wolf in the updated gray wolf population according to formula (8), sort them from small to large according to fitness, where the first, second, and third rankings are α wolf, β wolf and δ wolf respectively; compare the fitness value of the current α wolf with the fitness value corresponding to the previous variable Td, if the fitness value of the current α wolf is less than the fitness value corresponding to the previous variable Td, then update the position vector corresponding to the current α wolf to the variable Td, and continue to execute step S55;
[0099] S59. Extract the optimal combination of key parameters from the variable Td, as shown in Table 2, and combine with the remaining parameters to form an optimal parameter combination to obtain an ultra-short-term wind power prediction model based on MGWO optimized Informer.
[0100] Table 1
[0101]
[0102] Table 2
[0103]
[0104] Select the root mean square error RMSE, mean absolute error MAE and correlation coefficient R 2The three evaluation indicators are used to evaluate the prediction performance of the ultra-short-term wind power prediction model of the unoptimized informer in the prior art, referred to as the unoptimized informer, the ultra-short-term wind power prediction model using the GWO optimized informer, referred to as the GWO-Informer, and the ultra-short-term wind power prediction model using the MGWO optimized informer provided by the specific embodiment of the present invention; when evaluating, the smaller the RMSE, the higher the prediction accuracy of the model at the extreme point; the smaller the MAE, the higher the overall prediction accuracy of the model; R 2 The larger the value is, the closer the prediction result of the model is to the actual result trend, and the higher the prediction accuracy is. The evaluation formulas of the three indicators are shown in formulas (9), (10) and (11), respectively, where n is the number of samples, ti is the predicted value of the model, and y is the predicted value of the model. i The actual value of the sample is:
[0105]
[0106] After processing the obtained data, error analysis and evaluation were performed on the unoptimized Informer, GWO-Informer, and MGWO-Informer. The results are shown in Table 3:
[0107] Table 3
[0108]
[0109] As shown in Table 3, the RMSE and MAE of MGWO-Informer are smaller than those of the unoptimized Informer and GWO-Informer. 2 It is larger than that of the unoptimized Informer and GWO-Informer. It can be seen that the RMSE, MAE and R 2 Both are better than the indicators of the unoptimized Informer and GWO-Informer, indicating that MGWO-Informer has a higher prediction accuracy for ultra-short-term wind power.
[0110] What is disclosed above is only a preferred embodiment of the present invention, which certainly cannot be used to limit the scope of rights of the present invention. A person skilled in the art can understand that all or part of the processes of the above embodiments and equivalent changes made according to the claims of the present invention still fall within the scope of the invention.
Claims
1. A modeling method for an ultra-short-term wind power prediction model based on MGWO optimized informer, characterized in that: The following steps are involved: S1. Obtain historical power data of wind farms and supporting weather data within the collection period; S2. Process the above historical power data and the supporting weather data, and divide them into a training set and a validation set respectively; and construct the data of the training set and the validation set as the input and output sample set of the Informer model according to the requirements of the input and output sample set of the Informer model; S3, initializing the Grey Wolf Optimizer (GWO) population, using a new convergence factor formula to replace the initial convergence factor formula, using a new Grey Wolf population overall position update formula to replace the initial Grey Wolf population overall position update formula, and obtaining an improved Grey Wolf Optimizer (MGWO); S4. Initialize the hyperparameters of the Informer model and set the key parameters; define the generation range of the remaining parameters except the key parameters, and randomly generate the remaining parameter combinations; use the training set and the validation set to conduct several experiments, select the optimal initial hyperparameter combination, and obtain the first pre-optimization model of the Informer ultra-short-term wind power forecast; S5. Using the training set and the validation set, and adopting MGWO to optimize the key parameters of the first pre-optimization model of ultra-short-term wind power prediction of Informer, the optimal hyperparameter combination is selected to obtain the ultra-short-term wind power prediction model based on MGWO optimized Informer.
2. The modeling method of the ultra-short-term wind power prediction model based on MGWO optimized Informer according to claim 1 is characterized in that: The weather data includes: wind speed, wind direction, temperature, humidity, air density and air pressure.
3. The modeling method of the ultra-short-term wind power prediction model based on MGWO optimized Informer according to claim 1 is characterized in that: The step S2 comprises the following steps: S20, using the 3σ method to detect the historical power data and weather data, remove abnormal values, set them as missing values, and obtain first historical power data and matching first weather data; S21, using linear interpolation to supplement the missing values in the first historical power data and the first weather data, to obtain second historical power data and matching second weather data; S22, normalizing the second historical power data and the second weather data to obtain third historical power data and matching third weather data; S23, dividing the third historical power data and the matching third weather data into a training set and a validation set respectively according to a ratio of 8:2; S24. According to the requirements of the input and output sample sets of the Informer model, the data of the training set and the validation set are reconstructed to obtain the training set and the validation set that meet the requirements of the input and output sample sets of the Informer model.
4. The modeling method of the ultra-short-term wind power prediction model based on MGWO optimized Informer according to claim 3 is characterized in that: In step S24, the requirements of the input and output sample sets of the Informer model are as shown in formula (1): Where M represents the sample set based on time series; x i The 24*7 input matrix represents the sequence of wind speed, wind direction, temperature, humidity, air density, air pressure and power data in the first 24 time points of the i-th sample; y i It represents a 4*1 output matrix composed of the sequence of power data at the last 4 time points in the i-th sample; S represents the capacity of each sample; m represents the total number of samples.
5. The modeling method of the ultra-short-term wind power prediction model based on MGWO optimized Informer according to claim 1, characterized in that: The step S3 comprises the following steps: S30, initializing the grey wolf algorithm population, including: Set the spatial dimension to d, and randomly generate several gray wolf individuals from the gray wolf population in the d-dimensional space. Calculate the fitness values of all gray wolf individuals according to the fitness function formula, and sort them from small to large according to the fitness values. The first, second, and third ranked ones are α wolf, β wolf, and δ wolf respectively, and the rest are ω wolf; S31. Obtain the distance between the individual gray wolf and the prey according to formula (2), where C is a coefficient vector, C=2*γ, γ is a random number between 0 and 1; X p (t) is the current position of the prey, X(t) is the current position of the individual gray wolf, and D is the distance between the individual gray wolf and the prey; D=|C·X p (t)-X(t)| Formula (2) S32, obtaining the position X(t+1) of each individual gray wolf after iteration according to formula (3), wherein A is a coefficient vector obtained by formula (4), and a is a convergence factor; X(t+1)=X p (t)-A·D Formula (3) A=2·a·γ-a Formula (4) S33. During the iteration process, the convergence factor a is updated according to formula (5), where T represents the maximum number of iterations and t represents the current number of iterations; S34. In the first half of the iteration cycle and the second half of the iteration cycle, the overall position X′(t+1) of the gray wolf population is updated using formula (6) and formula (7) respectively to obtain an improved gray wolf algorithm, where X α (t+1), X β (t+1), X δ (t+1) represents the iterated position vectors of wolf α, wolf β, and wolf δ, respectively, which can be obtained by formula (3): X′(t+1)=0.3X α (t+1)+0.35X β (t+1)+0.35X δ (t+1) Formula (6) X′(t+1)=0.4X α (t+1)+0.3X β (t+1)+0.3X δ (t+1) Formula (7) 6. The modeling method of the ultra-short-term wind power prediction model based on MGWO optimized Informer according to claim 1, characterized in that: The step S4 comprises the following steps: S40, initialize the hyperparameters of the Informer model, set the learning rate, batch size, maximum number of iterations and drop rate as key parameters, and keep the values of the key parameters unchanged, which are: learning rate = 0.0001, batch size = 32, maximum number of iterations = 10, drop rate = 0.1; S41. Define the generation range of the remaining parameters except the key parameters, which are: label sequence length = [4, 20], d_model layer size = [128, 1024], ffc_channels layer size = [512, 4096], encoder layer number = [1, 3], decoder layer number = [1, 3], multi-head attention mechanism number = [4, 16]; S42, randomly generating a hyperparameter combination of the Informer model according to the value of the key parameter set in step S40 and the generation range of the remaining parameters set in step S41; S43, training the Informer model using the training set to obtain an Informer model capable of predicting ultra-short-term wind power; S44. Using the validation set, optimize the hyperparameter combination of the Informer model capable of predicting ultra-short-term wind power obtained in step S43 to obtain the optimal hyperparameter combination, and obtain the first pre-optimization model of the Informer ultra-short-term wind power prediction.
7. The modeling method of the ultra-short-term wind power prediction model based on MGWO optimized Informer according to claim 1, characterized in that: The step 5 comprises the following steps: S50, initialize the pre-parameters of the first pre-optimization model of the ultra-short-term wind power forecast of Informer obtained in S4, the pre-parameters are the remaining parameters except the key parameters, set the number of gray wolf individuals in the gray wolf population to N, the spatial dimension to D, the maximum number of iterations to T, and set the four key parameters in turn, the learning rate, the number of iterations, the discard rate and the upper and lower bounds of the batch size in the search interval to u b and l b , randomly generate the position vector of the individual gray wolf containing key parameter information; S51, using the training set to train the first pre-optimization model of ultra-short-term wind power forecasting of Informer obtained based on the parameters set in step S50, to obtain the second pre-optimization model of ultra-short-term wind power forecasting of Informer; S52, input the value of the input sample set in the verification set into the second pre-optimization model of the ultra-short-term wind power forecast of Informer to obtain the predicted value of wind power t i ; S53, according to formula (8), the fitness value fitness of each gray wolf in the gray wolf population is obtained, where y i for and t i The corresponding validation set outputs the actual value of the sample set, and R is the number of output samples in the validation set; S54. Sort the wolves according to their fitness from small to large, where the first, second, and third ranked alpha wolf, beta wolf, and delta wolf are respectively, and save the position vector corresponding to the alpha wolf to the variable T d middle; S55, continue to iterate in the search interval, and determine whether the number of iterations t reaches the maximum number of iterations. If so, execute step S59, otherwise execute step S56; S56, determining whether the current iteration is in the first half of the iteration cycle or in the second half of the iteration cycle. If the number of iterations t is less than or equal to T / 2, the iteration is determined to be in the first half of the iteration cycle, and the overall position X′(t+1) of the gray wolf population is updated according to formula (6); if the number of iterations t is greater than T / 2, the iteration is determined to be in the second half of the iteration cycle, and the overall position X′(t+1) of the gray wolf population is updated according to formula (7); S57, according to the overall position of the gray wolf population after the update, use the training set to retrain the first pre-optimization model of the ultra-short-term wind power forecast of Informer, and obtain the second pre-optimization model of the ultra-short-term wind power forecast of Informer based on the overall position of the current gray wolf population; S58, input the value of the input sample set in the validation set into the second pre-optimization model of the Informer ultra-short-term wind power forecast based on the overall position of the current gray wolf population, and obtain the updated wind power forecast value t i According to formula (8), the fitness value of each gray wolf in the updated gray wolf population is obtained, and the fitness values are sorted from small to large. The first, second, and third wolves are α wolf, β wolf, and δ wolf respectively. The fitness value of the current α wolf is compared with the previous variable T d The corresponding fitness values are compared. If the current fitness value of wolf α is less than the previous variable T d The corresponding fitness value is updated to the variable T. d , continue to execute step S55; S59, from variable T d The optimal combination of key parameters is extracted and combined with other parameters to form the optimal parameter combination, and the ultra-short-term wind power prediction model based on MGWO optimized Informer is obtained.
8. The modeling method of the ultra-short-term wind power prediction model based on MGWO optimized Informer according to claim 3 is characterized in that: The normalization process is performed according to formula (9), where x is the data before normalization, y is the data after normalization, and x max and x min are the maximum and minimum values of the data before normalization, and the normalization range is [0, 1].
Citation Information
Cited By
Radar signal classification method and device, electronic equipment, medium and program product
CN120539696A
Regional wind and light power generation cluster short-term power prediction method, device, equipment and medium
CN121566425A
