Short-term wind power prediction method, device, electronic equipment and storage medium
By using the BiGRU model and attention mechanism optimized by the fishing optimization algorithm in short-term wind power prediction, combined with the sliding window weight distributor, the problem of low prediction accuracy in the prior art is solved, and more efficient and accurate wind power prediction is achieved.
Patent Information
- Application Number
- CN202510264758.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-07
- Publication Date
- 2025-05-09
- Estimated Expiration
- 2045-03-07
AI Technical Summary
Existing short-term wind power power prediction methods are difficult to fully capture the complex dynamic changes in wind power power, resulting in low prediction accuracy.
The BiGRU model optimized based on the fishing optimization algorithm is used for preliminary prediction, and the environmental variables are weighted in combination with the attention mechanism. The preliminary prediction results and error correction results are weighted and summed through the sliding window weight allocator to generate the final wind power prediction value.
The accuracy and adaptability of wind power power prediction are improved, and the inefficiency and local optimization problems of traditional models relying on manual parameter adjustment are avoided.
Smart Images

Figure CN119809138B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of renewable energy power generation, and in particular to a short-term wind power prediction method, device, electronic equipment and storage medium. Background Art
[0002] As an important clean energy, wind power has been widely used around the world. However, due to the intermittent and volatile nature of wind resources, it poses a huge challenge to grid dispatching and wind farm operations. Therefore, accurate prediction of wind power has become a key technology to ensure the safety of wind power grid connection, optimize grid operation and improve wind power utilization. Wind power forecasting can be divided into short-term, medium-term and long-term forecasts. Short-term wind power forecasting usually refers to the prediction of wind power in the next few minutes to hours, which is mainly used for real-time dispatching of wind farms, power generation optimization and coordination with the grid.
[0003] At present, the main methods for short-term wind power forecasting include physical method, statistical method and artificial intelligence method. The physical method is complex in modeling and difficult to obtain geographic data, so it is not suitable for short-term wind power forecasting. The statistical method only considers linear relationships, which is insufficient for short-term wind power sequences with large randomness and volatility. With the continuous development of artificial intelligence technology, artificial intelligence methods have gradually shown their potential in processing the prediction of non-stationary sequences. In the research of short-term wind power forecasting, long short-term memory networks (LSTM) and gated recurrent units (GRU) have been widely used.
[0004] Existing short-term wind power forecasting methods have the following limitations: wind power is affected by many factors, and a single model is difficult to fully capture its complex dynamic changes, which limits the prediction accuracy. Summary of the invention
[0005] In view of this, it is necessary to provide a short-term wind power prediction method, device, electronic device and storage medium to solve the technical problem that the existing short-term wind power prediction method is difficult to fully capture its complex dynamic changes, resulting in low prediction accuracy.
[0006] In order to solve the above problems, on the one hand, the present invention provides a short-term wind power prediction method, comprising:
[0007] Obtain an initial data set based on historical wind power data and related meteorological data;
[0008] Preprocessing the initial data set to generate a data set required for wind power prediction;
[0009] Based on the BiGRU model optimized by the fishing optimization algorithm, a preliminary prediction is made on the data set required for wind power prediction to capture the fluctuation characteristics of wind power and obtain the preliminary prediction results and the error sequence of the preliminary prediction results;
[0010] The environmental variables are weighted in combination with the attention mechanism, and the weighted environmental variables and the error sequence of the preliminary prediction results are input into the BiGRU model optimized by the fishing optimization algorithm to obtain the error correction result;
[0011] Based on the preliminary prediction result and the error correction result, a wind power prediction value is obtained.
[0012] In a possible implementation, the BiGRU model is optimized based on the fishing optimization algorithm, including:
[0013] Initialize the hyperparameters of the BiGRU model and determine the search space corresponding to the optimization target;
[0014] Initializing the total number of fishermen and the maximum number of iterations in the fishing optimization algorithm, and randomly generating fisherman positions corresponding to the total number of fishermen in the search space;
[0015] In the exploration phase, the fishermen's positions in the search space are updated based on independent search and group fishing;
[0016] In the development stage, the fishermen's positions are updated with reference to the distribution of fishermen, which is centered on the fish school and gradually becomes sparser from the middle to the periphery;
[0017] The exploration phase and the development phase are repeated until the number of iterations reaches the maximum number of iterations or the fitness meets the preset standard, and the hyperparameters are updated based on the updated fishermen's positions in the search space to obtain the optimal hyperparameters of the BiGRU model.
[0018] In a possible implementation, a BiGRU model optimized by the fishing optimization algorithm performs preliminary prediction on the data set required for wind power prediction, including:
[0019] Divide the data set required for wind power prediction into a training set and a test set;
[0020] Based on the training set, the BiGRU model optimized by the fishing optimization algorithm is trained to obtain a trained BiGRU model;
[0021] A preliminary prediction is made on the test set based on the trained BiGRU model.
[0022] In a possible implementation, the short-term wind power forecasting method further includes:
[0023] An error analysis is performed based on the wind power prediction value and the true label corresponding to the test set. When the error analysis result does not meet the preset requirements, the exploration phase and the development phase are repeated to readjust the optimal hyperparameters of the BiGRU model optimized by the fishing optimization algorithm, and the readjusted BiGRU model is retrained.
[0024] In one possible implementation, the environment variables are weighted in combination with the attention mechanism, including:
[0025] Determining the cosine similarity between the error sequences of the collected environmental variables and the preliminary prediction results;
[0026] Normalizing the cosine similarity to obtain the attention mechanism weight;
[0027] The environment variables are weighted based on the attention mechanism weights.
[0028] In a possible implementation, obtaining a wind power prediction value based on the preliminary prediction result and the error correction result includes:
[0029] The preliminary prediction result and the error correction result are weighted and summed through a sliding window weight allocator to obtain a wind power prediction value.
[0030] In a possible implementation, the preliminary prediction result and the error correction result are weighted and summed by a sliding window weight allocator to obtain a wind power prediction value, including:
[0031] Constructing a weighted sum model of the preliminary prediction result and the error correction result; the weighted sum model includes: a first weight coefficient corresponding to the preliminary prediction result, a second weight coefficient corresponding to the error correction result, and a model bias coefficient;
[0032] Based on the preliminary prediction results and error correction results of the previous time window, a sliding window weight allocator is constructed, and the sliding window weight allocator is solved using a fishing optimization algorithm to obtain the first weighting coefficient, the second weighting coefficient and the model bias coefficient corresponding to the weighted sum model of the current time window;
[0033] Based on the first weighting coefficient, the second weighting coefficient and the model bias coefficient corresponding to the weighted summation model of the current time window, the preliminary prediction result and the error correction result of the current time window are weighted summed to obtain the wind power prediction value of the current time window.
[0034] On the other hand, the present invention also provides a short-term wind power prediction device, comprising:
[0035] A data acquisition module, used to acquire an initial data set based on historical wind power data and related meteorological data;
[0036] A preprocessing module, used to preprocess the initial data set to generate a data set required for wind power prediction;
[0037] The preliminary prediction module is used to make preliminary predictions on the data set required for wind power prediction based on the BiGRU model optimized by the fishing optimization algorithm, so as to capture the fluctuation characteristics of wind power and obtain preliminary prediction results and error sequences of preliminary prediction results;
[0038] An error prediction module is used to weight the environmental variables in combination with the attention mechanism, and input the weighted environmental variables and the error sequence of the preliminary prediction results into the BiGRU model optimized by the fishing optimization algorithm to obtain an error correction result;
[0039] The power prediction module is used to obtain a wind power prediction value based on the preliminary prediction result and the error correction result.
[0040] On the other hand, the present invention also provides an electronic device, including a memory and a processor, wherein:
[0041] The memory is used to store programs;
[0042] The processor is coupled to the memory and is used to execute the program stored in the memory to implement the steps of the short-term wind power prediction method as described in any one of the above.
[0043] On the other hand, the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, wherein when the computer program is executed by a processor, the steps of the short-term wind power prediction method as described in any one of the above items are implemented.
[0044] The beneficial effects of adopting the above-mentioned implementation method are: the short-term wind power prediction method, device, electronic device and storage medium provided by the present invention, the method performs preliminary prediction on the data set required for wind power prediction based on the BiGRU model optimized by the fishing optimization algorithm to capture the fluctuation characteristics of wind power, and obtain preliminary prediction results and the error sequence of the preliminary prediction results; the environmental variables are weighted in combination with the attention mechanism, and the weighted environmental variables and the error sequence of the preliminary prediction results are input into the BiGRU model optimized by the fishing optimization algorithm to obtain the error correction result; based on the preliminary prediction result and the error correction result, the wind power prediction value is obtained.
[0045] The present invention adopts a two-stage prediction framework, that is, a preliminary prediction is first performed through the BiGRU model optimized by the fishing optimization algorithm, and then the weighted environmental variables and the error sequence of the preliminary prediction results are input into the BiGRU model optimized by the fishing optimization algorithm to obtain the error correction result, and the preliminary prediction result is combined with the error correction result considering environmental factors to improve the accuracy and adaptability of the prediction. Secondly, traditional models often rely on manual parameter adjustment, which is inefficient and easy to fall into local optimal solutions. To this end, the present invention introduces a BiGRU model combined with a fishing optimization algorithm, and optimizes the hyperparameters of the BiGRU model through the fishing optimization algorithm, thereby improving the prediction efficiency and accuracy and avoiding the influence of the local optimal problem. Therefore, the present invention can solve the technical problem that the existing short-term wind power prediction method is difficult to fully capture its complex dynamic changes, resulting in low prediction accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the following briefly introduces the drawings required for use in the description of the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.
[0047] Figure 1 A flow chart of an embodiment of a short-term wind power prediction method provided by the present invention;
[0048] Figure 2 A flow chart of another embodiment of the short-term wind power prediction method provided by the present invention;
[0049] Figure 3 A prediction effect diagram of a real data set of a wind farm provided by the present invention;
[0050] Figure 4 A principle block diagram of an embodiment of a short-term wind power prediction device provided by the present invention;
[0051] Figure 5 A schematic structural diagram of an embodiment of an electronic device provided by the present invention. DETAILED DESCRIPTION
[0052] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0053] In the description of the embodiments of the present application, unless otherwise specified, “plurality” means two or more than two.
[0054] The terms "including" and "having" and any variations thereof in the embodiments of the present invention are intended to cover non-exclusive inclusions. For example, a process, method, apparatus, product or equipment comprising a series of steps or modules is not necessarily limited to those steps or modules clearly listed, but may include other steps or modules not clearly listed or inherent to these processes, methods, products or equipment.
[0055] The naming or numbering of the steps in the embodiments of the present invention does not mean that the steps in the method flow must be executed in the time / logical sequence indicated by the naming or numbering. The execution order of the named or numbered process steps can be changed according to the technical purpose to be achieved, as long as the same or similar technical effects can be achieved.
[0056] Reference to an "embodiment" herein means that a particular feature, structure, or characteristic described in conjunction with the embodiment may be included in at least one embodiment of the present invention. The appearance of the phrase in various places in the specification does not necessarily refer to the same embodiment, nor is it an independent or alternative embodiment that is mutually exclusive with other embodiments. It is explicitly and implicitly understood by those skilled in the art that the embodiments described herein may be combined with other embodiments.
[0057] The present invention provides a short-term wind power prediction method, device, electronic device and storage medium, which are respectively described below.
[0058] like Figure 1 As shown, the present invention provides a short-term wind power prediction method, comprising:
[0059] S101, obtaining an initial data set constructed based on historical wind power data and related meteorological data;
[0060] S102, preprocessing the initial data set to generate a data set required for wind power prediction;
[0061] S103, performing preliminary prediction on the data set required for wind power prediction based on the BiGRU model optimized by the fishing optimization algorithm to capture the fluctuation characteristics of wind power and obtain preliminary prediction results and error sequences of the preliminary prediction results;
[0062] S104, weighting the environmental variables in combination with the attention mechanism, inputting the weighted environmental variables and the error sequence of the preliminary prediction results into the BiGRU model optimized by the fishing optimization algorithm to obtain an error correction result;
[0063] S105. Obtain a wind power prediction value based on the preliminary prediction result and the error correction result.
[0064] It is understandable that the short-term in the short-term wind power forecasting method of the present invention generally refers to 15 minutes to 1 hour. The BiGRU model consists of two directional GRU (Gated Recurrent Unit) networks, one network processes time series data from front to back, and the other network processes time series data from back to front. This bidirectional structure can capture past and future information at the same time, thereby more comprehensively modeling the temporal relationship in time series data. In the BiGRU model, each GRU unit has an update gate and a reset gate to control the flow of information.
[0065] The present invention adopts a two-stage prediction framework, combining the preliminary prediction results with the error correction results obtained by considering environmental factors to improve the accuracy and adaptability of the prediction. Secondly, traditional models often rely on manual parameter adjustment, which is inefficient and easy to fall into local optimal solutions. To this end, the present invention introduces a combined model combined with a fishing optimization algorithm, and optimizes the model hyperparameters through the fishing optimization algorithm, thereby improving the prediction efficiency and accuracy and avoiding the influence of local optimal problems. Finally, in the traditional two-stage prediction model, the prediction results of the two stages are usually simply combined by linear addition. In order to further ensure that the contribution of the predictions of each stage to the final result is optimally weighted, the present invention constructs a sliding window weight allocator that takes into account the time scale, which can dynamically adjust the weighting coefficient of the prediction value of each window, thereby improving the reliability and accuracy of the prediction.
[0066] In some embodiments, optimizing the BiGRU model based on a fishing optimization algorithm includes:
[0067] Initialize the hyperparameters of the BiGRU model and determine the search space corresponding to the optimization target;
[0068] Initializing the total number of fishermen and the maximum number of iterations in the fishing optimization algorithm, and randomly generating fisherman positions corresponding to the total number of fishermen in the search space;
[0069] In the exploration phase, the fishermen's positions in the search space are updated based on independent search and group fishing;
[0070] In the development stage, the fishermen's positions are updated with reference to the distribution of fishermen, which is centered on the fish school and gradually becomes sparser from the middle to the periphery;
[0071] The exploration phase and the development phase are repeated until the number of iterations reaches the maximum number of iterations or the fitness meets the preset standard, and the hyperparameters are updated based on the updated fishermen's positions in the search space to obtain the optimal hyperparameters of the BiGRU model.
[0072] In a possible implementation, a BiGRU model optimized by the fishing optimization algorithm performs preliminary prediction on the data set required for wind power prediction, including:
[0073] Divide the data set required for wind power prediction into a training set and a test set;
[0074] Based on the training set, the BiGRU model optimized by the fishing optimization algorithm is trained to obtain a trained BiGRU model;
[0075] A preliminary prediction is made on the test set based on the trained BiGRU model.
[0076] The short-term wind power prediction method further includes:
[0077] An error analysis is performed based on the wind power prediction value and the true label corresponding to the test set. When the error analysis result does not meet the preset requirements, the exploration phase and the development phase are repeated to readjust the optimal hyperparameters of the BiGRU model optimized by the fishing optimization algorithm, and the readjusted BiGRU model is retrained.
[0078] In some embodiments, the short-term wind power forecasting method further includes:
[0079] When the error analysis result meets the preset requirements, the wind power prediction value is determined to be the final wind power prediction result.
[0080] In some embodiments, the environment variables are weighted in conjunction with an attention mechanism, including:
[0081] Determining the cosine similarity between the error sequences of the collected environmental variables and the preliminary prediction results;
[0082] Normalizing the cosine similarity to obtain the attention mechanism weight;
[0083] The environment variables are weighted based on the attention mechanism weights.
[0084] In some embodiments, obtaining a wind power prediction value based on the preliminary prediction result and the error correction result includes:
[0085] The preliminary prediction result and the error correction result are weighted and summed through a sliding window weight allocator to obtain a wind power prediction value.
[0086] In some embodiments, the preliminary prediction result and the error correction result are weighted and summed by a sliding window weight allocator to obtain a wind power prediction value, including:
[0087] Constructing a weighted sum model of the preliminary prediction result and the error correction result; the weighted sum model includes: a first weight coefficient corresponding to the preliminary prediction result, a second weight coefficient corresponding to the error correction result, and a model bias coefficient;
[0088] Based on the preliminary prediction results and error correction results of the previous time window, a sliding window weight allocator is constructed, and the sliding window weight allocator is solved using a fishing optimization algorithm to obtain the first weighting coefficient, the second weighting coefficient and the model bias coefficient corresponding to the weighted sum model of the current time window;
[0089] Based on the first weighting coefficient, the second weighting coefficient and the model bias coefficient corresponding to the weighted summation model of the current time window, the preliminary prediction result and the error correction result of the current time window are weighted summed to obtain the wind power prediction value of the current time window.
[0090] In some embodiments, the present invention provides a two-stage short-term wind power forecasting method based on deep learning, fishing optimization algorithm, and sliding window allocator, comprising the following steps:
[0091] Collect historical wind power data and related meteorological data (such as wind speed, wind direction, temperature, etc.) and integrate them to obtain the initial data set for wind power forecasting.
[0092] The initial data set is preprocessed to generate a data set required for wind power prediction, and is divided into a training set and a test set.
[0093] In the preliminary prediction stage, the BiGRU model optimized by the fishing optimization algorithm (CFOA) is used to make preliminary predictions on the data set to capture the main fluctuation characteristics of wind power.
[0094] In the error prediction stage, the importance of environmental variables is weighted by combining the attention mechanism. The processed weighted environmental variables and the error sequence generated in the preliminary prediction stage are input into the CFOA-optimized BiGRU model for error prediction. This stage can further improve the model's ability to capture wind power changes, especially the correction of abnormal fluctuations.
[0095] The preliminary prediction results and the error correction results are weighted and summed through the sliding window weight distributor to generate the final wind power prediction value. The high accuracy and robustness of the final result are guaranteed by dynamically optimizing the weighting coefficient.
[0096] Perform error analysis based on the final prediction results and the actual values of the test set. If the error is within an acceptable range, complete model training and prediction. If the error is large, readjust the model parameters and iterate the training until the prediction accuracy meets the requirements.
[0097] In some embodiments, Figure 2 As shown, the short-term wind power forecasting method includes:
[0098] Step 210: Collect historical wind power data and related meteorological data (including wind speed, wind direction, temperature, humidity, and air pressure), and integrate them to obtain an initial data set for wind power prediction.
[0099] Step 220: Preprocess the initial data set. First, use the mean interpolation method to process the missing values in the data to ensure data integrity. Then divide the processed data set into a training set and a test set in a ratio of 8:2, with 80% of the data used for model training and 20% of the data used for model verification to ensure that the model has sufficient training data and good generalization ability.
[0100] Step 230: In the preliminary prediction stage, the BiGRU model optimized by the fishing optimization algorithm (CFOA) is used to train and preliminarily predict the data set to capture the main fluctuation characteristics of wind power. The specific steps are as follows:
[0101] (1) Define the optimization goal and determine the search space: Select hyperparameters suitable for the BiGRU model (such as the number of GRU units, batch size, learning rate, etc.), determine the search space and set the objective function. This invention uses RMSE (root mean square error) as the objective function:
[0102]
[0103] In the formula, Historical wind power data is the preliminary forecast value of wind power.
[0104] (2) Initialize fishermen: set the total number of fishermen N , maximum number of iterations M , randomly generate fisher positions in the search space.
[0105] (3) Exploration stage (m / M<0.5): In the exploration stage, the fishermen’s positions are updated by independent search and group fishing. The independent search update formula is as follows:
[0106]
[0107] in, It is the empirical analysis value obtained by fishermen with any other fishermen as reference objects, and its value range is (-1,1). and Respectively t The worst and best fitness values after a complete position update. T Represents the iteration number of the fisherman's position. and Indicates i Fishermen j Wei Zai T and T +1 position after iteration. is a random number between (0,1). is the Euclidean distance between the individual and the reference object. s for d -dimensional random unit vector.
[0108] The update formula for group fishing is as follows:
[0109]
[0110] In the formula, is the target point of the c group encirclement, and Indicated in T +1 and T After the update, the i A fisherman in j The position in the dimension. is the speed at which fishermen approach the center, and its value range is (0,1). is the moving offset, its value range is (-1,1), and it decreases gradually with the increase of iteration rounds.
[0111] (4) Development stage (m / M ≥ 0.5): In this stage, the distribution of fishermen is as follows: with the fish school as the center, the concentration gradually becomes sparse from the center to the periphery, and the distribution range gradually decreases outward. Fishermen in the center catch the fish school, while fishermen on the periphery catch the escaped fish. The update formula is as follows:
[0112]
[0113] In the formula, GD is the Gaussian distribution function, with a population mean of μ At 0, the population variance As the number of iterations increases from 0 to 1. For the i Fishermen in T +1 updated position. is the matrix of the mean values of the fishermen's centers in each dimension. is the global optimal position, is a random number in [1, 2, 3].
[0114] (5) Repeat the above steps until the predetermined number of iterations is reached or the fitness meets a certain standard.
[0115] (6) The optimal hyperparameters obtained by CFOA are used to set the BiGRU network to complete the preliminary prediction of wind power.
[0116] Step 240: In the error prediction stage, the importance of environmental variables (wind speed, wind direction, temperature, humidity, and air pressure) is weighted by combining the attention mechanism. The processed weighted environmental variables and the error sequence generated in the preliminary prediction stage are input into the CFOA-optimized BiGRU model for error prediction. This stage can further enhance the model's ability to capture wind power changes, especially the correction of abnormal fluctuations. The specific steps are as follows:
[0117] (1) Subtract the initial prediction result (Y) obtained in the first stage from the actual wind power data to obtain the error sequence :
[0118]
[0119] (2) The collected environmental variable data and the error sequence are used to obtain the attention weight through cosine similarity. The cosine similarity calculation formula is:
[0120]
[0121] In the formula, m represents the length of the training set, Indicates i Environmental factors in t The value of the moment, express t The initial prediction error value at time Represents environment variables With error sequence Y 2 cosine similarity.
[0122] (3) The obtained cosine similarity is normalized by the Softmax function to obtain the attention mechanism weight. The Softmax function expression is:
[0123]
[0124] n Indicates the number of input environment variables, wi Indicates i The attention weights of the environment variables are recorded as the weight matrix , and the original environment variable matrix Multiply to get the new training set .
[0125] (4) The new training set Input the BiGRU network optimized by the CFOA algorithm for prediction and obtain the error correction result .
[0126] Step 250: Initial prediction results The error correction result The final wind power forecast value is generated by weighted summation through the sliding window weight distributor. The high accuracy and robustness of the final result are guaranteed by dynamically optimizing the weighting coefficient. The specific steps are as follows:
[0127] (1) Set the time window length Q (the default value of Q is 4 hours), which can be appropriately scaled according to the severity of real-time environmental changes. When wind power fluctuates violently, the window length can be appropriately reduced so that the sliding window weight allocator frequently updates the weights to ensure the accuracy of model prediction. When wind power shows a stable trend, the window length can be appropriately increased to save computing costs while ensuring prediction accuracy.
[0128] (2) Construct a mathematical model for integrating the two-stage prediction results:
[0129]
[0130] In the formula, a , b are the weighted coefficients of the first-stage prediction results and the second-stage prediction results, c is the model bias.
[0131] (3) Extract the two-stage prediction data of the previous window (Q-1 moment) and As the training data of the sliding window weight distributor, and construct the objective function, the formula of the objective function is:
[0132]
[0133] (4) Parameters The optimal solution at time Q-1 is calculated through the fishing optimization algorithm, and this set of parameters is applied to the integration task at the current time Q0 to obtain the forecast data at time Q0, and the actual wind power data at time Q0 is recorded in real time.
[0134] (5) When the next time window Q1 is reached, the above steps are repeated, and the parameters are updated using the two-stage prediction data of the Q0 window and the recorded real power data to complete the prediction task of the subsequent windows.
[0135] Step 260: Perform error analysis based on the final prediction result and the actual value of the test set. If the error is within an acceptable range, the model training and prediction are completed; if the error is large, readjust the model parameters and iterate the training until the prediction result accuracy meets the requirements. The prediction effect diagram of the wind farm real data set is finally obtained as shown in the figure below. Figure 3 shown.
[0136] The present invention has the following beneficial effects:
[0137] The present invention utilizes a fishing optimization algorithm, weighted environmental variables, and a sliding window weight distributor to make the constructed two-stage model more flexible in responding to power fluctuations, significantly improve the accuracy of power prediction, and further improve the stability and robustness of the prediction results.
[0138] like Figure 4 As shown, the present invention also provides a short-term wind power prediction device 400, comprising:
[0139] The data acquisition module 401 is used to acquire an initial data set constructed based on historical wind power data and related meteorological data;
[0140] A preprocessing module 402 is used to preprocess the initial data set to generate a data set required for wind power prediction;
[0141] The preliminary prediction module 403 is used to make a preliminary prediction of the data set required for wind power prediction based on the BiGRU model optimized by the fishing optimization algorithm, so as to capture the fluctuation characteristics of wind power and obtain the preliminary prediction results and the error sequence of the preliminary prediction results;
[0142] The error prediction module 404 is used to weight the environmental variables in combination with the attention mechanism, and input the weighted environmental variables and the error sequence of the preliminary prediction results into the BiGRU model optimized by the fishing optimization algorithm to obtain the error correction result;
[0143] The power prediction module 405 is used to obtain a wind power prediction value based on the preliminary prediction result and the error correction result.
[0144] The short-term wind power prediction device provided in the above embodiment can implement the technical solution described in the above short-term wind power prediction method embodiment. The specific implementation principles of the above modules or units can refer to the corresponding contents in the above short-term wind power prediction method embodiment, which will not be repeated here.
[0145] like Figure 5 As shown, the present invention also provides an electronic device 500. The electronic device 500 includes a processor 501, a memory 502 and a display 503. Figure 5 Only some components of the electronic device 500 are shown, but it should be understood that it is not required to implement all of the components shown, and more or fewer components may be implemented instead.
[0146] In some embodiments, the memory 502 may be an internal storage unit of the electronic device 500, such as a hard disk or memory of the electronic device 500. In other embodiments, the memory 502 may also be an external storage device of the electronic device 500, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the electronic device 500.
[0147] Furthermore, the memory 502 may include both an internal storage unit of the electronic device 500 and an external storage device. The memory 502 is used to store application software installed in the electronic device 500 and various data.
[0148] In some embodiments, the processor 501 may be a central processing unit (CPU), a microprocessor or other data processing chip, used to run program codes or process data stored in the memory 502, such as the short-term wind power prediction method of the present invention.
[0149] In some embodiments, the display 503 may be an LED display, a liquid crystal display, a touch-sensitive liquid crystal display, an OLED (Organic Light-Emitting Diode) touch device, etc. The display 503 is used to display information on the electronic device 500 and to display a visual user interface. The components 501-503 of the electronic device 500 communicate with each other via a system bus.
[0150] In some embodiments of the present invention, when the processor 501 executes the short-term wind power prediction program in the memory 502, the following steps may be implemented:
[0151] Obtain an initial data set based on historical wind power data and related meteorological data;
[0152] Preprocessing the initial data set to generate a data set required for wind power prediction;
[0153] Based on the BiGRU model optimized by the fishing optimization algorithm, a preliminary prediction is made on the data set required for wind power prediction to capture the fluctuation characteristics of wind power and obtain the preliminary prediction results and the error sequence of the preliminary prediction results;
[0154] The environmental variables are weighted in combination with the attention mechanism, and the weighted environmental variables and the error sequence of the preliminary prediction results are input into the BiGRU model optimized by the fishing optimization algorithm to obtain the error correction result;
[0155] Based on the preliminary prediction result and the error correction result, a wind power prediction value is obtained.
[0156] It should be understood that: when the processor 501 executes the short-term wind power prediction program in the memory 502 , in addition to the above functions, other functions may also be implemented, and details may refer to the description of the above corresponding method embodiments.
[0157] Furthermore, the embodiment of the present invention does not specifically limit the type of the electronic device 500 mentioned, and the electronic device 500 may be a portable electronic device such as a mobile phone, a tablet computer, a personal digital assistant (PDA), a wearable device, a laptop computer, etc. Exemplary embodiments of portable electronic devices include but are not limited to portable electronic devices equipped with IOS, Android, Microsoft or other operating systems. The above-mentioned portable electronic device may also be other portable electronic devices, such as a laptop computer with a touch-sensitive surface (e.g., a touch panel). It should also be understood that in some other embodiments of the present invention, the electronic device 500 may not be a portable electronic device, but a desktop computer with a touch-sensitive surface (e.g., a touch panel).
[0158] In another aspect, the present invention further provides a non-transitory computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the short-term wind power prediction method provided by the above methods is implemented, and the method includes:
[0159] Obtain an initial data set based on historical wind power data and related meteorological data;
[0160] Preprocessing the initial data set to generate a data set required for wind power prediction;
[0161] Based on the BiGRU model optimized by the fishing optimization algorithm, a preliminary prediction is made on the data set required for wind power prediction to capture the fluctuation characteristics of wind power and obtain the preliminary prediction results and the error sequence of the preliminary prediction results;
[0162] The environmental variables are weighted in combination with the attention mechanism, and the weighted environmental variables and the error sequence of the preliminary prediction results are input into the BiGRU model optimized by the fishing optimization algorithm to obtain the error correction result;
[0163] Based on the preliminary prediction result and the error correction result, a wind power prediction value is obtained.
[0164] Those skilled in the art will appreciate that all or part of the processes of the above-mentioned embodiments can be implemented by instructing related hardware through a computer program, and the program can be stored in a computer-readable storage medium, wherein the computer-readable storage medium is a disk, an optical disk, a read-only storage memory, or a random access memory, etc.
[0165] The short-term wind power prediction method, device, electronic device and storage medium provided by the present invention are introduced in detail above. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea; at the same time, for technical personnel in this field, according to the idea of the present invention, there will be changes in the specific implementation method and application scope. In summary, the content of this specification should not be understood as a limitation on the present invention.
Claims
1. A short-term wind power prediction method, characterized in that: include: Obtain an initial data set based on historical wind power data and related meteorological data; Preprocessing the initial data set to generate a data set required for wind power prediction; Based on the BiGRU model optimized by the fishing optimization algorithm, a preliminary prediction is made on the data set required for wind power prediction to capture the fluctuation characteristics of wind power and obtain the preliminary prediction results and the error sequence of the preliminary prediction results; The environmental variables are weighted in combination with the attention mechanism, and the weighted environmental variables and the error sequence of the preliminary prediction results are input into the BiGRU model optimized by the fishing optimization algorithm to obtain the error correction result; Based on the preliminary prediction result and the error correction result, a wind power prediction value is obtained; Optimize the BiGRU model based on the fishing optimization algorithm, including: Initialize the hyperparameters of the BiGRU model and determine the search space corresponding to the optimization target; Initializing the total number of fishermen and the maximum number of iterations in the fishing optimization algorithm, and randomly generating fisherman positions corresponding to the total number of fishermen in the search space; In the exploration phase, the fishermen's positions in the search space are updated based on independent search and group fishing; In the development stage, the fishermen's positions are updated with reference to the distribution of fishermen, which is centered on the fish school and gradually becomes sparser from the middle to the periphery; Repeating the exploration phase and the development phase until the number of iterations reaches the maximum number of iterations or the fitness meets the preset standard, updating the hyperparameters based on the updated fisherman positions in the search space to obtain the optimal hyperparameters of the BiGRU model; Based on the preliminary prediction result and the error correction result, a wind power prediction value is obtained, including: The preliminary prediction result and the error correction result are weighted and summed by a sliding window weight allocator to obtain a wind power prediction value; The preliminary prediction result and the error correction result are weighted and summed by a sliding window weight allocator to obtain a wind power prediction value, including: Constructing a weighted sum model of the preliminary prediction result and the error correction result; the weighted sum model includes: a first weight coefficient corresponding to the preliminary prediction result, a second weight coefficient corresponding to the error correction result, and a model bias coefficient; Based on the preliminary prediction results and error correction results of the previous time window, a sliding window weight allocator is constructed, and the sliding window weight allocator is solved using a fishing optimization algorithm to obtain the first weighting coefficient, the second weighting coefficient and the model bias coefficient corresponding to the weighted sum model of the current time window; Based on the first weighting coefficient, the second weighting coefficient and the model bias coefficient corresponding to the weighted summation model of the current time window, the preliminary prediction result and the error correction result of the current time window are weighted summed to obtain the wind power prediction value of the current time window.
2. The short-term wind power prediction method according to claim 1, characterized in that: The BiGRU model optimized by the fishing optimization algorithm makes a preliminary prediction of the data set required for wind power prediction, including: Divide the data set required for wind power prediction into a training set and a test set; Training the BiGRU model optimized by the fishing optimization algorithm based on the training set to obtain a trained BiGRU model; A preliminary prediction is made on the test set based on the trained BiGRU model.
3. The short-term wind power prediction method according to claim 2, characterized in that: Also includes: An error analysis is performed based on the wind power prediction value and the true label corresponding to the test set. When the error analysis result does not meet the preset requirements, the exploration phase and the development phase are repeated to readjust the optimal hyperparameters of the BiGRU model optimized by the fishing optimization algorithm, and the readjusted BiGRU model is retrained.
4. The short-term wind power prediction method according to claim 1, characterized in that: Combine the attention mechanism to weight the environment variables, including: Determining the cosine similarity between the error sequences of the collected environmental variables and the preliminary prediction results; Normalizing the cosine similarity to obtain the attention mechanism weight; The environment variables are weighted based on the attention mechanism weights.
5. A short-term wind power prediction device, characterized in that: include: A data acquisition module, used to acquire an initial data set based on historical wind power data and related meteorological data; A preprocessing module, used to preprocess the initial data set to generate a data set required for wind power prediction; The preliminary prediction module is used to make preliminary predictions on the data set required for wind power prediction based on the BiGRU model optimized by the fishing optimization algorithm, so as to capture the fluctuation characteristics of wind power and obtain preliminary prediction results and error sequences of preliminary prediction results; An error prediction module is used to weight the environmental variables in combination with the attention mechanism, and input the weighted environmental variables and the error sequence of the preliminary prediction results into the BiGRU model optimized by the fishing optimization algorithm to obtain an error correction result; A power prediction module, used for obtaining a wind power prediction value based on the preliminary prediction result and the error correction result; Optimize the BiGRU model based on the fishing optimization algorithm, including: Initialize the hyperparameters of the BiGRU model and determine the search space corresponding to the optimization target; Initializing the total number of fishermen and the maximum number of iterations in the fishing optimization algorithm, and randomly generating fisherman positions corresponding to the total number of fishermen in the search space; In the exploration phase, the fishermen's positions in the search space are updated based on independent search and group fishing; In the development stage, the fishermen's positions are updated with reference to the distribution of fishermen, which is centered on the fish school and gradually becomes sparser from the middle to the periphery; Repeating the exploration phase and the development phase until the number of iterations reaches the maximum number of iterations or the fitness meets the preset standard, updating the hyperparameters based on the updated fisherman positions in the search space to obtain the optimal hyperparameters of the BiGRU model; Based on the preliminary prediction result and the error correction result, a wind power prediction value is obtained, including: The preliminary prediction result and the error correction result are weighted and summed by a sliding window weight allocator to obtain a wind power prediction value; The preliminary prediction result and the error correction result are weighted and summed by a sliding window weight allocator to obtain a wind power prediction value, including: Constructing a weighted sum model of the preliminary prediction result and the error correction result; the weighted sum model includes: a first weight coefficient corresponding to the preliminary prediction result, a second weight coefficient corresponding to the error correction result, and a model bias coefficient; Based on the preliminary prediction results and error correction results of the previous time window, a sliding window weight allocator is constructed, and the sliding window weight allocator is solved using a fishing optimization algorithm to obtain the first weighting coefficient, the second weighting coefficient and the model bias coefficient corresponding to the weighted sum model of the current time window; Based on the first weighting coefficient, the second weighting coefficient and the model bias coefficient corresponding to the weighted summation model of the current time window, the preliminary prediction result and the error correction result of the current time window are weighted summed to obtain the wind power prediction value of the current time window.
6. An electronic device, characterized in that: comprising a memory and a processor, wherein: The memory is used to store programs; The processor is coupled to the memory and is used to execute the program stored in the memory to implement the steps of the short-term wind power prediction method according to any one of claims 1 to 4.
7. A non-transitory computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the short-term wind power prediction method according to any one of claims 1 to 4 are implemented.
Citation Information
Patent Citations
Photovoltaic power generation power prediction method and system based on neural network
CN117117859A
Ultra-short-term wind power prediction method based on primary decomposition and WOA-CNN-BIGRU-Attention
CN118939998A
Cited By
Short-term wind power prediction method and system considering regional and meteorological characteristics
CN121683872A