Hybrid deep learning-based photovoltaic power generation prediction method and device, and storage medium
By using the CNN-LSTM-MHA model and MIC feature selection in the photovoltaic power generation prediction model, the lag and complexity problems of the photovoltaic power generation prediction model are solved, the prediction accuracy and sensitivity are improved, and more accurate photovoltaic power generation power is achieved. predict.
Patent Information
- Application Number
- CN202410618682.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-17
- Publication Date
- 2024-08-27
AI Technical Summary
Existing photovoltaic power generation power prediction models have problems with lag and poor prediction effects in dealing with time series nonlinear problems. Too many input features increase the complexity of the model and fail to effectively consider the impact of environmental factors.
A hybrid deep learning model based on CNN-LSTM-MHA is used to select relevant features through the maximum information coefficient (MIC), combined with convolutional neural network, long short-term memory neural network and multi-head attention mechanism to improve the sensitivity and sensitivity of the model to historical data. Prediction accuracy.
The accuracy and sensitivity of the photovoltaic power generation prediction model are improved, the model complexity is reduced, the focus on historical data at different times is enhanced, and the prediction effect is improved.
Smart Images

Figure CN118554433A
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of power systems, and mainly relates to a photovoltaic power generation prediction method, device and storage medium based on hybrid deep learning. Background Art
[0002] Photovoltaic power generation is currently a clean and renewable form of energy, which can alleviate the shortage of fossil energy, environmental pollution and climate change to a certain extent. Accurately predicting photovoltaic power can not only provide a basis for the grid-connected operation and energy management of photovoltaic power stations, but also provide a reference for timely detection of equipment abnormalities and troubleshooting. Therefore, accurately predicting photovoltaic power generation is of great significance to the future planning and stable and safe operation of the power grid. However, solar irradiance, a key factor affecting photovoltaic power generation, is affected by climate, topography, etc., and has obvious volatility and intermittency, which brings certain difficulties to the prediction of photovoltaic power generation.
[0003] At present, photovoltaic power generation prediction is divided into physical methods, statistical methods and machine learning methods. The physical method mainly builds a physical model for calculation, but modeling is relatively difficult. The statistical method is mainly time series method and regression analysis method, which are only applicable to stable time series and small data sample size. Machine learning methods are represented by support vector machine and artificial neural network. Due to the time series characteristics of photovoltaic power generation, the long short-term memory neural network LSTM, which has advantages in dealing with time series nonlinear problems, is widely used. However, the prediction results of a single LSTM model have lags, and the prediction effect deteriorates as the prediction time increases. Although the single model is constantly improving, it still has its inherent deficiencies and limitations. Photovoltaic power generation is affected by environmental factors such as solar irradiance and temperature. Therefore, the prediction of photovoltaic power generation also needs to consider the influence of different environmental factors to improve the prediction effect of the model. In addition, although various environmental factors are considered, the input features of the model are not screened, resulting in too many input parameters of the prediction model and increasing the complexity of the prediction model. Summary of the invention
[0004] In order to solve the above problems, the present invention proposes a photovoltaic power generation prediction method, device and storage medium based on hybrid deep learning. The present invention solves the problem of insufficient extraction of traditional photovoltaic power features, makes up for the deficiency of LSTM in weakening and forgetting long time series input features, and improves the sensitivity of the prediction model to historical data at different times.
[0005] To achieve the above object, the present invention adopts the following technical solution:
[0006] A photovoltaic power generation prediction method based on a hybrid deep learning model includes the following steps:
[0007] Step 1. Collect photovoltaic power generation and historical meteorological data as research data sets, and preprocess the raw data;
[0008] Step 2. Use the feature selection method of maximum information coefficient MIC to analyze the correlation between photovoltaic power generation and meteorological factors, and select features with strong correlation;
[0009] Step 3. Build a photovoltaic power generation prediction model based on CNN-LSTM-MHA, and use the training data set after feature extraction obtained in step 2 to train the CNN-LSTM-MHA network model;
[0010] Step 4. Use the mean absolute percentage error, standard root mean square error and correlation coefficient to evaluate the prediction effect of the model as a whole.
[0011] CNN-LSTM-MHA is the abbreviation of Convolutional Neural Network-Long Short-Term Memory Neural Network-Multi-Head Attention Mechanism. CNN is the abbreviation of Convolutional Neural Network, LSTM is the abbreviation of Long Short-Term Memory Neural Network, and MHA is the abbreviation of Multi-Head Attention Mechanism.
[0012] The data in step 1 include meteorological data such as irradiance, temperature, humidity, wind speed and historical data of photovoltaic power generation; step 1 also includes: preprocessing the historical data, and the preprocessing is data cleaning and normalization processing of different types of data.
[0013] 1) The purpose of data cleaning is to ensure the integrity and accuracy of the data. During the data cleaning process, it is necessary to check whether there are missing values or outliers in the data set and deal with them accordingly. The method for filling missing values and outliers is as follows:
[0014]
[0015] In the formula, x i is the i-th data after filling, x i-2 、x i-1 、x i+1 and x i+2 They are the i-2, i-1, i+1 and i+2 data respectively.
[0016] The calculation formula of MIC in step 2 is as follows, and its value range is [0,1], where 0 indicates no correlation and 1 indicates complete correlation, that is, the larger the value, the stronger the correlation between the two variables.
[0017]
[0018]
[0019] Where m is the photovoltaic power variable, n is the meteorological factor variable, I(m,n) is the mutual information coefficient of m and n, p(m,n) is the joint probability of m and n, p(m) and p(n) are the probabilities of m and n respectively, MIC(m,n) is the maximum information coefficient of m and n, a and b are the number of grids divided in the m and n directions, that is, the grid distribution, and B is a constant.
[0020] The convolutional neural network CNN of step 3 includes a convolution layer, a batch normalization layer, an activation function layer, a maximum pooling layer and a fully connected layer; the input data is first convolved through convolution kernels of different scales in the convolution layer to extract features of different fineness, and a batch normalization layer and an activation function layer are added after the convolution to obtain a set of feature vectors; then the generated feature vectors are compressed through the maximum pooling layer, and the output dimension is adjusted through the fully connected layer.
[0021] The long short-term memory neural network LSTM unit in step 3 includes a forget gate, an input gate and an output gate, and its mathematical model is as follows:
[0022] Forget Gate:
[0023] f t =σ(W f ·[h t-1 ,x t ]+b f )
[0024] Input Gate:
[0025]
[0026]
[0027] i t =σ(W i ·[h t-1 ,x t ]+b i )
[0028] Output Gate:
[0029] o t =σ(W o ·[h t-1 ,x t ]+b o )
[0030] h t =o t tanh(C t )
[0031] In the formula, f tis the output state of the forget gate at time t, i t is the output state of the input gate at time t, o t is the output state of the output gate at time t; x t is the sample data at time t; and C t are the immediate state and long-term state of the neuron at time t; h t is the hidden state of the neuron at time t, h t-1 is the hidden state of the neuron at time t-1; W f and b f are the weight coefficient matrix and bias term corresponding to the forget gate respectively; W i and b i are the weight coefficient matrix and bias term corresponding to the input gate respectively; W o and b o are the weight coefficient matrix and bias term corresponding to the output gate respectively; W c and b c are the weight coefficient matrix and bias term corresponding to the neurons respectively; σ(·) and tanh(·) are the sigmoid activation function and the hyperbolic tangent activation function respectively.
[0032] The multi-head attention mechanism MHA in step 3 can execute multiple attentions in parallel, which is mainly used to extract and process the input sequence. The model learns different feature representations to improve the performance of the model. The calculation process is as follows:
[0033] 1) First, map the query Q, key K, and value V into n different linear spaces respectively:
[0034]
[0035] 2) Then, using scaled dot product attention, calculate the attention score for each attention head:
[0036]
[0037] 3) Finally, the results of multiple attention heads are concatenated and transformed linearly to obtain the final multi-head attention:
[0038]
[0039] Among them, W i Q is the parameter matrix mapped to the linear space corresponding to the ith attention head, W i K is the parameter matrix of the linear space corresponding to the key mapping to the i-th attention head, W i Vis the parameter matrix that maps values to the linear space corresponding to the i-th attention head, Q i K is the result of mapping the query to the linear space corresponding to the i-th attention head. i is the result of mapping the key to the linear space corresponding to the i-th attention head, V i is the result of mapping the value to the linear space corresponding to the i-th attention head, H i is the attention score of the ith attention head, softmax(·) is the normalized exponential function, K i is the transpose of , d is a scaling factor, MHA(Q,K,V) is the output of the final multi-head attention, W o A parameter matrix that maps the multi-head attention representation to the original vector space.
[0040] The training process of step 3 is as follows: the data set is divided into a training set, a validation set and a test set in proportion, and the Adam optimization algorithm is used to train and optimize the established CNN-LSTM-MHA model.
[0041] The step 4 uses the mean absolute percentage error, the standard root mean square error and the correlation coefficient to evaluate the prediction effect of the model as a whole.
[0042] Mean absolute percentage error:
[0043]
[0044] Standardized Root Mean Square Error:
[0045]
[0046] Correlation coefficient:
[0047]
[0048] 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 value and the predicted value, y i represents the actual value, y′ i represents the predicted value, M is the total number of samples, The sample mean represents the actual value, Represents the sample mean of the predicted value.
[0049] Accordingly, the present invention proposes a photovoltaic power generation prediction device based on CNN-LSTM-MHA, comprising:
[0050] Data storage module, used to store photovoltaic power generation and historical meteorological data;
[0051] The data processing module is used to preprocess the data in the data storage module. The preprocessing includes data cleaning and normalization. Data cleaning ensures the integrity and accuracy of the data. Normalization prevents the large magnitude difference between variables from affecting the prediction accuracy of the model. The processed data is stored in the data storage module.
[0052] The feature selection module is used to perform feature selection on the preprocessed training data set of the data storage module and use it as the input of the photovoltaic power generation prediction module. The feature selection module uses the maximum information coefficient MIC feature selection method to analyze the correlation between photovoltaic power generation and meteorological factors, explore the interaction between different features and give the importance analysis results of the features;
[0053] The photovoltaic power generation prediction module is used to calculate the predicted value of photovoltaic power generation. The photovoltaic power generation prediction module adopts the CNN-LSTM-MHA model and integrates the attention mechanism into the photovoltaic power generation prediction module. It can focus on the information features that are more important to the current task among many input information, reduce the attention to other information, and even filter out irrelevant information, which can improve the prediction accuracy.
[0054] The present invention also provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the steps of the above-mentioned photovoltaic power generation prediction method based on CNN-LSTM-MHA are implemented.
[0055] Beneficial effects:
[0056] 1. The method of the present invention adopts the MIC method as theoretical support, selects key data features that affect photovoltaic power generation, improves the correlation between input variables and target variables, and effectively improves prediction accuracy;
[0057] 2. The method of the present invention combines the advantages of CNN in feature extraction and the advantages of LSTM in time series prediction, solves the problem of insufficient feature extraction of traditional photovoltaic power generation, and uses the MHA attention mechanism to make up for the shortcomings of LSTM in weakening and forgetting long time series input features, thereby improving the sensitivity of the prediction model to historical data at different times. BRIEF DESCRIPTION OF THE DRAWINGS
[0058] Figure 1 This is a flow chart of the photovoltaic power generation prediction method based on the hybrid deep learning model of the present invention;
[0059] Figure 2 It is the CNN structure diagram of the present invention;
[0060] Figure 3 It is the LSTM structure diagram of the present invention;
[0061] Figure 4 It is the structural diagram of MHA of the present invention;
[0062] Figure 5 This is a photovoltaic power generation prediction model diagram based on CNN-LSTM-MHA of the present invention. DETAILED DESCRIPTION
[0063] The present invention is further described in detail below in conjunction with embodiments and drawings, but the embodiments of the present invention are not limited thereto.
[0064] Reference Figure 1 As shown, the present invention provides a photovoltaic power generation prediction method based on a hybrid deep learning model, which specifically includes the following steps:
[0065] Step 1. Collect photovoltaic power generation and historical meteorological data as research data sets, and preprocess the original data; divide the acquired data sets into training set, validation set and test set in a ratio of 7:2:1. The training set and validation set are used to train the model, and the test set is used to test the trained model. The data includes meteorological data such as irradiance, temperature, humidity, wind speed, and historical data of photovoltaic power generation. Furthermore, the historical data is preprocessed, and the preprocessing includes data cleaning and normalization.
[0066] CNN-LSTM-MHA is the abbreviation of 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-Head Attention Mechanism (MHA).
[0067] 1) The purpose of data cleaning is to ensure the integrity and accuracy of the data. During the data cleaning process, it is necessary to check whether there are missing values or outliers in the data set and deal with them accordingly. The method for filling missing values and outliers is as follows:
[0068]
[0069] In the formula, x i is the i-th data after filling, x i-2 、x i-1 、x i+1 and x i+2 They are the i-2, i-1, i+1, and i+2 data respectively.
[0070] 2) The purpose of data normalization is to scale the data range of different features to the same range, which can avoid the data being unable to learn sequence information well due to large differences in dimensions, resulting in the model performance not being able to reach a relatively ideal level. This paper uses data minimum-maximum normalization to scale different features to the same range, usually between 0 and 1. The formula for minimum-maximum normalization is as follows:
[0071]
[0072] In the formula, x i is the i-th data, is the normalized ith data, x min and x max are the maximum and minimum values in the data respectively.
[0073] Step 2. Use the feature selection method of maximum information coefficient MIC to analyze the correlation between photovoltaic power generation and meteorological factors, and screen out features with strong correlation. The calculation formula of MIC is as follows. Its value range is [0,1], where 0 means no correlation and 1 means complete correlation. That is, the larger the value, the stronger the correlation between the two variables.
[0074]
[0075]
[0076] Where m is the photovoltaic power variable, n is the meteorological factor variable, I(m,n) is the mutual information coefficient of m and n, p(m,n) is the joint probability of m and n, p(m) and p(n) are the probabilities of m and n, MIC(m,n) is the maximum information coefficient of m and n, a and b are the number of grids divided in the m and n directions, that is, the grid distribution, and B is a constant.
[0077] Step 3. Construct a photovoltaic power generation prediction model based on CNN-LSTM-MHA, where the convolutional neural network CNN includes a convolution layer, a batch normalization layer, an activation function layer, a maximum pooling layer and a fully connected layer. Its structure is as follows: Figure 2 As shown in Figure 1. The input data is first convolved through convolutional layers with convolution kernels of different scales to extract features of different fineness. After convolution, a batch normalization layer and an activation function layer are added to obtain a set of feature vectors. The generated feature vectors are then compressed through a maximum pooling layer, and the output dimension is adjusted through a fully connected layer. The structure of the long short-term memory neural network LSTM is shown in Figure 1. Figure 3 As shown, each LSTM unit contains a forget gate, an input gate, and an output gate, and its mathematical model is as follows:
[0078] Forget Gate:
[0079] f t =σ(W f ·[h t-1 ,x t ]+b f )
[0080] Input Gate:
[0081]
[0082]
[0083] i t =σ(W i ·[h t-1 ,x t ]+b i )
[0084] Output Gate:
[0085] o t =σ(W o ·[h t-1 ,x t ]+b o )
[0086] h t =o t tanh(C t )
[0087] In the formula, f t is the output state of the forget gate at time t, i t is the output state of the input gate at time t, o t is the output state of the output gate at time t; x t is the sample data at time t; is the instantaneous state of the neuron at time t, C t is the long-term state of the neuron at time t; h t is the hidden state of the neuron at time t, h t-1 are the hidden states of the neuron at time t-1; W f and b f are the weight coefficient matrix and bias term corresponding to the forget gate respectively; W i and b i are the weight coefficient matrix and bias term corresponding to the input gate respectively; W o and b o are the weight coefficient matrix and bias term corresponding to the output gate respectively; W c and b c are the weight coefficient matrix and bias term corresponding to the neurons respectively; σ(·) and tanh(·) are the sigmoid activation function and the hyperbolic tangent activation function respectively.
[0088] Furthermore, the multi-head attention mechanism MHA can execute multiple attentions in parallel, which is mainly used to extract and process the input sequence. The model learns different feature representations to improve the performance of the model. The calculation process is as follows:
[0089] First, the query Q, key K, and value V are mapped into n different linear spaces respectively:
[0090] Q i =QW i Q ,K i =KW i K ,V i =VW i V ,i∈[1,n]
[0091] Then, using scaled dot product attention, we calculate the attention score for each attention head:
[0092]
[0093] Finally, the results of multiple attention heads are concatenated and transformed again to get the final multi-head attention:
[0094]
[0095] Where W i Q is the parameter matrix mapped to the linear space corresponding to the ith attention head, W i K is the parameter matrix of the linear space corresponding to the key mapping to the i-th attention head, W i V is the parameter matrix that maps values to the linear space corresponding to the i-th attention head, Q i K is the result of mapping the query to the linear space corresponding to the i-th attention head. i is the result of mapping the key to the linear space corresponding to the i-th attention head, V i is the result of mapping the value to the linear space corresponding to the i-th attention head, H i is the attention score of the ith attention head, softmax(·) is the normalized exponential function, K i is the transpose of , d is a scaling factor, MHA(Q,K,V) is the output of the final multi-head attention, W o A parameter matrix that maps the multi-head attention representation to the original vector space.
[0096] So far, the photovoltaic power generation prediction model based on CNN-LSTM-MHA has been established, and its complete structure is as follows: Figure 5 As shown. Furthermore, the training data set after feature extraction obtained in step 2 and the Adam optimization algorithm are used to train and optimize the established CNN-LSTM-MHA model.
[0097] Step 4. Use the mean absolute percentage error, standard root mean square error and correlation coefficient to evaluate the prediction effect of the model as a whole.
[0098] Mean absolute percentage error:
[0099]
[0100] Standardized Root Mean Square Error:
[0101]
[0102] Correlation coefficient:
[0103]
[0104] 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 value and the predicted value, y i represents the actual value, y′ i represents the predicted value, M is the total number of samples, The sample mean represents the actual value, Represents the sample mean of the predicted value.
[0105] The implementation of the embodiments of the present invention has the following beneficial effects:
[0106] The embodiment of the present invention comprehensively considers the impact of different environmental factors on photovoltaic power generation based on the operating characteristics of photovoltaic power generation. In the feature selection stage, the MIC method is used to extract feature variables with higher importance as the input of the neural network model, which can improve the correlation between the input feature variables and the target variables and reduce the complexity of the prediction model. Combining the advantages of CNN in feature extraction and the advantages of LSTM in time series prediction, the problem of insufficient feature extraction in traditional photovoltaic power prediction is solved, and the MHA attention mechanism is used to make up for the shortcomings of LSTM in weakening and forgetting long-time series input features, thereby improving the sensitivity of the prediction model to historical data at different times and improving the short-term prediction accuracy of photovoltaic power generation.
[0107] Based on the same inventive concept as the above embodiment, one embodiment of the present invention provides a photovoltaic power generation prediction device based on hybrid deep learning, comprising:
[0108] Data storage module, used to store photovoltaic power generation and historical meteorological data;
[0109] The data processing module is used to preprocess the data in the data storage module. The preprocessing includes data cleaning and normalization. Data cleaning ensures the integrity and accuracy of the data. Normalization prevents the large magnitude difference between variables from affecting the prediction accuracy of the model. The processed data is stored in the data storage module.
[0110] A feature selection module is used to perform feature selection on the preprocessed training data set of the data storage module and use it as the input of the photovoltaic power generation prediction module; the feature selection module uses the maximum information coefficient MIC feature selection method to analyze the correlation between photovoltaic power generation and meteorological factors, explore the interaction between different features and give the importance analysis results of the features;
[0111] The photovoltaic power generation prediction module is used to calculate the predicted value of photovoltaic power generation; the photovoltaic power generation prediction module adopts the CNN-LSTM-MHA model, and integrates the attention mechanism into the photovoltaic power generation prediction module, which can focus on the information features that are more important to the current task among a large amount of input information, reduce the attention to other information, and even filter out irrelevant information, thereby improving the prediction accuracy.
[0112] In another embodiment, the present invention provides a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the above-mentioned photovoltaic power generation prediction method based on CNN-LSTM-MHA.
[0113] The above embodiments are preferred implementation modes of the present invention, but the implementation modes of the present invention are not limited to the above embodiments. Any other changes, modifications, substitutions, combinations, and simplifications that do not deviate from the spirit and principles of the present invention should be equivalent replacement methods and are included in the protection scope of the present invention.
Claims
1. A photovoltaic power generation prediction method based on hybrid deep learning, characterized in that: The following steps are involved: Step 1: Collect photovoltaic power generation and historical meteorological data as research data sets, and pre-process the raw data; Step 2: Use the feature selection method of maximum information coefficient MIC to analyze the correlation between photovoltaic power generation and meteorological factors, and select features with strong correlation; Step 3: Build a photovoltaic power generation prediction model based on CNN-LSTM-MHA, and use the training data set after feature extraction obtained in step 2 to train the CNN-LSTM-MHA network model; Step 4: Use mean absolute percentage error, standard root mean square error and correlation coefficient to evaluate the prediction effect of the model as a whole; The CNN-LSTM-MHA is the English abbreviation of Convolutional Neural Network-Long Short-Term Memory Neural Network-Multi-Head Attention Mechanism.
2. The photovoltaic power generation prediction method based on hybrid deep learning according to claim 1 is characterized in that: The data described in step 1 include meteorological data such as irradiance, temperature, humidity, wind speed, and historical data of photovoltaic power generation; step 1 also includes: preprocessing the historical data, wherein the preprocessing is to clean and normalize the meteorological data and photovoltaic power generation history; The purpose of data cleaning is to ensure the integrity and accuracy of the data. During the data cleaning process, it is necessary to check whether there are missing values or outliers in the data set, and deal with them accordingly; the method for filling missing values and outliers is as follows: In the formula, x i is the i-th data after filling, x i-2 、x i-1 、x i+1 and x i+2 They are the i-2, i-1, i+1 and i+2 data respectively; The purpose of data normalization is to scale the data range of different features to the same range, which can avoid the data from being unable to learn sequence information well due to large differences in dimensions, resulting in the model performance not being able to reach a relatively ideal level; the data normalization uses data minimum-maximum normalization to scale different features to the same range, usually between 0 and 1; the formula for minimum-maximum normalization is as follows: In the formula, x i is the i-th data, is the normalized ith data, x min is the minimum value in the data, x max is the maximum value in the data.
3. The photovoltaic power generation prediction method based on hybrid deep learning according to claim 1 is characterized in that: The feature selection method of maximum information coefficient MIC is used to analyze the correlation between photovoltaic power generation and meteorological factors. The value range of MIC is [0,1], where 0 indicates no correlation and 1 indicates complete correlation. That is, the larger the value, the stronger the correlation between the two variables. Its calculation formula is as follows: Where m is the photovoltaic power variable, n is the meteorological factor variable, I(m,n) is the mutual information coefficient of m and n variables, p(m,n) is the joint probability of m and n variables, p(m) is the probability of m variable, p(n) is the probability of n variable, MIC(m,n) is the maximum information coefficient of m and n variables, a and b are the number of grids divided in the m and n directions, that is, grid distribution; B is a constant, which is set to 0.6 power of the data amount.
4. The photovoltaic power generation prediction method based on hybrid deep learning according to claim 1 is characterized in that: The convolutional neural network CNN includes a convolution layer, a batch normalization layer, an activation function layer, a maximum pooling layer and a fully connected layer; the input data is first convolved with convolution kernels of different scales in the convolution layer to extract features of different fineness, and after the convolution, a batch normalization layer and an activation function layer are added in sequence to obtain a set of feature vectors; then the generated feature vectors are compressed through the maximum pooling layer, and the output dimension is adjusted through the fully connected layer.
5. The photovoltaic power generation prediction method based on hybrid deep learning according to claim 1 is characterized in that: The LSTM unit of the long short-term memory neural network in the photovoltaic power generation prediction model of the CNN-LSTM-MHA includes a forget gate, an input gate and an output gate, and its mathematical model is as follows: Forget Gate: f t =σ(W f ·[h t-1 ,x t ]+b f ) Input Gate: i t =σ(W i ·[h t-1 ,x t ]+b i ) Output Gate: the t =σ(W o ·[h t-1 ,x t ]+b o ) h t =o t ·tanh(C t ) In the formula, f t is the output state of the forget gate at time t, i t is the output state of the input gate at time t, o t is the output state of the output gate at time t; x t is the sample data at time t; is the instantaneous state of the neuron at time t, C t is the long-term state of the neuron at time t; h t is the hidden state of the neuron at time t, h t-1 is the hidden state of the neuron at time t-1; W f and b f are the weight coefficient matrix and bias term corresponding to the forget gate respectively; W i and b i are the weight coefficient matrix and bias term corresponding to the input gate respectively; W o and b o They are the weight coefficient matrix and bias term corresponding to the output gate respectively; W c and b c are the weight coefficient matrix and bias term corresponding to the neurons respectively; σ(·) and tanh(·) are the sigmoid activation function and the hyperbolic tangent activation function respectively.
6. The photovoltaic power generation prediction method based on hybrid deep learning according to claim 1 is characterized in that: The multi-head attention mechanism MHA in the photovoltaic power generation prediction model of the CNN-LSTM-MHA can execute multiple attentions in parallel, which is mainly used to extract and process the input sequence. The photovoltaic power generation prediction model learns different feature representations to improve the performance of the model. The calculation process is as follows: 1) First, map the query Q, key K, and value V into n different linear spaces respectively: 2) Then, using scaled dot product attention, calculate the attention score for each attention head: 3) Finally, the results of multiple attention heads are concatenated and transformed linearly to obtain the final multi-head attention: In the formula, To query the parameter matrix mapped to the linear space corresponding to the i-th attention head, is the parameter matrix of the linear space corresponding to the key mapping to the i-th attention head, is the parameter matrix that maps values to the linear space corresponding to the i-th attention head, Q i K is the result of mapping the query to the linear space corresponding to the i-th attention head. i is the result of mapping the key to the linear space corresponding to the i-th attention head, V i is the result of mapping the value to the linear space corresponding to the i-th attention head, H i is the attention score of the ith attention head, softmax(·) is the normalized exponential function, K i is the transpose of , d is a scaling factor, MHA(Q,K,V) is the output of the final multi-head attention, W o A parameter matrix that maps the multi-head attention representation to the original vector space.
7. The photovoltaic power generation prediction method based on hybrid deep learning according to claim 1 is characterized in that: The data set is divided into training set, validation set and test set in proportion, and the Adam optimization algorithm is used to train and optimize the established CNN-LSTM-MHA model.
8. The photovoltaic power generation prediction method based on hybrid deep learning according to claim 1, characterized in that: The mean absolute percentage error, standard root mean square error and correlation coefficient were used to evaluate the prediction effect of the model as a whole; Mean absolute percentage error: Standardized 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 value and the predicted value, y i Represents the actual value, y i ′ represents the predicted value, M is the total number of samples, The sample mean represents the actual value, Represents the sample mean of the predicted value.
9. A device using the photovoltaic power generation prediction method based on a hybrid deep learning model according to any one of claims 1 to 8, characterized in that: include: Data storage module, used to store photovoltaic power generation and historical meteorological data; The data processing module is used to preprocess the data in the data storage module. The preprocessing includes data cleaning and normalization. Data cleaning ensures the integrity and accuracy of the data. Normalization prevents the large magnitude difference between variables from affecting the prediction accuracy of the model. The processed data is stored in the data storage module. A feature selection module is used to perform feature selection on the preprocessed training data set of the data storage module and use it as the input of the photovoltaic power generation prediction module; the feature selection module uses the maximum information coefficient MIC feature selection method to analyze the correlation between photovoltaic power generation and meteorological factors, explore the interaction between different features and give the importance analysis results of the features; The photovoltaic power generation prediction module is used to calculate the predicted value of photovoltaic power generation; the photovoltaic power generation prediction module adopts the CNN-LSTM-MHA model, integrates the attention mechanism into the photovoltaic power generation prediction module, pays attention to the information features that are more important to the current task among a large number of input information, reduces the attention to other information, and even filters out irrelevant information, which can improve the prediction accuracy.
10. A computer-readable storage medium having instructions stored thereon, characterized in that: When the instruction is executed by the processor, the photovoltaic power generation prediction method based on hybrid deep learning as described in any one of claims 1 to 8 is implemented.
Citation Information
Cited By
Deep learning and physical model guide fused dense medium sorting density decision-making method
CN119049595A
Wind-solar power generation power prediction method based on meteorological feature screening and transfer learning
CN119167039A
State monitoring method and device of gas insulated switchgear and electronic equipment
CN119247125A
Photovoltaic power generation short-term prediction method and device based on satellite inversion data
CN119397233A
Method, system and equipment for predicting aggregation adjustable capability of virtual power plant based on cloud-edge collaboration mechanism
CN119476699A
