Photovoltaic power generation power prediction method based on BP convolutional neural network

By optimizing the photovoltaic power generation prediction model using BP convolutional neural network and genetic optimization algorithm, the problems of large computational load and insufficient accuracy in existing technologies are solved, and efficient photovoltaic power generation prediction is achieved.

CN119315507APending Publication Date: 2025-01-14NORTH CHINA GRID MEASUREMENT CENT +1

Patent Information

Application Number
CN202310861850.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2023-07-14
Publication Date
2025-01-14

AI Technical Summary

Technical Problem

Existing photovoltaic power generation prediction methods involve large computational loads and insufficient accuracy, making it difficult to meet the needs of optimized grid-connected operation.

Method used

A photovoltaic power generation prediction method based on BP convolutional neural network is adopted. By cleaning historical data, establishing an LSTM-CNN prediction model and optimizing it using a genetic optimization algorithm, the LSTM neural network with forget gate, input gate and output gate is used to extract temporal features, and the CNN neural network is used to extract spatial features, thereby reducing the amount of computation and improving the prediction accuracy.

Benefits of technology

It reduces the amount of computation, improves the accuracy of photovoltaic power generation prediction, and optimizes the grid-connected operation of photovoltaic power generation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119315507A_ABST
    Figure CN119315507A_ABST
Patent Text Reader

Abstract

The invention belongs to the technical field of photovoltaic power generation, and particularly discloses a photovoltaic power generation power prediction method based on a BP convolutional neural network, and the method comprises the steps: cleaning the historical data of photovoltaic power generation, and replacing the abnormal data with an average value after detecting the abnormal data; then, a prediction model based on the LSTM-CNN is established, and the model is trained and tested; optimizing the prediction model by using a genetic optimization algorithm; and finally, predicting the photovoltaic power generation power by using the optimized model. According to the invention, an artificial intelligence prediction model is established and optimization is carried out by using a neural network algorithm, so that the calculation amount is reduced and the prediction precision of the photovoltaic power generation power is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of photovoltaic power generation, and relates to a method for predicting photovoltaic power generation by means of a neural network algorithm model, and specifically to a method for predicting photovoltaic power generation based on a BP convolutional neural network. Background Art

[0002] In recent years, photovoltaic power generation technology has been widely used around the world, but the problems in photovoltaic power generation operation have become increasingly prominent. The photovoltaic power generation process is affected by weather and geographical environment, showing volatility and random multi-interference. Its output power is prone to change with external factors. Therefore, predicting the power output is crucial to optimize the grid-connected operation of photovoltaic power generation and reduce the impact of uncertainty.

[0003] In the prior art, the analysis and prediction are mainly carried out by exploring weather classification and feature correlation. For example, the Chinese invention patent application with publication number CN104156777A discloses a low-cost photovoltaic power prediction method based on urban weather forecast. The exotropic radiation intensity is calculated by the solar-terrestrial model, and the penetration coefficient of the exotropic solar radiation to the atmosphere is first obtained, and then the weather forecast type classifier model that can calculate the statistical penetration coefficient is obtained, and then the statistical penetration coefficient of the previous 14 days is obtained. The obtained statistical penetration coefficient is subtracted from the penetration coefficient to obtain a difference sequence, and the corresponding weight sequence is multiplied and added to obtain the penetration coefficient error. The statistical penetration coefficient under the predicted weather type of the day is corrected by the penetration coefficient error to obtain the predicted penetration coefficient, and the predicted solar radiation intensity curve is inverted by using the exotropic radiation intensity curve of the predicted day. The power generation power prediction curve of the power station can be obtained through the light intensity-power relationship. Although this analysis method can predict the efficiency of photovoltaic power generation, it requires a lot of calculations, and the prediction accuracy needs to be improved. Summary of the invention

[0004] The present invention aims to propose a photovoltaic power prediction method based on BP convolutional neural network, establish an artificial intelligence prediction model and optimize it with a neural network algorithm to reduce the amount of calculation and improve the prediction accuracy of photovoltaic power.

[0005] To achieve the above purpose, the technical solution adopted by the present invention is as follows:

[0006] A photovoltaic power generation prediction method based on BP convolutional neural network includes the following steps:

[0007] S1. Clean the historical data of photovoltaic power generation, detect abnormal data and then replace the abnormal data with the average value;

[0008] S2. Establish a prediction model based on LSTM-CNN and train and test the prediction model;

[0009] S3. Optimize the prediction model using genetic optimization algorithm;

[0010] S4. Use the optimized model to predict photovoltaic power generation.

[0011] As a limitation, the historical data in step S1 includes the instantaneous rate of photovoltaic power generation and data features in four dimensions of wind speed, temperature, humidity and irradiance at the corresponding moment.

[0012] As a further limitation, in step S1, the three sigma criterion is used to detect abnormal data, and then the average value is used to replace the abnormal data. The specific steps are as follows:

[0013] S11. Take the data of all sampling points of each day in the historical data as {X1, X2, X3...X i}, calculate the expectation E(i) according to formula ①, and calculate the standard deviation σ(i) according to formula ②;

[0014]

[0015]

[0016] Where N is the number of days in the historical data, N ≥ 2, X i is the data of the i-th sampling point in a day;

[0017] S12. Judgment data X i Whether it falls within the range of (E(i)-3σ(i), E(i)+3σ(i)). If it does, continue to judge the next data until all sampling points of each day in the historical data are judged, and then go to step S2. If the data Xi does not fall within the range, it is judged as abnormal data and step S13 is executed.

[0018] S13. Use formula ③ to calculate the average value X(i)' of the previous data X(i-1) and the next data X(i+1) of the abnormal data, and replace Xi with X'(i). After the replacement is completed, execute step S11.

[0019]

[0020] As a further limitation, the prediction model based on LSTM-CNN in step S2 includes an LSTM neural network and a CNN neural network; the LSTM neural network is used to extract the time feature information of the historical data, and the CNN neural network is used to extract the spatial feature information of the historical data. The obtained historical data is first transmitted to the LSTM neural network to extract the time feature information, and then the output of the LSTM neural network is used as the input of the CNN neural network to extract the spatial feature information of the data, and then the output result is obtained;

[0021] The CNN neural network includes a convolutional layer, a pooling layer, and a fully connected layer connected in sequence, wherein the convolutional layer is used to extract data features, the pooling layer is used to sample and reduce the dimensions of the data features, and the fully connected layer is used to summarize and output the data features processed by the convolutional layer and the pooling layer;

[0022] The LSTM neural network includes a forget gate, an input gate and an output gate connected in sequence, and the input end of the forget gate is connected to the output end of the fully connected layer; the forget gate performs forgetting processing on the data features to obtain the information after the forgetting processing, the input gate performs cell state update on the information after the forgetting processing to obtain the updated information, and the output gate filters the state of the LSTM neural network according to the updated information, and uses the obtained first prediction result as the output of the LSTM neural network.

[0023] As a further limitation, the specific steps of optimizing the prediction model in step S3 are as follows:

[0024] S31 predicts the output using the trained LSTM model according to the three parameters of the neural network and the input characteristics of the model, takes the absolute value of the error between the predicted output value and the actual value as the individual fitness, and calculates the function H through formula ④;

[0025]

[0026] Where n represents the number of output nodes, x i Represents the predicted output value, y i represents the actual value, k is the coefficient;

[0027] S32 uses a roulette wheel to select individuals, and the probability of each individual being selected is P i , use equation ⑤ and equation ⑥ to calculate P i ;

[0028]

[0029] f i =k / H Formula ⑥,

[0030] Among them, f i represents the fitness value of individual i, J i represents the position of individual i in the neural network, and N is the number of individuals in the population;

[0031] S33 adopts the real number crossover method and uses equations ⑦ and ⑧ to perform crossover operations;

[0032] a kj =a kj (1-b)+a ij b formula ⑦,

[0033] a ij =a ij (1-b)+a kj b Formula ⑧,

[0034] Among them, a ij represents the jth gene of the i-th individual, a kj represents the jth gene of the kth individual, and b is the bias vector;

[0035] S34 selects the jth gene of the i-th individual and performs mutation operation using formula ⑨;

[0036]

[0037] Among them, a max for a ij The upper limit of the gene, a min for a ij The lower limit of the gene, g is the current iteration number, and r is a random number between [0, 1];

[0038] S35 repeats steps S32-S34 until a new population is formed.

[0039] Due to the adoption of the above technical solution, the present invention has the following beneficial effects compared with the prior art:

[0040] (1) The present invention establishes an artificial intelligence prediction model, which reduces the amount of manual calculation;

[0041] (2) The present invention utilizes a neural network algorithm to optimize the artificial intelligence prediction model, thereby improving the prediction accuracy of photovoltaic power generation.

[0042] In summary, the present invention provides a photovoltaic power prediction method based on BP convolutional neural network, establishes an artificial intelligence prediction model and optimizes it with a neural network algorithm, reduces the amount of calculation, and has a relatively high prediction accuracy for photovoltaic power. BRIEF DESCRIPTION OF THE DRAWINGS

[0043] Figure 1 This is a flow chart of optimizing a model using a genetic optimization algorithm in an embodiment of the present invention;

[0044] Figure 2 Schematic diagram of the GA-LSTM-CNN hybrid algorithm model structure in an embodiment of the present invention. DETAILED DESCRIPTION

[0045] The embodiments of the present invention are described below in conjunction with the accompanying drawings. It should be understood that the embodiments described herein are only used to illustrate and explain the present invention, and are not used to limit the present invention.

[0046] Example 1 A photovoltaic power prediction method based on BP convolutional neural network

[0047] This embodiment is carried out in the following steps in sequence:

[0048] S1. Clean the historical data of photovoltaic power generation, and then use the three sigma criteria to detect abnormal data according to the following steps, and then replace the abnormal data with the average value. The historical data refers to the instantaneous power generation at all sampling points at each day of the past year and the data characteristics of the four dimensions of wind speed, temperature, humidity, and irradiance at the corresponding time. The specific steps are as follows:

[0049] S11. Take the data of all sampling points of each day in the historical data as {X1, X2, X3, ... X i}, calculate the expectation E(i) according to formula ①, and calculate the standard deviation σ(i) according to formula ②;

[0050]

[0051]

[0052] Where N is the number of days in the historical data, 366 ≥ N ≥ 2, X i is the data of the i-th sampling point in a day;

[0053] S12. Determine whether the data Xi falls within the range of (E(i)-3σ(i), E(i)+3σ(i)). If so, continue to determine the next data until all sampling points of each day in the historical data are determined, and then proceed to step S2. If the data X i If it is not within the range, it is determined as abnormal data and step S13 is executed;

[0054] S13. Use formula ③ to calculate the average value X'(i) of the previous data X(i-1) and the next data X(i+1) of the abnormal data, and replace X with X(i)' i After the replacement is completed, step S11 is executed.

[0055]

[0056] S2. Establish a prediction model based on LSTM-CNN and test the model. The prediction model based on LSTM-CNN includes LSTM neural network and CNN neural network. LSTM neural network is used to extract the time feature information of historical data, and CNN neural network is used to extract the spatial feature information of historical data. The obtained historical data is first transmitted to the LSTM neural network to extract the time feature information, and then the output of the LSTM neural network is used as the input of the CNN neural network to extract the spatial feature information of the data, and then the output result is obtained.

[0057] The CNN neural network consists of a convolutional layer, a pooling layer, and a fully connected layer connected in sequence. The convolutional layer is used to extract data features, the pooling layer is used to sample and reduce the dimensions of data features, and the fully connected layer is used to summarize and output the data features processed by the convolutional layer and the pooling layer.

[0058] The LSTM neural network includes a forget gate, an input gate and an output gate connected in sequence, the input end of the forget gate is connected to the output end of the fully connected layer; the forget gate performs forgetting processing on the data features to obtain the information after the forgetting processing, the input gate performs cell state update on the information after the forgetting processing to obtain the updated information, the output gate filters the state of the LSTM neural network according to the updated information, and uses the obtained first prediction result as the output of the LSTM neural network.

[0059] After the prediction model is established, the prediction model is verified and tested. The historical data processed in step S1 is selected, 80% of which is used as training data and 20% as test data. The model is tested on a computer with an Intel Core I7-3770k CPU configuration, a frequency of 3.60 GHZ, an MX250 graphics card, and a win10 system. The program code is python 3.6, the editor is pycharm, and the framework is Tensorflow.

[0060] S3. Figure 1 As shown, the prediction model is optimized using the genetic optimization algorithm. The specific steps are as follows:

[0061] S31 predicts the output using the trained LSTM model according to the three parameters of the neural network and the input characteristics of the model, takes the absolute value of the error between the predicted output value and the actual value as the individual fitness, and calculates the function H through formula ④;

[0062]

[0063] Where n represents the number of output nodes, x i Represents the predicted output value, y i represents the actual value, k is the coefficient;

[0064] S32 uses a roulette wheel to select individuals, and the probability of each individual being selected is P i , use equation ⑤ and equation ⑥ to calculate P i ;

[0065]

[0066] f i =k / H Formula ⑥,

[0067] Among them, f i represents the fitness value of individual i, J i represents the position of individual i in the neural network, and N is the number of individuals in the population;

[0068] S33 adopts the real number crossover method and uses equations ⑦ and ⑧ to perform crossover operations;

[0069] a kj =a kj (1-b)+a ij b formula ⑦,

[0070] a ij =a ij (1-b)+a ij b Formula ⑧,

[0071] Among them, a ij represents the jth gene of the i-th individual, a kj represents the jth gene of the kth individual, and b is the bias vector;

[0072] S34 selects the jth gene of the i-th individual and performs mutation operation using formula ⑨;

[0073]

[0074] Among them, a max for a ij The upper limit of the gene, a min for a ij The lower limit of the gene, g is the current iteration number, and r is a random number between [0, 1];

[0075] S35 repeats steps S32-S34 until a new population is formed.

[0076] like Figure 2As shown in the figure, the GA-LSTM-CNN hybrid algorithm model obtained after optimization by the genetic optimization algorithm is mainly composed of a convolutional neural network and a long short-term memory neural network. The long short-term memory neural network first extracts the time features, and then the convolutional neural network extracts the spatial features of the data. The hybrid algorithm model combines the advantages of the two neural networks, and when training the hyperparameters of the LSTM neural network, the network's weight coefficients, bias values, batches, and iterations are updated and calculated by the genetic optimization algorithm.

[0077] S4. Use the optimized hybrid algorithm model to predict photovoltaic power generation.

Claims

1. A photovoltaic power prediction method based on BP convolutional neural network, characterized in that: Follow these steps in order: S1. Clean the historical data of photovoltaic power generation, detect abnormal data and then replace the abnormal data with the average value; S2. Establish a prediction model based on LSTM-CNN and train and test the prediction model; S3. Optimize the prediction model using genetic optimization algorithm; S4. Use the optimized model to predict photovoltaic power generation.

2. A photovoltaic power prediction method based on BP convolutional neural network as claimed in claim 1, characterized in that: The historical data in step S1 includes the instantaneous rate of photovoltaic power generation and data features in four dimensions of wind speed, temperature, humidity, and irradiance at the corresponding moment.

3. A photovoltaic power prediction method based on BP convolutional neural network as claimed in claim 2, characterized in that: In step S1, the three sigma criterion is used to detect abnormal data, and then the average value is used to replace the abnormal data. The specific steps are as follows: S11. Take the data of all sampling points of each day in the historical data as {X1, X2, X3, ... X i }, calculate the expectation E(i) according to formula ①, and calculate the standard deviation σ(i) according to formula ②; Where N is the number of days in the historical data, N ≥ 2, X i is the data of the i-th sampling point in a day; S12. Determine data X i Whether it falls within the range of (E(i)-3σ(i), E(i)+3σ(i)). If it does, continue to judge the next data until all sampling points of each day in the historical data are judged, and then go to step S2. If the data X i If it is not within the range, it is determined as abnormal data and step S13 is executed; S13. Use formula ③ to calculate the average value X(i)′ of the previous data X(i-1) and the next data X(i+1) of the abnormal data, and replace X with X(i)′. i After the replacement is completed, step S11 is executed.

4. A photovoltaic power prediction method based on BP convolutional neural network as claimed in claim 3, characterized in that: The prediction model based on LSTM-CNN in step S2 includes an LSTM neural network and a CNN neural network; the LSTM neural network is used to extract the time feature information of the historical data, and the CNN neural network is used to extract the spatial feature information of the historical data. The obtained historical data is first transmitted to the LSTM neural network to extract the time feature information, and then the output of the LSTM neural network is used as the input of the CNN neural network to extract the spatial feature information of the data, and then the output result is obtained; The CNN neural network includes a convolutional layer, a pooling layer, and a fully connected layer connected in sequence, wherein the convolutional layer is used to extract data features, the pooling layer is used to sample and reduce the dimensions of the data features, and the fully connected layer is used to summarize and output the data features processed by the convolutional layer and the pooling layer; The LSTM neural network includes a forget gate, an input gate and an output gate connected in sequence, and the input end of the forget gate is connected to the output end of the fully connected layer; the forget gate performs forgetting processing on the data features to obtain the information after the forgetting processing, the input gate performs cell state update on the information after the forgetting processing to obtain updated information, the output gate filters the state of the LSTM neural network according to the updated information, and uses the obtained first prediction result as the output of the LSTM neural network.

5. A photovoltaic power prediction method based on BP convolutional neural network as claimed in claim 4, characterized in that: The specific steps for optimizing the model in step S3 are as follows: S31 predicts the output using the trained prediction model according to the three parameters of the neural network and the input characteristics of the model, takes the absolute value of the error between the predicted output value and the actual value as the individual fitness, and calculates the function H through formula ④; Where n represents the number of output nodes, x i Represents the predicted output value, y i represents the actual value, k is the coefficient; S32 uses the roulette wheel method to select individuals, and uses formula ⑤ and formula ⑥ to calculate the probability of each individual being selected as P i ; f i =k / H Formula ⑥, Among them, f i represents the fitness value of individual i, J i represents the position of individual i in the neural network, and N is the number of individuals in the population; S33 adopts the real number crossover method and uses equations ⑦ and ⑧ to perform crossover operations; a kj = a kj (1-b)+a ij b Equation ⑦, a ij = a ij (1-b)+a kj b Equation ⑧, Among them, a ij represents the jth gene of the i-th individual, a kj represents the jth gene of the kth individual, and b is the bias; S34 selects the jth gene of the i-th individual and performs mutation operation using formula ⑨; Among them, a max for a ij The upper limit of the gene, a min for a ij The lower limit of the gene, g is the current iteration number, and r is a random number between [0, 1]; S35 repeats steps S32-S34 until a new population is formed.

Citation Information

Patent Citations

  • Low-cost photovoltaic power prediction method based on city weather forecasts

    CN104156777A

Cited By

  • Optimization method for hydrogen production through multi-cell series-parallel connection of alkaline electrolytic cells

    CN119517203A