A method, apparatus and device for photovoltaic power prediction
By combining multimodal decomposition and dual-stream attention network, the problem of the model's inability to distinguish the patterns of different time scales in photovoltaic power prediction is solved, and accurate prediction of photovoltaic power and meteorological factors is achieved, improving the accuracy and stability of prediction.
Patent Information
- Application Number
- CN202511496550.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-20
- Publication Date
- 2026-02-24
- Estimated Expiration
- 2045-10-20
AI Technical Summary
Existing photovoltaic power prediction models struggle to effectively distinguish and learn patterns at different time scales when faced with non-stationary and nonlinear photovoltaic signals, resulting in limited prediction accuracy. Furthermore, single decomposition methods are susceptible to hyperparameter effects or mode aliasing risks, impacting prediction performance.
A multimodal decomposition technique combined with a dual-stream attention network is employed. The photovoltaic power sequence is decomposed in parallel using VMD, CEEMD, and SSA algorithms. A dual-stream neural network with CNN and GRU streams is constructed to capture spatiotemporal information and perform deep fusion. The self-attention mechanism is used to optimize feature weights and improve prediction accuracy.
It significantly improves the accuracy and stability of short-term photovoltaic power forecasting, simplifies the forecasting task, enhances the ability to capture the fluctuation patterns of photovoltaic power and the correlation with meteorological factors, and improves the robustness and generalization ability of the model.
Smart Images

Figure CN120974456B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present invention generally relate to the field of renewable energy power generation technology, and particularly to a method, apparatus and equipment for photovoltaic power prediction. Background Technology
[0002] In recent years, with the global energy structure transitioning towards clean and low-carbon energy, photovoltaic (PV) power generation, as a flexible and sustainable distributed power source, has played a crucial role in meeting global clean energy demand. However, the PV power generation process is highly dependent on meteorological factors such as sunlight intensity, temperature, wind speed, and cloud cover, resulting in significant intermittency, fluctuation, and randomness in its output power. This inherent uncertainty poses a severe challenge to the grid-connected power system, directly affecting the safe and stable operation of the grid, power quality, and economic dispatch. Therefore, achieving accurate short-term forecasting of PV output power is a key technological prerequisite for ensuring the safe operation of active power distribution networks, rationally arranging energy dispatch, and maximizing PV absorption capacity.
[0003] The original photovoltaic power time series is a typical non-stationary, nonlinear signal, often coupled with multiple fluctuation components at different time scales, ranging from high-frequency instantaneous disturbances to low-frequency diurnal variation periods, resulting in complex composition. If this original sequence, containing multiple frequencies, is directly input into a prediction model, the model will struggle to effectively distinguish and learn the underlying patterns at different scales, thus limiting prediction accuracy. To address this issue, multimodal decomposition technology has been introduced into the field of photovoltaic prediction.
[0004] In existing technologies, researchers have explored various decomposition prediction models. For example, patent CN117592593A discloses a short-term power load prediction method based on improved quadratic mode decomposition and WOA-optimized BiLSTM-attention. This method employs a quadratic decomposition strategy combining CEEMDAN and VMD. While this improves the decomposition depth to some extent, it also introduces new problems: the quadratic decomposition process may generate too many modal components, requiring the subsequent training of independent prediction models for each component. This not only significantly increases the computational complexity and training time of the model, but also, although the BiLSTM-attention model it uses is good at capturing the dynamic characteristics of time series, it fails to effectively explore the complex spatial correlation characteristics between various meteorological factors and photovoltaic power. Patent CN202411304442.5 discloses a distribution network photovoltaic power prediction method based on WOA-VMD and dual-stream network. This scheme uses a BiGRU model to extract temporal features and utilizes a GCN model to capture spatial features. Although it introduces the concept of a two-stream network, it only uses a single VMD for decomposition. When faced with extremely non-stationary original photovoltaic sequences, there may still be risks of mode aliasing or incomplete decomposition. In addition, the decomposition effect of the VMD algorithm is extremely sensitive to hyperparameters such as the number of modes K and the penalty factor α. Inappropriate parameter settings will directly affect the decomposition quality, thus limiting the performance ceiling of the entire prediction model.
[0005] Therefore, developing a new method for photovoltaic power prediction that can effectively solve the above problems has important theoretical value and engineering application prospects. Summary of the Invention
[0006] To address the above issues, this invention introduces multimodal decomposition technology, which successfully breaks down the complex original photovoltaic power sequence into multiple relatively stable, single-frequency modal components, greatly simplifying the prediction task. Based on this, combined with the deep fusion capability of the dual-stream attention network for spatiotemporal information, the model can more accurately capture the fluctuation patterns of photovoltaic power and its intricate correlation with meteorological factors, thereby significantly improving the accuracy and stability of short-term photovoltaic power prediction.
[0007] According to embodiments of the present invention, a method, apparatus, and device for photovoltaic power prediction are provided.
[0008] In a first aspect of the invention, a method for photovoltaic power prediction is provided. The method includes:
[0009] Step S01: Obtain historical power data and meteorological factor data of the target photovoltaic power station and perform preprocessing;
[0010] Step S02: Based on the meteorological characteristics of meteorological factor data, a clustering algorithm is used to divide historical days into different meteorological categories, and a training set for the corresponding meteorological categories is constructed;
[0011] Step S03: Perform correlation analysis on each training set to obtain core meteorological features and form a core feature sequence. Use three mode decomposition algorithms, namely VMD, CEEMD, and SSA, to decompose the core feature sequence in parallel to form an enhanced feature set.
[0012] Step S04: Construct a dual-stream neural network model, which consists of a CNN stream and a GRU stream. Train the model for each meteorological category using the training set from Step S02 to obtain the model corresponding to each meteorological category. Use the enhanced feature set as input to the dual-stream neural network model, and concatenate and fuse the output feature vectors of the CNN stream and the GRU stream to obtain a combined spatiotemporal feature vector. Then, input the combined spatiotemporal feature vector into the self-attention mechanism module to calculate the importance weight of each feature dimension and weight the features to obtain the optimized feature vector.
[0013] Step S05: Input the optimized feature vector into at least one fully connected layer to obtain the final short-term photovoltaic power prediction value.
[0014] Furthermore, the meteorological data for the same period mentioned in step S01 include: total horizontal radiation, total radiation of the inclined surface, ambient temperature, relative humidity, and wind speed.
[0015] Furthermore, the weather categories mentioned in step S02 include: sunny, cloudy, rainy, and overcast.
[0016] Furthermore, the clustering algorithm described in step S02 is evaluated using DBI, through iterative analysis of different clustering methods. Value and calculate each The DBI corresponding to the value is selected to minimize the DBI value. As the optimal number of clusters, historical days are divided into Weather categories:
[0017] ,
[0018] in, and For history day And another historical day The average distance to the corresponding cluster center. Representing historical days And another historical day The Euclidean distance between the centers This represents the number of clusters.
[0019] Furthermore, the correlation analysis described in step S03 involves calculating the Pearson correlation coefficient between each meteorological feature and active power, and selecting two features with a correlation coefficient > 0.9 as core meteorological features.
[0020] Further, in step S04, the CNN stream inputs the enhanced feature set into a one-dimensional convolutional neural network stream. The CNN stream consists of convolutional layers, pooling layers, and flattening layers, used to capture the local patterns and spatial correlations between different feature components at the same time point and extract spatial feature vectors. The GRU stream simultaneously inputs the enhanced feature set into a gated recurrent unit stream. The GRU stream consists of two GRU layers and a flattening layer, used to capture the dynamic patterns and long-term dependencies of each feature sequence over time and extract temporal feature vectors.
[0021] Furthermore, the self-attention module described in step S04 linearly transforms the input into a query matrix, a key matrix, and a value matrix, calculates the attention weights, and outputs the weighted features:
[0022] ,
[0023] in, It is the dimension of the key vector. For querying the matrix, The key matrix, The value matrix is provided. In a second aspect of the invention, an apparatus for photovoltaic power prediction is provided. The apparatus includes:
[0024] Data acquisition module: used to acquire historical power data and meteorological factor data of the target photovoltaic power station and perform preprocessing;
[0025] Category segmentation module: Based on meteorological features of meteorological factor data, it uses clustering algorithms to divide historical days into different meteorological categories and constructs training sets for the corresponding meteorological categories;
[0026] Feature set enhancement module: It is used to perform correlation analysis on each training set to obtain core meteorological features and form a core feature sequence. It uses three mode decomposition algorithms, namely VMD, CEEMD and SSA, to decompose the core feature sequence in parallel to form an enhanced feature set.
[0027] Feature vector optimization module: This module is used to construct a two-stream neural network model, which consists of a CNN stream and a GRU stream. The model is trained on each meteorological category using the training set from step S02 to obtain models corresponding to different meteorological categories. The enhanced feature set is used as input to the two-stream neural network model. The output feature vectors of the CNN stream and the GRU stream are concatenated and fused to obtain a combined spatiotemporal feature vector, which is then input into the self-attention mechanism module. The importance weights of each feature dimension are calculated and the features are weighted to obtain the optimized feature vector.
[0028] Photovoltaic power prediction module: used to input the optimized feature vector into at least one fully connected layer to obtain the final short-term photovoltaic power prediction value.
[0029] In a third aspect of the invention, an electronic device is provided. The electronic device includes a memory and a processor, the memory storing a computer program, the processor executing the program to implement the method according to a first aspect of the invention.
[0030] In a fourth aspect of the invention, a computer-readable storage medium is provided having a computer program stored thereon, which, when executed by a processor, implements the method according to a first aspect of the invention.
[0031] This invention introduces multimodal decomposition technology to successfully decompose the complex original photovoltaic power sequence into multiple relatively stable, single-frequency modal components, which greatly simplifies the prediction task. On this basis, combined with the deep fusion capability of the dual-stream attention network for spatiotemporal information, the model can more accurately capture the fluctuation pattern of photovoltaic power and its intricate relationship with meteorological factors, thereby significantly improving the accuracy and stability of short-term photovoltaic power prediction.
[0032] It should be understood that the description in the Summary of the Invention is not intended to limit the key or essential features of the embodiments of the present invention, nor is it intended to restrict the scope of the invention. Other features of the invention will become readily apparent from the following description.
[0033] The beneficial effects of this invention are:
[0034] 1. By introducing multimodal decomposition technology and using three different decomposition methods, more diverse and information-rich features can be obtained. Furthermore, the combination of these subsequences from different mechanisms, which process the signal according to different mathematical mechanisms, can form a more comprehensive description of the signal's complexity, thereby better representing the inherent laws of complex signals. At the same time, it can avoid some easily aliased modal subsequences that may be missed in a single decomposition method. It successfully decomposes the complex original photovoltaic power sequence into multiple relatively stable, single-frequency modal components, greatly simplifying the prediction task. On this basis, combined with the unique dual-stream attention network's deep fusion capability of spatiotemporal information, it can more accurately capture the fluctuation law of photovoltaic power and its intricate relationship with meteorological factors, thereby significantly improving the prediction accuracy and stability of short-term photovoltaic power.
[0035] 2. Multimodal decomposition of key input features effectively enhances the ability to express the internal structure and patterns of the data, enabling the subsequent dual-stream network to learn the potential patterns at different time scales more efficiently. At the same time, the dual-stream network processes and deeply integrates the time series features of photovoltaic power and the spatial correlation features of meteorological factors in parallel. One stream focuses on capturing the temporal evolution patterns of each modal component, while the other stream focuses on mining the spatial dependence between multiple meteorological factors and photovoltaic power. This avoids the limitation of a single model that cannot simultaneously take into account temporal dynamics and spatial dependence, and achieves comprehensive and effective utilization of multi-source heterogeneous data.
[0036] 3. The introduction of a self-attention mechanism significantly enhances the model's ability to focus on key features, enabling the model to adaptively allocate weights based on the relevance of the input data, prioritizing key information that has the greatest impact on the prediction results. This not only improves the model's interpretability but also further enhances the robustness and accuracy of the prediction. Addressing the issue of existing decomposition methods being susceptible to hyperparameter effects or mode aliasing, an optimized multimodal decomposition strategy is adopted. This strategy can more effectively handle non-stationary photovoltaic power sequences, reducing the impact of improper decomposition on prediction performance. Combined with the powerful feature learning capabilities of the dual-stream attention network, it can maintain good prediction performance and generalization ability even under complex and variable meteorological conditions.
[0037] 4. This invention adopts a clustering-then-correlation approach. During clustering, all features are retained first, without considering the final photovoltaic power prediction. The data's internal structure is divided from an unsupervised perspective to discover some implicit operating patterns. This overcomes the problem that the screening process based on the correlation between features and output power masks the structural differences within the data. For different photovoltaic power plants, when the understanding of data characteristics is limited, direct feature screening may prematurely discard some information that is only important in specific scenarios. Therefore, clustering first can avoid making feature selections too early, thus preserving the possibility of all information.
[0038] 5. A strategy of clustering followed by correlation analysis is adopted. First, unsupervised clustering is performed on the photovoltaic data to divide the data into multiple categories, thereby enabling automatic identification and classification of weather types, such as sunny, cloudy, overcast, or rainy days. Through clustering, samples with similar meteorological characteristics and operational features can be grouped into one category, resulting in higher internal consistency within each category and providing a more accurate and purer data foundation for subsequent analysis. On this basis, correlation analysis is then performed on the data after each clustering. This can eliminate features with low correlation and more accurately identify features with predictive value under specific weather conditions, thereby significantly reducing the data dimensionality and data volume required for subsequent model training, ultimately optimizing data volume and improving model training efficiency. Attached Figure Description
[0039] The above and other features, advantages, and aspects of the various embodiments of the present invention will become more apparent from the accompanying drawings and the following detailed description. Wherein:
[0040] Figure 1 A flowchart of a photovoltaic power prediction method according to an embodiment of the present invention is shown;
[0041] Figure 2 A flowchart of a DBI-based K-means clustering algorithm according to an embodiment of the present invention is shown;
[0042] Figure 3 A schematic diagram of a two-stream network structure according to an embodiment of the present invention is shown;
[0043] Figure 4 A framework diagram of a photovoltaic power prediction model based on multimodal decomposition and dual-stream spatiotemporal feature extraction according to an embodiment of the present invention is shown.
[0044] Figure 5 A schematic diagram illustrating the short-term power prediction results for a photovoltaic power plant for the next hour, according to an embodiment of the present invention, is shown.
[0045] Figure 6 A block diagram of a photovoltaic power prediction apparatus according to an embodiment of the present invention is shown;
[0046] Figure 7 A schematic diagram of a photovoltaic power prediction device according to an embodiment of the present invention is shown. Detailed Implementation
[0047] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0048] According to embodiments of the present invention, a method, apparatus, and device for photovoltaic power prediction are proposed. By introducing multimodal decomposition technology, the complex original photovoltaic power sequence is successfully decomposed into multiple relatively stable, single-frequency modal components, which greatly simplifies the prediction task. On this basis, combined with the deep fusion capability of spatiotemporal information by dual-stream attention network, the model can more accurately capture the fluctuation pattern of photovoltaic power and its intricate correlation with meteorological factors, thereby significantly improving the accuracy and stability of short-term photovoltaic power prediction.
[0049] The principles and spirit of the present invention will be explained in detail below with reference to several representative embodiments.
[0050] Figure 1 This is a schematic flowchart of a photovoltaic power prediction method according to an embodiment of the present invention. The method includes:
[0051] Step S01: Obtain historical power data and meteorological factor data of the target photovoltaic power station and perform preprocessing;
[0052] Step S02: Based on the meteorological characteristics of meteorological factor data, a clustering algorithm is used to divide historical days into different meteorological categories, and a training set for the corresponding meteorological categories is constructed;
[0053] Step S03: Perform correlation analysis on each training set to obtain core meteorological features and form a core feature sequence. Use three mode decomposition algorithms, namely VMD, CEEMD, and SSA, to decompose the core feature sequence in parallel to form an enhanced feature set.
[0054] Step S04: Construct a dual-stream neural network model, which consists of a CNN stream and a GRU stream. Train the model for each meteorological category using the training set from Step S02 to obtain the model corresponding to each meteorological category. Use the enhanced feature set as input to the dual-stream neural network model, and concatenate and fuse the output feature vectors of the CNN stream and the GRU stream to obtain a combined spatiotemporal feature vector. Then, input the combined spatiotemporal feature vector into the self-attention mechanism module to calculate the importance weight of each feature dimension and weight the features to obtain the optimized feature vector.
[0055] Step S05: Input the optimized feature vector into at least one fully connected layer to obtain the final short-term photovoltaic power prediction value.
[0056] It should be noted that although the operation of the method of the present invention has been described in a specific order in the above embodiments and figures, this does not require or imply that the operations must be performed in that specific order, or that all the operations shown must be performed to achieve the desired result. Additionally or alternatively, certain steps may be omitted, multiple steps may be combined into one step, and / or one step may be broken down into multiple steps.
[0057] To provide a clearer explanation of the above-described method for predicting photovoltaic power, a specific embodiment will be used for illustration below. However, it is worth noting that this embodiment is only for better illustrating the present invention and does not constitute an improper limitation of the present invention.
[0058] The following specific example will further illustrate the method of photovoltaic power prediction in more detail:
[0059] Step S01: Obtain historical power data and meteorological factor data of the target photovoltaic power station, and perform data cleaning, missing value filling and normalization.
[0060] In this embodiment, a photovoltaic power station is used as an example to collect its historical data, with a data sampling frequency of once every 5 minutes. The collected data includes: the active power of the photovoltaic power station (kW) and the meteorological data for the same period, including: total horizontal radiation (W / m²), total radiation of the tilted surface (W / m²), ambient temperature (°C), relative humidity (%), and wind speed (m / s). The collected dataset is divided into a training set (first 80%) and a test set (last 20%).
[0061] The collected dataset underwent preprocessing, including: data cleaning to remove obvious outliers and null values caused by sensor malfunctions or transmission errors; missing value imputation, where linear interpolation was used to fill in a small number of missing data points; and data normalization: to eliminate the influence of different physical dimensions and accelerate model convergence, a minimum-maximum normalization method was used to scale all feature data to the [0,1] interval, and the calculation formula is as follows:
[0062] ,
[0063] In the formula, For the original data points, For the normalized data points, and These are the maximum and minimum values in the feature sequence, respectively.
[0064] Step S02: Based on the meteorological characteristics of meteorological factor data, a clustering algorithm is used to divide historical days into different meteorological categories; according to the meteorological forecast information of the day to be predicted, its category is determined, and all historical day data under that category are selected to construct the training set of the corresponding meteorological category.
[0065] Specifically, to improve the accuracy of predictions, historical data is first clustered to select historical days with similar meteorological conditions to the day to be predicted, including the following steps.
[0066] 1. Feature Vector Construction: For each historical day, a set of features reflecting its daytime weather pattern is extracted, including: daily average total radiation, daily maximum temperature, daily average humidity, and daily average wind speed. These features together constitute a... d The daily eigenvector of dimension.
[0067] 2. K-means Clustering: Using the feature vector set of all historical days as input, the K-means algorithm is used for clustering. The specific steps are as follows.
[0068] Initialization: Randomly select from the data sample Each object serves as the initial cluster center. , Sample allocation: For each historical day sample Calculate its relationship with each cluster center. Euclidean distance and assign it to the nearest cluster. middle:
[0069] ,
[0070] Update Center: Recalculate each cluster The centroid, as the new cluster center :
[0071] ,
[0072] Iteration: Repeat the two steps of sample allocation and center update until the cluster centers no longer change or the maximum number of iterations is reached.
[0073] In the K-means algorithm, the number of clusters Since the clustering is determined manually and contains errors, a quantitative index is introduced to find the optimal clustering of the samples and automatically determine the optimal number of clusters. In this invention, the Davis-Bouldin index (DBI) is used for cluster evaluation, and the specific process is as follows: Figure 2 As shown, by iterating different Values, for example, from 2 to the preset value. Calculate each The DBI corresponding to the value is selected to minimize the DBI value. As the optimal number of clusters, historical days are divided into In this embodiment, historical days are divided into three weather categories: sunny, cloudy, and rainy. DBI utilizes the inherent quantity and characteristics of the dataset, defined as follows:
[0074] ,
[0075] in, and For history day And another historical day The average distance to the corresponding cluster center. Represents another historical day And another historical day The Euclidean distance between the centers. A smaller DBI value indicates better clustering performance. To avoid redundancy caused by generating too many clusters, a threshold constraint can be imposed on the number of clusters, i.e. .
[0076] When making predictions, the daily feature vector is first constructed based on the meteorological forecast data for the day to be predicted. Then, the vector is compared with the predetermined feature vector. The Euclidean distance between the cluster centers is used to classify each cluster into the nearest cluster. Finally, the data of all historical days contained in the cluster are extracted to form a training set specifically for this prediction: including a sunny day training set, a cloudy day training set, and a rainy day training set.
[0077] Step S03: Perform correlation analysis on each training set to obtain core meteorological features and form a core feature sequence. Use three mode decomposition algorithms, namely VMD, CEEMD, and SSA, to decompose the core feature sequence in parallel to form an enhanced feature set.
[0078] Correlation analysis involved calculating the Pearson correlation coefficient between various meteorological features and active power. In this embodiment, total horizontal radiation and total radiation on the tilted surface showed the highest correlation with photovoltaic power, with calculated results of 0.96 and 0.92 respectively (correlation coefficients > 0.9). These two features were selected as core meteorological features and formed the core feature sequence. In this embodiment, correlation analysis is performed on the sunny day training set, the cloudy day training set, and the rainy day training set to obtain their corresponding core feature sequences, that is, a total of 3 core feature sequences are formed. The correlation calculation is only performed in the data preprocessing stage. Subsequent data to be predicted follow this selection, that is, only one correlation analysis needs to be performed before training the model.
[0079] Multimodal decomposition into three selected core feature sequences The VMD (Variational Mode Decomposition), CEEMD (Complete Ensemble Empirical Mode Decomposition), and SSA (Singular Spectrum Analysis) algorithms were applied in parallel for decomposition.
[0080] VMD decomposition: Constructing and solving a constrained variational problem, transforming the original signal... Decomposed into Modal components Its center frequency is ,but:
[0081] ,
[0082] in, For the Dirac function, For convolution operations, For time derivative, For the index of mode decomposition, This represents the total number of modal decompositions.
[0083] CEEMD decomposition: By inputting the original signal Add to Gaussian white noise with opposite signs Constructing new signal pairs Then, empirical mode decomposition (EMD) is performed on each new signal, and finally, the corresponding mode components are averaged to eliminate noise and obtain the final intrinsic mode function. .
[0084] SSA decomposition: transforming the original signal The transformation is into a trajectory matrix, and then singular value decomposition (SVD) is performed on the trajectory matrix. The first spectral decomposition obtained after singular spectral analysis The amount ,in, For eigenvalues, For orthogonal vectors, These are orthogonal vectors. By grouping and reconstructing the singular values, the trend, periodicity, and noise components of the signal are separated. After decomposition, the original two core feature sequences are expanded into multiple subsequences.
[0085] This process decomposes each single core feature sequence into multiple more stable and regular subsequence components.
[0086] All the subsequence components generated by the decomposition are merged with the original photovoltaic power sequence to form a high-dimensional enhanced feature set. This greatly enriches the input information, providing a more comprehensive data perspective for subsequent model learning.
[0087] Step S04: Construct a dual-stream neural network model, which consists of a CNN stream and a GRU stream. Use the training set from step S02 to train each weather category to obtain models corresponding to different weather categories. In this embodiment, models corresponding to sunny days, cloudy days, and rainy days are obtained. Use the enhanced feature set as input to the dual-stream neural network model, and concatenate and fuse the output feature vectors of the CNN stream and the GRU stream to obtain a combined spatiotemporal feature vector, which is then input into the self-attention mechanism module. Calculate the importance weights of each feature dimension and weight the features to obtain an optimized feature vector.
[0088] Specifically, such as Figure 3-4 As shown, the dual-stream feature extraction consists of a CNN stream and a GRU stream. The CNN stream inputs the enhanced feature set into a one-dimensional convolutional neural network (CNN) stream, which is composed of convolutional layers, pooling layers, and flattening layers. It is used to capture the local patterns and spatial correlations between different feature components, such as a VMD component of radiation or a temperature sequence, at the same time point, and extract spatial feature vectors. The GRU stream simultaneously inputs the enhanced feature set into a gated recurrent unit (GRU) stream, which is composed of two GRU layers and a flattening layer. It is used to capture the dynamic patterns and long-term dependencies of each feature sequence over time and extract temporal feature vectors.
[0089] CNN stream: Input data Through a one-dimensional convolutional layer. Layer Output of each feature map It can be represented as:
[0090] ,
[0091] in, For activation function, For bias terms, For convolution kernel weights, The number of convolution kernels, This is the position index of the convolution kernel. This provides the location index for the current feature map. This layer is used to capture local combination patterns of different features at the same time. The data is then passed through a max-pooling layer to reduce the data dimensionality.
[0092] GRU stream: Input data It passes through the GRU layer in parallel. GRU cells in... The calculation process for the time point is as follows:
[0093] Reset Gate : Decide how much past information to ignore:
[0094] ,
[0095] Update Gate : Determine how much new information to write to the current state:
[0096] ,
[0097] Candidate hidden state :
[0098] ,
[0099] Current hidden state :
[0100] ,
[0101] In the formula, This is the hidden state from the previous moment. For the Sigmoid function, This indicates element-wise multiplication. and These are the corresponding weight matrix and bias terms.
[0102] The output feature vectors of the CNN stream and the GRU stream are concatenated and fused to obtain a combined spatiotemporal feature vector. This combined spatiotemporal feature vector is then input into a self-attention module, which calculates the importance weights of each feature dimension and weights the features to highlight key information and suppress redundant information, thus obtaining the final optimized feature vector.
[0103] Specifically, the outputs of the CNN stream and the GRU stream are... After flattening, the vectors are concatenated along the feature dimensions. This fused vector is then fed into the self-attention module. This module first processes the input... , composed of multiple The structure is linearly transformed into a query matrix. Q Key matrix Value matrix V Then, the attention weights are calculated and the weighted features are output:
[0104] ,
[0105] in, It is the dimension of the key vector. This mechanism allows the model to focus on the spatiotemporal features that are most important for prediction.
[0106] Step S05: Input the optimized feature vector into at least one fully connected layer (Dense), and obtain the final short-term photovoltaic power prediction value through regression calculation.
[0107] Specifically, the prediction layer inputs the optimized feature vector output by the attention module into the prediction head. The prediction head consists of at least one fully connected layer and is processed using a non-linear activation function. The purpose of this step is to perform high-order non-linear combination and mapping on the features filtered by the attention mechanism to capture deeper intrinsic correlations. Data passes through an output layer, which is a fully connected layer with 12 neurons, where 12 represents the prediction step size, corresponding to a prediction point every 5 minutes for the next hour. This layer typically uses a linear activation function to output unbounded, continuous power prediction values. .
[0108] Model Training: The entire network model is trained end-to-end. This is achieved by minimizing the predicted values. Compared with the true value The model parameters are optimized by analyzing the error between the two values. Mean Squared Error (MSE) is chosen as the loss function. :
[0109] ,
[0110] in, The total number of samples used for evaluation. For the first A true value, For the first One predicted value.
[0111] An adaptive learning rate optimizer such as Adam is used. The gradient of the loss function with respect to the weights and biases of each layer of the network is calculated through the backpropagation algorithm, and the parameters are updated accordingly until the loss of the model on the validation set no longer decreases significantly.
[0112] Multi-step forecasting strategy: When performing multi-step forecasting, a rolling or recursive forecasting strategy is adopted. Specifically, historical data is first used to predict the power value at the first future time point (t+1). Then, this predicted value is used as part of the new historical data to update the input sequence to predict the power at the second time point (t+2). This process is repeated until the forecasts for all T time points are completed, thus obtaining a complete power forecast sequence for a future period (e.g., 1 hour).
[0113] In this embodiment, a rolling prediction strategy is adopted. That is, the power from time t+1 to time t+12 is predicted using historical data before time t. When the actual data at time t+1 is available, the data window is rolled forward, and the power from time t+2 to time t+13 is predicted using the updated historical data, and so on, to achieve continuous short-term prediction.
[0114] This example aims to predict the short-term power output of a photovoltaic power station for the next hour. The prediction results are as follows: Figure 5 As shown in the figure, the comparison between the actual power and the model-predicted power of the photovoltaic power station under four different weather types: sunny, cloudy, and rainy. The black curve represents the actual power, and the red curve represents the model-predicted power. It can be seen that the model can accurately track the power change trend under various weather conditions and has a good prediction effect.
[0115] Based on the same inventive concept, this invention also proposes a device for photovoltaic power prediction. The implementation of this device can be found in the implementation of the method described above; repeated details will not be repeated. Figure 6 As shown, the device 100 includes:
[0116] Data acquisition module 101: used to acquire historical power data and meteorological factor data of the target photovoltaic power station and perform preprocessing;
[0117] Category segmentation module 102: Based on meteorological features of meteorological factor data, it uses a clustering algorithm to divide historical days into different meteorological categories and constructs training sets for the corresponding meteorological categories;
[0118] Feature set enhancement module 103: It is used to perform correlation analysis on each training set to obtain core meteorological features and form a core feature sequence. It uses three mode decomposition algorithms, namely VMD, CEEMD and SSA, to decompose the core feature sequence in parallel to form an enhanced feature set.
[0119] Feature vector optimization module 104: This module is used to construct a dual-stream neural network model, which consists of a CNN stream and a GRU stream. The model is trained on each meteorological category using the training set from step S02 to obtain models corresponding to different meteorological categories. The enhanced feature set is used as input to the dual-stream neural network model. The output feature vectors of the CNN stream and the GRU stream are concatenated and fused to obtain a combined spatiotemporal feature vector, which is then input into the self-attention mechanism module. The importance weights of each feature dimension are calculated and the features are weighted to obtain the optimized feature vector.
[0120] Photovoltaic power prediction module 105: used to input the optimized feature vector into at least one fully connected layer to obtain the final short-term photovoltaic power prediction value.
[0121] Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the described module can be referred to the corresponding process in the foregoing method embodiments, and will not be repeated here.
[0122] like Figure 7 As shown, the device includes a central processing unit (CPU), which can perform various appropriate actions and processes based on computer program instructions stored in read-only memory (ROM) or loaded from storage units into random access memory (RAM). The RAM can also store various programs and data required for device operation. The CPU, ROM, and RAM are interconnected via a bus. Input / output (I / O) interfaces are also connected to the bus.
[0123] Multiple components in the device are connected to the I / O interface, including: input units such as keyboards and mice; output units such as various types of displays and speakers; storage units such as disks and optical discs; and communication units such as network interface cards (NICs), modems, and wireless transceivers. The communication unit allows the device to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.
[0124] The processing unit executes the various methods and processes described above, such as method steps S01 to S05. For example, in some embodiments, method steps S01 to S05 may be implemented as a computer software program tangibly contained in a machine-readable medium, such as a storage unit. In some embodiments, part or all of the computer program may be loaded and / or installed on the device via ROM and / or a communication unit. When the computer program is loaded into RAM and executed by the CPU, one or more steps of method steps S01 to S05 described above may be performed. Alternatively, in other embodiments, the CPU may be configured to execute method steps S01 to S05 by any other suitable means (e.g., by means of firmware).
[0125] The functions described above in this document can be performed at least in part by one or more hardware logic components. For example, exemplary types of hardware logic components that can be used, without limitation, include: field programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload programmable logic devices (CPLDs), and so on.
[0126] The program code used to implement the methods of the present invention can be written in any combination of one or more programming languages. This program code can be provided to a processor or controller of a general-purpose computer, special-purpose computer, or other programmable data processing device, such that when executed by the processor or controller, the program code causes the functions / operations specified in the flowcharts and / or block diagrams to be implemented. The program code can be executed entirely on the machine, partially on the machine, as a standalone software package partially on the machine and partially on a remote machine, or entirely on a remote machine or server.
[0127] In the context of this invention, a machine-readable medium can be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, apparatus, or device. A machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. Machine-readable media can include, but are not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination of the foregoing. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.
[0128] Furthermore, although the operations are described in a specific order, this should be understood as requiring that such operations be performed in the specific order shown or in sequential order, or requiring that all illustrated operations be performed to achieve the desired result. In certain environments, multitasking and parallel processing may be advantageous. Similarly, although several specific implementation details are included in the above discussion, these should not be construed as limiting the scope of the invention. Certain features described in the context of individual embodiments may also be implemented in combination in a single implementation. Conversely, various features described in the context of a single implementation may also be implemented individually or in any suitable sub-combination in multiple implementations.
[0129] Although the subject matter has been described using language specific to structural features and / or methodological logic, it should be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or actions described above. Rather, the specific features and actions described above are merely illustrative examples of implementing the claims.
Claims
1. A method for predicting photovoltaic power, characterized in that, The method includes: Step S01: Obtain historical power data and meteorological factor data of the target photovoltaic power station and perform preprocessing; Step S02: Based on the meteorological characteristics of meteorological factor data, the K-means clustering algorithm is used to divide historical days into different meteorological categories, and a training set for the corresponding meteorological category is constructed; Step S03: Perform correlation analysis on each training set to obtain core meteorological features and form a core feature sequence. Use three mode decomposition algorithms, namely VMD, CEEMD, and SSA, to decompose the core feature sequence in parallel to form an enhanced feature set. Step S04: Construct a dual-stream neural network model, which consists of a CNN stream and a GRU stream. Train the model for each meteorological category using the training set from Step S02 to obtain the model corresponding to each meteorological category. Use the enhanced feature set as input to the dual-stream neural network model, and concatenate and fuse the output feature vectors of the CNN stream and the GRU stream to obtain a combined spatiotemporal feature vector. Then, input the combined spatiotemporal feature vector into the self-attention mechanism module to calculate the importance weight of each feature dimension and weight the features to obtain the optimized feature vector. Step S05: Input the optimized feature vector into at least one fully connected layer to obtain the final short-term photovoltaic power prediction value.
2. The method for photovoltaic power prediction according to claim 1, characterized in that, The meteorological data mentioned in step S01 include: total horizontal radiation, total radiation of the inclined surface, ambient temperature, relative humidity, and wind speed.
3. The method for photovoltaic power prediction according to claim 1, characterized in that, The weather categories mentioned in step S02 include: sunny, cloudy, rainy, and overcast.
4. The method for photovoltaic power prediction according to claim 1, characterized in that, The clustering algorithm described in step S02 is evaluated using DBI, through iterative analysis of different clustering methods. Value and calculate each The DBI corresponding to the value is selected to minimize the DBI value. As the optimal number of clusters, historical days are divided into Weather categories: , in, and For history day And another historical day The average distance to the corresponding cluster center. Representing historical days And another historical day The Euclidean distance between the centers This represents the number of clusters.
5. The method for photovoltaic power prediction according to claim 1, characterized in that, The correlation analysis mentioned in step S03 involves calculating the Pearson correlation coefficient between each meteorological feature and active power, and selecting two features with a correlation coefficient > 0.9 as core meteorological features.
6. The method for photovoltaic power prediction according to claim 1, characterized in that, In step S04, the CNN stream inputs the enhanced feature set into a one-dimensional convolutional neural network stream. The CNN stream consists of convolutional layers, pooling layers, and flattening layers, used to capture the local patterns and spatial correlations between different feature components at the same time point and extract spatial feature vectors. The GRU stream simultaneously inputs the enhanced feature set into a gated recurrent unit stream. The GRU stream consists of two GRU layers and a flattening layer, used to capture the dynamic patterns and long-term dependencies of each feature sequence over time and extract temporal feature vectors.
7. The method for photovoltaic power prediction according to claim 1, characterized in that, The self-attention mechanism module described in step S04 linearly transforms the input into a query matrix, a key matrix, and a value matrix, calculates the attention weights, and outputs the weighted features: , in, It is the dimension of the key vector. For querying the matrix, The key matrix, It is a value matrix.
8. A device for predicting photovoltaic power, characterized in that, The device implements the method as described in any one of claims 1 to 7, comprising: Data acquisition module: used to acquire historical power data and meteorological factor data of the target photovoltaic power station and perform preprocessing; Category segmentation module: Based on meteorological features of meteorological factor data, it uses clustering algorithms to divide historical days into different meteorological categories and constructs training sets for the corresponding meteorological categories; Feature set enhancement module: It is used to perform correlation analysis on each training set to obtain core meteorological features and form a core feature sequence. It uses three mode decomposition algorithms, namely VMD, CEEMD and SSA, to decompose the core feature sequence in parallel to form an enhanced feature set. Feature vector optimization module: This module is used to construct a two-stream neural network model, which consists of a CNN stream and a GRU stream. The model is trained on each meteorological category using the training set from step S02 to obtain models corresponding to different meteorological categories. The enhanced feature set is used as input to the two-stream neural network model. The output feature vectors of the CNN stream and the GRU stream are concatenated and fused to obtain a combined spatiotemporal feature vector, which is then input into the self-attention mechanism module. The importance weights of each feature dimension are calculated and the features are weighted to obtain the optimized feature vector. Photovoltaic power prediction module: used to input the optimized feature vector into at least one fully connected layer to obtain the final short-term photovoltaic power prediction value.
9. An electronic device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the program, it implements the method as described in any one of claims 1 to 7.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the method as described in any one of claims 1 to 7.
Citation Information
Patent Citations
Power distribution network photovoltaic generation power prediction method based on WOA-VMD and double-current network
CN119231499A
Ultra-short-term photovoltaic power prediction method based on deep learning
CN115879629A
Photovoltaic power ultra-short-term prediction method based on multi-mode decomposition and multi-branch input
CN116995670A
Photovoltaic power station regulation and operation optimization method, device, equipment and medium
CN118748538A