Wind power prediction method and system based on improved sparrow algorithm
By introducing Tent chaos and Gaussian mutation into the sparrow search algorithm, the problem that the algorithm is prone to fall into local extreme values is solved, and the accuracy and stability of wind power prediction are improved.
Patent Information
- Application Number
- CN202411374396.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-29
- Publication Date
- 2025-03-21
AI Technical Summary
In the later stage of finding the best, the traditional sparrow search algorithm is prone to fall into local extreme values, losing overall diversity, resulting in inaccurate wind power power prediction results.
Tent chaos and Gaussian mutation are introduced into the sparrow search algorithm, the initial population position is determined through Tent chaos, and the individual position is changed through Gaussian mutation or Tent chaos when the population accumulates or diverges to avoid local optimal solutions.
It improves the accuracy and stability of the wind power prediction model, enhances the global search capability and diversity of the algorithm, and effectively breaks out of the local optimal solution.
Smart Images

Figure CN119670799A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of wind power generation, and in particular to a wind power prediction method and system based on an improved sparrow algorithm. Background Art
[0002] With the proposal of the dual carbon goals, the installed capacity of new energy sources has gradually increased, and the research methods of power prediction have become particularly important. The Sparrow Search Algorithm (SSA) is a new type of swarm intelligence optimization algorithm. SSA is inspired by the foraging behavior of sparrow populations. The algorithm simulates the behavioral characteristics of sparrow populations in the process of foraging and defense. The research methods of wind power prediction can be mainly divided into the extraction of data features, the improvement of prediction models, the improvement of parameter optimization intelligent optimization algorithms, and the combination of different neural networks. Whether it is the improvement of prediction models, the improvement of intelligent optimization algorithms and the combination of different neural networks, there may be problems of model overfitting and the possibility of the model falling into a minimum point.
[0003] The traditional sparrow search algorithm is prone to fall into local extreme values in the later stage of optimization, losing the overall diversity, resulting in inaccurate final results. In order to solve the problem that SSA is prone to fall into local optimality, this paper proposes an improved sparrow search algorithm (ISSA). Tent chaos and Gaussian mutation are introduced into SSA. First, Tent chaos is used to determine the initial population, and the advantages of uniform distribution and strong global search ability of Tent chaotic sequence are brought into play to optimize the initial position of the sparrow population; when the sparrow population "aggregates" or "diverges", Gaussian mutation or Tent chaos is used to change the position of individuals in the population so that they can obtain better fitness values, thereby achieving a jump out of the local optimal solution. Summary of the invention
[0004] In view of the problem that the traditional sparrow search algorithm is prone to fall into local extreme values in the late stage of optimization and loses the overall diversity, the present invention is proposed.
[0005] Therefore, the technical problem solved by the present invention is: introducing Tent chaos and Gaussian variation into the sparrow search algorithm, so that the wind power prediction model jumps out of the local optimum and finds a better global solution, thereby improving the accuracy and stability of wind power prediction.
[0006] To solve the above technical problems, the present invention provides the following technical solutions: collect and preprocess historical operation data of wind farms to construct a wind power prediction model; introduce Tent chaotic mapping into the traditional sparrow search algorithm, and introduce adaptive parameters into the Tent chaotic mapping to obtain a preliminary improved sparrow search algorithm; integrate the preliminary improved sparrow search algorithm with Gaussian mutation operation to obtain a final improved sparrow search algorithm; use the final improved sparrow search algorithm to optimize the wind power prediction model, and use the optimized wind power prediction model to predict wind power.
[0007] As a preferred solution of the wind power prediction method based on the improved sparrow algorithm of the present invention, wherein: building a wind power prediction model includes, using a machine learning model, dividing the preprocessed wind farm historical operation data into a training set, a validation set and a test set; using the training set to train the machine learning model, using the validation set to evaluate the machine learning model and adjust the machine learning model parameters; using the test set to test the machine learning model after parameter adjustment, and if the set prediction accuracy is met, a wind power prediction model is obtained.
[0008] As a preferred solution of the wind power prediction method based on the improved sparrow algorithm of the present invention, wherein: the Tent chaotic map is introduced into the traditional sparrow search algorithm, and the expression of the Tent chaotic map is as follows:
[0009]
[0010] Among them, z i+1 represents the state value of the next time step, z i Represents the state value of the current time step, and z represents the state variable. Adding random quantity to the Tent map, the expression of the updated Tent chaotic map is as follows:
[0011]
[0012] Among them, z i+1 represents the state value of the next time step, z i Represents the state value of the current time step, rand(0,1) represents a random number between [0, 1], which is used to increase the randomness of the chaotic sequence, N T Indicates the number of particles.
[0013] As a preferred solution of the wind power prediction method based on the improved sparrow algorithm of the present invention, wherein: introducing an adaptive parameter in the Tent chaotic map includes: the calculation formula of the adaptive parameter is as follows:
[0014]
[0015] Among them, α(t) represents the adaptive parameter, α max represents the maximum value of the adaptive parameter, α min represents the minimum value of the adaptive parameter, t represents the current number of iterations, T max Represents the maximum number of iterations, and n represents the exponential factor, which controls the speed at which the adaptive parameter decreases. The adaptive parameter is introduced into the updated Tent chaotic mapping formula to obtain the adaptive Tent chaotic mapping. The formula of the adaptive Tent chaotic mapping is as follows:
[0016]
[0017] Among them, z i+1 represents the chaotic sequence value at the next time step, z i represents the state value of the current time step, α(t) represents the adaptive parameter, rand(0,1) represents a random number between [0, 1], which is used to increase the randomness of the chaotic sequence, and N T Indicates the number of particles.
[0018] As a preferred solution of the wind power prediction method based on the improved sparrow algorithm of the present invention, wherein: the positions of the discoverer, the joiner and the scout are updated using an adaptive Tent chaotic map, and for the discoverer:
[0019] X new =X old +β·z i+1 ·α(t)(X best -X old )+γ·z i+1 ·rand(0,1)·(x max -x min )
[0020] Among them, X new represents the individual position after the discoverer updates, z i+1 represents the chaotic sequence value at the next time step, X old represents the current individual position of the discoverer, α(t) represents the adaptive parameter, rand(0,1) represents a random number between [0, 1], and X best represents the optimal solution in the current population, β and γ are control parameters, X min and X max Respectively represent the lower and upper limits of the search space; for joiners:
[0021] X new =X old +η·z i+1 ·α(t)(X random -X old )+δ·(1-z i+1 α(t))rand(0,1)·(x max -x min )
[0022] Among them, X new Indicates the updated position of the joiner, z i+1 represents the chaotic sequence value at the next time step, X old represents the current position of the joiner, α(t) represents the adaptive parameter, X randomrepresents the position of a randomly selected individual in the current population, rand(0,1) represents a random number between [0, 1], η and δ represent control parameters, X min and X max Respectively represent the lower and upper limits of the search space; for the scout:
[0023] X new =X best +ε·z i+1 L (2 rand (0,1) - 1)
[0024] Among them, X new represents the updated position of the scout, z i+1 represents the chaotic sequence value at the next time step, X best represents the optimal solution in the current population, rand(0,1) represents a random number between [0, 1], ε represents a control parameter, and L represents a proportional factor for adjusting the step size, which is used to control the movement amplitude of the scout. The updated positions of the discoverer, joiner, and scout are applied to the traditional sparrow search algorithm to obtain a preliminary improved sparrow search algorithm.
[0025] As a preferred solution of the wind power prediction method based on the improved sparrow algorithm of the present invention, the preliminary improved sparrow search algorithm is integrated with the Gaussian mutation operation, and the formula of Gaussian mutation is as follows:
[0026]
[0027] Gaussian(x)=x+σ·N(0,1)
[0028] Among them, σ represents the current mutation strength, which decreases with the increase of iteration number t, and σ max represents the initial mutation strength, t represents the current number of iterations, T max represents the maximum number of iterations, N(0,1) represents a random number with a mean and standard deviation of 0 and 1 respectively and a normal distribution, Gaussian(x) represents the new position of the sparrow individual after Gaussian mutation, and x represents the current position of the sparrow individual before Gaussian mutation; for each individual sparrow position, including the discoverer, joiner and scout, Gaussian mutation is applied to calculate the new position of each individual; check whether the new position after Gaussian mutation exceeds the boundary of the search space, if so, adjust the new position to the boundary value; compare the fitness before and after Gaussian mutation, and retain the better position; update the individual optimal solution and the global optimal solution until the iteration reaches the termination condition; based on the optimal solution found in the iterative process, determine the final improved sparrow algorithm; use the final improved sparrow algorithm to optimize the parameters of the wind power prediction model to obtain the optimized wind power prediction model.
[0029] As a preferred solution of the wind power prediction method based on the improved sparrow algorithm of the present invention, wherein: using the optimized wind power prediction model to predict wind power includes: selecting feature data according to the optimized wind power prediction model; inputting the selected feature data into the optimized wind power prediction model, running the optimized wind power prediction model, generating a wind power prediction value at a future time point, and generating a wind power prediction result including a point prediction value and a prediction interval.
[0030] Another object of the present invention is to provide a wind power prediction system based on an improved sparrow algorithm, comprising: a model building module, used to collect and preprocess historical operation data of wind farms to build a wind power prediction model; a preliminary improvement module, used to introduce Tent chaotic mapping into a traditional sparrow search algorithm, and introduce adaptive parameters into the Tent chaotic mapping to obtain a preliminary improved sparrow search algorithm; a Gaussian mutation module, used to integrate the preliminary improved sparrow search algorithm with a Gaussian mutation operation to obtain a final improved sparrow search algorithm; a prediction module, used to use the final improved sparrow search algorithm to optimize the wind power prediction model, and use the optimized wind power prediction model to predict wind power.
[0031] A 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 wind power prediction method based on the improved sparrow algorithm are implemented as described above.
[0032] Beneficial effects of the present invention: The present invention successfully solves the problem that the traditional sparrow search algorithm is prone to fall into local optimality through multi-level algorithm improvement and optimization strategies; by introducing Tent chaos mapping and adaptive parameters, the initial population position is optimized and the global search capability is improved; the Gaussian mutation operation is integrated to maintain population diversity and enhance the ability to jump out of the local optimality; the position update strategy of the discoverer, joiner and scout is optimized to achieve more effective search space exploration. These improvement measures work together to act on the optimization process of the wind power prediction model, significantly improving the convergence performance and prediction accuracy of the algorithm. The present invention not only innovatively combines multiple optimization strategies in theory, but also demonstrates excellent performance in practical applications, providing a more reliable and accurate tool for power prediction of wind farms. It helps to improve the operating efficiency of wind farms, optimize power grid scheduling, and provide strong technical support for large-scale grid connection of new energy. It has important practical significance for achieving dual carbon goals and promoting the development of renewable energy. BRIEF DESCRIPTION OF THE DRAWINGS
[0033] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.
[0034] Figure 1 It is a schematic diagram of the structure of the terminal of the present invention;
[0035] Figure 2 It is a schematic diagram of the process of the present invention;
[0036] Figure 3 This is a wind power data set diagram of the present invention;
[0037] Figure 4 A comparison bar chart of evaluation indicators of a single model of the present invention;
[0038] Figure 5 It is a comparison bar chart of evaluation indicators of the model of the present invention;
[0039] Figure 6 This is the comparison chart of wind power generation power of SSA-RES-1DCNN-LSTM-Attention;
[0040] Figure 7 This is the comparison chart of wind power generation power of ISSA-RES-1DCNN-LSTM-Attention;
[0041] Figure 8 A schematic diagram of the structure of a computer device. DETAILED DESCRIPTION
[0042] In order to make the above-mentioned purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are described in detail below in conjunction with the drawings of the specification. Obviously, the described embodiments are part of the embodiments of the present invention, but not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary persons in the art without creative work should fall within the scope of protection of the present invention.
[0043] In the following description, many specific details are set forth to facilitate a full understanding of the present invention, but the present invention may also be implemented in other ways different from those described herein, and those skilled in the art may make similar generalizations without violating the connotation of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below.
[0044] Example 1
[0045] Reference Figure 1, which is an embodiment of the present invention, provides a wind power prediction method based on an improved sparrow algorithm.
[0046] First, the wind power prediction method based on the improved sparrow algorithm provided in this application can be applied to Figure 1 In the terminal shown. Figure 1 As shown, the terminal may include one or two ( Figure 1 Only one is shown in the figure) processor and memory for storing data, wherein the processor may include but is not limited to a processing system such as a microprocessor MCU or a programmable logic device FPGA. The above terminal may also include a transmission device and an input and output device for communication functions. It can be understood by ordinary technicians in this field that Figure 1 The structure shown is only for illustration and does not limit the structure of the above terminal. Figure 1 More or fewer components as shown, or with Figure 1 Different configurations shown.
[0047] The memory can be used to store computer programs, such as the computer program corresponding to the wind power prediction method based on the improved sparrow algorithm in this embodiment. The processor executes various functional applications and data processing by running the computer program stored in the memory, that is, implementing the above method. The memory may include a high-speed random access memory, and may also include a non-volatile memory, such as one or more magnetic storage systems, flash memory, or other non-volatile solid-state memory. In some instances, the memory may further include a memory remotely arranged relative to the processor, and these remote memories may be connected to the terminal via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0048] The transmission device is used to receive or send data via a network. The above network includes a wireless network provided by a communication provider of the terminal. In one example, the transmission device includes a network adapter (Network Interface Controller, referred to as NIC), which can be connected to other network devices through a base station so as to communicate with the Internet. In one example, the transmission device can be a radio frequency (Radio Frequency, referred to as RF) module, which is used to communicate with the Internet wirelessly.
[0049] like Figures 2 to 7 As shown, the embodiment of the present invention provides a wind power prediction method based on the improved sparrow algorithm, and the method is applied to Figure 1 The terminal in is used as an example to illustrate, including the following steps:
[0050] S1: Collect and preprocess historical operation data of wind farms and build a wind power prediction model.
[0051] Specifically, the wind power data set uses the real power generation data of a unit in a wind farm in Shanghai. Real data can more effectively prove the effectiveness of the algorithm model; the data uses data from January 1, 2022 to December 31, 2022. The data sampling time is 1 hour per sampling, there are 24 sampling points in a day, and the data length is 8760 sampling points. The specific data set is shown in the attached manual. Figure 3 shown.
[0052] Furthermore, before the corresponding training task is performed on the acquired data, the acquired data cannot be used directly. For more complex training tasks related to deep learning, such as prediction, classification, recognition, and image processing, the real data directly obtained often has some anomalies. In order to make the computer model understand and easier to perform calculation training, the corresponding acquired data is preprocessed. The purpose of data preprocessing is mainly to convert the acquired raw data set into a clean data set that is easier for the machine to analyze and model.
[0053] Furthermore, using the machine learning model, the preprocessed historical operation data of the wind farm is divided into a training set, a validation set and a test set; the training set is used to train the machine learning model, and the validation set is used to evaluate the machine learning model and adjust the machine learning model parameters; the test set is used to test the machine learning model after parameter adjustment, and if the set prediction accuracy is met, a wind power prediction model is obtained.
[0054] Furthermore, the RES-CNN-LSTM-Attention neural network model based on channel fusion: The wind power prediction model is the main model designed in this study. This paper mainly uses BP, CNN, LSTM, CNN-Attention, LSTM-Attention, serial structure CNN-LSTM-Attention model, and channel fusion CNN-LSTM-Attention model for benchmark model comparison.
[0055] Furthermore, a clear indicator is needed to evaluate the quality of the model. 2 , MAPE to judge the prediction results of the model. The specific single model evaluation index comparison bar chart is as attached in the manual. Figure 4 Specific data are shown in Table 1.
[0056] Table 1 RMSE, MAPE, and R of wind power prediction of a single model 2 Data Sheet
[0057]
[0058] Further, by Figure 4 It can be seen intuitively that the LSTM model has the best evaluation index among the BP model, 1DCNN model, and LSTM model. As can be seen from Table 1, the RMSE value of the LSTM neural network algorithm for predicting wind power data is 30.606 lower than that of the BP neural network, the MAPE value is 0.629% lower, and the R2 is increased by 0.032. Compared with the 1DCNN model neural network, the RMSE value is 20.974 lower, the MAPE value is 0.101% lower, and the R2 is increased by 0.022. This shows that compared with other single neural network models, the LSTM neural network is the most superior in wind power prediction. This also confirms that the LSTM neural network algorithm has a good learning ability for time series and has a good prediction effect on time series data.
[0059] Furthermore, attention mechanism layers are added to different single models and combined models, and the attention mechanism algorithm is used to weight the outputs of different neural networks, so as to re-screen the features extracted by the neural network, retain valid information, and eliminate redundant information, ultimately improving the ability of the network model to predict wind power.
[0060] Furthermore, for different network structures, we explored the impact of different structures on the prediction effect, and proposed the serial structure of the network model, the multi-channel fusion structure, and the structure with jump connections added to the multi-channel fusion structure. Through experimental research, the CNN-LSTM-Attention (convolutional long short-term memory attention mechanism model) based on the jump connection channel fusion structure in the combined neural network has the best effect.
[0061] S2: Introduce Tent chaotic mapping into the traditional sparrow search algorithm, and introduce adaptive parameters into the Tent chaotic mapping to obtain a preliminary improved sparrow search algorithm.
[0062] Specifically, the introduction of Tent chaotic mapping into the traditional sparrow search algorithm includes the following expression of Tent chaotic mapping:
[0063]
[0064] Among them, z i+1 represents the state value of the next time step, z i represents the state value of the current time step, and z represents the state variable.
[0065] Preferably, the introduction of Tent chaotic mapping increases the randomness and diversity of the algorithm, helps to escape from the local optimal solution, and improves the global search ability of the algorithm, so that the algorithm can better explore the solution space.
[0066] Furthermore, random quantities are added to the Tent map, and the expression of the updated Tent chaos map is as follows:
[0067]
[0068] Among them, z i+1 represents the state value of the next time step, z i Represents the state value of the current time step, rand(0,1) represents a random number between [0, 1], which is used to increase the randomness of the chaotic sequence, N T Indicates the number of particles.
[0069] Preferably, adding random variables further enhances the randomness of the algorithm, helps to deal with complex optimization problems, improves the sensitivity of the algorithm to different initial conditions, and increases the diversity of the search.
[0070] Furthermore, the adaptive parameters are introduced into the Tent chaotic map, and the calculation formula of the adaptive parameters is as follows:
[0071]
[0072] Among them, α(t) represents the adaptive parameter, α max represents the maximum value of the adaptive parameter, α min represents the minimum value of the adaptive parameter, t represents the current number of iterations, T max represents the maximum number of iterations, and n represents the exponential factor, which controls the speed at which the adaptive parameters decrease.
[0073] Furthermore, an adaptive parameter is introduced into the updated Tent chaotic mapping formula to obtain an adaptive Tent chaotic mapping; the formula of the adaptive Tent chaotic mapping is as follows:
[0074]
[0075] Among them, z i+1 represents the state value of the next time step, z i represents the state value of the current time step, α(t) represents the adaptive parameter, rand(0,1) represents a random number between [0, 1], which is used to increase the randomness of the chaotic sequence, and N T Indicates the number of particles.
[0076] Furthermore, the introduction of adaptive parameters enables the algorithm to dynamically adjust parameters according to the iterative process, which improves the adaptability of the algorithm. In the early stage of the search, large-scale exploration can be carried out, and in the later stage, fine local search can be carried out, thus balancing exploration and utilization.
[0077] Furthermore, the positions of the discoverer, joiner, and scout are updated using an adaptive tent chaotic map.
[0078] For discoverers:
[0079] X new =X old +β·z i+1 ·α(t)(X best -X old )+γ·z i+1 ·rand(0,1)·(x max -x min )
[0080] Among them, X new represents the individual position after the discoverer updates, z i+1 represents the chaotic sequence value at the next time step, X old represents the current individual position of the discoverer, α(t) represents the adaptive parameter, rand(0,1) represents a random number between [0, 1], and X best represents the optimal solution in the current population, β and γ are control parameters, X min and X max They represent the lower and upper bounds of the search space respectively.
[0081] For those who join:
[0082] X new =X old +η·z i+1 ·α(t)(X random -X old )+δ·(1-z i+1 α(t))rand(0,1)·(x max -x min )
[0083] Among them, X new Indicates the updated position of the joiner, z i+1 represents the chaotic sequence value at the next time step, X old represents the current position of the joiner, α(t) represents the adaptive parameter, X random represents the position of a randomly selected individual in the current population, rand(0,1) represents a random number between [0, 1], η and δ represent control parameters, X min and X max They represent the lower and upper bounds of the search space respectively.
[0084] For scouts:
[0085] X new =X best +ε·z i+1 L (2 rand (0,1) - 1)
[0086] Among them, X new represents the updated position of the scout, z i+1 represents the chaotic sequence value at the next time step, X best represents the optimal solution in the current population, rand(0,1) represents a random number between [0, 1], ε represents the control parameter, and L represents the proportional factor for adjusting the step size, which is used to control the movement amplitude of the scout.
[0087] Preferably, the discoverer, joiner and scout are updated separately, while maintaining the swarm intelligence characteristics of the original SSA, the search capability of each role is enhanced, and the behavior of each role is made more flexible and efficient by introducing adaptive parameters.
[0088] Furthermore, the updated positions of the discoverer, joiner and scout are applied to the traditional sparrow search algorithm to obtain a preliminary improved sparrow search algorithm.
[0089] In summary, the introduction of Tent chaotic mapping into the traditional sparrow search algorithm and the introduction of adaptive parameters into the Tent chaotic mapping not only improve the convergence speed and accuracy of the algorithm, enhance the ability of the algorithm to handle high-dimensional complex optimization problems, improve the stability and robustness of the algorithm, but also achieve the goal of jumping out of the local optimal solution.
[0090] S3: Integrate the Gaussian mutation operation into the preliminary improved sparrow search algorithm to obtain the final improved sparrow search algorithm.
[0091] Specifically, Gaussian mutation is a commonly used mutation operation that can increase the algorithm's exploration ability and help escape from the local optimal solution. The Gaussian mutation operation is integrated into the preliminary improved sparrow search algorithm. The formula for Gaussian mutation is as follows:
[0092]
[0093] Gaussian(x)=x+σ·N(0,1)
[0094] Among them, σ represents the current mutation strength, which decreases with the increase of iteration number t, and σ max represents the initial mutation strength, t represents the current number of iterations, T maxrepresents the maximum number of iterations, N(0,1) represents a random number with a mean and standard deviation of 0 and 1 respectively, and obeys a normal distribution, Gaussian(x) represents the new position of the sparrow individual after Gaussian mutation, and x represents the current position of the sparrow individual before Gaussian mutation.
[0095] Furthermore, applying Gaussian mutation to each individual sparrow position, including the finder, joiner, and scout, and calculating the new position of each individual can increase the diversity of the population and help the algorithm escape from the local optimal solution.
[0096] Furthermore, check whether the new position after Gaussian mutation exceeds the boundary of the search space. If so, adjust the new position to the boundary value, compare the fitness before and after Gaussian mutation, retain the better position, and ensure that the algorithm develops in a better direction; update the individual optimal solution and the global optimal solution until the iteration reaches the termination condition. If the current position is better than the individual's historical best position, update the individual optimal solution; if the current best individual is better than the historical global optimal solution, update the global optimal solution; record the best solution found during the search process to prepare for the final output of the optimal solution.
[0097] Further, the steps of Gaussian mutation are repeated until the preset termination condition is reached, the maximum number of iterations or the convergence threshold is reached, and the setting of the termination condition needs to balance the computational efficiency and the quality of the solution. Based on the optimal solution found in the iterative process, the final improved sparrow algorithm is determined. This final algorithm includes all the improved steps such as initialization, position update, and Gaussian mutation.
[0098] Furthermore, the final improved sparrow algorithm is used to optimize the parameters of the wind power prediction model to obtain an optimized wind power prediction model. The optimized parameters may include the weights of the neural network, the kernel function parameters of the support vector machine, etc.
[0099] In summary, the Gaussian mutation operation introduces randomness, which enables the algorithm to jump out of the local optimal solution and explore a wider search space, which helps to find potential better solutions, especially in complex multi-peak optimization problems. By dynamically adjusting the mutation intensity (σ(t) decreases with the number of iterations), the algorithm has a strong exploration ability in the early stage, and pays more attention to local fine search in the later stage. This balance can speed up the convergence of the algorithm while ensuring the quality of the solution. Finally, the improved sparrow search algorithm can more effectively optimize the parameters of the wind power prediction model, find a better combination of model parameters, and thus improve the performance of the prediction model.
[0100] S4: Use the final improved sparrow search algorithm to optimize the wind power prediction model, and use the optimized wind power prediction model to predict wind power.
[0101] Specifically, using the optimized wind power prediction model to predict wind power includes selecting feature data according to the optimized wind power prediction model; inputting the selected feature data into the optimized wind power prediction model, running the optimized wind power prediction model, generating wind power prediction values at future time points, and generating wind power prediction results including point prediction values and prediction intervals.
[0102] Furthermore, the optimized wind power prediction model is used to perform feature importance analysis: correlation analysis, principal component analysis and other methods can be used to select the features that have the greatest impact on wind power prediction. Possible features include: wind speed, wind direction, temperature, humidity, air pressure, time characteristics (such as hours, dates, seasons), etc.
[0103] Furthermore, the selected feature data is standardized or normalized to make the features of different scales comparable, and the time series data is lagged to create a suitable time window and consider the time correlation of wind power. The pre-processed feature data is input into the optimized wind power prediction model, and the optimized wind power prediction model is run to generate the wind power prediction value at the future time point.
[0104] Example 2
[0105] Reference Figure 1 to Figure 7 , which is the second embodiment of the present invention, provides a wind power prediction system based on an improved sparrow algorithm, comprising:
[0106] Model building module, used to collect and pre-process historical operation data of wind farms and build a wind power prediction model;
[0107] A preliminary improvement module is used to introduce Tent chaotic mapping into the traditional sparrow search algorithm and introduce adaptive parameters into the Tent chaotic mapping to obtain a preliminary improved sparrow search algorithm;
[0108] Gaussian mutation module, used to integrate the preliminary improved sparrow search algorithm with Gaussian mutation operation to obtain the final improved sparrow search algorithm;
[0109] The prediction module is used to optimize the wind power prediction model using the final improved sparrow search algorithm, and predict the wind power using the optimized wind power prediction model.
[0110] For the specific limitations of the wind power prediction system based on the improved sparrow algorithm, please refer to the limitations of the wind power prediction method based on the improved sparrow algorithm in the above text, which will not be repeated here. Each module in the above-mentioned wind power prediction system based on the improved sparrow algorithm can be implemented in whole or in part through software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0111] Example 3
[0112] Reference Figure 8 , which is the third embodiment of the present invention. Based on the first two embodiments, the embodiment of the present invention provides a computer device, which may be a server, and its internal structure diagram may be as shown in FIG. Figure 8 As shown. The computer device includes a processor, a memory and a network interface connected via a system bus. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium.
[0113] The database of the computer device is used to store action detection data. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, the steps in any of the above-mentioned sparse tensor operation acceleration method embodiments are implemented.
[0114] Those skilled in the art will understand that Figure 8 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0115] In one embodiment, an embodiment of the present invention provides a computer-readable storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps in any of the above-mentioned sparse tensor operation acceleration method embodiments are implemented.
[0116] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application may include at least one of non-volatile and volatile memory. Non-volatile memory may include read-only memory (ROM), magnetic tape, floppy disk, flash memory or optical memory, etc. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).
[0117] Example 4
[0118] As an embodiment of the present invention, a wind power prediction method based on an improved sparrow algorithm is provided. In order to verify the beneficial effects of the present invention, a scientific demonstration is carried out through simulation experiments.
[0119] Specifically, after a large number of continuous experiments, the ISSA-RES-1DCNN-LSTM-Attention neural network hyperparameters were finally determined using the improved sparrow optimization algorithm as shown in the following table:
[0120] Table 2 Optimal parameters of ISSA-RES-1DCNN-LSTM-Attention neural network model
[0121]
[0122] Furthermore, the experiments in this paper use RMSE and R 2 , MAPE to judge the prediction results of the model. The specific model evaluation index comparison bar chart is as follows Figure 5 shown.
[0123] Furthermore, this experiment uses RMSE, R2, and MAPE to judge the prediction results of the model. The comparison of the evaluation indicators of the wind power prediction models of RES-1DCNN-LSTM-Attention, SSA-RES-1DCNN-LSTM-Attention, and ISSA-RES-1DCNN-LSTM-Attention is shown in Table 3:
[0124] Table 3 RMSE, MAPE, and R2 values of wind power prediction models
[0125]
[0126] Furthermore, from the data in the table, we can see that compared with the RES-1DCNN-LSTM-Attention neural network, the RMSE value of the SSA-RES-1DCNN-LSTM-Attention neural network for predicting wind power data decreased by 14.171, the MAPE value decreased by 0.013%, and the R2 increased by 0.008. This shows that compared with the particle swarm optimization algorithm, the sparrow search algorithm is better than the particle swarm optimization algorithm in parameter optimization of the network model. Compared with the SSA-RES-1DCNN-LSTM-Attention neural network, the RMSE value of the ISSA-RES-1DCNN-LSTM-Attention neural network for predicting wind power data decreased by 15.64, the MAPE value decreased by 0.034%, and the R2 increased by 0.008. This shows that the improved sparrow search algorithm is better than the sparrow search algorithm before the improvement. See the power generation comparison chart. Figure 6 and Figure 7 .
[0127] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of the present invention, which should all be included in the scope of the claims of the present invention.
Claims
1. A wind power prediction method based on an improved sparrow algorithm, characterized in that: include Collect and preprocess historical operation data of wind farms to build a wind power prediction model; Introducing Tent chaotic mapping into the traditional sparrow search algorithm, and introducing adaptive parameters into the Tent chaotic mapping, a preliminary improved sparrow search algorithm is obtained; The preliminary improved sparrow search algorithm is integrated with Gaussian mutation operation to obtain the final improved sparrow search algorithm; The wind power prediction model is optimized using the final improved sparrow search algorithm, and the wind power prediction model is used to predict wind power.
2. The wind power prediction method based on the improved sparrow algorithm according to claim 1 is characterized in that: The construction of the wind power prediction model comprises: Using a machine learning model, the pre-processed historical operation data of the wind farm is divided into a training set, a validation set, and a test set; Use the training set to train the machine learning model, and use the validation set to evaluate the machine learning model and adjust the machine learning model parameters; The test set is used to test the machine learning model after parameter adjustment. If the set prediction accuracy is met, the wind power prediction model is obtained.
3. The wind power prediction method based on the improved sparrow algorithm according to claim 2 is characterized in that: The introduction of Tent chaos mapping into the traditional sparrow search algorithm includes: The expression of Tent chaos map is as follows: Among them, z i+1 represents the state value of the next time step, z i represents the state value of the current time step, and z represents the state variable; Adding random amount to the Tent map, the expression of the updated Tent chaos map is as follows: Among them, z i+1 represents the state value of the next time step, z i Represents the state value of the current time step, rand(0,1) represents a random number between [0, 1], which is used to increase the randomness of the chaotic sequence, N T Indicates the number of particles.
4. The wind power prediction method based on the improved sparrow algorithm according to claim 3 is characterized in that: The introduction of adaptive parameters in the Tent chaotic map includes: The calculation formula of the adaptive parameters is as follows: Among them, α(t) represents the adaptive parameter, α max represents the maximum value of the adaptive parameter, α min represents the minimum value of the adaptive parameter, t represents the current number of iterations, T max represents the maximum number of iterations, n represents the exponential factor, which controls the speed at which the adaptive parameters decrease; Introducing adaptive parameters into the updated Tent chaotic mapping formula, the adaptive Tent chaotic mapping is obtained; The formula of adaptive Tent chaotic mapping is as follows: Among them, z i+1 represents the chaotic sequence value at the next time step, z i represents the state value of the current time step, α(t) represents the adaptive parameter, rand(0,1) represents a random number between [0, 1], which is used to increase the randomness of the chaotic sequence, and N T Indicates the number of particles.
5. The wind power prediction method based on the improved sparrow algorithm according to claim 4 is characterized in that: Use the adaptive tent chaotic map to update the positions of the discoverer, joiner, and scout, For discoverers: X new =X old +β·z i+1 ·α(t)(X best -X old )+γ·z i+1 ·rand(0,1)·(x max -x min ) Among them, X new represents the individual position after the discoverer updates, z i+1 represents the chaotic sequence value at the next time step, X old represents the current individual position of the discoverer, α(t) represents the adaptive parameter, rand(0,1) represents a random number between [0, 1], and X best represents the optimal solution in the current population, β and γ are control parameters, X min and X max Respectively represent the lower and upper bounds of the search space; For those who join: X new =X old +η·z i+1 ·α(t)(X random -X old )+δ·(1-z i+1 α(t))rand(0,1)·(x max -x min ) Among them, X new Indicates the updated position of the joiner, z i+1 represents the chaotic sequence value at the next time step, X old represents the current position of the joiner, α(t) represents the adaptive parameter, X random represents the position of a randomly selected individual in the current population, rand(0,1) represents a random number between [0, 1], η and δ represent control parameters, X min and X max Respectively represent the lower and upper bounds of the search space; For scouts: X new =X best +ε·z i+1 ·L·(2·rand(0,1)-1) Among them, X new represents the updated position of the scout, z i+1 represents the chaotic sequence value at the next time step, X best represents the optimal solution in the current population, rand(0,1) represents a random number between [0, 1], ε represents a control parameter, and L represents a proportional factor for adjusting the step size, which is used to control the movement range of the scout; The updated positions of discoverers, joiners and scouts are applied to the traditional sparrow search algorithm to obtain a preliminary improved sparrow search algorithm.
6. The wind power prediction method based on the improved sparrow algorithm according to claim 5, characterized in that: The Gaussian mutation operation is integrated into the preliminarily improved sparrow search algorithm. The formula of Gaussian mutation is as follows: Gaussian(x)=x+σ·N(0,1) Among them, σ represents the current mutation strength, which decreases with the increase of iteration number t, and σ max represents the initial mutation strength, t represents the current number of iterations, T max represents the maximum number of iterations, N(0,1) represents a random number with a mean and standard deviation of 0 and 1 respectively and a normal distribution, Gaussian(x) represents the new position of the sparrow individual after Gaussian mutation, and x represents the current position of the sparrow individual before Gaussian mutation; For each individual sparrow position, including the finder, joiner, and scout, Gaussian mutation is applied to calculate the new position of each individual; Check whether the new position after Gaussian mutation exceeds the boundary of the search space. If so, adjust the new position to the boundary value; Compare the fitness before and after Gaussian mutation and retain the better position; Update the individual optimal solution and the global optimal solution until the iteration reaches the termination condition; Based on the optimal solution found in the iterative process, the final improved sparrow algorithm is determined; The final improved sparrow algorithm is used to optimize the parameters of the wind power prediction model to obtain the optimized wind power prediction model.
7. The wind power prediction method based on the improved sparrow algorithm according to claim 6, characterized in that: The method of using the optimized wind power prediction model to predict wind power includes: Select characteristic data according to the optimized wind power prediction model; The selected characteristic data are input into the optimized wind power prediction model, the optimized wind power prediction model is run, the wind power prediction value at a future time point is generated, and the wind power prediction result including the point prediction value and the prediction interval is generated.
8. A system using the wind power prediction method based on the improved sparrow algorithm as claimed in any one of claims 1 to 7, characterized in that: include: Model building module, used to collect and pre-process historical operation data of wind farms and build a wind power prediction model; A preliminary improvement module is used to introduce Tent chaotic mapping into the traditional sparrow search algorithm and introduce adaptive parameters into the Tent chaotic mapping to obtain a preliminary improved sparrow search algorithm; Gaussian mutation module, used to integrate the preliminary improved sparrow search algorithm with Gaussian mutation operation to obtain the final improved sparrow search algorithm; The prediction module is used to optimize the wind power prediction model using the final improved sparrow search algorithm, and predict the wind power using the optimized wind power prediction model.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the wind power prediction method based on the improved sparrow algorithm according to any one of claims 1 to 7 are implemented.
10. A 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 wind power prediction method based on the improved sparrow algorithm according to any one of claims 1 to 7 are implemented.
Citation Information
Cited By
Nuclear power operation parameter prediction method and device
CN120355267A
Nuclear power operation parameter prediction method and device
CN120355267B