Photovoltaic power prediction method based on hybrid neural network
Through the hybrid neural network method of VMD-SSA-GA-LSTM algorithm, the characteristics of photovoltaic power signals are decomposed and extracted, and data dimensionality reduction and time series modeling are carried out, which solves the problem of insufficient real-time and accuracy of existing photovoltaic power prediction methods. , achieving a more efficient prediction process.
Patent Information
- Application Number
- CN202411671341.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-21
- Publication Date
- 2025-02-25
AI Technical Summary
The existing photovoltaic power prediction methods have problems with unsatisfactory real-time and accuracy, and the hybrid model has shortcomings in insufficient data preprocessing, slow prediction speed, and difficult training.
The hybrid neural network method using VMD-SSA-GA-LSTM algorithm is used to decompose photovoltaic power signals through VMD algorithm, and feature extraction and data dimensionality reduction are used to use SSA and GA combination optimization algorithms to perform feature extraction and data dimensionality reduction. Finally, the LSTM neural network is used for time series modeling and prediction. .
It improves the real-time and accuracy of photovoltaic power prediction, solves the problems of insufficient data preprocessing, slow prediction speed and difficult training in traditional methods, and achieves faster prediction speed and easier training process.
Smart Images

Figure CN119514799A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of photovoltaic power generation grid-connected power prediction, and in particular to a photovoltaic power prediction method based on a hybrid neural network. Background Art
[0002] Photovoltaic power generation has many advantages such as cleanliness, safety, and extensiveness. At the same time, the power output of photovoltaic power generation has defects such as intermittent and volatility. Large-scale grid connection will have an impact on the operation of the power system. Dynamic adjustment of energy flow between photovoltaics, energy storage, and the power grid based on predicted power is currently an effective measure to alleviate the fluctuation of photovoltaic output power and improve the acceptance capacity of photovoltaic systems over a large range. Therefore, how to achieve accurate prediction of photovoltaic power generation output power is crucial. In the existing technology, traditional photovoltaic power prediction usually relies on historical meteorological data and simple statistical models, lacking real-time update capabilities. When dealing with sudden weather and complex nonlinear relationships, the prediction real-time and accuracy are not ideal. Artificial neural networks (ANN) can theoretically fit nonlinear relationships, but single artificial neural network models often have poor stability and static error. The hybrid model method used in existing research for photovoltaic power prediction still has problems such as insufficient data preprocessing, slow prediction speed, and difficulty in training. Summary of the invention
[0003] In view of the shortcomings of the prior art, the present invention proposes a hybrid neural network photovoltaic power prediction method based on the VMD-SSA-GA-LSTM algorithm. The VMD algorithm is used to decompose the photovoltaic power signal and effectively extract the signal features. The SSA algorithm is used to extract features and reduce dimensions to find the optimal fitness. Finally, the LSTM neural network is used to model and predict time series. The problems of unsatisfactory real-time and accuracy of traditional photovoltaic power prediction methods and insufficient data preprocessing, slow prediction speed and great training difficulty when the existing hybrid model is used for photovoltaic power prediction are solved. Technical solution: The present invention provides a photovoltaic power prediction method based on a hybrid neural network, which specifically includes the following steps: Step 1: Decompose the photovoltaic power signal f using the VMD algorithm (t) , extract effective signal features; Step 2: Use the SSA and GA combined optimization algorithm to extract signal features and reduce data dimension to find the best fitness; Step 3: Use LSTM neural network for time series modeling and power prediction. Preferably, in step 1, the VMD variational mode decomposition method is used to iteratively find the local frequency and amplitude of the signal and the time variation information of the signal to decompose the complex signal into several discrete mode functions. The structure and characteristics of the signal are analyzed by the mode functions representing the different frequency components and time variation characteristics of the signal. Preferably, in step 2, the SSA and GA combined optimization algorithm is used to initialize the data and set a series of parameters. The fitness function uses the mean square error method and is sorted according to the fitness value. The optimal solution with the minimum fitness is calculated by the formula. Whether the stop condition is met is determined according to the calculation result. If it is met, the result is output. If it is not met, the above steps are repeated. Preferably, in step three, the LSTM algorithm is used to substitute into the training set, appropriate data is selected as the target accuracy, and then the obtained result is substituted back into the test set data to obtain the error analysis result. Preferably, the VMD variational mode decomposition method comprises the following steps: (1) Input signal f (t) Decompose into k discrete mode functions u k (t): Where: Ak(t) is the instantaneous amplitude; is the instantaneous frequency, which can be obtained by transformation: And then an index Phase aliasing, the central spectrum of the analytical signal is w k ; Smooth the mode of the analytical signal to obtain the bandwidth: Where: f is the data sample sequence; u k =1,2,…,n are the modal components after decomposition; w k =1,2,…,n is the center frequency corresponding to the modal component; (2) Augmented Lagrangian transform: (3) Solve using the alternating direction method: Preferably, the SSA and GA combined optimization algorithm comprises the following steps: (1) Initialize the data and set a series of parameters; (2) The fitness function uses the mean square error method and is sorted according to the fitness value; (3) Update the data value according to the following formula: Where t is the current iteration number, iter max is the maximum number of iterations, α is a random number in (0,1]; Where X p is the global optimal position, X worst is the global worst position; Where X best is the global optimal position, β is subject to random normal distribution; (4) Initialize the data. (5) Perform crossover transformation and random mutation operations on the offspring data. The crossover operation requires randomly selecting a part of two individuals and performing crossover and exchange to form two new individuals. The crossover operation can be understood as the crossover mutation of two chromosomes. When performing the crossover operation, two individuals need to be grouped together. There are two ways of combination. The first is random combination; the second is sequential combination. The combined individuals need to be deleted from the parent population. After the individuals are combined, it is necessary to determine whether the combination requires a crossover operation. However, the crossover operation data still comes from the parent population, so it is difficult to optimize the solution. This patent adds a random mutation operation to randomly mutate part of the offspring data, introduce random variables, expand the scale of the offspring population data, and make it easier to obtain the optimal solution when iterating. The mutation operation simulates the mutation phenomenon in genetic inheritance. The difference from the crossover operation is that it is only implemented for a single individual and does not require cooperation between two individuals. Whether to perform the mutation operation on an individual depends on the setting of the mutation rate. In the context of binary coding, the mutation operation is achieved by randomly performing a "not" logical operation on a part of the individual. This mutation method uses a list reversal mechanism to update the individual, that is, a section of the individual data is randomly selected for mutation, and the mutation rate is set to 30%. It is worth noting that in the crossover and mutation operations, the system will identify and record the individual with the best fitness. In order to ensure that the advantage of this optimal individual is maintained, the marked optimal individual will not participate in the crossover and mutation process. (6) Recalculate the out-of-bounds data, check and update the population after the crossover and mutation operations. Because the crossover and mutation operations are performed randomly, some individual optimization anomalies will occur, mainly exceeding the parameter limit anomaly and "0" anomaly. The exceeding parameter limit anomaly (the parameter limit is set to 10-100) and "0" anomaly in the crossover and mutation operations. When a parameter is out of bounds, the problem is usually solved by regenerating the parameter. (7) Calculate the fitness, taking the traditional BP neural network as an example. First, decode the binary population and convert it into a real population; then build a traditional BP neural network model based on the hidden layer depth parameters and the number of neurons in the population; then use the DST and UDDS data sets to train the network model in turn, and take the maximum error of the model as the fitness function of the individual; finally, calculate the fitness function of each individual in turn. Due to the addition of the time series length parameter, when calculating the fitness function of the CNN and RNN models, first use the decoded time series length parameter to divide the data into time series data, and then build the network model based on the network layer depth parameters and the number of neurons in the population; take the maximum error as the fitness function; finally, calculate the fitness function of all individuals. (8) Perform iterative calculations. After completing the optimization and checking operations of the GA (genetic algorithm), the system enters the loop iteration phase. In this phase, the fitness function values of the current iteration and the previous iteration are compared to determine the new optimal fitness function value and mark the corresponding best individual. Subsequently, the system checks whether the last iteration has been reached. If not, it returns to the step of calculating the fitness function to continue execution; if it has been reached, the best individual is decoded to obtain the final network parameters, that is, the result after decoding the best individual. (9) The optimal solutions obtained by the SSA algorithm and the GA algorithm are averaged to obtain the final optimal solution value. (10) According to the calculation results, it is judged whether the stop condition is met. If it is met, the result is output. If it is not met, the stop condition is not met, and the above steps are repeated. Preferably, the LSTM algorithm comprises the following steps: (1) The forget gate f is composed of x t With h t-1 After activation transformation, we get f t : f t =σ(W fx x t +W fh h t-1 +b f ) (2) Input gate i to x t With h t-1 Perform function transformation to obtain memory information i t and candidate memory unit g t : i t =σ(W fx x t +W ih h t-1 +b i ) g t =tanh(W gx x t +W gh h t-1 +b g ) (3) According to f t 、i t , g t and C at the previous moment t-1 Update the current memory cell C t : C t =g t i t +C t-1 f t . Beneficial effects: 1. The present invention proposes a hybrid neural network photovoltaic power prediction method of VMD-SSA-GA-LSTM algorithm, which can judge the superiority and feasibility of the model according to the values of root mean square error (RMSE), mean absolute error (MAE), and median absolute percentage error (MAPE), and then dynamically adjust the prediction model by analyzing meteorological data, historical power generation data, and real-time monitoring data. It intersects with traditional power prediction methods, can better capture the complex interaction between photovoltaic power generation and meteorological factors, and enhance the prediction ability of instantaneous fluctuations, thereby improving the real-time and accuracy of the prediction. 2. The present invention firstly utilizes the VMD algorithm to decompose the photovoltaic power signal and effectively extracts the signal features. VMD decomposes the signal into multiple frequency bands by constructing and solving a variational problem. Each frequency band corresponds to a modal function, which can effectively process non-stationary and nonlinear signals. Secondly, the SSA algorithm is used for feature extraction and dimensionality reduction to find the optimal fitness. It has strong global search capability and fast convergence speed. By establishing the LSTM model, the gradient vanishing problem of the traditional RNN model is effectively alleviated, and it is easier to train. In summary, compared with the existing hybrid model, the present invention has more complete data processing, faster prediction speed and easier training. BRIEF DESCRIPTION OF THE DRAWINGS Figure 1 A photovoltaic power prediction flow chart of an embodiment of the present invention; Figure 2 It is the flow chart of GA algorithm of the present invention; Figure 3 A schematic diagram of the cross-transformation operation of child data of the present invention; Figure 4 This is a schematic diagram of the random mutation operation of progeny data of the present invention; Figure 5 This is a schematic diagram of out-of-bounds data in the present invention. DETAILED DESCRIPTION The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention. See also Figure 1 The present invention provides a photovoltaic power prediction method based on a hybrid neural network, and the specific implementation methods are as follows: First, the VMD algorithm is used to decompose the photovoltaic power signal f (t) , extract effective signal features. Specifically, the VMD variational mode decomposition method is used to iteratively find the local frequency and amplitude of the signal, the time variation information of the signal, and decompose the complex signal into several discrete mode functions. The structure and characteristics of the signal are analyzed through the mode functions representing the different frequency components and time variation characteristics of the signal. The specific steps of VMD variational mode decomposition method are as follows: (1) Input signal f (t) Decompose into k discrete mode functions u k (t): Where: Ak(t) is the instantaneous amplitude; is the instantaneous frequency, which can be obtained by transformation: And then an index Phase aliasing, the central spectrum of the analytical signal is w k ; Smooth the mode of the analytical signal to obtain the bandwidth: Where: f is the data sample sequence; u k =1,2,…,n are the modal components after decomposition; w k =1,2,…,n is the center frequency corresponding to the modal component; (2) Augmented Lagrangian transform: (3) Solve using the alternating direction method: Secondly, the SSA and GA combined optimization algorithm is used to extract signal features and reduce data dimension to find the best fitness. Specifically, the SSA and GA combined optimization algorithm is used to extract signal features and reduce data dimension, find the best fitness, initialize the data and set a series of parameters. The fitness function uses the mean square error method and sorts according to the fitness value. The optimal solution with the minimum fitness is calculated by the formula. According to the calculation results, it is judged whether the stop condition is met. If it is met, the result is output. If it is not met, the above steps are repeated. The GA algorithm flow chart is as follows: Figure 2 shown. The SSA and GA combined optimization algorithm includes the following steps: (1) Initialize the data and set a series of parameters; (2) The fitness function uses the mean square error method and is sorted according to the fitness value; (3) Update the data value according to the following formula: Where t is the current iteration number, iter max is the maximum number of iterations, α is a random number in (0,1]; Where X p is the global optimal position, X worst is the global worst position; Where X best is the global optimal position, β is subject to random normal distribution; (4) Initialize the data; (5) Perform crossover transformation and random mutation operations on the offspring data. Figure 3 As shown, the crossover operation requires randomly selecting a part of two individuals, performing crossover and exchange, and forming two new individuals. The crossover operation can be understood as the crossover mutation of two chromosomes. When performing the crossover operation, two individuals need to be grouped together. There are two ways of combination. The first is a random combination; the second is a sequential combination. The combined individuals need to be deleted from the parent population. After the individuals are combined, it is necessary to determine whether this combination requires a crossover operation, but the crossover operation data still comes from the parent population, so it is difficult to optimize the solution. This patent adds a random mutation operation to randomly mutate part of the offspring data, introduce random variables, expand the scale of the offspring population data, and make it easier to obtain the optimal solution when iterating. like Figure 4 As shown in Figure 1, the mutation operation simulates the mutation phenomenon in genetic inheritance. The difference from the crossover operation is that it is only implemented on a single individual and does not require cooperation between two individuals. Whether to perform the mutation operation on an individual depends on the setting of the mutation rate. In the case of binary coding, the mutation operation is performed by randomly performing a "non" on a part of the individual. This mutation method uses a list reversal mechanism to update individuals, that is, a segment of individual data is randomly selected for mutation, and the mutation rate is set to 30%. It is worth noting that in the crossover and mutation operations, the system will identify and record the individual with the best fitness. In order to ensure that the advantage of this optimal individual is maintained, the marked optimal individual will not participate in the crossover and mutation process. (6) Figure 5 As shown in the figure, the population is checked and updated after the crossover and mutation operations. Because the crossover and mutation operations are performed randomly, some individual optimization anomalies will occur, mainly exceeding the parameter limit anomaly and "0" anomaly. The exceeding parameter limit anomaly (the parameter limit is set to 10-100) and "0" anomaly in the crossover and mutation operations. When a parameter is out of bounds, the problem is usually solved by regenerating the parameter. (7) Take the traditional BP neural network as an example. First, decode the binary population and convert it into a real population; then build a traditional BP neural network model based on the hidden layer depth parameters and the number of neurons in the population; then use the DST and UDDS data sets to train the network model in turn, and take the maximum error of the model as the fitness function of the individual; finally, calculate the fitness function of each individual in turn. Due to the addition of the time series length parameter, when calculating the fitness function of the CNN and RNN models, first use the decoded time series length parameter to divide the data into time series data, and then build a network model based on the network layer depth parameters and the number of neurons in the population; take the maximum error as the fitness function; finally, calculate the fitness function of all individuals. (8) After completing the optimization and checking operation of GA (genetic algorithm), the system enters the loop iteration stage. In this stage, the fitness function value of the current iteration is compared with that of the previous iteration to determine the new optimal fitness function value and mark the corresponding best individual. Subsequently, the system checks whether the last iteration has been reached. If not, it returns to the step of calculating the fitness function to continue execution; if it has been reached, the best individual is decoded to obtain the final network parameters, that is, the result after decoding the best individual. (9) The optimal solutions obtained by the SSA algorithm and the GA algorithm are averaged to obtain the final optimal solution value. (10) According to the calculation results, it is judged whether the stop condition is met. If it is met, the result is output. If it is not met, the stop condition is not met, and the above steps are repeated. Preferably, the LSTM algorithm comprises the following steps: (1) The forget gate f is composed of x t With h t-1 After activation transformation, we get ft : f t =σ(W fx x t +W fh h t-1 +b f ) (2) Input gate i to x t With h t-1 Perform function transformation to obtain memory information i t and candidate memory unit g t : i t =σ(W fx x t +W ih h t-1 +b i ) g t =tan h(W gx x t +W gh h t-1 +b g ) (3) According to f t 、i t , g t and C at the previous moment t-1 Update the current memory cell C t : C t =g t i t +C t-1 f t . Finally, LSTM neural network is used for time series modeling and power prediction. Specifically, the LSTM algorithm is used to substitute the training set, and appropriate data is selected as the target accuracy. The obtained results are then substituted back into the test set data to obtain the error analysis results. The superiority and feasibility of the model are observed through the values of root mean square error (RMSE), mean absolute error (MAE), and median absolute percentage error (MAPE), and the prediction model is dynamically adjusted. The LSTM algorithm consists of the following steps: (1) The forget gate f is composed of x t With h t-1 After activation transformation, we get f t : f t =σ(W fx x t +W fh h t-1 +b f ) (2) Input gate i to x t With h t-1 Perform function transformation to obtain memory information i t and candidate memory unit g t : i t =σ(W fx x t +W ih h t-1 +b i ) g t =tan h(W gx x t +W gh h t-1 +b g ) (3) According to f t 、i t , g t and C at the previous moment t-1 Update the current memory cell C t : C t =g t i t +C t-1 f t . In this embodiment, the obtained photovoltaic power signal may be cleaned in advance before the photovoltaic power signal is decomposed by VMD. Although the preferred embodiments of the present invention have been described, those skilled in the art may make other changes and modifications to these embodiments once they have learned the basic creative concept. Therefore, the appended claims are intended to be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention. Obviously, those skilled in the art can make various changes and modifications to the embodiments of the present invention without departing from the spirit and scope of the embodiments of the present invention. Thus, if these modifications and variations of the embodiments of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include these modifications and variations.
Claims
1. A photovoltaic power prediction method based on a hybrid neural network, characterized in that: The method comprises the following steps: Step 1: Decompose the photovoltaic power signal f using the VMD algorithm (t) , extract effective signal features; Step 2: Use the SSA and GA combined algorithm to extract signal features and reduce data dimension to find the best fitness; Step 3: Use LSTM neural network for time series modeling and power prediction.
2. A photovoltaic power prediction method based on hybrid neural network according to claim 1, characterized in that: In step one, the VMD variational mode decomposition method is used to iteratively search for the local frequency and amplitude of the signal, the time variation information of the signal, and decompose the complex signal into several discrete mode functions. The structure and characteristics of the signal are analyzed through the mode functions representing the different frequency components and time variation characteristics of the signal.
3. The photovoltaic power prediction method based on hybrid neural network according to claim 1 is characterized in that: In step 2, the SSA and GA combined optimization algorithm is used to initialize the data and set a series of parameters. The fitness function uses the mean square error method and is sorted according to the fitness value. The optimal solution with the minimum fitness is calculated by the formula. The calculation result is used to determine whether the stopping condition is met. If it is met, the result is output. If it does not meet the stopping condition, the above steps are repeated.
4. The photovoltaic power prediction method based on hybrid neural network according to claim 1 is characterized in that: In step three, the LSTM algorithm is used to substitute the training set, appropriate data is selected as the target accuracy, and then the obtained results are substituted back into the test set data to obtain the error analysis results.
5. The photovoltaic power prediction method based on hybrid neural network according to claim 2 is characterized in that: The VMD variational mode decomposition method comprises the following steps: (1) Input signal f (t) Decompose into k discrete mode functions u k (t): Where: Ak(t) is the instantaneous amplitude; is the instantaneous frequency, which can be obtained by transformation: And then an index Phase aliasing, the central spectrum of the analytical signal is w k ; Smooth the mode of the analytical signal to obtain the bandwidth: Where: f is the data sample sequence; u k =1,2,…,n are the modal components after decomposition; w k =1,2,…,n is the center frequency corresponding to the modal component; (2) Augmented Lagrangian transform: (3) Solve using the alternating direction method:
6. The photovoltaic power prediction method based on hybrid neural network according to claim 3 is characterized in that: The SSA optimization algorithm includes the following steps: (1) Initialize the data and set a series of parameters; (2) The fitness function uses the mean square error method and is sorted according to the fitness value; (3) Update the data value according to the following formula: Where t is the current iteration number, iter max is the maximum number of iterations, α is a random number in (0,1]; Where X p is the global optimal position, X worst is the global worst position; Where X best is the global optimal position, β is subject to random normal distribution; (4) Initialize the data. (5) Perform crossover transformation and random mutation operations on the offspring data. (6) Recalculate the out-of-bounds data. (7) Calculate fitness, (8) Perform iterative calculations. (9) The optimal solutions obtained by the SSA algorithm and the GA algorithm are averaged to obtain the final optimal solution value. (10) Determine whether the stop condition is met based on the calculation result. If it is met, output the result and stop. If it is not met, repeat the above steps.
7. The photovoltaic power prediction method based on hybrid neural network according to claim 4 is characterized in that: The LSTM algorithm includes the following steps: (1) The forget gate f is composed of x t With h t-1 After activation transformation, we get f t : f t =σ(W fx x t +W fh h t-1 +b f ) (2) Input gate i to x t With h t-1 Perform function transformation to obtain memory information i t and candidate memory unit g t : i t =σ(W fx x t +W ih h t-1 +b i ) g t =tanh(W gx x t +W gh h t-1 +b g ) (3) According to f t 、i t , g t and C at the previous moment t-1 Update the current memory cell C t : C t =g t i t +C t-1 f t 。