CN118554433A - Photovoltaic power generation prediction method and device based on hybrid deep learning and storage medium - Google Patents
Photovoltaic power generation prediction method and device based on hybrid deep learning and storage medium Download PDFInfo
- Publication number
- CN118554433A CN118554433A CN202410618682.6A CN202410618682A CN118554433A CN 118554433 A CN118554433 A CN 118554433A CN 202410618682 A CN202410618682 A CN 202410618682A CN 118554433 A CN118554433 A CN 118554433A
- Authority
- CN
- China
- Prior art keywords
- power generation
- data
- photovoltaic power
- model
- generation prediction
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000010248 power generation Methods 0.000 title claims abstract description 87
- 238000000034 method Methods 0.000 title claims abstract description 39
- 238000013135 deep learning Methods 0.000 title claims abstract description 15
- 238000003860 storage Methods 0.000 title claims abstract description 8
- 230000007246 mechanism Effects 0.000 claims abstract description 23
- 238000012549 training Methods 0.000 claims abstract description 18
- 238000007781 pre-processing Methods 0.000 claims abstract description 16
- 238000000605 extraction Methods 0.000 claims abstract description 9
- 230000000694 effects Effects 0.000 claims abstract description 8
- 238000010187 selection method Methods 0.000 claims abstract description 8
- 238000012216 screening Methods 0.000 claims abstract description 4
- 239000011159 matrix material Substances 0.000 claims description 24
- 238000010606 normalization Methods 0.000 claims description 19
- 238000012545 processing Methods 0.000 claims description 17
- 238000013527 convolutional neural network Methods 0.000 claims description 15
- 238000004140 cleaning Methods 0.000 claims description 14
- 230000006870 function Effects 0.000 claims description 14
- 210000002569 neuron Anatomy 0.000 claims description 14
- 230000004913 activation Effects 0.000 claims description 12
- 238000013500 data storage Methods 0.000 claims description 12
- 238000004364 calculation method Methods 0.000 claims description 9
- 239000013598 vector Substances 0.000 claims description 9
- 230000015654 memory Effects 0.000 claims description 8
- 230000008569 process Effects 0.000 claims description 8
- 238000013528 artificial neural network Methods 0.000 claims description 7
- 230000002159 abnormal effect Effects 0.000 claims description 6
- 230000001537 neural effect Effects 0.000 claims description 6
- 238000011176 pooling Methods 0.000 claims description 6
- 238000012360 testing method Methods 0.000 claims description 5
- 238000013136 deep learning model Methods 0.000 claims description 4
- 238000005457 optimization Methods 0.000 claims description 4
- ORILYTVJVMAKLC-UHFFFAOYSA-N Adamantane Natural products C1C(C2)CC3CC1CC2C3 ORILYTVJVMAKLC-UHFFFAOYSA-N 0.000 claims description 3
- 101001095088 Homo sapiens Melanoma antigen preferentially expressed in tumors Proteins 0.000 claims description 3
- 102100037020 Melanoma antigen preferentially expressed in tumors Human genes 0.000 claims description 3
- 238000004458 analytical method Methods 0.000 claims description 3
- 238000004422 calculation algorithm Methods 0.000 claims description 3
- 238000006243 chemical reaction Methods 0.000 claims description 3
- 238000009826 distribution Methods 0.000 claims description 3
- 230000003993 interaction Effects 0.000 claims description 3
- 230000007774 longterm Effects 0.000 claims description 3
- 238000013507 mapping Methods 0.000 claims description 3
- 238000013178 mathematical model Methods 0.000 claims description 3
- 238000011160 research Methods 0.000 claims description 3
- 238000012795 verification Methods 0.000 claims description 3
- 238000011156 evaluation Methods 0.000 abstract description 4
- 230000007613 environmental effect Effects 0.000 description 4
- 230000007547 defect Effects 0.000 description 3
- 238000010586 diagram Methods 0.000 description 3
- 230000035945 sensitivity Effects 0.000 description 3
- 230000009286 beneficial effect Effects 0.000 description 2
- 238000004590 computer program Methods 0.000 description 2
- 238000010801 machine learning Methods 0.000 description 2
- 238000000053 physical method Methods 0.000 description 2
- 238000007619 statistical method Methods 0.000 description 2
- 230000003313 weakening effect Effects 0.000 description 2
- 230000005856 abnormality Effects 0.000 description 1
- 230000008859 change Effects 0.000 description 1
- 238000003912 environmental pollution Methods 0.000 description 1
- 238000007726 management method Methods 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000003062 neural network model Methods 0.000 description 1
- 230000002035 prolonged effect Effects 0.000 description 1
- 238000000611 regression analysis Methods 0.000 description 1
- 230000006403 short-term memory Effects 0.000 description 1
- 238000006467 substitution reaction Methods 0.000 description 1
- 238000012706 support-vector machine Methods 0.000 description 1
- 238000012876 topography Methods 0.000 description 1
- 238000010200 validation analysis Methods 0.000 description 1
Landscapes
- Management, Administration, Business Operations System, And Electronic Commerce (AREA)
Abstract
The invention discloses a photovoltaic power generation prediction method, a device and a storage medium based on mixed deep learning, wherein the photovoltaic power generation prediction method comprises the following steps: acquiring photovoltaic power generation power and historical meteorological data, and preprocessing the original data; adopting a feature selection method of the MIC to analyze the correlation between the photovoltaic power generation power and the meteorological factors and screening out features with stronger correlation; constructing a photovoltaic power generation prediction model based on CNN-LSTM-MHA, and training the model by using a training data set after feature extraction; and carrying out overall evaluation on the prediction effect of the model by adopting an average absolute percentage error, a standard root mean square error and a correlation coefficient. The invention considers the problem of larger input feature set and the influence factors of photovoltaic power generation prediction, improves the photovoltaic power generation prediction precision, combines the attention mechanism advantages of CNN, LSTM and MHA by the model, and can accurately predict the photovoltaic power generation power.
Description
Technical Field
The invention belongs to the technical field of power systems, and mainly relates to a photovoltaic power generation prediction method and device based on hybrid deep learning and a storage medium.
Background
The current photovoltaic power generation is used as a clean and renewable energy form, and the problems of shortage of fossil energy, environmental pollution, climate change and the like can be relieved to a certain extent. The photovoltaic power is accurately predicted, so that a basis can be provided for grid-connected operation and energy management operation of the photovoltaic power station, and references are provided for timely finding out equipment abnormality and removing faults. Therefore, accurately predicting the photovoltaic power generation power has important significance for future planning and stable and safe operation of the power grid. However, the solar irradiance, which is a key factor affecting the photovoltaic power generation, is affected by climate, topography, etc., and has obvious volatility and intermittence, thus making it difficult to predict the photovoltaic power generation.
At present, photovoltaic power generation power prediction is divided into a physical method, a statistical method and a machine learning method. The physical method mainly builds a physical model for calculation, and modeling is relatively difficult. The statistical method is mainly a time series method and a regression analysis method, and is only applicable to the case of stable time series and small data sample size. The machine learning method is represented by a support vector machine and an artificial neural network. Due to the timing characteristics of photovoltaic power generation, long-short-term memory neural networks LSTM that are advantageous in dealing with timing nonlinearity problems are widely used. However, the prediction result of the single LSTM model has hysteresis, and the prediction effect becomes poor as the prediction time is prolonged. While single models continue to improve, there are inherent shortcomings and limitations. The photovoltaic power generation power is influenced by environmental factors such as solar irradiance, air temperature and the like, so that the prediction of the photovoltaic power generation also needs to consider the influence of different environmental factors, and the prediction effect of the model is improved. In addition, although various environmental factors are considered, input features of the model are not screened, so that input parameters of the prediction model are excessive, and the complexity of the prediction model is increased.
Disclosure of Invention
In order to solve the problems, the invention provides a photovoltaic power generation prediction method, a device and a storage medium based on mixed deep learning, solves the problem of insufficient extraction of the traditional photovoltaic power generation power characteristics, overcomes the defects of weakening and forgetting the long time sequence input characteristics of LSTM, and improves the sensitivity of a prediction model to historical data at different moments.
In order to achieve the above purpose, the invention adopts the following technical scheme:
the photovoltaic power generation prediction method based on the hybrid deep learning model comprises the following steps of:
step 1, collecting photovoltaic power generation power and historical meteorological data as a research data set, and preprocessing original data;
Step 2, analyzing the correlation between the photovoltaic power generation power and meteorological factors by adopting a feature selection method of the MIC, and screening out features with stronger correlation;
Step 3, constructing a photovoltaic power generation prediction model based on the CNN-LSTM-MHA, and training a CNN-LSTM-MHA network model by using the training data set obtained in the step 2 after feature extraction;
And 4, carrying out overall evaluation on the prediction effect of the model by adopting an average absolute percentage error, a standard root mean square error and a correlation coefficient.
CNN-LSTM-MHA is an English abbreviation for convolutional neural network-long-short-term memory neural network-multi-head attention mechanism. CNN corresponds to english abbreviation of convolutional neural network, LSTM corresponds to english abbreviation of long-short-term memory neural network, and MHA corresponds to english abbreviation of multi-head attention mechanism.
The data in the step 1 comprise weather data such as irradiance, temperature, humidity and wind speed and historical data of photovoltaic power generation power; step 1 further comprises: and preprocessing the historical data, wherein the preprocessing is to perform data cleaning and normalization processing on different types of data.
1) The data cleaning aims to ensure the integrity and accuracy of the data, and in the data cleaning process, whether missing values and abnormal values exist in the data set or not needs to be checked, and corresponding processing is performed. The filling method of the missing value and the abnormal value is as follows:
Where x i is the i-th data after filling, and x i-2、xi-1、xi+1 and x i+2 are the i-2, i-1, i+1 and i+2 data, respectively.
The formula of MIC in the step 2 is as follows, and the value range is [0,1], wherein 0 represents no correlation, 1 represents complete correlation, namely, the larger the value is, the stronger the correlation of the two variables is.
Wherein m is a photovoltaic power generation power variable, n is a meteorological factor variable, I (m, n) is a mutual information coefficient of m and n variables, p (m, n) is a joint probability of m and n variables, p (m) and p (n) are probabilities of m and n variables respectively, MIC (m, n) is a maximum information coefficient of m and n variables, a and B are numbers dividing grids in m and n directions, namely grid distribution, and B is a constant.
The convolutional neural network CNN in the step 3 comprises a convolutional layer, a batch normalization layer, an activation function layer, a maximum pooling layer and a full connection layer; firstly, carrying out convolution calculation on input data through convolution kernels with different scales of a convolution layer, extracting features with different finesses, and adding a batch normalization layer and an activation function layer after convolution to obtain a group of feature vectors; and then compressing the generated feature vector through a maximum pooling layer, and adjusting the output dimension through a full connection layer.
The long-short-term memory neural network LSTM unit in the step 3 comprises a forgetting gate, an input gate and an output gate, and the mathematical model is as follows:
Forgetting the door:
ft=σ(Wf·[ht-1,xt]+bf)
an input door:
it=σ(Wi·[ht-1,xt]+bi)
output door:
ot=σ(Wo·[ht-1,xt]+bo)
ht=ot·tanh(Ct)
Wherein f t is the output state at the time of forgetting gate t, i t is the output state at the time of input gate t, and o t is the output state at the time of output gate t; x t is sample data at time t; And C t are the instant state and the long-term state of the neuron at the time t respectively; h t is the hidden state of neuron t, h t-1 is the hidden state of neuron t-1; w f and b f are respectively a weight coefficient matrix and a bias term corresponding to the forgetting gate; w i and b i are respectively a weight coefficient matrix and a bias term corresponding to the input gate; w o and b o are respectively a weight coefficient matrix and a bias term corresponding to the output gate; w c and b c are respectively a weight coefficient matrix and a bias term corresponding to the neuron; sigma (·) and tan h (·) are the sigmoid activation function and hyperbolic tangent activation function, respectively.
The multi-head attention mechanism MHA of the step 3 can execute a plurality of attentions in parallel, is mainly used for extracting and processing characteristics of an input sequence, and a model learns different characteristic representations, so that the performance of the model is improved, and the calculation process is as follows:
1) First, query Q, key K, and value V are mapped into n different linear spaces, respectively:
2) Then, using the scaled dot product attentiveness, an attentiveness score for each attentiveness head is calculated:
3) Finally, splicing the results of the plurality of attention heads, and obtaining the final multi-head attention through another linear conversion:
Wherein W i Q is a parameter matrix of the linear space corresponding to the ith attention head mapped to the query, W i K is a parameter matrix of the linear space corresponding to the ith attention head mapped to the key, W i V is a parameter matrix of the linear space corresponding to the ith attention head mapped to the value, Q i is a result of the linear space corresponding to the ith attention head mapped to the query, K i is a result of the linear space corresponding to the ith attention head mapped to the key, V i is a result of the linear space corresponding to the ith attention head mapped to the value, H i is an attention score of the ith attention head, softmax (·) is a normalized exponential function, For the transpose of K i, d is a scaling factor, MHA (Q, K, V) is the output of the final multi-head attention, and W o is the mapping of the multi-head attention representation to the parameter matrix in the original vector space.
The training process of the step 3 is as follows: the data set is divided into a training set, a verification set and a test set according to the proportion, and the established CNN-LSTM-MHA model is trained and optimized by adopting an Adam optimization algorithm.
And step 4, carrying out overall evaluation on the prediction effect of the model by adopting an average absolute percentage error, a standard root mean square error and a correlation coefficient.
Average absolute percentage error:
standard root mean square error:
correlation coefficient:
Where N MAPE is the mean absolute percentage error, N RMSE is the standard root mean square error, R 2 is the correlation coefficient between the actual and predicted values, y i is the actual value, y' i is the predicted value, M is the total number of samples, The average value of the samples representing the actual value,Sample average representing predicted values.
Correspondingly, the invention provides a photovoltaic power generation prediction device based on CNN-LSTM-MHA, which comprises the following components:
The data storage module is used for storing photovoltaic power generation power and historical meteorological data;
The data processing module is used for preprocessing the data in the data storage module, the preprocessing comprises data cleaning and normalization processing, the data cleaning ensures the integrity and the accuracy of the data, the normalization processing prevents the order-of-magnitude difference among variables from greatly influencing the model prediction precision, and the processed data is stored in the data storage module;
And the feature selection module is used for performing feature selection on the preprocessed training data set of the data storage module and taking the feature selection as the input of the photovoltaic power generation prediction module. The feature selection module adopts a feature selection method of the maximum information coefficient MIC to analyze the correlation between the photovoltaic power generation power and meteorological factors, explores the interaction between different features and gives an importance analysis result of the features;
And the photovoltaic power generation prediction module is used for calculating a predicted value of photovoltaic power generation power. The photovoltaic power generation prediction module adopts a CNN-LSTM-MHA model, and integrates an attention mechanism into the photovoltaic power generation prediction module, so that information features which are more important for the current task can be focused in a plurality of input information, the degree of focusing on other information is reduced, even irrelevant information is filtered, and the prediction precision can be improved.
The invention also provides a computer readable storage medium having stored thereon a computer program which when executed by a processor implements the steps of the CNN-LSTM-MHA based photovoltaic power generation prediction method described above.
The beneficial effects are that:
1. According to the method, the MIC method is used as a theoretical support, key data characteristics affecting photovoltaic power generation are selected, the correlation between an input variable and a target variable is improved, and the prediction accuracy is effectively improved;
2. The method combines the advantages of CNN on feature extraction and LSTM on time sequence prediction, solves the problem of insufficient feature extraction of the traditional photovoltaic power generation power, overcomes the defects of weakening and forgetting long time sequence input features of LSTM by utilizing an MHA attention mechanism, and improves the sensitivity of a prediction model to historical data at different moments.
Drawings
FIG. 1 is a flow chart of a photovoltaic power generation prediction method based on a hybrid deep learning model of the present invention;
FIG. 2 is a diagram of the CNN architecture of the present invention;
FIG. 3 is a block diagram of the LSTM of the present invention;
FIG. 4 is a block diagram of the MHA of the present invention;
FIG. 5 is a graph of a photovoltaic power generation prediction model based on CNN-LSTM-MHA of the present invention.
Detailed Description
The present invention will be described in further detail with reference to examples and drawings, but embodiments of the present invention are not limited thereto.
Referring to fig. 1, the invention provides a photovoltaic power generation prediction method based on a hybrid deep learning model, which specifically comprises the following steps:
Step 1, collecting photovoltaic power generation power and historical meteorological data as a research data set, and preprocessing original data; the acquired dataset was then processed according to 7:2: the scale of 1 is divided into a training set, a validation set and a test set. The training set and the verification set are used for training the model, and the test set is used for testing the trained model. The data includes weather data such as irradiance, temperature, humidity, wind speed, and historical data of photovoltaic power generation power. Further, preprocessing is carried out on the historical data, and the preprocessing comprises data cleaning and normalization processing.
CNN-LSTM-MHA is an English abbreviation for convolutional neural network-long-short-term memory neural network-multi-head attention mechanism. Convolutional Neural Network (CNN) -long short term memory neural network (LSTM) -multi-headed attention Mechanism (MHA).
1) The data cleaning aims to ensure the integrity and accuracy of the data, and in the data cleaning process, whether missing values and abnormal values exist in the data set or not needs to be checked, and corresponding processing is performed. The filling method of the missing value and the abnormal value is as follows:
Where x i is the i-th data after filling, and x i-2、xi-1、xi+1 and x i+2 are the i-2, i-1, i+1, and i+2 data, respectively.
2) The purpose of data normalization is to scale the data ranges of different features to the same range, so that the problem that the model performance cannot reach a more ideal degree due to the fact that sequence information cannot be well learned because of overlarge dimension differences of data can be avoided. Data min-max normalization is employed herein to scale different features to the same range, typically between 0-1. The min-max normalized formula is as follows:
where x i is the ith data, For the normalized i-th data, x min and x max are the maximum and minimum values in the data, respectively.
And 2, analyzing the correlation between the photovoltaic power generation power and the meteorological factors by adopting a characteristic selection method of the maximum information coefficient MIC, screening out the characteristic with stronger correlation, wherein the MIC has a calculation formula as shown in the specification, and the range of values of the MIC is [0,1], wherein 0 represents no correlation, 1 represents complete correlation, namely, the larger the value is, the stronger the correlation of the two variables is.
Wherein m is a photovoltaic power generation power variable, n is a meteorological factor variable, I (m, n) is a mutual information coefficient of m and n variables, p (m, n) is a joint probability of m and n variables, p (m) and p (n) are probabilities of m and n variables, MIC (m, n) is a maximum information coefficient of m and n variables, a and B are numbers dividing grids in m and n directions, namely grid distribution, and B is a constant.
And 3, constructing a photovoltaic power generation prediction model based on CNN-LSTM-MHA, wherein the convolutional neural network CNN comprises a convolutional layer, a batch normalization layer, an activation function layer, a maximum pooling layer and a full connection layer, and the structure of the convolutional neural network CNN is shown in figure 2. Firstly, carrying out convolution calculation on input data through convolution kernels with different scales of a convolution layer, extracting features with different finesses, and adding a batch normalization layer and an activation function layer after convolution to obtain a group of feature vectors; and then compressing the generated feature vector through a maximum pooling layer, and adjusting the output dimension through a full connection layer. The structure of the long-short-term memory neural network LSTM is shown in fig. 3, each LSTM unit comprises a forgetting gate, an input gate and an output gate, and the mathematical model is as follows:
Forgetting the door:
ft=σ(Wf·[ht-1,xt]+bf)
an input door:
it=σ(Wi·[ht-1,xt]+bi)
output door:
ot=σ(Wo·[ht-1,xt]+bo)
ht=ot·tanh(Ct)
Wherein f t is the output state at the time of forgetting gate t, i t is the output state at the time of input gate t, and o t is the output state at the time of output gate t; x t is sample data at time t; Is the instant state at time t of the neuron, C t is the long-term state at time t of the neuron; h t is the hidden state of neuron t, and h t-1 is the hidden state of neuron t-1, respectively; w f and b f are respectively a weight coefficient matrix and a bias term corresponding to the forgetting gate; w i and b i are respectively a weight coefficient matrix and a bias term corresponding to the input gate; w o and b o are respectively a weight coefficient matrix and a bias term corresponding to the output gate; w c and b c are respectively a weight coefficient matrix and a bias term corresponding to the neuron; sigma (·) and tan h (·) are the sigmoid activation function and hyperbolic tangent activation function, respectively.
Further, the multi-head attention mechanism MHA can execute multiple attentions in parallel, and is mainly used for extracting and processing features of an input sequence, and the model learns different feature representations, so that the performance of the model is improved, and the calculation process is as follows:
First, query Q, key K, and value V are mapped into n different linear spaces, respectively:
Qi=QWi Q,Ki=KWi K,Vi=VWi V,i∈[1,n]
Then, using the scaled dot product attentiveness, an attentiveness score for each attentiveness head is calculated:
Finally, splicing the results of the plurality of attention heads, and obtaining the final multi-head attention through another linear conversion:
Where W i Q is a parameter matrix of the linear space corresponding to the ith attention head of the query, W i K is a parameter matrix of the linear space corresponding to the ith attention head of the key map, W i V is a parameter matrix of the linear space corresponding to the ith attention head of the value map, Q i is a result of the linear space corresponding to the ith attention head of the query, K i is a result of the linear space corresponding to the ith attention head of the key map, V i is a result of the linear space corresponding to the ith attention head of the value map, H i is an attention score of the ith attention head of the key map, softmax (·) is a normalized exponential function, For the transpose of K i, d is a scaling factor, MHA (Q, K, V) is the output of the final multi-head attention, and W o is the mapping of the multi-head attention representation to the parameter matrix in the original vector space.
So far, the photovoltaic power generation prediction model based on CNN-LSTM-MHA is completely established, and the complete structure of the model is shown in figure 5. Further, training and optimizing the established CNN-LSTM-MHA model by using the training data set obtained in the step 2 after feature extraction and an Adam optimization algorithm.
And 4, carrying out overall evaluation on the prediction effect of the model by adopting an average absolute percentage error, a standard root mean square error and a correlation coefficient.
Average absolute percentage error:
standard root mean square error:
correlation coefficient:
Where N MAPE is the mean absolute percentage error, N RMSE is the standard root mean square error, R 2 is the correlation coefficient between the actual and predicted values, y i is the actual value, y' i is the predicted value, M is the total number of samples, The average value of the samples representing the actual value,Sample average representing predicted values.
The embodiment of the invention has the following beneficial effects:
According to the embodiment of the invention, according to the operation characteristics of the photovoltaic power generation, the influence of different environmental factors on the photovoltaic power generation is comprehensively considered. In the feature selection stage, feature variables with higher importance degree are extracted by using an MIC method and used as the input of a neural network model, so that the correlation between the input feature variables and target variables can be improved, and the complexity of a prediction model can be reduced. The advantages of CNN in feature extraction and LSTM in time sequence prediction are combined, the problem of insufficient feature extraction of traditional photovoltaic power generation power prediction is solved, the defect that LSTM weakens and forgets long time sequence input features is overcome by utilizing an MHA attention mechanism, sensitivity of a prediction model to historical data at different time is improved, and short-term prediction accuracy of photovoltaic power generation is improved.
Based on the same inventive concept as the above embodiments, one embodiment of the present invention provides a hybrid deep learning-based photovoltaic power generation prediction apparatus, including:
The data storage module is used for storing photovoltaic power generation power and historical meteorological data;
The data processing module is used for preprocessing the data in the data storage module, the preprocessing comprises data cleaning and normalization processing, the data cleaning ensures the integrity and the accuracy of the data, the normalization processing prevents the order-of-magnitude difference among variables from greatly influencing the model prediction precision, and the processed data is stored in the data storage module;
the feature selection module is used for performing feature selection on the preprocessed training data set of the data storage module and taking the feature selection as input of the photovoltaic power generation prediction module; the feature selection module adopts a feature selection method of the maximum information coefficient MIC to analyze the correlation between the photovoltaic power generation power and meteorological factors, explores the interaction between different features and gives an importance analysis result of the features;
The photovoltaic power generation prediction module is used for calculating a predicted value of photovoltaic power generation power; the photovoltaic power generation prediction module adopts a CNN-LSTM-MHA model, and integrates an attention mechanism into the photovoltaic power generation prediction module, so that information features which are more important for the current task can be focused in a plurality of input information, the degree of focusing on other information is reduced, even irrelevant information is filtered, and the prediction precision can be improved.
In another embodiment, the invention provides a computer readable storage medium having stored thereon a computer program which when executed by a processor implements the above-described CNN-LSTM-MHA based photovoltaic power generation prediction method.
The above examples are preferred embodiments of the present invention, but the embodiments of the present invention are not limited to the above examples, and any other changes, modifications, substitutions, combinations, and simplifications that do not depart from the spirit and principle of the present invention should be made in the equivalent manner, and the embodiments are included in the protection scope of the present invention.
Claims (10)
1. The photovoltaic power generation prediction method based on mixed deep learning is characterized by comprising the following steps of:
Step 1: collecting photovoltaic power generation power and historical meteorological data as a research data set, and preprocessing original data;
step 2: adopting a feature selection method of the MIC to analyze the correlation between the photovoltaic power generation power and the meteorological factors and screening out features with stronger correlation;
Step 3: constructing a photovoltaic power generation prediction model based on CNN-LSTM-MHA, and training a CNN-LSTM-MHA network model by using the training data set obtained in the step 2 after feature extraction;
step 4: the prediction effect of the model is comprehensively evaluated by adopting an average absolute percentage error, a standard root mean square error and a correlation coefficient;
The CNN-LSTM-MHA is an English abbreviation of convolutional neural network-long-short-term memory neural network-multi-head attention mechanism.
2. The hybrid deep learning based photovoltaic power generation prediction method according to claim 1, wherein the data in step 1 includes weather data such as irradiance, temperature, humidity, wind speed, and historical data of photovoltaic power generation power; step 1 further comprises: preprocessing the historical data, wherein the preprocessing is to clean and normalize meteorological data and photovoltaic power generation histories;
The data cleaning aims to ensure the integrity and the accuracy of the data, and in the data cleaning process, whether missing values and abnormal values exist in a data set or not is checked, and corresponding processing is performed; the filling method of the missing value and the abnormal value is as follows:
Wherein x i is the i-th data after filling, and x i-2、xi-1、xi+1 and x i+2 are the i-2, i-1, i+1 and i+2 data respectively;
The purpose of the data normalization is to scale the data ranges of different features into the same range, so that the problem that the model performance cannot reach ideal degree due to the fact that sequence information cannot be well learned because the data size differences are too large can be avoided; the data normalization is to scale different features to the same range, usually between 0 and 1, by adopting data min-max normalization; the min-max normalized formula is as follows:
where x i is the ith data, For the normalized i-th data, x min is the minimum value in the data and x max is the maximum value in the data.
3. The hybrid deep learning-based photovoltaic power generation prediction method according to claim 1, wherein a feature selection method of a maximum information coefficient MIC is adopted to analyze the correlation between photovoltaic power generation power and meteorological factors, the MIC has a value range of [0,1], wherein 0 represents no correlation, 1 represents complete correlation, namely, the larger the value is, the stronger the correlation between two variables is indicated, and the calculation formula is as follows;
Wherein m is a photovoltaic power generation power variable, n is a meteorological factor variable, I (m, n) is a mutual information coefficient of m and n variables, p (m, n) is a joint probability of m and n variables, p (m) is a probability of m variables, p (n) is a probability of n variables, MIC (m, n) is a maximum information coefficient of m and n variables, and a, b are the number of dividing grids in the m and n directions, namely grid distribution; b is a constant set to the power of 0.6 of the data amount.
4. The hybrid deep learning-based photovoltaic power generation prediction method according to claim 1, wherein the convolutional neural network CNN comprises a convolutional layer, a batch normalization layer, an activation function layer, a maximum pooling layer and a full connection layer; firstly, carrying out convolution calculation on input data through convolution kernels with different scales in a convolution layer, extracting features with different finesses, and sequentially adding a batch normalization layer and an activation function layer after convolution to obtain a group of feature vectors; and then compressing the generated feature vector through a maximum pooling layer, and adjusting the output dimension through a full connection layer.
5. The hybrid deep learning-based photovoltaic power generation prediction method according to claim 1, wherein the long-short-term memory neural network LSTM unit in the CNN-LSTM-MHA photovoltaic power generation prediction model comprises a forgetting gate, an input gate and an output gate, and the mathematical model is as follows:
Forgetting the door:
ft=σ(Wf·[ht-1,xt]+bf)
an input door:
it=σ(Wi·[ht-1,xt]+bi)
output door:
ot=σ(Wo·[ht-1,xt]+bo)
ht=ot·tanh(Ct)
Wherein f t is the output state at the time of forgetting gate t, i t is the output state at the time of input gate t, and o t is the output state at the time of output gate t; x t is sample data at time t; Is the instant state at time t of the neuron, C t is the long-term state at time t of the neuron; h t is the hidden state of neuron t, h t-1 is the hidden state of neuron t-1; w f and b f are respectively a weight coefficient matrix and a bias term corresponding to the forgetting gate; w i and b i are respectively a weight coefficient matrix and a bias term corresponding to the input gate; w o and b o are respectively a weight coefficient matrix and a bias term corresponding to the output gate; w c and b c are respectively a weight coefficient matrix and a bias term corresponding to the neuron; sigma (·) and tan h (·) are the sigmoid activation function and hyperbolic tangent activation function, respectively.
6. The hybrid deep learning-based photovoltaic power generation prediction method according to claim 1, wherein the multi-head attention mechanism MHA in the CNN-LSTM-MHA photovoltaic power generation prediction model can execute a plurality of attentions in parallel, and is mainly used for extracting and processing characteristics of an input sequence, and the photovoltaic power generation prediction model learns different characteristic representations, so that the performance of the model is improved, and the calculation process is as follows:
1) First, query Q, key K, and value V are mapped into n different linear spaces, respectively:
2) Then, using the scaled dot product attentiveness, an attentiveness score for each attentiveness head is calculated:
3) Finally, splicing the results of the plurality of attention heads, and obtaining the final multi-head attention through another linear conversion:
In the method, in the process of the invention, To query the parameter matrix mapped to the linear space corresponding to the ith attention header,For a parameter matrix key mapped to the linear space corresponding to the ith attention header,For a parameter matrix whose values map to the linear space corresponding to the ith attention head, Q i is the result of the query mapped to the linear space corresponding to the ith attention head, K i is the result of the key mapped to the linear space corresponding to the ith attention head, V i is the result of the value mapped to the linear space corresponding to the ith attention head, H i is the attention score of the ith attention head, softmax (.),For the transpose of K i, d is a scaling factor, MHA (Q, K, V) is the output of the final multi-head attention, and W o is the mapping of the multi-head attention representation to the parameter matrix in the original vector space.
7. The hybrid deep learning-based photovoltaic power generation prediction method according to claim 1, wherein the data set is proportionally divided into a training set, a verification set and a test set, and the established CNN-LSTM-MHA model is subjected to training optimization by adopting an Adam optimization algorithm.
8. The hybrid deep learning-based photovoltaic power generation prediction method according to claim 1, wherein the prediction effect of the model is integrally evaluated by adopting an average absolute percentage error, a standard root mean square error and a correlation coefficient;
average absolute percentage error:
standard root mean square error:
correlation coefficient:
Where N MAPE is the mean absolute percentage error, N RMSE is the standard root mean square error, R 2 is the correlation coefficient between the actual and predicted values, y i is the actual value, y i' is the predicted value, M is the total number of samples, The average value of the samples representing the actual value,Sample average representing predicted values.
9. An apparatus for using the hybrid deep learning model-based photovoltaic power generation prediction method of any one of claims 1 to 8, comprising:
The data storage module is used for storing photovoltaic power generation power and historical meteorological data;
The data processing module is used for preprocessing the data in the data storage module, the preprocessing comprises data cleaning and normalization processing, the data cleaning ensures the integrity and the accuracy of the data, the normalization processing prevents the order-of-magnitude difference among variables from greatly influencing the model prediction precision, and the processed data is stored in the data storage module;
the feature selection module is used for performing feature selection on the preprocessed training data set of the data storage module and taking the feature selection as input of the photovoltaic power generation prediction module; the feature selection module adopts a feature selection method of the maximum information coefficient MIC to analyze the correlation between the photovoltaic power generation power and meteorological factors, explores the interaction between different features and gives an importance analysis result of the features;
The photovoltaic power generation prediction module is used for calculating a predicted value of photovoltaic power generation power; the photovoltaic power generation prediction module adopts a CNN-LSTM-MHA model, a attention mechanism is integrated into the photovoltaic power generation prediction module, information features which are more important to the current task are focused in a plurality of input information, the degree of focusing on other information is reduced, even irrelevant information is filtered, and the prediction precision can be improved.
10. A computer readable storage medium having instructions stored thereon, which when executed by a processor, implement the hybrid deep learning based photovoltaic power generation prediction method of any of claims 1-8.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202410618682.6A CN118554433A (en) | 2024-05-17 | 2024-05-17 | Photovoltaic power generation prediction method and device based on hybrid deep learning and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202410618682.6A CN118554433A (en) | 2024-05-17 | 2024-05-17 | Photovoltaic power generation prediction method and device based on hybrid deep learning and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN118554433A true CN118554433A (en) | 2024-08-27 |
Family
ID=92445681
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202410618682.6A Pending CN118554433A (en) | 2024-05-17 | 2024-05-17 | Photovoltaic power generation prediction method and device based on hybrid deep learning and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN118554433A (en) |
-
2024
- 2024-05-17 CN CN202410618682.6A patent/CN118554433A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110909919A (en) | Photovoltaic power prediction method of depth neural network model with attention mechanism fused | |
CN114792156B (en) | Photovoltaic output power prediction method and system based on curve characteristic index clustering | |
CN110717610A (en) | Wind power prediction method based on data mining | |
CN113449919B (en) | Power consumption prediction method and system based on feature and trend perception | |
CN114462718A (en) | CNN-GRU wind power prediction method based on time sliding window | |
CN112381673A (en) | Park electricity utilization information analysis method and device based on digital twin | |
CN114021483A (en) | Ultra-short-term wind power prediction method based on time domain characteristics and XGboost | |
CN114676923A (en) | Method and device for predicting generated power, computer equipment and storage medium | |
CN116842337A (en) | Transformer fault diagnosis method based on LightGBM (gallium nitride based) optimal characteristics and COA-CNN (chip on board) model | |
CN116826737A (en) | Photovoltaic power prediction method, device, storage medium and equipment | |
CN110738363A (en) | photovoltaic power generation power prediction model and construction method and application thereof | |
CN113762591A (en) | Short-term electric quantity prediction method and system based on GRU and multi-core SVM counterstudy | |
CN117290673A (en) | Ship energy consumption high-precision prediction system based on multi-model fusion | |
CN108038518A (en) | A kind of photovoltaic generation power based on meteorological data determines method and system | |
CN117458437A (en) | Short-term wind power prediction method, system, equipment and medium | |
CN114234392B (en) | Air conditioner load fine prediction method based on improved PSO-LSTM | |
CN113449466B (en) | Solar radiation prediction method and system for optimizing RELM based on PCA and chaos GWO | |
CN118554433A (en) | Photovoltaic power generation prediction method and device based on hybrid deep learning and storage medium | |
CN114897260A (en) | Short-term wind speed prediction model modeling method and prediction method based on LSTM neural network | |
CN113642784A (en) | Wind power ultra-short term prediction method considering fan state | |
CN113723670A (en) | Photovoltaic power generation power short-term prediction method with variable time window | |
CN113485986B (en) | Electric power data restoration method | |
CN117874495B (en) | Solar power generation power combination prediction method and device | |
CN114626195B (en) | Modeling method and system for solid oxide fuel cell system by using space-time data | |
CN117895508A (en) | Wind power prediction method based on deep learning |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination |