Photovoltaic power generation power prediction method and system
By building a deep learning model, combining weather and power characteristics, adding attention weights and correcting, the accuracy and management efficiency of photovoltaic power generation power prediction are solved, and higher prediction accuracy and stability are achieved.
Patent Information
- Application Number
- CN202411065212.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-08-05
- Publication Date
- 2024-12-20
AI Technical Summary
The existing photovoltaic power prediction methods have low prediction accuracy and are difficult to cope with sudden weather changes, resulting in low management and scheduling efficiency.
By constructing a deep learning-based photovoltaic power prediction model, combining weather characteristics and power characteristics, hidden features are extracted and attention weights are added, splicing processing and time periodicity and near-neighbor similarity correction are performed to improve prediction accuracy.
It improves the accuracy and adaptability of photovoltaic power generation power prediction, improves the management and scheduling efficiency of photovoltaic power stations, and enhances the accuracy and stability of prediction results.
Smart Images

Figure CN119167987A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of data processing, and in particular to a photovoltaic power generation power prediction method and system. Background Art
[0002] Accurate PV power forecasting can help the grid dispatching center to make power allocation in advance, balance supply and demand, ensure the stable operation of the grid, and reduce grid frequency and voltage fluctuations caused by PV power generation fluctuations.
[0003] With the rapid development of technologies such as pattern recognition, machine learning, and deep learning, more and more modern technologies are being applied to photovoltaic power prediction.
[0004] The commonly used photovoltaic power prediction technology is mainly the Long Short-Term Memory (LSTM) neural network. By introducing the "memory" mechanism, it can capture long-term dependencies and accurately predict photovoltaic power. However, the LSTM neural network mainly predicts the photovoltaic power generation in the future based on the power generation within a period of time from the current time, ignoring the impact of natural factors such as weather and climate on photovoltaic power generation, and it is difficult to cope with sudden weather changes, resulting in low accuracy in predicting power changes. Summary of the invention
[0005] In view of the above-mentioned problems, the present invention is proposed.
[0006] Therefore, the technical problem solved by the present invention is that the existing photovoltaic power generation prediction method has the problems of low prediction accuracy, low management and scheduling efficiency of photovoltaic power stations, and difficulty in coping with sudden weather changes.
[0007] To solve the above technical problems, the present invention provides the following technical solutions: a photovoltaic power prediction method, comprising constructing a photovoltaic power prediction model based on deep learning through weather characteristics and power characteristics; extracting hidden features to add attention weights; splicing the hidden features after adding attention weights; predicting power based on the fused features after splicing and outputting preliminary predicted power; correcting the preliminary predicted power based on time periodicity and neighbor similarity and outputting the final predicted power.
[0008] As a preferred solution of the photovoltaic power prediction method described in the present invention, wherein: the photovoltaic power prediction model based on deep learning is constructed by using weather characteristics and power characteristics, including collecting historical weather data and historical photovoltaic power generation data, and constructing a photovoltaic power prediction model based on deep learning, wherein the photovoltaic power prediction model includes a weather prediction unit and a power prediction unit;
[0009] The weather features in the historical weather data are extracted through the first convolutional layer in the weather prediction unit, and the power features in the historical photovoltaic power generation data are extracted through the second convolutional layer in the power prediction unit;
[0010] The convolution features in the historical weather data and the power features in the historical photovoltaic power generation data are extracted by the convolution kernel respectively, which are expressed as:
[0011]
[0012] in, represents the output of the current convolutional layer, represents the output of the previous convolutional layer, Represents the convolution kernel weight of the current convolution layer, Represents the bias term of the current convolutional layer, M j represents the selected input feature map, σ() represents the activation function;
[0013] The extracted convolution features are pooled and expressed as:
[0014]
[0015] Among them, down represents the downsampling function, represents the output of the current pooling layer, Represents the output of the previous pooling layer;
[0016] The pooled features are summarized and weather features and power features are output respectively.
[0017] As a preferred solution of the photovoltaic power prediction method described in the present invention, wherein: the extraction of hidden features to add attention weights includes extracting weather hidden features in weather features through the first gating unit in the weather prediction unit, and extracting power hidden features in power features through the second gating unit in the power prediction unit, which is expressed as:
[0018] z t =σ(W uz x t +W hz hw t-1 +b z )
[0019] r t =σ(W ur x t +W hr hw t-1 +b r )
[0020] c t =σ(W uc xt +W hc (r t hw t-1 )+b c )
[0021] hw t =(1-z t )hw t-1 +z t c t
[0022] Among them, z t represents the output vector of the update gate at time t, σ() represents the activation function, and W uz represents the weight matrix between the input layer and the update gate, x t represents the weather characteristics or power characteristics at time t, W hz represents the self-connection weight matrix of the update gate between time t and time t-1, h wt-1 represents the hidden state vector at time t-1, b z represents the bias term of the update gate, r t represents the output vector of the reset gate at time t, W ur represents the weight matrix between the input layer and the reset gate, W hr represents the self-connection weight matrix between the reset gate at time t and time t-1, b r represents the bias term of the reset gate, c t represents the output vector of the candidate layer at time t, W uc Represents the weight matrix between the input layer and the candidate layer, W hc represents the self-connection weight matrix between the candidate layer at time t and time t-1, b c represents the bias term of the candidate layer, ⊙ represents the element-wise product operation, and h wt Represents the hidden state vector at time t.
[0023] As a preferred solution of the photovoltaic power prediction method described in the present invention, the extraction of hidden features to add attention weights includes adding attention weights to weather hidden features at each moment through the first attention layer in the weather prediction unit, and adding attention weights to power hidden features at each moment through the second attention layer in the power prediction unit, which is expressed as:
[0024] e t =σ(W h hw t +b h )
[0025]
[0026] hw t'=α t hw t
[0027] Among them, e t represents the attention score at time t, σ() represents the activation function, and W h represents the attention weight matrix, h wt represents the hidden state vector at time t, b h represents the bias term of the attention layer, α t represents the attention weight at time t, exp() represents an exponential function with a natural constant as the base, T represents the total length of the data, and hw t ' represents the weather hidden features or power hidden features after adding the attention weights.
[0028] As a preferred solution of the photovoltaic power prediction method described in the present invention, the splicing processing of the hidden features after adding the attention weight includes splicing the weather hidden features and the power hidden features after adding the attention weight through a fully connected network, which is expressed as:
[0029] H t =(hw t ',hp t ')
[0030] Among them, H t represents the fusion feature after splicing, hw' t Represents the weather hidden features after adding attention weights, hp' t Represents the power hidden feature after adding the attention weights.
[0031] As a preferred solution of the photovoltaic power prediction method described in the present invention, the power prediction and output of the preliminary predicted power according to the fusion features after splicing processing include performing power prediction through the prediction layer according to the fusion features after splicing processing, and outputting the preliminary predicted power, which is expressed as:
[0032]
[0033] in, represents the initial prediction power at time t, σ() represents the activation function, W H represents the prediction weight matrix, H t represents the fusion features after splicing, b H Represents the prediction layer bias term.
[0034] As a preferred solution of the photovoltaic power prediction method described in the present invention, wherein: the correcting the preliminary predicted power based on time periodicity and neighbor similarity to output the final predicted power includes correcting the preliminary predicted power based on time periodicity and neighbor similarity to determine the final predicted power;
[0035] Output the correlation coefficients between adjacent days in the year before the forecast day:
[0036]
[0037] S ij =f(w ij ,w 00 )
[0038] V ij =gw ij )
[0039] Among them, C ij represents the correlation coefficient between the forecast day and the jth adjacent day in the previous i years, T ij represents the time correlation coefficient of the jth adjacent day in the previous i years, k1 represents the year correlation coefficient, k2 represents the date correlation coefficient, S ij represents the weather correlation coefficient of the jth adjacent day in the previous i years, f() represents the weather correlation function, and w ij represents the weather type of the jth consecutive day in the previous i years, w 00 represents the weather type prediction value of the forecast day, which is calculated based on the weather hidden features after adding the attention weight, V ij represents the randomness coefficient of the jth consecutive day in the previous i years, V 00 Represents the random coefficient of the forecast day, g() random function;
[0040] According to the correlation coefficient between the predicted day and each adjacent day in the previous year, the correlation prediction power is output, which is expressed as:
[0041]
[0042] Among them, P c Represents the correlation prediction power of the prediction day, P ij represents the power generation of the jth consecutive day in the previous i years, n represents the total number of years, and m represents the total number of consecutive days;
[0043] According to the correlation prediction power, the preliminary prediction power is corrected to determine the final prediction power;
[0044] The preliminary predicted power is corrected according to the correlation predicted power, which is expressed as:
[0045]
[0046] Among them, P t represents the final predicted power at time t, represents the preliminary predicted power at time t, P ct represents the correlation prediction power at time t in the prediction day, and λ represents the correction coefficient;
[0047] The photovoltaic power generation prediction model is trained by gradient descent method.
[0048] Another object of the present invention is to provide a photovoltaic power prediction system, which can output a final predicted power by correcting the preliminary predicted power based on time periodicity and neighbor similarity, thereby solving the problem of low prediction accuracy in current photovoltaic power prediction methods.
[0049] As a preferred solution of the photovoltaic power generation prediction system described in the present invention, it includes:
[0050] A computer device comprises a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement a step of a photovoltaic power generation prediction method.
[0051] A computer-readable storage medium stores a computer program, which implements the steps of a photovoltaic power generation power prediction method when executed by a processor.
[0052] The beneficial effects of the present invention are as follows: the photovoltaic power prediction method provided by the present invention takes into account historical weather data and historical photovoltaic power generation data, takes into account weather factors in the photovoltaic power prediction process, comprehensively captures various factors affecting photovoltaic power generation, improves adaptability to weather changes and prediction accuracy of power changes, and makes corrections based on time periodicity and neighbor similarity on the basis of preliminary prediction to determine the final predicted power, further improves the accuracy of photovoltaic power prediction, constructs a photovoltaic power prediction model based on deep learning through weather characteristics and power characteristics, more accurately predicts future photovoltaic power generation, and improves the management and scheduling efficiency of photovoltaic power stations. By adding attention weights to hidden features, complex data can be processed more effectively, and the accuracy of photovoltaic power prediction can be improved. By feature splicing processing, power prediction is performed using information of more dimensions to improve the accuracy of prediction results. By predicting fusion features, preliminary power prediction results can be quickly obtained, providing a basis for subsequent corrections. By correcting time periodicity and neighbor similarity, the final predicted power is more accurate, and the operation and scheduling of photovoltaic power stations can be better guided. The gradient descent method can improve the prediction accuracy and stability of the model. The present invention achieves better results in terms of prediction success rate, efficiency and stability. BRIEF DESCRIPTION OF THE DRAWINGS
[0053] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.
[0054] Figure 1 An overall flow chart of a photovoltaic power generation power prediction method provided for the first embodiment of the present invention.
[0055] Figure 2 A schematic flow chart of a photovoltaic power generation prediction method provided in the first embodiment of the present invention.
[0056] Figure 3 A schematic diagram of the structure of a photovoltaic power prediction method provided by the first embodiment of the present invention.
[0057] Figure 4 A schematic diagram of the structure of a photovoltaic power prediction method provided by the first embodiment of the present invention.
[0058] Figure 5 This is an overall flow chart of a photovoltaic power generation prediction system provided in the third embodiment of the present invention. DETAILED DESCRIPTION
[0059] In order to make the above-mentioned purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are described in detail below in conjunction with the drawings of the specification. Obviously, the described embodiments are part of the embodiments of the present invention, but not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary persons in the art without creative work should fall within the scope of protection of the present invention.
[0060] Example 1
[0061] Reference Figure 1-Figure 4 , as an embodiment of the present invention, provides a photovoltaic power generation power prediction method, comprising:
[0062] S1: Construct a photovoltaic power prediction model based on deep learning through weather characteristics and power characteristics.
[0063] Furthermore, a photovoltaic power generation prediction model based on deep learning is constructed, and the photovoltaic power generation prediction model includes a weather prediction unit and a power prediction unit.
[0064] It should be noted that the weather prediction unit includes a first convolutional layer, a first gating unit and a first attention layer connected in series, and the power prediction unit includes a second convolutional layer, a second gating unit and a second attention layer connected in series. The first attention layer and the second attention layer are both connected to the fully connected network, and the fully connected layer is connected to the prediction layer.
[0065] It should also be noted that historical weather data and historical photovoltaic power generation data can be obtained through the meteorological department, and historical photovoltaic power generation data can be obtained through the monitoring system of the photovoltaic power station.
[0066] Furthermore, weather features in historical weather data are extracted through the first convolutional layer in the weather prediction unit, and power features in historical photovoltaic power generation data are extracted through the second convolutional layer in the power prediction unit.
[0067] In a possible implementation, extracting weather features in historical weather data through a first convolutional layer in a weather prediction unit, and extracting power features in historical photovoltaic power generation data through a second convolutional layer in a power prediction unit, specifically includes:
[0068] The convolution features in the historical weather data and the power features in the historical photovoltaic power generation data are extracted by convolution kernels respectively:
[0069]
[0070] in, represents the output of the current convolutional layer, represents the output of the previous convolutional layer, Represents the convolution kernel weight of the current convolution layer, Represents the bias term of the current convolutional layer, M j represents the selected input feature map and σ() represents the activation function.
[0071] It should be noted that the convolutional layer can automatically learn and extract key features in weather data without the need for manual feature design. It can capture complex patterns and local correlations in the data and improve the efficiency and effectiveness of feature extraction.
[0072] Pooling is performed on the extracted convolution features:
[0073]
[0074] Among them, down represents the downsampling function, represents the output of the current pooling layer, Represents the output of the previous pooling layer.
[0075] It should be noted that the pooling layer can effectively reduce the spatial dimension of the features through downsampling (such as maximum pooling and average pooling), thereby reducing the computational complexity and retaining the main feature information, which helps prevent overfitting and improve the generalization ability of the model.
[0076] The pooled features are summarized to obtain weather features and power features respectively.
[0077] In the present invention, by extracting weather features through the first convolutional layer, important information in historical weather data can be captured and utilized more efficiently, thereby improving the performance of the photovoltaic power prediction model.
[0078] Optionally, the power feature may be extracted in a manner similar to the weather feature extraction, which will not be described in detail in the present invention to avoid repetition.
[0079] S2: Extract hidden features and add attention weights.
[0080] Furthermore, weather hidden features in weather features are extracted through the first gating unit in the weather prediction unit, and power hidden features in power features are extracted through the second gating unit in the power prediction unit.
[0081] It should be noted that, in a possible implementation manner, extracting weather hidden features in weather features through the first gating unit in the weather prediction unit, and extracting power hidden features in power features through the second gating unit in the power prediction unit in S4 specifically include:
[0082] z t =σ(W uz x t +W hz hw t-1 +b z )
[0083] r t =σ(W ur x t +W hr hw t-1 +b r )
[0084] c t =σ(W uc x t +W hc (r t hw t-1 )+b c )
[0085] hw t =(1-z t )hw t-1 +z tc t
[0086] Among them, z t represents the output vector of the update gate at time t, σ() represents the activation function, and W uz represents the weight matrix between the input layer and the update gate, x t represents the weather characteristics or power characteristics at time t, W hz represents the self-connection weight matrix of the update gate between time t and time t-1, h wt-1 represents the hidden state vector at time t-1, b z represents the bias term of the update gate, r t represents the output vector of the reset gate at time t, W ur represents the weight matrix between the input layer and the reset gate, W hr represents the self-connection weight matrix between the reset gate at time t and time t-1, b r represents the bias term of the reset gate, c t represents the output vector of the candidate layer at time t, W uc Represents the weight matrix between the input layer and the candidate layer, W hc represents the self-connection weight matrix between the candidate layer at time t and time t-1, b c represents the bias term of the candidate layer, ⊙ represents the element-wise product operation, and h wt Represents the hidden state vector at time t.
[0087] Among them, activation functions such as ReLU, tanh, sigmoid, etc., can choose a suitable activation function according to the specific needs of the problem.
[0088] It should be noted that the gated units are used to process time series data and can capture the time dependencies in the data. They store and transmit important information through memory and gating mechanisms and are suitable for processing data with time series characteristics.
[0089] In the present invention, hidden features in weather features are extracted by gating units, so that the model can better handle the complexity of time series data and improve the accuracy and stability of photovoltaic power generation prediction.
[0090] Optionally, the power hidden feature may be extracted in a manner similar to the weather hidden feature extraction, which will not be described in detail in the present invention to avoid repetition.
[0091] S3: Concatenate the hidden features after adding the attention weights.
[0092] Furthermore, attention weights are added to the weather hidden features at each moment through the first attention layer in the weather prediction unit, and attention weights are added to the power hidden features at each moment through the second attention layer in the power prediction unit.
[0093] It should be noted that, in a possible implementation, adding attention weights to weather hidden features at each moment through the first attention layer, and adding attention weights to power hidden features at each moment through the second attention layer in the power prediction unit, specifically includes:
[0094] e t =σ(W h hw t +b h )
[0095]
[0096] hw t '=α t hw t
[0097] Among them, e t represents the attention score at time t, σ() represents the activation function, and W h represents the attention weight matrix, h wt represents the hidden state vector at time t, b h represents the bias term of the attention layer, α t represents the attention weight at time t, exp() represents an exponential function with a natural constant as the base, T represents the total length of the data, and hw t ' represents the weather hidden features or power hidden features after adding the attention weights.
[0098] In the present invention, the attention mechanism allows the model to assign different weights to different time steps, so that the model can focus on the time steps that are most important for the prediction, which helps to highlight the hidden weather features that have an important impact on the current prediction and improve the accuracy of the prediction.
[0099] Optionally, the attention weight may be added to the power hidden feature in a manner similar to the manner of adding the attention weight to the weather hidden feature, which will not be described in detail in the present invention to avoid repetition.
[0100] S4: Perform power prediction based on the fused features after splicing to output a preliminary predicted power.
[0101] Furthermore, the weather hidden features and power hidden features after adding attention weights are concatenated through a fully connected network, specifically:
[0102] H t =(hwt ',hp t ')
[0103] Among them, H t represents the fusion features after splicing, hw' t Represents the weather hidden features after adding attention weights, hp' t Represents the power hidden feature after adding the attention weights.
[0104] In the present invention, by splicing weather hidden features and power hidden features together, the model can consider two different data sources at the same time, which can more comprehensively capture the factors affecting photovoltaic power generation. The complementary information in weather data and historical power data helps to improve the accuracy of prediction. At the same time, the spliced fusion features contain richer information and can provide more input features for the fully connected network. This enhances the expressiveness of the model, enabling it to better learn complex patterns and relationships.
[0105] It should be noted that according to the fusion features after splicing, power prediction is performed through the prediction layer, and the preliminary predicted power is obtained as follows:
[0106]
[0107] in, represents the initial prediction power at time t, σ() represents the activation function, W H represents the prediction weight matrix, H t represents the fusion features after splicing, b H Represents the prediction layer bias term.
[0108] In the present invention, through the above method, the fusion features can be efficiently utilized to accurately predict the photovoltaic power generation power.
[0109] S5: Based on the time periodicity and the nearest neighbor similarity, the preliminary predicted power is corrected to output the final predicted power.
[0110] Furthermore, based on the time periodicity and the nearest neighbor similarity, the preliminary predicted power is corrected to determine the final predicted power. It should be noted that by calculating the correlation coefficient between the predicted date and the adjacent dates in history, the periodicity and similarity laws in the historical data can be fully utilized. Photovoltaic power generation has obvious seasonality and daily periodicity. Based on the time periodicity and nearest neighbor similarity, these laws can be captured to improve the accuracy of the prediction.
[0111] Output the correlation coefficients between adjacent days in the year before the forecast day:
[0112]
[0113] S ij =f(w ij ,w 00 )
[0114] V ij =gw ij )
[0115] Among them, C ij represents the correlation coefficient between the forecast day and the jth adjacent day in the previous i years, T ij represents the time correlation coefficient of the jth adjacent day in the previous i years, k1 represents the year correlation coefficient, k2 represents the date correlation coefficient, S ij represents the weather correlation coefficient of the jth adjacent day in the previous i years, f() represents the weather correlation function, and w ij represents the weather type of the jth consecutive day in the previous i years, w 00 represents the weather type prediction value of the forecast day, which is calculated based on the weather hidden features after adding the attention weight, V ij represents the randomness coefficient of the jth consecutive day in the previous i years, V 00 Represents the random coefficient of the prediction day, g() random function.
[0116] The correlation prediction power is calculated based on the correlation coefficient between the predicted day and each adjacent day in previous years:
[0117]
[0118] Among them, P c Represents the correlation prediction power of the prediction day, P ij It represents the power generation of the jth consecutive day in the previous i years, n represents the total number of years, and m represents the total number of consecutive days.
[0119] It should be noted that the calculation of the correlation coefficient takes into account multiple factors such as time correlation coefficient, weather correlation coefficient and randomness coefficient. This method of comprehensively considering multiple factors can more accurately reflect the complex relationship that affects photovoltaic power generation and improve the performance of the prediction model.
[0120] According to the correlation predicted power, the preliminary predicted power is corrected to determine the final predicted power.
[0121] In a possible implementation manner, the specific manner of correcting the preliminary predicted power according to the correlation predicted power is as follows:
[0122]
[0123] Among them, P t represents the final predicted power at time t, represents the preliminary predicted power at time t, Pct represents the correlation prediction power at time t in the prediction day, and λ represents the correction coefficient.
[0124] Among them, those skilled in the art can set the size of the correction coefficient λ according to actual conditions, and the present invention does not limit this.
[0125] In this invention, the advantages of model prediction and historical data are combined, and the periodicity and similarity in the data can be fully utilized to improve the accuracy and reliability of the prediction. Through dynamic adjustment and comprehensive consideration of multiple factors, different weather conditions and time series patterns can be effectively responded to, and the adaptability and robustness of the prediction model can be enhanced.
[0126] In a possible implementation, the photovoltaic power generation prediction model is trained by a gradient descent method.
[0127] Specifically, the Huber loss function of the photovoltaic power generation prediction model is set:
[0128]
[0129] Where L represents the Huber loss function, e represents the error between the predicted power and the actual power, and δ represents a hyperparameter used to control the switching point.
[0130] The Huber loss function is the same as the mean square error (MSE) when the error is small, and the same as the absolute error (MAE) when the error is large. The Huber loss function is the same as the mean square error (MSE) when the error is small, and the same as the absolute error (MAE) when the error is large. It is a loss function that is both robust and effective for prediction errors and is widely used in regression problems. It combines the advantages of the mean square error (MSE) and the absolute error (MAE) and can handle data with outliers.
[0131] It shows better robustness.
[0132] With the goal of minimizing the Huber loss function, the model parameters of the lifting ring recognition model are optimized by the gradient descent method.
[0133]
[0134] Among them, θ k+1 represents the model parameters at the k+1th iteration, θ k represents the model parameters at the kth iteration, η k represents the adaptive learning rate at the kth iteration, represents the gradient of the Huber loss function L with respect to the model parameter θk, and β represents the momentum coefficient.
[0135] Furthermore, the adaptive learning rate is calculated as:
[0136]
[0137] Among them, η k represents the adaptive learning rate at the kth iteration, η0 represents the initial learning rate, Huber loss function L for model parameters θ u The gradient of , u=1,2,…,k, μ represents a hyperparameter that prevents the denominator from being zero.
[0138] It should be noted that the adaptive learning rate can be dynamically adjusted according to the change of the gradient. When the gradient is large, the learning rate is reduced to prevent gradient explosion; when the gradient is small, the learning rate is increased to prevent the convergence speed from being too slow. This dynamic adjustment mechanism makes the optimization process more stable and efficient.
[0139] In the present invention, the photovoltaic power prediction model is trained by the gradient descent method, which can make full use of its efficient optimization ability and flexible learning rate adjustment mechanism, and perform well in processing complex nonlinear relationships and large-scale data. Combined with appropriate loss functions and data preprocessing techniques, the gradient descent method can improve the prediction accuracy and stability of the model and provide a reliable solution for photovoltaic power prediction.
[0140] Example 2
[0141] An embodiment of the present invention provides a photovoltaic power generation power prediction method. In order to verify the beneficial effects of the present invention, scientific demonstration is carried out through economic benefit calculation and simulation experiments.
[0142] First, the experimental objects include historical weather data and historical power generation data of photovoltaic power stations. The specific data set comes from the operating data of a photovoltaic power station from 2020 to 2023. The model training and prediction process is implemented in the Python environment using the TensorFlow and Keras frameworks.
[0143] Implementation process:
[0144] Historical weather data and power generation data from 2020 to 2023 are obtained from photovoltaic power stations. Weather data includes daily temperature, humidity, wind speed, solar radiation and other characteristics. Power generation data includes daily total power generation, time period power generation, etc. The data is standardized to eliminate the impact of dimensions and divided into a training set (2020-2022 data) and a test set (2023 data).
[0145] Building a predictive model:
[0146] A photovoltaic power generation prediction model is constructed using deep learning methods, including a weather prediction unit and a power prediction unit. The weather prediction unit uses a convolutional layer to extract weather features from historical weather data. The power prediction unit uses another convolutional layer to extract power features from historical power generation data.
[0147] Feature extraction and attention mechanism:
[0148] Weather hidden features in weather features and power hidden features in power features are extracted through the gating unit.
[0149] Hidden feature concatenation and preliminary prediction:
[0150] The weather hidden features and power hidden features after adding attention weights are concatenated, and a preliminary power prediction is performed using a fully connected network.
[0151] Power correction:
[0152] Based on time periodicity and neighbor similarity, the initial predicted power is revised.
[0153] Calculate the correlation predicted power, correct the preliminary predicted power according to the correlation predicted power, and output the final predicted power.
[0154] Control experimental group: The control group uses the traditional time series prediction model (such as the ARIMA model) to perform the same data training and prediction.
[0155] Table 1 Experimental data table
[0156]
[0157] Through the comparative analysis of the above experimental data, it can be seen that the photovoltaic power generation prediction model based on deep learning is significantly superior to the traditional time series prediction model in terms of prediction accuracy, efficiency and stability.
[0158] The prediction accuracy of deep learning-based Model 1 and Model 2 were 95.2% and 97.0%, respectively, which were significantly higher than the 90.0% and 92.3% of traditional prediction Model 1 and Model 2.
[0159] With the same computing resources, the deep learning-based model can complete training and prediction more quickly. The prediction results of the deep learning-based model under different weather conditions are more stable.
[0160] The data shows that the prediction error of the deep learning-based model is smaller under different weather conditions, while the prediction error of the traditional model is larger under extreme weather conditions.
[0161] In summary, the present invention achieves better results in prediction success rate, efficiency and stability.
[0162] Example 3
[0163] Reference Figure 5 , as an embodiment of the present invention, a photovoltaic power generation power prediction system is provided, including an initialization module, a feature extraction module, a hidden feature extraction module, an attention weight adding module, a hidden feature processing module, a preliminary prediction power output module, and a final prediction power output module.
[0164] The initialization module is used to collect historical weather data and historical photovoltaic power generation data, the feature extraction module is used to extract weather features in historical weather data and power features in historical photovoltaic power generation data, the hidden feature extraction module is used to extract weather hidden features in weather features and power hidden features in power features, the attention weight adding module is used to add attention weights to the weather hidden features and power hidden features at each moment, the hidden feature processing module is used to splice the weather hidden features and power hidden features after adding the attention weights, the preliminary predicted power output module is used to perform power prediction through the prediction layer according to the fusion features after splicing, and output the preliminary predicted power, and the final predicted power output module is used to correct the preliminary predicted power based on time periodicity and neighbor similarity to determine the final predicted power.
[0165] If the function is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or the part of the technical solution, can be embodied in the form of a software product. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, server, or network device, etc.) to perform all or part of the steps of the methods of each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk, etc. Various media that can store program codes.
[0166] The logic and / or steps represented in the flowchart or otherwise described herein, for example, can be considered as an ordered list of executable instructions for implementing logical functions, and can be embodied in any computer-readable medium for use by an instruction execution system, device or apparatus (such as a computer-based system, a system including a processor, or other system that can fetch instructions from an instruction execution system, device or apparatus and execute instructions), or in conjunction with such instruction execution systems, devices or apparatuses. For the purposes of this specification, "computer-readable medium" can be any device that can contain, store, communicate, propagate or transmit a program for use by an instruction execution system, device or apparatus, or in conjunction with such instruction execution systems, devices or apparatuses.
[0167] More specific examples of computer-readable media (a non-exhaustive list) include the following: an electrical connection with one or more wires (electronic device), a portable computer disk case (magnetic device), a random access memory (RAM), a read-only memory (ROM), an erasable and programmable read-only memory (EPROM or flash memory), an optical fiber device, and a portable compact disk read-only memory (CDROM). In addition, the computer-readable medium may even be a paper or other suitable medium on which the program is printed, since the program may be obtained electronically, for example, by optically scanning the paper or other medium, followed by editing, deciphering, or processing in another suitable manner as necessary, and then stored in a computer memory.
[0168] It should be understood that the various parts of the present invention can be implemented by hardware, software, firmware or a combination thereof. In the above-mentioned embodiments, multiple steps or methods can be implemented by software or firmware stored in a memory and executed by a suitable instruction execution system. For example, if implemented by hardware, as in another embodiment, it can be implemented by any one of the following technologies known in the art or their combination: a discrete logic circuit having a logic gate circuit for implementing a logic function for a data signal, a dedicated integrated circuit having a suitable combination of logic gate circuits, a programmable gate array (PGA), a field programmable gate array (FPGA), etc. It should be noted that the above embodiments are only used to illustrate the technical solution of the present invention and are not limited. Although the present invention is described in detail with reference to the preferred embodiments, it should be understood by those skilled in the art that the technical solution of the present invention can be modified or replaced by equivalents without departing from the spirit and scope of the technical solution of the present invention, which should be included in the scope of the claims of the present invention.
[0169] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of the present invention, which should all be included in the scope of the claims of the present invention.
Claims
1. A photovoltaic power generation power prediction method, characterized in that: include: Construct a photovoltaic power generation prediction model based on deep learning through weather characteristics and power characteristics; Extract hidden features and add attention weights; Concatenate the hidden features after adding the attention weights; Power prediction is performed based on the fused features after splicing to output a preliminary predicted power; The preliminary predicted power is corrected based on time periodicity and neighbor similarity to output the final predicted power.
2. The photovoltaic power generation prediction method according to claim 1, characterized in that: The photovoltaic power generation prediction model based on deep learning is constructed by using weather characteristics and power characteristics, including collecting historical weather data and historical photovoltaic power generation data, and constructing a photovoltaic power generation prediction model based on deep learning, wherein the photovoltaic power generation prediction model includes a weather prediction unit and a power prediction unit; The weather features in the historical weather data are extracted through the first convolutional layer in the weather prediction unit, and the power features in the historical photovoltaic power generation data are extracted through the second convolutional layer in the power prediction unit; The convolution features in the historical weather data and the power features in the historical photovoltaic power generation data are extracted by the convolution kernel respectively, which are expressed as: in, represents the output of the current convolutional layer, represents the output of the previous convolutional layer, Represents the convolution kernel weight of the current convolution layer, Represents the bias term of the current convolutional layer, M j represents the selected input feature map, σ() represents the activation function; The extracted convolution features are pooled and expressed as: Among them, down represents the downsampling function, represents the output of the current pooling layer, Represents the output of the previous pooling layer; The pooled features are summarized and weather features and power features are output respectively.
3. The photovoltaic power generation prediction method according to claim 2, characterized in that: The extraction of hidden features and adding attention weights includes extracting weather hidden features in weather features through a first gating unit in a weather prediction unit, and extracting power hidden features in power features through a second gating unit in a power prediction unit, which is expressed as: z t =σ(W uz x t +W hz hw t-1 +b z ) r t =σ(W ur x t +W hr hw t-1 +b r ) c t =σ(W uc x t +W hc (r t hw t-1 )+b c ) hw t =(1-z t ) hw t-1 +z t c t Among them, z t represents the output vector of the update gate at time t, σ() represents the activation function, and W uz represents the weight matrix between the input layer and the update gate, x t represents the weather characteristics or power characteristics at time t, W hz represents the self-connection weight matrix of the update gate between time t and time t-1, h wt-1 represents the hidden state vector at time t-1, b z represents the bias term of the update gate, r t represents the output vector of the reset gate at time t, W ur represents the weight matrix between the input layer and the reset gate, W hr represents the self-connection weight matrix between the reset gate at time t and time t-1, b r represents the bias term of the reset gate, c t represents the output vector of the candidate layer at time t, W uc Represents the weight matrix between the input layer and the candidate layer, W hc represents the self-connection weight matrix between the candidate layer at time t and time t-1, b c represents the bias term of the candidate layer, ⊙ represents the element-wise product operation, and h wt Represents the hidden state vector at time t.
4. The photovoltaic power generation prediction method according to claim 3, characterized in that: The extraction of hidden features and adding attention weights includes adding attention weights to weather hidden features at each moment through a first attention layer in a weather prediction unit, and adding attention weights to power hidden features at each moment through a second attention layer in a power prediction unit, which is expressed as: e t =σ(W h hw t +b h ) hw t '=α t hw t Among them, e t represents the attention score at time t, σ() represents the activation function, and W h represents the attention weight matrix, h wt represents the hidden state vector at time t, b h represents the bias term of the attention layer, α t represents the attention weight at time t, exp() represents an exponential function with a natural constant as the base, T represents the total length of the data, and hw t ' represents the weather hidden features or power hidden features after adding the attention weights.
5. The photovoltaic power generation prediction method according to claim 4, characterized in that: The concatenation process of the hidden features after adding the attention weights includes concatenating the weather hidden features and the power hidden features after adding the attention weights through a fully connected network, which is expressed as: H t =(hw t ',hp t ') Among them, H t represents the fusion feature after splicing, hw' t Represents the weather hidden features after adding attention weights, hp' t Represents the power hidden feature after adding the attention weights.
6. The photovoltaic power generation prediction method according to claim 5, characterized in that: The method of performing power prediction and outputting preliminary predicted power according to the fused features after splicing includes performing power prediction through a prediction layer according to the fused features after splicing, and outputting preliminary predicted power, which is expressed as: in, represents the initial prediction power at time t, σ() represents the activation function, W H represents the prediction weight matrix, H t represents the fusion features after splicing, b H Represents the prediction layer bias term.
7. The photovoltaic power generation prediction method according to claim 6, characterized in that: The correcting the preliminary predicted power based on the time periodicity and the nearest neighbor similarity to output the final predicted power includes correcting the preliminary predicted power based on the time periodicity and the nearest neighbor similarity to determine the final predicted power; Output the correlation coefficients between adjacent days in the year before the forecast day: S ij =f(w ij ,w 00 ) V ij =g w ij ) Among them, C ij represents the correlation coefficient between the forecast day and the jth adjacent day in the previous i years, T ij represents the time correlation coefficient of the jth adjacent day in the previous i years, k1 represents the year correlation coefficient, k2 represents the date correlation coefficient, S ij represents the weather correlation coefficient of the jth adjacent day in the previous i years, f() represents the weather correlation function, and w ij represents the weather type of the jth consecutive day in the previous i years, w 00 represents the weather type prediction value of the forecast day, which is calculated based on the weather hidden features after adding the attention weight, V ij represents the randomness coefficient of the jth consecutive day in the previous i years, V 00 Represents the random coefficient of the forecast day, g() random function; According to the correlation coefficient between the predicted day and each adjacent day in the previous year, the correlation prediction power is output, which is expressed as: Among them, P c Represents the correlation prediction power of the prediction day, P ij represents the power generation of the jth consecutive day in the previous i years, n represents the total number of years, and m represents the total number of consecutive days; According to the correlation prediction power, the preliminary prediction power is corrected to determine the final prediction power; The preliminary predicted power is corrected according to the correlation predicted power, which is expressed as: Among them, P t represents the final predicted power at time t, represents the preliminary predicted power at time t, P ct represents the correlation prediction power at time t in the prediction day, and λ represents the correction coefficient; The photovoltaic power generation prediction model is trained by gradient descent method.
8. A system using the photovoltaic power prediction method according to any one of claims 1 to 7, characterized in that: It includes an initialization module, a feature extraction module, a hidden feature extraction module, an attention weight adding module, a hidden feature processing module, a preliminary power output prediction module, and a final power output prediction module; The initialization module is used to collect historical weather data and historical photovoltaic power generation data; The feature extraction module is used to extract weather features in historical weather data and power features in historical photovoltaic power generation data; The hidden feature extraction module is used to extract weather hidden features in weather features and power hidden features in power features; The attention weight adding module is used to add attention weights to the weather hidden features and power hidden features at each moment; The hidden feature processing module is used to perform splicing processing on the weather hidden feature and the power hidden feature after adding the attention weight; The preliminary predicted power output module is used to perform power prediction through the prediction layer according to the fusion features after splicing processing, and output the preliminary predicted power; The final predicted power output module is used to correct the preliminary predicted power based on time periodicity and neighbor similarity to determine the final predicted power.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the photovoltaic power prediction method according to any one of claims 1 to 7 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the photovoltaic power prediction method according to any one of claims 1 to 7 are implemented.
Citation Information
Cited By
Short-term power prediction method, device and equipment of photovoltaic power station, medium and product
CN119994873A
