Short-term wind power prediction method, device and electronic equipment

CN123018781APending Publication Date: 2026-10-30HUANENG GUANGXI CLEAN ENERGY CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611128531.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-28
Publication Date
2026-10-30

AI Technical Summary

Technical Problem

[0003]但是,风电预测的主要困难在于气象与功率数据的高维非线性特征

Benefits of technology

[0025]利用本申请技术方案,将麻雀搜索算法引入并替代传统算法来优化BP神经网络的初始参数,从而构建更稳定、更精确的预测模型,能够提升短期风电功率的预测精度。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123018781A_ABST
    Figure CN123018781A_ABST
Patent Text Reader

Abstract

The application discloses a short-term wind power prediction method, device and electronic equipment, wherein the method comprises the following steps: acquiring historical meteorological data and corresponding wind power data of a wind farm, and obtaining a training set after processing; constructing a BP neural network model; constructing a fitness function, mapping to-be-optimized parameters to spatial position vectors of sparrow individuals in a sparrow population, iteratively updating the spatial positions of discoverers, joiners and sentinels in the sparrow population by using a sparrow search algorithm, and searching for an optimal sparrow individual position corresponding to an optimal fitness value; then, a BP neural network model after optimization of the to-be-optimized parameters is obtained; and the training set is input into the optimized BP neural network model, iterative adjustment is performed, and a short-term wind power prediction model is obtained. The sparrow search algorithm is introduced and replaces a traditional algorithm to optimize initial parameters of the BP neural network, so that a more stable and more accurate prediction model is constructed, and the prediction accuracy of short-term wind power can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of power equipment technology, and in particular to a short-term wind power prediction method, apparatus and electronic equipment. Background Technology

[0002] Among related technologies, wind power prediction methods mainly include continuous prediction, time series analysis, Kalman filtering, and artificial neural network methods. Continuous prediction methods suffer from significant errors and unstable results; time series models (such as ARIMA) and Kalman filtering methods have limitations in handling nonlinearity and complex noise. In recent years, data-driven artificial intelligence algorithms, represented by backpropagation (BP) neural networks, have become the mainstream choice in the field of wind power prediction due to their powerful multidimensional function mapping and complex data analysis capabilities.

[0003] However, the main difficulty in wind power forecasting lies in the high-dimensional nonlinear characteristics of meteorological and power data. Traditional BP neural networks have significant limitations in handling this type of forecasting: because they rely on gradient descent to update weights, the model learning and updating speed is slow, and they are prone to getting trapped in local optima when facing gentle gradients, which directly affects the final forecast accuracy. Summary of the Invention

[0004] This disclosure provides a method, apparatus, and electronic device for short-term wind power prediction, which at least solves the above-mentioned technical problems existing in the prior art.

[0005] According to a first aspect of this application, a short-term wind power prediction method is provided, the method comprising: Historical meteorological data and corresponding wind power data of wind farms are obtained, input feature sequences and output label sequences are constructed, and the training set is obtained after processing. Construct a BP neural network model, determine the number of nodes in the input layer, hidden layer and output layer of the BP neural network model, and use the initial weights and initial thresholds of the BP neural network model as parameters to be optimized; A fitness function with prediction error as the core indicator is constructed; the fitness function is used to evaluate the quality of the spatial position of individual sparrows; the prediction error is the difference between the prediction result of the BP neural network model and the actual power data. The parameters to be optimized are mapped to the spatial location vectors of individual sparrows in the sparrow population. The training set is input into the BP neural network model, and the fitness value of each sparrow is calculated through the sparrow search algorithm. Based on the calculated fitness value, the spatial positions of discoverers, joiners and watchers in the sparrow population are iteratively updated according to the sparrow search algorithm to search for the optimal sparrow individual position corresponding to the optimal fitness value. The optimal sparrow individual position corresponding to the optimal fitness value is assigned as the weight and threshold of the BP neural network model to obtain the BP neural network model after the parameters to be optimized. The training set is input into the optimized BP neural network model, and forward propagation calculation and backward error propagation iterative adjustment are performed based on the training set to obtain a converged short-term wind power prediction model; the short-term wind power prediction model is used to predict short-term wind power.

[0006] In one possible implementation, it further includes: The preprocessed input feature sequence and output label sequence are divided into training set and test set; The test set is input into the short-term wind power prediction model to obtain the predicted wind power value; Error analysis is performed between the predicted wind power value and the actual wind power value to evaluate the predictive performance of the short-term wind power prediction model.

[0007] In one possible implementation, the training set obtained after processing includes: The input feature sequence and output label sequence are normalized to obtain the training set; The input feature sequence consists of historical wind speed, wind direction, and temperature data, and the output label sequence consists of wind power at the corresponding historical moment.

[0008] In one possible implementation, constructing a BP neural network model, determining the number of nodes in the input layer, hidden layer, and output layer of the BP neural network model, and using the initial weights and initial thresholds of the BP neural network model as parameters to be optimized, includes: Based on the input wind speed, wind direction, and temperature, the number of neurons in the input layer of the BP neural network model is set to 3. Set the number of neurons in the hidden layer of the BP neural network model to 5; Based on the output wind power, the number of neurons in the output layer of the BP neural network model is set to 1. Among them, the hidden layer is the first The output of each neuron The calculation formula is:

[0009] Neurons in the output layer Predicted output The calculation method is as follows

[0010] in, The number of neurons in the input layer. Input layer iThe value of each neuron, The number of neurons in the hidden layer. No. i The first neuron to the hidden layer j The connection weights of each neuron For the hidden layer node j The threshold of a neuron; For the hidden layer j From one neuron to the output layer neuron k The connection weights, For output layer neurons k The threshold of a node; and These are the activation functions for the hidden layer and the output layer, respectively.

[0011] In one possible implementation, the fitness function is:

[0012] in, The total number of samples in the training set. For the first q Normalized values ​​of the actual wind power output of each sample The BP neural network corresponding to the current sparrow position vector is the first... q The predicted value for each sample, For the first i The fitness value of each individual.

[0013] In one possible implementation, the spatial location of the finder in the sparrow population is iteratively updated in the following manner:

[0014] in, This represents the current iteration number. This represents the maximum number of iterations. Indicates the first The sparrow in the first Vi in the t +1 generation position; for Random numbers; This is a warning value. This is a safety threshold; For random numbers that follow a normal distribution, It is a matrix of all 1s; The spatial location of newcomers in the sparrow population is updated iteratively using the following method.

[0015] in, For the first The position of the new member in generation t+1 This is the worst position globally at present; A matrix whose elements are randomly set to 1 or -1, and ; This represents the total number of sparrows; The spatial location of watchdogs in a sparrow population is updated iteratively using the following method.

[0016] in, This is the current globally optimal position; These are step size control parameters. It is a random number; This represents the current sparrow fitness value. and These are the current best and worst fitness values ​​globally, respectively. It is a constant.

[0017] In one possible implementation, forward propagation calculations and backpropagation error propagation iterative adjustments are performed to obtain a converged short-term wind power prediction model, including: The training set is input into the BP neural network model to calculate the error, and the gradient descent method is used for backpropagation fine-tuning to update the network parameters, thus obtaining a converged short-term wind power prediction model. Update network parameters using the following method.

[0018]

[0019] in, For error, The set learning rate, and These are the connection weight set and threshold set of the BP neural network model, respectively.

[0020] In one possible implementation, the step of performing error analysis between the predicted wind power value and the actual wind power value to evaluate the predictive performance of the short-term wind power prediction model includes: Calculate the mean absolute error, root mean square error, and coefficient of determination between the predicted wind power value and the actual wind power value; The predictive performance of the short-term wind power prediction model is evaluated based on the mean absolute error, root mean square error, and coefficient of determination.

[0021] According to a second aspect of this application, a short-term wind power prediction device is provided, the device comprising: The data acquisition module is used to acquire historical meteorological data and corresponding wind power data of wind farms, construct input feature sequences and output label sequences, and obtain training sets after processing. The first construction module is used to construct a BP neural network model, determine the number of nodes in the input layer, hidden layer and output layer of the BP neural network model, and use the initial weights and initial thresholds of the BP neural network model as parameters to be optimized. The second construction module is used to construct a fitness function with prediction error as the core indicator; the fitness function is used to evaluate the quality of the spatial position of individual sparrows; the prediction error is the difference between the prediction result of the BP neural network model and the actual power data. The fitness calculation module is used to map the parameters to be optimized to the spatial location vectors of individual sparrows in the sparrow population, input the training set into the BP neural network model, and calculate the fitness value of each sparrow through the sparrow search algorithm. The iterative update module is used to iteratively update the spatial positions of discoverers, joiners and watchers in the sparrow population based on the calculated fitness value and according to the sparrow search algorithm, and to search for the optimal sparrow individual position corresponding to the optimal fitness value. The parameter assignment module is used to assign the optimal sparrow individual position corresponding to the optimal fitness value as the weight and threshold of the BP neural network model, so as to obtain the BP neural network model after the parameters to be optimized. The model output module is used to input the training set into the optimized BP neural network model, perform forward propagation calculation and backpropagation iterative adjustment based on the training set, and obtain a converged short-term wind power prediction model.

[0022] According to a third aspect of this application, an electronic device is provided, comprising: At least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method described in this application.

[0023] According to a fourth aspect of this application, a non-transitory computer-readable storage medium is provided storing computer instructions for causing the computer to perform the methods described in this application.

[0024] According to a fifth aspect of this application, a computer program product is provided, comprising a computer program or instructions that, when executed by a processor, implement the method described in this application.

[0025] By utilizing the technical solution of this application, the sparrow search algorithm is introduced and replaced by the traditional algorithm to optimize the initial parameters of the BP neural network, thereby constructing a more stable and accurate prediction model, which can improve the prediction accuracy of short-term wind power.

[0026] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of this application, nor is it intended to limit the scope of this application. Other features of this application will become readily apparent from the following description. Attached Figure Description

[0027] The above and other objects, features, and advantages of exemplary embodiments of this application will become readily apparent from the following detailed description taken in conjunction with the accompanying drawings. Several embodiments of this application are illustrated in the drawings by way of example and not limitation, in which: In the accompanying drawings, the same or corresponding reference numerals indicate the same or corresponding parts.

[0028] Figure 1 A flowchart illustrating the short-term wind power prediction method in an embodiment of this application is shown; Figure 2 A block diagram illustrating the implementation of the short-term wind power prediction device in an embodiment of this application is shown. Figure 3 A schematic diagram of the composition structure of the electronic device in an embodiment of this application is shown. Detailed Implementation

[0029] To make the objectives, features, and advantages of this application more apparent and understandable, the technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0030] In the following description, the terms "first" and "second" are used merely to distinguish similar objects and do not represent a specific ordering of objects. It is understood that "first" and "second" may be interchanged in a specific order or sequence where permitted, so that the embodiments of this application described herein can be implemented in an order other than that illustrated or described herein.

[0031] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs. The terminology used herein is for the purpose of describing embodiments of this application only and is not intended to limit this application.

[0032] The following description, in conjunction with the accompanying drawings, introduces a short-term wind power prediction method, apparatus, and electronic equipment provided in this application.

[0033] like Figure 1 As shown, this application provides a short-term wind power prediction method, the method comprising: S101: Obtain historical meteorological data and corresponding wind power data of the wind farm, construct input feature sequence and output label sequence, and obtain training set after processing; This application collects historical meteorological data and corresponding actual wind power data from coastal wind farms. This is because wind power is affected by the coupling of multiple meteorological factors.

[0034] In some embodiments, the training set obtained after processing includes: The input feature sequence and output label sequence are normalized to obtain the training set; The input feature sequence consists of historical wind speed, wind direction, and temperature data, and the output label sequence consists of wind power at the corresponding historical moment.

[0035] It should be noted that in this application, the historical wind speed, wind direction and temperature are selected as input feature variables, the corresponding actual wind power is selected as output variable, and the constructed sequence dataset is divided into a training set for model learning and a test set for accuracy verification.

[0036] In some embodiments, the training set obtained after processing includes: The input feature sequence and output label sequence are normalized to obtain the training set; The input feature sequence consists of historical wind speed, wind direction, and temperature data, and the output label sequence consists of wind power at the corresponding historical moment.

[0037] In this application, the input historical meteorological data and wind power data need to be normalized. Since wind speed, wind direction, and temperature have different physical dimensions, and historical wind power data often fluctuates significantly, directly inputting them into the back propagation (BP) neural network model may cause the BP neural network model to become overly sensitive to large-value features due to the vast differences in numerical ranges, resulting in gradient explosion or vanishing, thus interfering with the stability of the gradient descent process and slowing down the convergence speed. Normalization maps the data to a unified interval of [0,1], allowing features of different dimensions to be on the same order of magnitude, improving the efficiency of parameter optimization.

[0038] Specifically, the input feature sequence and output label sequence are normalized using the following method:

[0039] in, It is the minimum value in this type of data sequence. The maximum value of this type of data. For the true value of the data, These are the normalized data values.

[0040] S102, Construct a BP neural network model, determine the number of nodes in the input layer, hidden layer and output layer of the BP neural network model, and use the initial weights and initial thresholds of the BP neural network model as parameters to be optimized; It should be noted that a BP neural network is a deep feedforward network with the ability to map multidimensional functions and analyze complex models. Its core principle is to train the BP neural network weights using an error backpropagation algorithm to fit arbitrarily complex nonlinear mapping relationships.

[0041] In some embodiments, the construction of the BP neural network model, determining the number of nodes in the input layer, hidden layer, and output layer of the BP neural network model, and using the initial weights and initial thresholds of the BP neural network model as parameters to be optimized, includes: Based on the input wind speed, wind direction, and temperature, the number of neurons in the input layer of the BP neural network model is set to 3. Set the number of neurons in the hidden layer of the BP neural network model to 5; Based on the output wind power, the number of neurons in the output layer of the BP neural network model is set to 1. Among them, the hidden layer is the first The output of each neuron The calculation formula is:

[0042] Neurons in the output layer Predicted output

[0043]

[0044] in, The number of neurons in the input layer. Input layer i The value of each neuron, The number of neurons in the hidden layer. No. i The first neuron to the hidden layer j The connection weights of each neuron For the hidden layer node j The threshold of a neuron; For the hidden layer j From one neuron to the output layer neuron kThe connection weights, For output layer neurons k The threshold of a node; and These are the activation functions for the hidden layer and the output layer, respectively.

[0045] In this application, the number of neurons in the input layer of the network is set to 3 (corresponding to wind speed, wind direction, and temperature), the number of neurons in the hidden layer is 5, and the number of neurons in the output layer is 1 (corresponding to wind power).

[0046] Traditional backpropagation (BP) neural networks use gradient descent to update weights and thresholds. However, when dealing with non-stationary wind power sequences, they are prone to getting trapped in local optima and the update speed is slow. Therefore, optimization algorithms are needed to find the optimal initial weights and thresholds.

[0047] S103, Construct a fitness function with prediction error as the core indicator; the fitness function is used to evaluate the quality of the spatial position of individual sparrows; the prediction error is the difference between the prediction result of the BP neural network model and the actual power data; In this application, a sparrow search algorithm (SSA) is introduced to optimize a backpropagation (BP) neural network model. The Sparrow Search Algorithm (SSA) is a novel swarm intelligence optimization algorithm inspired by the foraging and anti-predation behaviors of sparrow groups. It has advantages such as fewer parameters, high optimization accuracy, and fast convergence speed. This invention concatenates all initial weights and thresholds of the BP neural network into a multi-dimensional vector, representing the spatial location of individual sparrows. Simultaneously, the mean squared error (MSE) of the training set is used as a fitness function to evaluate the quality of the sparrow's position; a lower fitness indicates better parameters.

[0048] The fitness function is:

[0049] in, The total number of samples in the training set. For the first q Normalized values ​​of the actual wind power output of each sample The BP neural network corresponding to the current sparrow position vector is the first... q The predicted value for each sample, For the first i The fitness value of each individual.

[0050] S104, the parameters to be optimized are mapped to the spatial location vectors of individual sparrows in the sparrow population, the training set is input into the BP neural network model, and the fitness value of each sparrow is calculated by the sparrow search algorithm; The parameters to be optimized are mapped to the spatial location vectors of individual sparrows in the sparrow search algorithm population, where each sparrow corresponds to a set of BP neural network parameters to be optimized. The training set samples are input into the constructed BP neural network model, and the mean squared error (MSE) between the network output and the true label is used as the evaluation criterion. The fitness value corresponding to each sparrow is iteratively calculated using the sparrow search algorithm. During the iterative optimization process, the spatial location of individual sparrows is continuously optimized according to the position update rules of discoverers, followers, and watchers in the sparrow population, achieving adaptive optimization of the BP neural network parameters until the preset iteration termination condition is met, resulting in the optimal combination of network parameters.

[0051] S105. Based on the calculated fitness value, according to the sparrow search algorithm, the spatial positions of discoverers, joiners and watchers in the sparrow population are iteratively updated to search for the optimal sparrow individual position corresponding to the optimal fitness value. During the SSA optimization process, sparrow populations were divided into discoverers, joiners, and vigilants.

[0052] The discoverer is responsible for finding food within the population and providing foraging directions for the entire population. Its location is updated using the following methods:

[0053] in, This represents the current iteration number. This represents the maximum number of iterations. Indicates the first The sparrow in the first Vi in the t +1 generation position; for Random numbers; This is a warning value. This is the safety threshold (usually set to 0.8). For random numbers that follow a normal distribution, It is a matrix of all 1s.

[0054] Newcomers follow the discoverer with the highest fitness level to forage, thereby improving their own fitness. Their location is updated in the following way:

[0055] in, The current position of the best discoverer. This is the worst position globally. A matrix whose elements are randomly set to 1 or -1, and .

[0056] The vigilant (scout) is responsible for monitoring the area. When danger approaches, they quickly move to a safe location. Updates are made using the following methods.

[0057] in, The globally optimal position; These are step size control parameters. for Random numbers; , , These are the fitness values ​​for the current sparrow, the best in the world, and the worst in the world, respectively. This is a very small constant. After the maximum number of iterations, the position of the sparrow with the optimal fitness value is output, which is the optimal initial weight and threshold of the network.

[0058] S106, assign the optimal sparrow individual position corresponding to the optimal fitness value as the weight and threshold of the BP neural network model to obtain the BP neural network model after the optimization of the parameters to be optimized; In this application, the optimal sparrow individual position corresponding to the optimal fitness value is assigned as the weight and threshold of the BP neural network model to complete the global optimization of the parameters to be optimized, thereby obtaining the BP neural network model optimized by the sparrow search algorithm.

[0059] S107, Input the training set into the optimized BP neural network model, and perform forward propagation calculation and backward error propagation iterative adjustment based on the training set to obtain a converged short-term wind power prediction model.

[0060] In some embodiments, forward propagation calculations and backpropagation error propagation iterative adjustments are performed to obtain a converged short-term wind power prediction model, including: The training set is input into the BP neural network model to calculate the error, and the gradient descent method is used for backpropagation fine-tuning to update the network parameters, thus obtaining a converged short-term wind power prediction model. Update network parameters using the following method.

[0061]

[0062] in, For error, The set learning rate, and These are the connection weight set and threshold set of the BP neural network model, respectively.

[0063] In this application, the globally optimal solution output by the SSA algorithm is deconstructed and assigned to a BP neural network as initial parameters. Subsequently, using training set data, with a learning rate of 0.01 and 1000 training iterations, the network parameters are further fine-tuned through backpropagation error until the accuracy requirements are met, thus completing the construction of the SSA-BP model.

[0064] In some embodiments, the short-term wind power prediction method provided in this application further includes: The preprocessed input feature sequence and output label sequence are divided into training set and test set; The test set is input into the short-term wind power prediction model to obtain the predicted wind power value; Error analysis is performed between the predicted wind power value and the actual wind power value to evaluate the predictive performance of the short-term wind power prediction model.

[0065] This application can also input meteorological data from the test set into the trained model, output the predicted wind power, and restore it to the true power level through the inverse normalization formula.

[0066] In some embodiments, the step of performing error analysis between the predicted wind power value and the actual wind power value to evaluate the predictive performance of the short-term wind power prediction model includes: Calculate the mean absolute error, root mean square error, and coefficient of determination between the predicted wind power value and the actual wind power value; The predictive performance of the short-term wind power prediction model is evaluated based on the mean absolute error, root mean square error, and coefficient of determination.

[0067] In this application, to quantify the predictive performance of the present invention, mean absolute error (MAE), root mean square error (RMSE), and coefficient of determination (CQD) are introduced. The accuracy of the prediction is evaluated.

[0068] The mean absolute error is calculated using the following method.

[0069] The root mean square error is calculated using the following method.

[0070] The coefficient of determination is calculated in the following manner.

[0071] in, The total number of samples in the test set. This represents the actual wind power output. These are the model's predicted values. This represents the average value of the actual power.

[0072] The SSA-BP model proposed in this application exhibits extremely low relative error and excellent generalization fitting ability, and the prediction curve can closely match the fluctuation trajectory of actual wind power.

[0073] As an example, historical hourly meteorological data (wind speed, wind direction, temperature) and actual wind power generation data of a coastal wind farm in China were collected in June. Missing and abnormal data in the historical data were cleaned and supplemented. The constructed sequence dataset was divided into a training set for model training and a test set for accuracy verification. The input historical meteorological feature data and wind power data were normalized. Equation (1) was used to map data of different dimensions to a unified interval of [0,1] to eliminate the interference of maxima and minima on the gradient descent of the neural network. A three-layer BP neural network topology was constructed, and the initial connection weights and thresholds of the BP neural network were optimized using the Sparrow Search Algorithm (SSA). The prediction mean square error (MSE) of the training set data was used as the fitness function. The optimal weights and thresholds that minimize the fitness function value were obtained through population iteration. The globally optimal parameters optimized by SSA were deconstructed and replaced with the initial weights and thresholds randomly generated inside the BP neural network. Then, the network was forward calculated and backward fine-tuned using the training set data to complete the construction of the SSA-BP prediction model. Meteorological data from the test set are input into the trained SSA-BP model for prediction. The prediction results output by the network are inversely normalized to obtain the final wind power prediction value. The prediction value is then compared and evaluated with the actual power value using MAE, RMSE, and R² indices.

[0074] In this application, a method based on Sparrow Search Algorithm (SSA) optimized backpropagation (BP) neural network is used for short-term wind power prediction. Considering that wind power is strongly influenced by multiple meteorological factors, exhibiting characteristics such as strong randomness, high volatility, and nonlinearity, a BP neural network with powerful high-dimensional function mapping capabilities is selected for effective power prediction. However, the initial connection weights and thresholds of the BP neural network directly affect the model's convergence speed and prediction performance. Traditional random parameter initialization methods struggle to balance learning efficiency with global optima. When dealing with highly volatile and strongly random wind power sequences, they are prone to getting trapped in local minima, causing the predicted curve to lag significantly behind the actual curve, thus leading to a substantial decrease in prediction accuracy.

[0075] Sparrow Search Algorithm (SSA) is a novel swarm intelligence optimization algorithm inspired by the foraging and anti-predation behaviors of sparrows. It seeks optimal solutions by simulating the collaborative and competitive mechanisms among discoverers, joiners, and watchers within a population. It boasts advantages such as simple principle, few parameters, strong anti-interference ability, strong global search capability, and extremely fast convergence. Optimal initial parameters are more conducive to the neural network escaping local optima traps. Mean Squared Error (MSE) is a global metric for measuring the error of a prediction model, rigorously ensuring the good fit between predicted and actual values. Using MSE as the fitness function for SSA parameter optimization can simultaneously improve the accuracy of parameter optimization direction and the model's fitting ability. Addressing the problems of traditional BP networks, the Sparrow Search Algorithm is used to optimize network parameters, establishing a short-term wind power prediction model based on SSA-BP, improving the effectiveness and response speed of wind power prediction. This method uses real data from coastal wind farms for prediction verification. Compared with traditional BP neural networks and models without efficient optimization algorithms (such as GA-BP and PSO-BP), this application completely corrects the defect of prediction lag, has extremely low relative error and better prediction performance, and has key theoretical significance and practical engineering value.

[0076] like Figure 2 As shown, this application provides a short-term wind power prediction device, the device comprising: The data acquisition module 201 is used to acquire historical meteorological data and corresponding wind power data of wind farms, construct input feature sequences and output label sequences, and obtain training sets after processing. The first construction module 202 is used to construct a BP neural network model, determine the number of nodes in the input layer, hidden layer and output layer of the BP neural network model, and use the initial weights and initial thresholds of the BP neural network model as parameters to be optimized. The second construction module 203 is used to construct a fitness function with prediction error as the core indicator; the fitness function is used to evaluate the quality of the spatial position of individual sparrows; the prediction error is the difference between the prediction result of the BP neural network model and the actual power data; The fitness calculation module 204 is used to map the parameters to be optimized to the spatial location vectors of individual sparrows in the sparrow population, input the training set into the BP neural network model, and calculate the fitness value of each sparrow through the sparrow search algorithm. The iterative update module 205 is used to iteratively update the spatial positions of discoverers, joiners and watchers in the sparrow population based on the calculated fitness value and according to the sparrow search algorithm, and to search for the optimal sparrow individual position corresponding to the optimal fitness value. The parameter assignment module 206 is used to assign the optimal sparrow individual position corresponding to the optimal fitness value as the weight and threshold of the BP neural network model, so as to obtain the BP neural network model after the parameters to be optimized. The model output module 207 is used to input the training set into the optimized BP neural network model, perform forward propagation calculation and backpropagation iterative adjustment based on the training set, and obtain a converged short-term wind power prediction model.

[0077] The short-term wind power prediction device provided in this application includes a data acquisition module 201 that acquires historical meteorological data and corresponding wind power data of a wind farm, constructs an input feature sequence and an output label sequence, and processes them to obtain a training set; a first construction module 202 that constructs a BP neural network model, determines the number of nodes in the input layer, hidden layer, and output layer of the BP neural network model, and uses the initial weights and initial thresholds of the BP neural network model as parameters to be optimized; a second construction module 203 that constructs a fitness function with prediction error as the core indicator; the fitness function is used to evaluate the spatial location of individual sparrows; the prediction error is the difference between the prediction result of the BP neural network model and the actual power data; and a fitness calculation module 204 that maps the parameters to be optimized to the number of sparrows in the sparrow population. The spatial location vector of each sparrow is used as the training set. The training set is then input into the BP neural network model, and the fitness value of each sparrow is calculated using a sparrow search algorithm. The iterative update module 205, based on the calculated fitness value, iteratively updates the spatial locations of discoverers, joiners, and watchers in the sparrow population according to the sparrow search algorithm, searching for the optimal sparrow location corresponding to the optimal fitness value. The parameter assignment module 206 assigns the optimal sparrow location corresponding to the optimal fitness value as the weight and threshold of the BP neural network model, obtaining the BP neural network model optimized by the parameters to be optimized. The model output module 207 inputs the training set into the optimized BP neural network model, performs forward propagation calculations and backpropagation iterative adjustments based on the training set, and obtains a converged short-term wind power prediction model.

[0078] According to embodiments of this application, this application also provides an electronic device and a readable storage medium.

[0079] The electronic device includes at least one processor and a memory communicatively connected to the at least one processor. The memory stores instructions executable by the at least one processor, which, when executed, enable the at least one processor to perform the short-term wind power forecasting method described in this application. The computer instructions are used to cause the computer to perform the short-term wind power forecasting method described in this application.

[0080] This application also provides a computer program product, including a computer program / instructions, which, when executed by a processor, implement the short-term wind power prediction method of this application.

[0081] Figure 3 A schematic block diagram of an example electronic device 800 that can be used to implement embodiments of this application is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device may also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the application described and / or claimed herein.

[0082] like Figure 3 As shown, the electronic device 800 includes a computing unit 801, which can perform various appropriate actions and processes based on a computer program stored in a read-only memory (ROM) 802 or a computer program loaded from a storage unit 808 into a random access memory (RAM) 803. The RAM 803 may also store various programs and data required for the operation of the electronic device 800. The computing unit 801, ROM 802, and RAM 803 are interconnected via a bus 804. An input / output (I / O) interface 805 is also connected to the bus 804.

[0083] Multiple components in electronic device 800 are connected to I / O interface 805, including: input unit 806, such as keyboard, mouse, etc.; output unit 807, such as various types of displays, speakers, etc.; storage unit 808, such as disk, optical disk, etc.; and communication unit 809, such as network card, modem, wireless transceiver, etc. Communication unit 809 allows electronic device 800 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0084] The computing unit 801 can be a variety of general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of the computing unit 801 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, a digital signal processor (DSP), and any suitable processor, controller, microcontroller, etc. The computing unit 801 performs the various methods and processes described above, such as the short-term wind power prediction method. For example, in some embodiments, the short-term wind power prediction method may be implemented as a computer software program tangibly contained in a machine-readable medium, such as storage unit 808. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 800 via ROM 802 and / or communication unit 809. When the computer program is loaded into RAM 803 and executed by the computing unit 801, one or more steps of the short-term wind power prediction method described above may be performed. Alternatively, in other embodiments, the computing unit 801 may be configured to perform the short-term wind power prediction method by any other suitable means (e.g., by means of firmware).

[0085] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0086] The program code used to implement the methods of this application may be written in any combination of one or more programming languages. This program code may be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing device, such that when executed by the processor or controller, the functions / operations specified in the flowcharts and / or block diagrams are implemented. The program code may be executed entirely on a machine, partially on a machine, as a standalone software package partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0087] In the context of this application, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. Machine-readable media can be, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0088] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor); and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the computer. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0089] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as a data server), or computing systems that include middleware components (e.g., an application server), or computing systems that include frontend components (e.g., a user computer with a graphical user interface or web browser through which a user can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., a communication network). Examples of communication networks include local area networks (LANs), wide area networks (WANs), and the Internet.

[0090] Computer systems can include clients and servers. Clients and servers are generally located far apart and typically interact via communication networks. Client-server relationships are created by computer programs running on the respective computers and having a client-server relationship with each other. Servers can be cloud servers, servers in distributed systems, or servers incorporating blockchain technology.

[0091] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.

Claims

1. A short-term wind power prediction method, characterized in that, The method includes: Historical meteorological data and corresponding wind power data of wind farms are obtained, input feature sequences and output label sequences are constructed, and the training set is obtained after processing. Construct a BP neural network model, determine the number of nodes in the input layer, hidden layer and output layer of the BP neural network model, and use the initial weights and initial thresholds of the BP neural network model as parameters to be optimized; A fitness function with prediction error as the core indicator is constructed; the fitness function is used to evaluate the quality of the spatial position of individual sparrows; the prediction error is the difference between the prediction result of the BP neural network model and the actual power data. The parameters to be optimized are mapped to the spatial location vectors of individual sparrows in the sparrow population. The training set is input into the BP neural network model, and the fitness value of each sparrow is calculated through the sparrow search algorithm. Based on the calculated fitness value, the spatial positions of discoverers, joiners and watchers in the sparrow population are iteratively updated according to the sparrow search algorithm to search for the optimal sparrow individual position corresponding to the optimal fitness value. The optimal sparrow individual position corresponding to the optimal fitness value is assigned as the weight and threshold of the BP neural network model to obtain the BP neural network model after the parameters to be optimized. The training set is input into the optimized BP neural network model, and forward propagation calculation and backward error propagation iterative adjustment are performed based on the training set to obtain a converged short-term wind power prediction model; the short-term wind power prediction model is used to predict short-term wind power.

2. The method according to claim 1, characterized in that, Also includes: The preprocessed input feature sequence and output label sequence are divided into training set and test set; The test set is input into the short-term wind power prediction model to obtain the predicted wind power value; Error analysis is performed between the predicted wind power value and the actual wind power value to evaluate the predictive performance of the short-term wind power prediction model.

3. The method according to claim 1, characterized in that, The training set obtained after processing includes: The input feature sequence and output label sequence are normalized to obtain the training set; The input feature sequence consists of historical wind speed, wind direction, and temperature data, and the output label sequence consists of wind power at the corresponding historical moment.

4. The method according to claim 3, characterized in that, The construction of the BP neural network model, including determining the number of nodes in the input, hidden, and output layers, and using the initial weights and initial thresholds of the BP neural network model as parameters to be optimized, includes: Based on the input wind speed, wind direction, and temperature, the number of neurons in the input layer of the BP neural network model is set to 3. Set the number of neurons in the hidden layer of the BP neural network model to 5; Based on the output wind power, the number of neurons in the output layer of the BP neural network model is set to 1; Among them, the hidden layer is the first The output of each neuron The calculation formula is: Neurons in the output layer Predicted output The calculation formula is: in, The number of neurons in the input layer. Input layer i The value of each neuron, The number of neurons in the hidden layer. For the input layer i The first neuron to the hidden layer j The connection weights of each neuron For the hidden layer node j The threshold of a neuron; For the hidden layer j From one neuron to the output layer neuron k The connection weights, For output layer neurons k The threshold of a node; and These are the activation functions for the hidden layer and the output layer, respectively.

5. The method according to claim 1, characterized in that, The fitness function is: in, The total number of samples in the training set. For the first q Normalized values ​​of the actual wind power output of each sample The BP neural network corresponding to the current sparrow position vector is the first... q The predicted value for each sample, For the first i The fitness value of each individual.

6. The method according to claim 1, characterized in that, The spatial location of the discoverer in the sparrow population is updated iteratively using the following method. in, This represents the current iteration number. This represents the maximum number of iterations. Indicates the first The sparrow in the first Vi in the t +1 generation position; for Random numbers; This is a warning value. This is a safety threshold; For random numbers that follow a normal distribution, It is a matrix of all 1s; The spatial location of newcomers in the sparrow population is updated iteratively using the following method. in, For the first The position of the new member in generation t+1 This is the worst position globally at present; A matrix whose elements are randomly set to 1 or -1, and ; This represents the total number of sparrows; The spatial location of watchdogs in a sparrow population is updated iteratively using the following method. in, This is the current globally optimal position; These are step size control parameters. It is a random number; This represents the current sparrow fitness value. and These are the current best and worst fitness values ​​globally, respectively. It is a constant.

7. The method according to claim 1, characterized in that, The forward propagation calculation and backpropagation error propagation iterative adjustment are performed in the following manner to obtain a converged short-term wind power prediction model, including: The training set is input into the BP neural network model to calculate the error, and the gradient descent method is used for backpropagation fine-tuning to update the network parameters, thus obtaining a converged short-term wind power prediction model. Update network parameters using the following method. in, For error, The set learning rate, and These are the connection weight set and threshold set of the BP neural network model, respectively.

8. The method according to claim 2, characterized in that, The step of performing error analysis between the predicted wind power value and the actual wind power value to evaluate the predictive performance of the short-term wind power prediction model includes: Calculate the mean absolute error, root mean square error, and coefficient of determination between the predicted wind power value and the actual wind power value; The predictive performance of the short-term wind power prediction model is evaluated based on the mean absolute error, root mean square error, and coefficient of determination.

9. A short-term wind power prediction device, characterized in that, The device includes: The data acquisition module is used to acquire historical meteorological data and corresponding wind power data of wind farms, construct input feature sequences and output label sequences, and obtain training sets after processing. The first construction module is used to construct a BP neural network model, determine the number of nodes in the input layer, hidden layer and output layer of the BP neural network model, and use the initial weights and initial thresholds of the BP neural network model as parameters to be optimized. The second construction module is used to construct a fitness function with prediction error as the core indicator; the fitness function is used to evaluate the quality of the spatial position of individual sparrows; the prediction error is the difference between the prediction result of the BP neural network model and the actual power data. The fitness calculation module is used to map the parameters to be optimized to the spatial location vectors of individual sparrows in the sparrow population, input the training set into the BP neural network model, and calculate the fitness value of each sparrow through the sparrow search algorithm. The iterative update module is used to iteratively update the spatial positions of discoverers, joiners and watchers in the sparrow population based on the calculated fitness value and according to the sparrow search algorithm, and to search for the optimal sparrow individual position corresponding to the optimal fitness value. The parameter assignment module is used to assign the optimal sparrow individual position corresponding to the optimal fitness value as the weight and threshold of the BP neural network model, so as to obtain the BP neural network model after the parameters to be optimized. The model output module is used to input the training set into the optimized BP neural network model, perform forward propagation calculation and backpropagation iterative adjustment based on the training set, and obtain a converged short-term wind power prediction model.

10. An electronic device, characterized in that, At least one processor; and a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor to enable the at least one processor to perform the method according to any one of claims 1 to 8.