Wind power generation prediction method based on hybrid model
By adopting improved butterfly optimization algorithms and hybrid models (XGBoost and LightGBM) in wind power forecasting, the problem of low prediction accuracy in wind power generation in the prior art is solved, achieving higher prediction accuracy and stability.
Patent Information
- Application Number
- CN202411712116.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-27
- Publication Date
- 2025-03-25
AI Technical Summary
Existing wind power generation prediction methods are difficult to achieve high-precision prediction. Traditional physical models have high requirements for model accuracy and parameter measurement accuracy and are difficult to migrate, while a single data-driven model cannot meet multiple computing needs.
The wind power generation prediction method based on the hybrid model is adopted, and the parameters of the hybrid model are searched using the improved butterfly optimization algorithm, combined with the XGBoost and LightGBM models to predict, and the prediction results are fused through the weighted average method.
It improves the accuracy and stability of wind power generation forecasting, improves prediction accuracy, and can better support the operation and management of wind power generation systems.
Smart Images

Figure CN119695856A_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of wind power generation prediction, and in particular relates to a wind power generation prediction method based on a hybrid model. Background Art
[0002] Wind power generation has become one of the important ways for countries around the world to develop renewable energy. Accurate prediction of wind power output is a prerequisite for safe grid connection of wind power, and is also an important guarantee for stable operation and high-quality dispatch of power grid systems. However, since wind power generation systems are greatly affected by environmental factors, accurate prediction of wind power is difficult. Traditional wind power generation prediction methods mainly rely on physical models and data-driven methods. Physical methods are mainly based on physical modeling and analysis of real environments, but such methods have too high requirements on model accuracy and parameter measurement accuracy, and the models are difficult to migrate and engineer, so they are subject to more restrictions in actual applications; data-driven methods do not require the establishment of equivalent models, which greatly improves parameter identification capabilities and robustness, but a single data-driven model cannot meet multiple computing needs.
[0003] In recent years, data-driven wind power generation forecasting methods have gradually become a research hotspot. However, the accuracy of data-driven forecasting depends on the accuracy of model training, so it is necessary to continuously improve the accuracy of existing model training to improve forecasting accuracy. Summary of the invention
[0004] The purpose of the present invention is to provide a wind power generation prediction method based on a hybrid model, using an improved butterfly optimization algorithm to search for parameters of the hybrid model to improve the accuracy of wind power generation prediction.
[0005] The present invention adopts the following technical solutions:
[0006] A wind power generation prediction method based on a hybrid model comprises the following steps:
[0007] Obtain the factors affecting wind power generation;
[0008] Input the influencing factors into the hybrid model to obtain the wind power generation;
[0009] The improved butterfly optimization algorithm is used to determine the model parameters of the hybrid model; in the improved butterfly optimization algorithm, the model parameters are searched by adjusting the adaptive weights of the global search and the local search.
[0010] Furthermore, the hybrid model consists of an XGBoost model and a LightGBM model.
[0011] Furthermore, the model parameters of the hybrid model are determined using the improved butterfly optimization algorithm as follows:
[0012] The improved butterfly optimization algorithm is used to calculate the model parameters of the XGBoost model and the model parameters of the LightGBM model respectively;
[0013] Model parameters include the maximum number of iterations, the iteration step size, the maximum depth of the tree, and the minimum loss function drop value required for node splitting.
[0014] Furthermore, the improved butterfly optimization algorithm includes:
[0015] The adaptive weight coefficient is calculated by using the current iteration number and the maximum iteration number, and the position of the improved global search phase and the position of the improved local search phase are obtained based on the adaptive weight coefficient.
[0016] Furthermore, the improved butterfly optimization algorithm also includes:
[0017] The improved switching probability is obtained using the current iteration number and the maximum iteration number.
[0018] Furthermore, the adaptive weight coefficient is expressed as:
[0019]
[0020] In the formula, β is a constant between 0 and 1, t is the current number of iterations, and iter is the maximum number of iterations;
[0021] The position of the improved global search phase is expressed as:
[0022]
[0023] In the formula, is the solution of the ith butterfly at the tth iteration, g * is the current optimal solution, f i is the scent of the i-th butterfly, r is a random number between 0 and 1;
[0024] The position of the improved local search phase is expressed as:
[0025]
[0026] In the formula, is the kth butterfly randomly selected from the solution space, is the jth butterfly randomly selected from the solution space.
[0027] Furthermore, the improved switching probability is expressed as:
[0028]
[0029] Furthermore, the influencing factors are input into the hybrid model, and the wind power generation power is obtained including:
[0030] Input the influencing factors into the XGBoost model and the LightGBM model respectively to obtain the prediction results of the XGBoost model and the LightGBM model;
[0031] The weighted average method is used to merge the prediction results of the XGBoost model and the LightGBM model, where the weighted coefficients of the XGBoost model and the LightGBM model are determined by the cross-validation method.
[0032] Furthermore, before using the improved butterfly optimization algorithm to determine the model parameters of the hybrid model, it also includes cleaning of the influencing factors, outlier processing, normalization and feature engineering processing.
[0033] An electronic device, comprising:
[0034] at least one processor;
[0035] and, a memory communicatively coupled to the at least one processor;
[0036] The memory stores instructions that can be executed by at least one processor, and the instructions are executed by at least one processor so that the at least one processor can execute any one of the above wind power generation prediction methods based on a hybrid model.
[0037] The beneficial effects of the present invention are:
[0038] The present invention adopts an improved butterfly optimization algorithm and uses adaptive weight coefficients to adjust the weights of global search and local search, thereby searching for model parameters of the hybrid model, and using the model parameters to set the hybrid model, thereby improving the accuracy of wind power generation prediction and further improving the prediction accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] Figure 1 The figure is a flow chart of the method of the present invention. DETAILED DESCRIPTION
[0040] The present invention is described in detail below with reference to the accompanying drawings and specific embodiments.
[0041] The gradient boosting tree algorithm has attracted much attention due to its excellent prediction performance. XGBoost and LightGBM, as two advanced gradient boosting tree algorithms, have demonstrated excellent performance in many fields. However, the parameters of a single algorithm are mostly manually debugged, and the prediction results are limited by data features and model parameter settings.
[0042] like Figure 1As shown, it is a flow chart of the wind power generation prediction method based on the hybrid model of the present invention, which includes: selecting influencing factors of wind power generation, data preprocessing, model training, combined model construction, model evaluation, and model online prediction.
[0043] The present invention comprises the following steps:
[0044] Obtain the factors affecting wind power generation;
[0045] Input the influencing factors into the hybrid model to obtain the wind power generation;
[0046] The improved butterfly optimization algorithm is used to determine the model parameters of the hybrid model; in the improved butterfly optimization algorithm, the model parameters are searched by adjusting the adaptive weights of the global search and the local search.
[0047] Specifically:
[0048] Select the factors affecting wind power generation:
[0049] Wind power generation is easily affected by meteorological conditions and local random disturbance factors. The regularity of wind power output changes is poor, and prediction is relatively difficult. In order to ensure the accuracy of the prediction, the direct wind power prediction method based on historical data is selected. This method is based on the historical data of wind power, establishes a mapping relationship model between input and output, and directly predicts the wind power output power, avoiding the conversion error between wind speed and wind power.
[0050] The data set is feature screened, and wind speed, pitch angle 1, pitch angle 2, pitch angle 3, steering gear angle, and ambient temperature are selected as the influencing factor set. These six sets of data affect the output value of wind power generation. Among them, pitch angle 1, pitch angle 2, and pitch angle 3 are the angles between the three wind turbine blades and the wind rotor plane respectively.
[0051] Data preprocessing:
[0052] The influencing factors in the wind power generation data set are cleaned, outliers are processed, normalized and feature engineered to ensure data quality and the validity of model input, and the training set and test set are divided.
[0053] Model training:
[0054] The hybrid model consists of an XGBoost model and a LightGBM model. The training parameters of the XGBoost model and the LightGBM model are selected, such as the maximum number of iterations, the iteration step, the maximum depth of the tree, and the minimum loss function drop value required for node splitting. The improved butterfly optimization algorithm is used to 2 The (determination coefficient) fitness function is used to optimize these four parameters and find the model parameter values with the best prediction effect.
[0055] in, is the predicted value, y i is the actual value, is the mean.
[0056] In the traditional butterfly optimization algorithm, butterflies use their own sensors to locate the source of food. In this algorithm, it is assumed that each butterfly produces a certain intensity of fragrance, which will spread and be sensed by other butterflies in the area. The fragrance released by each butterfly is related to its fitness. This means that when a butterfly moves, its fitness will also change. When a butterfly senses that another butterfly is emitting more fragrance in the area, it will move closer. This stage is called global search. In another case, when the butterfly cannot perceive a fragrance greater than its own, it will move randomly. This stage is called the local search stage.
[0057] Aroma is described based on the physical intensity of the stimulus, which is calculated as follows:
[0058] f=cI α ,
[0059] Among them, I is the stimulus intensity, c is the sensory factor, α is the power exponent, and f is the fragrance.
[0060] For the four parameters that need to be optimized, the position of each butterfly represents the solution of the optimization algorithm, x1 is the position of the first butterfly, that is, x1 = [x 1,1 ,x 1,2 ,x 1,3 ,x 1,4 ].
[0062] The algorithm has two key steps: the global search phase and the local search phase.
[0063] In the global search phase, the butterfly will move towards the optimal solution g * Movement can be expressed as:
[0064]
[0065] in, is the solution of the ith butterfly at the tth iteration, g * is the current optimal solution, f i is the scent of the i-th butterfly, and r is a random number between 0 and 1.
[0066] Local search can be expressed as:
[0067]
[0068] in, is the kth butterfly randomly selected from the solution space, is the jth butterfly randomly selected from the solution space.
[0069] In the foraging process of butterflies, both global and local searches occur. Therefore, a switching probability P is set. s To switch between ordinary global search and intensive local search. Each iteration randomly generates a random number between 0 and 1, which is related to the switching probability P s A comparison is made to decide whether to perform a global or local search.
[0070] The present invention improves the butterfly optimization algorithm, and uses a switching probability that changes adaptively with the number of iterations, changes less in the function range, changes slowly in the early stage and changes faster in the later stage to control which position update method is used in the local search stage, so that individuals in the local range can be fully utilized in the early stage of the algorithm's local optimization, and at the same time, the optimal individual can be quickly converged in the later stage of the local optimization. The improved switching probability P s The calculation formula is as follows:
[0071]
[0072] Among them, t is the current iteration number and iter is the maximum iteration number.
[0073] The butterfly individual uses the current position and the current optimal individual position / random butterfly individual position to update the position. However, these individual positions are not fully utilized in either the global search phase or the local search phase of the algorithm. Therefore, an adaptive weight w that changes with the number of iterations is introduced in both the global search and local search phases of the butterfly algorithm, so that the three types of individual position information can be fully utilized, while controlling the movement direction and distance of the current butterfly individual, thereby improving the algorithm's optimization accuracy and convergence speed. The mathematical expression of the adaptive weight w is as follows:
[0074]
[0075] Here, β is a constant ranging from 0 to 1.
[0076] Therefore, after introducing the adaptive weight coefficient, the position update formula of the improved global search phase is obtained as follows:
[0077]
[0078] The position update in the improved local search phase is:
[0079]
[0080] The model parameters of the XGBoost model and the model parameters of the LightGBM model are calculated using the improved butterfly optimization algorithm as follows:
[0081] a. Initialize the butterfly population to 200, and randomly generate 200 x, that is in is the position of the butterfly at the first iteration, which represents the solution of the four parameters. is the maximum number of iterations in the first iteration, is the value of the iteration step size at the first iteration, is the maximum depth of the tree at the first iteration, The minimum loss function drop value required for node splitting in the first iteration;
[0082] b. According to the four sets of parameter values corresponding to the current number of iterations, set the parameter values of the XGBoost and LightGBM algorithms, and train the model according to the current parameter values and training data; among them, wind speed, pitch angle 1, pitch angle 2, pitch angle 3, steering gear angle and ambient temperature are the input data of the two models, and wind power generation is the output data of the two models. After training the model, the model parameters are obtained;
[0083] c. Use the current model to input the test data into the two models and calculate them separately to obtain two sets of prediction values. 2 The calculation formula for each model is 2 Value, R of the current iteration 2 The value is the optimized fitness function. Select the x with the largest fitness value and record the value corresponding to x at this time.
[0084] d. According to the switching probability P s Select whether the update method for the next iteration is global search or local search, and update the values of 200 x in the next iteration according to the improved position update formula in the global search phase and the improved position update formula in the local search phase;
[0085] e. Execute b, c, d in sequence until the optimal x value is found;
[0086] f. Train the XGBoost and LightGBM models respectively according to the four parameter values in the optimal x value.
[0087] As two advanced gradient boosting tree algorithms, XGBoost and LightGBM have demonstrated excellent performance in many fields. XGBoost model and LightGBM model are selected to form a hybrid model. Through the fusion and complementarity between different single data-driven methods, the hybrid model method is adopted. The algorithm parameters of XGBoost and LightGBM are optimized through the butterfly optimization algorithm, which can improve the accuracy of wind power generation prediction and further improve the prediction accuracy.
[0088] Hybrid model building:
[0089] Input the influencing factors into the XGBoost model and the LightGBM model respectively to obtain the prediction results of the XGBoost model and the LightGBM model;
[0090] The weighted average method is used to merge the prediction results of the XGBoost model and the LightGBM model. The prediction results are adjusted by setting different weight coefficients for the two algorithms, and the optimal weight combination is selected through cross-validation to maximize the prediction performance of the combined model.
[0091] Specifically: Input the test data into the trained XGBoost and LightGBM models to obtain the model's predicted values respectively Then set the weighted coefficients n1 and n2 of the two predicted values, where n1+n2=1 and the step size is 0.1. Then n1 changes from 0 to 1 and n2 changes from 1 to 0. The final predicted value is Find the y′, n1 and n2 corresponding to the highest accuracy. That is, the subsequent predictions are weighted averaged according to the coefficient values of n1 and n2 on the prediction results of the two models, which can achieve the effect of optimizing the prediction results.
[0092] The present invention improves the accuracy and stability of wind power generation prediction through a model fusion strategy, ensures the generalization ability and prediction performance of the model on different data sets through cross-validation, realizes real-time prediction of wind power generation, and provides better support and guarantee for the operation and management of wind power generation systems. It has broad application prospects and important practical significance.
[0093] Model Evaluation:
[0094] The combined model was evaluated using the validation data set, and the mean square error (MSE), root mean square error (RMSE), and coefficient of determination (R 2 ) and other indicators to evaluate the prediction accuracy and stability of the model.
[0095] Model online prediction:
[0096] In practical applications, the operating data of the wind power generation system is collected in real time and preprocessed, and the preprocessed data is input into the trained combined model. The model is optimized through parameter tuning to predict the output wind power generation power, and corresponding management and maintenance decisions are made based on the prediction results.
[0097] In summary, the present invention combines the advantages of two efficient gradient boosting algorithms, XGBoost and LightGBM, through integrated learning technology, and optimizes the parameters of the two algorithms through an improved butterfly optimization algorithm, and uses adaptive weight coefficients to adjust the weights of global search and local search, thereby searching for model parameters of the hybrid model, and improving the accuracy and stability of wind power generation prediction. This method has a wide range of application prospects in wind power generation systems, and is of great significance for improving the operating efficiency of wind farms, optimizing power grid dispatching, and reducing operating costs.
Claims
1. A wind power generation prediction method based on a hybrid model, characterized in that: The following steps are involved: Obtain the factors affecting wind power generation; Inputting the influencing factors into the hybrid model to obtain wind power generation power; The improved butterfly optimization algorithm is used to determine the model parameters of the hybrid model; in the improved butterfly optimization algorithm, the model parameters are searched by adjusting the adaptive weights of the global search and the local search.
2. A wind power generation prediction method based on a hybrid model according to claim 1, characterized in that: The hybrid model consists of an XGBoost model and a LightGBM model.
3. A wind power generation prediction method based on a hybrid model according to claim 2, characterized in that: The model parameters of the hybrid model determined by using the improved butterfly optimization algorithm are specifically: The improved butterfly optimization algorithm is used to calculate the model parameters of the XGBoost model and the model parameters of the LightGBM model respectively; The model parameters include the maximum number of iterations, the iteration step, the maximum depth of the tree, and the minimum loss function drop value required for node splitting.
4. The wind power generation prediction method based on a hybrid model according to claim 3 is characterized in that: The improved butterfly optimization algorithm includes: The adaptive weight coefficient is calculated using the current iteration number and the maximum iteration number, and the position of the improved global search phase and the position of the improved local search phase are obtained based on the adaptive weight coefficient.
5. A wind power generation prediction method based on a hybrid model according to claim 4, characterized in that: The improved butterfly optimization algorithm also includes: The improved switching probability is obtained using the current iteration number and the maximum iteration number.
6. A wind power generation prediction method based on a hybrid model according to claim 5, characterized in that: The adaptive weight coefficient is expressed as: In the formula, β is a constant between 0 and 1, t is the current number of iterations, and iter is the maximum number of iterations; The position of the improved global search phase is expressed as: In the formula, is the solution of the ith butterfly at the tth iteration, g * is the current optimal solution, f i is the scent of the i-th butterfly, r is a random number between 0 and 1; The position of the improved local search phase is expressed as: In the formula, is the kth butterfly randomly selected from the solution space, is the jth butterfly randomly selected from the solution space.
7. A wind power generation prediction method based on a hybrid model according to claim 6, characterized in that: The improved switching probability is expressed as:
8. A wind power generation prediction method based on a hybrid model according to any one of claims 2 to 7, characterized in that: The influencing factors are input into the hybrid model to obtain the wind power generation power including: Input the influencing factors into the XGBoost model and the LightGBM model respectively to obtain the prediction results of the XGBoost model and the LightGBM model; The weighted average method is used to merge the prediction results of the XGBoost model and the LightGBM model, where the weighted coefficients of the XGBoost model and the LightGBM model are determined by the cross-validation method.
9. The wind power generation prediction method based on a hybrid model according to claim 1, characterized in that: Before using the improved butterfly optimization algorithm to determine the model parameters of the hybrid model, it also includes cleaning of influencing factors, outlier processing, normalization and feature engineering processing.
10. An electronic device, characterized in that: include: at least one processor; and, a memory communicatively coupled to at least one of the processors; Wherein, the memory stores instructions that can be executed by at least one of the processors, and the instructions are executed by at least one of the processors so that at least one of the processors can execute a wind power generation prediction method based on a hybrid model as described in any one of claims 1 to 9.