Photovoltaic power prediction method, device and equipment
By combining multimodal decomposition and dual-stream attention network, the photovoltaic power sequence was successfully decomposed into stationary mode components, which solved the problem of limited photovoltaic power prediction accuracy in the existing technology and achieved more accurate short-term prediction results.
Patent Information
- Application Number
- CN202511496550.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-20
- Publication Date
- 2025-11-18
- 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 output 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 stream and GRU stream is constructed, and a self-attention mechanism is combined to deeply fuse spatiotemporal information, capturing the complex correlation between photovoltaic power and meteorological factors.
It significantly improves the accuracy and stability of short-term photovoltaic power forecasting, simplifies the forecasting task, enhances the model's ability to focus on key features, improves robustness and accuracy, and optimizes data utilization efficiency.
Smart Images

Figure CN120974456A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] Embodiments of the present application generally relate to the field of renewable energy power generation, and in particular, to a method, device and equipment for photovoltaic power prediction. BACKGROUND
[0002] In recent years, with the global energy structure transforming towards clean and low-carbon, photovoltaic power generation, as a flexible and sustainable distributed power source, plays a crucial role in the global demand for clean energy. However, the photovoltaic power generation process is strongly dependent on meteorological factors such as light intensity, temperature, wind speed, and cloud coverage, making its output power exhibit significant intermittency, volatility, and randomness. This inherent uncertainty poses a serious challenge to the grid-connected power system, directly affecting the safe and stable operation of the power grid, power quality, and economic dispatch. Therefore, achieving accurate short-term prediction of photovoltaic output power is a key technical prerequisite for ensuring the safe operation of active distribution networks, reasonable arrangement of energy scheduling, and maximizing the capacity of photovoltaic power consumption.
[0003] The original photovoltaic power time series is a typical non-stationary and nonlinear signal, which often couples multiple fluctuation components of different time scales, from high-frequency transient disturbances to low-frequency daily variation cycles, with complex components. If the original sequence mixed with multiple frequencies is directly input into the prediction model, the model will have difficulty in effectively distinguishing and learning the potential laws under different scales, thus leading to limited prediction accuracy. In order to solve this problem, multi-modal decomposition technology is introduced into the field of photovoltaic prediction.
[0004] In the prior art, researchers have explored a variety of decomposition prediction models. For example, patent CN117592593A discloses a short-term power load prediction method based on improved quadratic modal decomposition and WOA optimized BiLSTM-attention. The method adopts a quadratic decomposition strategy combining CEEMDAN and VMD. Although the depth of decomposition is improved to some extent, it brings new problems: the quadratic decomposition process may generate too many modal components, resulting in the need to train an independent prediction model for each component, which not only greatly increases the computational complexity and training time of the model, but also the BiLSTM-attention model used cannot effectively mine the complex spatial correlation between meteorological factors and photovoltaic power. Patent CN202411304442.5 discloses a power distribution network photovoltaic power prediction method based on WOA-VMD and a double-flow network. The scheme uses a BiGRU model to extract time sequence features and uses a GCN model to capture spatial features. Although it introduces the concept of a double-flow network, it only uses single VMD for decomposition, and when facing extremely non-stationary original photovoltaic sequences, there may still be a risk of modal aliasing or incomplete decomposition. In addition, the decomposition effect of the VMD algorithm is extremely sensitive to the number of modes K and the penalty factor α and other hyperparameters. Improper parameter settings will directly affect the decomposition quality and thus restrict the performance upper limit of the entire prediction model.
[0005] Therefore, it is of great theoretical value and engineering application prospect to develop a new photovoltaic power prediction method that can effectively solve the above problems. SUMMARY
[0006] To solve the above problems, the present application successfully disassembles the complex original photovoltaic power sequence into multiple relatively stable and single-frequency modal components by introducing a multi-modal decomposition technology, greatly simplifying the prediction task. On this basis, combined with the deep fusion ability of the double-flow attention network for time and space information, the model can more accurately capture the fluctuation rules of photovoltaic power and the complex correlation between it and meteorological factors, thereby significantly improving the prediction accuracy and stability of short-term photovoltaic power.
[0007] According to an embodiment of the present application, a photovoltaic power prediction method, device and equipment are provided.
[0008] In a first aspect of the present application, a photovoltaic power prediction method is provided. The method comprises: Step S01: obtaining historical power data and meteorological factor data of a target photovoltaic power station and preprocessing; Step S02: based on the meteorological features of the meteorological factor data, using a clustering algorithm to divide the historical days into different meteorological categories, and constructing a training set corresponding to the meteorological categories; Step S03: correlation analysis is performed on each training set to obtain core meteorological features and form a core feature sequence, and VMD algorithm, CEEMD algorithm and SSA algorithm are used to perform parallel decomposition on the core feature sequence respectively to form an enhanced feature set; Step S04: a double-flow neural network model is constructed, which is divided into a CNN flow and a GRU flow, and each meteorological category is trained using the training set in step S02 to obtain a model corresponding to different meteorological categories; the enhanced feature set is input into the double-flow neural network model, and the output feature vectors of the CNN flow and the GRU flow are spliced and fused to obtain a combined spatio-temporal feature vector which is then input into a self-attention mechanism module to calculate the importance weight of each feature dimension and weight the features to obtain an optimized feature vector; Step S05: the optimized feature vector is input into at least one fully connected layer to obtain a final short-term photovoltaic power prediction value.
[0009] Further, the synchronous meteorological factor data in step S01 includes total horizontal radiation, total radiation on a tilted surface, ambient temperature, relative humidity and wind speed.
[0010] Further, the meteorological categories in step S02 include sunny day, cloudy day, rainy day and overcast day.
[0011] Further, the clustering algorithm in step S02 is evaluated by DBI, and the DBI value corresponding to each value is calculated by iterating different values, and the value that makes the DBI value minimum is selected as the best clustering number, so that the historical days are divided into meteorological categories: , wherein, and are the average distances of the historical day and another historical day to the corresponding cluster center, represents the Euclidean distance between the historical day and another historical day center, is the number of clusters.
[0012] Further, the correlation analysis in step S03 is to calculate the Pearson correlation coefficient between each meteorological feature and active power, and select two features with a correlation coefficient >0.9 as core meteorological features.
[0013] Further, the CNN flow in step S04 inputs the enhanced feature set into a one-dimensional convolutional neural network flow composed of a convolutional layer, a pooling layer, a convolutional layer, a pooling layer, and a flattening layer, for capturing local patterns and spatial correlations between different feature components at the same time point and extracting spatial feature vectors; the GRU flow inputs the enhanced feature set into a gated recurrent unit flow at the same time, the GRU flow is composed of two layers of GRU layers and a flattening layer, for capturing dynamic rules and long-term dependencies of each feature sequence itself evolving over time and extracting time feature vectors.
[0014] Further, the self-attention module in step S04 linearly transforms the input into a query matrix, a key matrix, and a value matrix, calculates attention weights, and outputs weighted features: , wherein, is the dimension of the key vector, is the query matrix, is the key matrix, is the value matrix. In the second aspect of the present application, a photovoltaic power prediction device is provided. The device comprises: a data acquisition module for acquiring and preprocessing historical power data and meteorological factor data of a target photovoltaic power station; a category division module for dividing historical days into different meteorological categories based on meteorological features of meteorological factor data and constructing a training set corresponding to each meteorological category; a feature set enhancement module for performing correlation analysis on each training set to obtain core meteorological features and form a core feature sequence, and performing parallel decomposition on the core feature sequence using VMD algorithm, CEEMD algorithm, and SSA algorithm to form an enhanced feature set; a feature vector optimization module for constructing a double-flow neural network model, which is divided into a CNN flow and a GRU flow, and training each meteorological category using the training set in step S02 to obtain a model corresponding to each meteorological category; inputting the enhanced feature set into the double-flow neural network model, and splicing and fusing the output feature vectors of the CNN flow and the GRU flow to obtain a combined spatio-temporal feature vector, then inputting the combined spatio-temporal feature vector into a self-attention mechanism module, calculating the importance weights of each feature dimension, and weighting the features to obtain an optimized feature vector; a photovoltaic power prediction module for inputting the optimized feature vector into at least one fully connected layer to obtain a final short-term photovoltaic power prediction value.
[0015] In a third aspect of the application, an electronic device is provided. The electronic device comprises a memory having a computer program stored thereon and a processor, which, when executing the program, implements the method according to the first aspect of the application.
[0016] In a fourth aspect of the application, a computer readable storage medium is provided, having a computer program stored thereon, which, when executed by a processor, implements the method according to the first aspect of the application.
[0017] The present application successfully disassembles the complex original photovoltaic power sequence into multiple relatively stable and single frequency modal components by introducing a multi-modal decomposition technology, greatly simplifies the prediction task, and on this basis, combines the deep fusion ability of the dual-flow attention network to the spatio-temporal information, so that the model can more accurately capture the fluctuation law of photovoltaic power and the complex correlation between it and meteorological factors, thereby significantly improving the prediction accuracy and stability of short-term photovoltaic power.
[0018] It should be understood that the content described in the summary section is not intended to limit the key or important features of the embodiments of the present application, nor to limit the scope of the present application. Other features of the present application will become apparent from the following description.
[0019] Advantages of the present application: 1. Introducing a multi-modal decomposition technology, using three different decomposition methods can obtain more diversified and information-rich features, and the combination of these sub-sequences from different mechanisms according to different mathematical mechanisms to process signals can form a more comprehensive description of the complexity of the signal, thereby better representing the internal law of the complex signal, while avoiding some easily aliasing modal sub-sequences that may be missed in a single decomposition method, successfully disassembling the complex original photovoltaic power sequence into multiple relatively stable and single frequency modal components, greatly simplifying the prediction task, and on this basis, combining the deep fusion ability of the unique dual-flow attention network to the spatio-temporal information, more accurately capturing the fluctuation law of photovoltaic power and the complex correlation between it and meteorological factors, thereby significantly improving the prediction accuracy and stability of short-term photovoltaic power; 2. Multi-modal decomposition of key input features effectively enhances the expression ability of the internal structure and law of the data, so that the subsequent dual-flow network can more efficiently learn the potential law under different time scales, and at the same time, the dual-flow network parallelly processes and deeply fuses the time sequence features of photovoltaic power and the spatial correlation features of meteorological factors, wherein one flow focuses on capturing the time evolution law of each modal component, and the other flow focuses on mining the spatial dependence relationship between multi-element meteorological factors and photovoltaic power, avoiding the limitations of a single model that is difficult to simultaneously consider time sequence dynamics and spatial dependence relationship, and realizing comprehensive and effective utilization of multi-source heterogeneous data; 3. The introduction of the self-attention mechanism significantly enhances the model's ability to focus on key features, enabling the model to adaptively assign weights based on the relevance of the input data and prioritize key information that has the greatest impact on the prediction result, thereby improving the model's interpretability and further enhancing the robustness and accuracy of the prediction; To address the problem that existing decomposition methods are easily affected by hyperparameters or have modal aliasing, an optimized multi-modal decomposition strategy is used to more effectively handle non-stationary photovoltaic power sequences and reduce the impact of improper decomposition on prediction performance. Combined with the powerful feature learning ability of the dual-flow attention network, the model can maintain good prediction performance and generalization ability even under complex and variable weather conditions; 4. The present application adopts the mode of clustering first and then correlation, and when clustering, all features are retained without considering the final photovoltaic power prediction, and only the internal structure of the data is divided from an unsupervised perspective to discover some implicit operating modes, thereby overcoming the problem that the screening process based on the correlation between features and output power hides the structural differences in the data; For different photovoltaic power stations, direct feature screening may discard some important information under specific scenarios when the understanding of data characteristics is limited, therefore, clustering first can avoid premature feature selection, thereby retaining the possibility of all information; 5. The strategy of clustering first and then correlation analysis is adopted, first, unsupervised clustering is performed on photovoltaic data to divide the data into multiple categories, thereby realizing automatic identification and classification of weather types, such as sunny, cloudy, overcast, or rainy days, etc. Through clustering, samples with similar meteorological characteristics and operating characteristics can be classified into one category, so that the internal consistency of each category of data is higher, thereby providing a more accurate and pure data basis for subsequent analysis; On this basis, correlation analysis is performed on each clustered data, which can eliminate features with low correlation and more accurately identify features with predictive value under specific weather conditions, thereby significantly reducing the data dimension and data volume required for subsequent model training, and finally realizing optimization of data volume and improvement of model training efficiency. BRIEF DESCRIPTION OF DRAWINGS
[0020] The above and other features, advantages, and aspects of embodiments of the present application will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings, in which: Figure 1 A flowchart of a method for photovoltaic power prediction according to an embodiment of the present application is shown; Figure 2 A flowchart of a DBI-based K-means clustering algorithm according to an embodiment of the present application is shown; Figure 3 A schematic diagram of a dual-flow network structure according to an embodiment of the present application is shown; Figure 4A photovoltaic power prediction model framework based on multi-modal decomposition and double-flow spatio-temporal feature extraction according to an embodiment of the present application is shown. Figure 5 A short-term power prediction result diagram for a certain photovoltaic power station for the next one hour according to an embodiment of the present application is shown. Figure 6 A device block diagram of photovoltaic power prediction according to an embodiment of the present application is shown. Figure 7 A device diagram of photovoltaic power prediction according to an embodiment of the present application is shown. DETAILED DESCRIPTION
[0021] To make the objectives, technical solutions, and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are some but not all of the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by a person of ordinary skill in the art without creative work fall within the protection scope of the present application.
[0022] According to the embodiments of the present application, a photovoltaic power prediction method, device, and equipment are provided. By introducing a multi-modal decomposition technology, a complex original photovoltaic power sequence is successfully decomposed into multiple relatively stable and single-frequency modal components, greatly simplifying the prediction task. On this basis, combined with the deep fusion ability of spatio-temporal information of the double-flow attention network, the model can more accurately capture the fluctuation rules of photovoltaic power and the complex correlation between the photovoltaic power and meteorological factors, thereby significantly improving the prediction accuracy and stability of short-term photovoltaic power.
[0023] The principles and spirits of the present application will be explained in detail below with reference to several representative embodiments of the present application.
[0024] Figure 1 A method flow diagram of photovoltaic power prediction according to an embodiment of the present application is shown. The method comprises: Step S01: obtaining historical power data and meteorological factor data of a target photovoltaic power station and preprocessing; Step S02: based on the meteorological features of the meteorological factor data, using a clustering algorithm to divide the historical day into different meteorological categories, and constructing a training set corresponding to the meteorological category; Step S03: performing correlation analysis on each training set to obtain core meteorological features and form a core feature sequence, using VMD algorithm, CEEMD algorithm, and SSA algorithm three modal decomposition algorithms to perform parallel decomposition on the core feature sequence respectively, and constructing an enhanced feature set; Step S04: A double-flow neural network model is constructed, which is divided into a CNN flow and a GRU flow, and each meteorological category is trained using the training set in step S02 to obtain a model corresponding to different meteorological categories; the enhanced feature set is input into the double-flow neural network model, and the output feature vectors of the CNN flow and the GRU flow are spliced and fused to obtain a combined spatio-temporal feature vector, which is then input into a self-attention mechanism module to calculate the importance weight of each feature dimension and weight the features to obtain an optimized feature vector; Step S05: The optimized feature vector is input into at least one fully connected layer to obtain a final short-term photovoltaic power prediction value.
[0025] It should be noted that although the operations of the method of the present application are described in a specific order in the above embodiments and drawings, this does not require or imply that the operations must be performed in this specific order, or that all of the shown operations must be performed to achieve the desired results. Additionally or alternatively, certain steps can be omitted, multiple steps can be combined into one step, and / or one step can be divided into multiple steps.
[0026] In order to more clearly explain the above-mentioned photovoltaic power prediction method, a specific embodiment will be described below, however, it should be noted that this embodiment is only for better illustrating the present application and does not constitute an improper limitation on the present application.
[0027] The method for predicting photovoltaic power will be further described in more detail below with a specific example: Step S01: Obtain the historical power data and meteorological factor data of the target photovoltaic power station, and perform cleaning, missing value filling and normalization processing on the data.
[0028] In this embodiment, the historical data of a certain photovoltaic power station is collected, and the data sampling frequency is 5 minutes once. The collected data includes the active power (kW) of the photovoltaic power station and the contemporaneous meteorological data, including total horizontal radiation (W / m²), inclined surface total radiation (W / m²), ambient temperature (°C), relative humidity (%), and wind speed (m / s). The collected data set is divided into a training set (the first 80%) and a test set (the last 20%).
[0029] The collected data set is preprocessed, including: data cleaning, eliminating obvious outliers and null values caused by sensor failure or transmission errors; missing value filling, for a small number of missing data points, linear interpolation method is used for filling; data normalization: in order to eliminate the influence of different physical dimensions and speed up the convergence speed of the model, the minimum-maximum normalization method is used to scale all feature data to the [0, 1] interval, and the calculation formula is as follows: , In the formula, is the original data point, is the normalized data point, and are the maximum and minimum values in the feature sequence, respectively.
[0030] Step S02: Based on the meteorological features of the meteorological factor data, a clustering algorithm is used to divide the 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 the category are selected to construct a training set corresponding to the meteorological category.
[0031] Specifically, to improve the pertinence of prediction, the historical data is first clustered to filter out historical days similar to the meteorological conditions of the day to be predicted, including the following steps.
[0032] 1. Sex feature vector construction: For each historical day, a set of features reflecting its daily meteorological 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 dimensional daily feature vector.
[0033] 2. K-means clustering: The feature vector set of all historical days is taken as input, and the K-means algorithm is used for clustering. The specific steps are as follows.
[0034] Initialization: randomly select objects from the data samples as initial cluster centers , Sample assignment: for each historical day sample , calculate its Euclidean distance from each cluster center , and assign it to the nearest cluster : , Center update: recalculate the centroid of each cluster as the new cluster center : , Iteration: repeat the sample assignment and center update steps until the cluster centers no longer change or the maximum number of iterations is reached.
[0035] In the K-means algorithm, the number of clusters is determined by humans and has errors. Therefore, a quantitative index is introduced to find the optimal clustering of samples and automatically determine the optimal number of clusters In the present application, the Davies-Bouldin index (DBI) is used for cluster evaluation, and the specific process is as shown in Figure 2 The DBI corresponding to each value is calculated by iterating different values, for example, from 2 to a preset , and the value that makes the DBI value minimum is selected as the optimal cluster number, so as to divide the historical days into meteorological categories. In the present embodiment, the historical days are divided into 3 time limit meteorological categories: sunny days, cloudy days and rainy days. The DBI utilizes the number and characteristics inherent to the data set, and its definition is as follows: , wherein and are the average distances of the historical day and another historical day to the corresponding cluster center, represents the Euclidean distance between another historical day and another historical day center. The smaller the value of DBI, the better the clustering performance. In order to avoid the redundancy caused by generating too many clusters, a threshold constraint can be imposed on the number of clusters, i.e. .
[0036] When making a prediction, first, the daily feature vector of the day to be predicted is constructed according to the meteorological forecast data of the day to be predicted, and then the Euclidean distance between the vector and the determined cluster centers is calculated, and the vector is classified into the nearest cluster. Finally, the data of all historical days contained in the cluster are extracted to form a training set specially used for the present prediction: including a sunny training set, a cloudy training set and a rainy training set.
[0037] Step S03: Core meteorological features are obtained by performing correlation analysis on each training set to form a core feature sequence, and the core feature sequence is respectively subjected to parallel decomposition by using three modal decomposition algorithms, i.e., a VMD algorithm, a CEEMD algorithm and an SSA algorithm, to form an enhanced feature set.
[0038] The correlation analysis is to calculate the Pearson correlation coefficient between each meteorological feature and the active power. In the present embodiment, the total horizontal radiation and the total radiation on the inclined plane have the highest correlation with the photovoltaic power, and the calculated results are 0.96 and 0.92 respectively, i.e., the correlation coefficient > 0.9, so these two features are selected as the core meteorological features and form a 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.
[0039] 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.
[0040] VMD decomposition: Constructing and solving a constrained variational problem, transforming the original signal... Decomposed into Modal components Its center frequency is ,but: , 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.
[0041] 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. .
[0042] 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, is a standard orthogonal vector. By grouping and reconstructing singular values, the trend, periodic and noise components of the signal are separated. After decomposition, the original 2 core feature sequences are expanded into multiple groups of sub-sequence components.
[0043] This process decomposes each single core feature sequence into multiple more stable and regular sub-sequence components.
[0044] All sub-sequence components generated by decomposition are merged with the original photovoltaic power sequence to form a high-dimensional enhanced feature set This greatly enriches the input information and provides a more comprehensive data perspective for subsequent model learning.
[0045] Step S04: Construct a double-flow neural network model, which is divided into a CNN flow and a GRU flow, and use the training set in step S02 to train each meteorological category to obtain different models corresponding to different meteorological categories. In this embodiment, a model corresponding to sunny days, a model corresponding to cloudy days, and a model corresponding to rainy days are obtained; the enhanced feature set is input into the double-flow neural network model, and the output feature vectors of the CNN flow and the GRU flow are spliced and fused to obtain a combined spatio-temporal feature vector, which is then input into a self-attention mechanism module to calculate the importance weight of each feature dimension and weight the features to obtain an optimized feature vector.
[0046] Specifically, as shown in Figures 3-4 , the double-flow feature extraction is divided into a CNN flow and a GRU flow. The CNN flow inputs the enhanced feature set into a one-dimensional convolutional neural network (CNN) flow, which is composed of a convolutional layer, a pooling layer, a convolutional layer, a pooling layer, and a flattening layer, for capturing local patterns and spatial correlations between different feature components, such as a certain VMD component of radiation, a temperature sequence, etc., at the same time point, and extracting a spatial feature vector. The GRU flow simultaneously inputs the enhanced feature set into a gated recurrent unit (GRU) flow, which is composed of two layers of GRU layers and a flattening layer, for capturing the dynamic rules and long-term dependencies of each feature sequence over time, and extracting a temporal feature vector.
[0047] CNN flow: input data through a one-dimensional convolutional layer. The output of the first layer is the first feature map , which can be represented as: , wherein, is an activation function, is a bias term, is a convolution kernel weight, is the number of convolution kernels, is the position index of the convolution kernel, is the position index of the current feature map. This layer is used to capture the local combination pattern of different features at the same time. Then the data is passed through a max-pooling layer to reduce the dimension of the data.
[0048] GRU stream: input data is passed through a GRU layer in parallel. The GRU unit is in the calculation process at time t is as follows: Reset Gate : decides how much past information to ignore: , Update Gate : decides how much new information to write to the current state: , Candidate Hidden State : , Current Hidden State : , where, is the hidden state at the last time, is the Sigmoid function, denotes element-wise multiplication, and are the corresponding weight matrix and bias term.
[0049] The output feature vectors of the CNN stream and the GRU stream are spliced and fused to obtain a combined spatio-temporal feature vector; the combined spatio-temporal feature vector is input into a self-attention mechanism (Self-Attention) module, which calculates the importance weight of each feature dimension and weights the features to highlight key information and suppress redundant information, to obtain the final optimized feature vector.
[0050] Specifically, the output of the CNN stream and the output of the GRU stream are spliced along the feature dimension after being flattened. This fusion vector is sent to the self-attention module. The module first linearly transforms the input , which is composed of multiple into query matrix Q , key matrix , and value matrix V , then calculates the attention weight and outputs the weighted features: , where, is the dimension of the key vector. This mechanism enables the model to focus on the spatio-temporal features that are most important for prediction.
[0051] Step S05: The optimized feature vector is input into at least one dense layer (Dense) to obtain the final short-term photovoltaic power prediction value through regression calculation.
[0052] Specifically, the prediction layer inputs the optimized feature vector output by the attention module into the prediction head part. The prediction head is composed of at least one dense layer and is processed using a nonlinear activation function. The purpose of this step is to perform high-order nonlinear combination and mapping on the features filtered by the attention mechanism to capture deeper internal correlations. The data passes through an output layer, which is a dense layer with 12 neurons, where 12 is the prediction step, corresponding to 1 hour in the future, with a prediction point every 5 minutes. This layer usually uses a linear activation function to output unbounded, continuous power prediction values .
[0053] Model training: The entire network model is trained in an end-to-end manner. The model parameters are optimized by minimizing the error between the predicted value and the true value . The mean squared error (MSE) is chosen as the loss function : , where is the total number of samples used for evaluation, is the th true value, is the th predicted value.
[0054] The Adam adaptive learning rate optimizer is used. The gradients of the loss function with respect to the weights and biases of each layer of the network are calculated using the backpropagation algorithm, and the parameters are updated accordingly until the loss on the validation set no longer decreases significantly.
[0055] Multi-step prediction strategy: When performing multi-step prediction, a rolling or recursive prediction strategy is used. Specifically, the historical data is first used to predict the power value at the first time point (t+1). Then, the predicted value is used as part of the new historical data to update the input sequence for predicting the power at the second time point (t+2). This process is repeated until all T time points are predicted, resulting in a complete power prediction sequence for a certain period of time (e.g., 1 hour).
[0056] In this embodiment, a rolling prediction strategy is adopted. That is, the power at t+1 to t+12 time is predicted by using the historical data before t time, when the real data at t+1 time is available, the data window is rolled back, the power at t+2 to t+13 time is predicted by using the updated historical data, and so on, so as to realize continuous short-term prediction.
[0057] This embodiment aims to make short-term power prediction for a certain photovoltaic power station for 1 hour in the future, and the prediction result Figure 5 As shown in the figure, the figure shows the comparison of 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 in the figure 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 the prediction effect is good.
[0058] Based on the same inventive concept, the application also proposes a photovoltaic power prediction device. The implementation of the device can refer to the implementation of the above-mentioned method, and the repeated parts will not be described here. As Figure 6 As shown in the figure, the device 100 comprises: The data acquisition module 101 is used for acquiring and preprocessing the historical power data and meteorological factor data of the target photovoltaic power station; The category division module 102 is used for dividing the historical day into different meteorological categories based on the meteorological features of the meteorological factor data, and constructing a training set corresponding to the meteorological category; The feature set enhancement module 103 is used for performing correlation analysis on each training set to obtain core meteorological features and form a core feature sequence, and performing parallel decomposition on the core feature sequence by using VMD algorithm, CEEMD algorithm and SSA algorithm to form an enhanced feature set; The feature vector optimization module 104 is used for constructing a double-flow neural network model, which is divided into CNN flow and GRU flow, and training each meteorological category by using the training set in step S02 to obtain different models corresponding to the meteorological categories; the enhanced feature set is input into the double-flow neural network model, and the output feature vectors of the CNN flow and the GRU flow are spliced and fused to obtain a combined spatio-temporal feature vector, which is then input into a self-attention mechanism module to calculate the importance weight of each feature dimension and weight the features to obtain an optimized feature vector; The photovoltaic power prediction module 105 is used for inputting the optimized feature vector into at least one fully connected layer to obtain a final short-term photovoltaic power prediction value.
[0059] Those skilled in the art can clearly understand that, for the convenience and brevity of description, the specific working process of the described modules can refer to the corresponding process in the foregoing method embodiments, which will not be described here.
[0060] As shown in FIG. 1, the device includes a central processing unit (CPU) that can perform various appropriate actions and processes in accordance with computer program instructions stored in a read only memory (ROM) or loaded from a storage unit into a random access memory (RAM). Various programs and data required for operation of the device can also be stored in the RAM. The CPU, the ROM, and the RAM are connected to each other through a bus. An input / output (I / O) interface is also connected to the bus. Figure 7 Various components in the device are connected to the I / O interface, including: an input unit such as a keyboard, a mouse, etc.; an output unit such as various types of displays, a speaker, etc.; a storage unit such as a magnetic disk, an optical disk, etc.; and a communication unit such as a network card, a modem, a wireless communication transceiver, etc. The communication unit allows the device to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0061] The processing unit performs the various methods and processes described above, such as the method steps S01-S05. For example, in some embodiments, the method steps S01-S05 can be implemented as a computer software program that is tangibly embodied in a machine readable medium, such as the storage unit. In some embodiments, part or all of the computer program can be loaded and / or installed on the device via the ROM and / or the communication unit. When the computer program is loaded into the RAM and executed by the CPU, one or more of the method steps S01-S05 described above can be performed. Alternatively, in other embodiments, the CPU can be configured, by any appropriate means (e.g., by means of firmware), to perform the method steps S01-S05.
[0062] The functionality described above in this document can be performed, at least in part, by one or more hardware logic components. For example, and without limitation, exemplary types of hardware logic components that can be used include Field-programmable Gate Arrays (FPGAs), Application-specific Integrated Circuits (ASICs), Application-specific Standard Products (ASSPs), System-on-a-chip systems (SOCs), Complex Programmable Logic Devices (CPLDs), etc.
[0063]
[0064] Program code for carrying out operations of the methods of the present application can be written in any combination of one or more programming languages. The program code can be provided to a processor or controller of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the program code, when executed by the processor or controller, causes the machine to perform the functions / operations described in the flow diagrams and / or block diagrams. The program code can execute entirely on a machine, partly on a machine, as a stand-alone software package, partly on a machine and partly on a remote machine or entirely on a remote machine or server.
[0065] In the context of the present application, a machine-readable medium can be a tangible medium that can contain or store program for use by or in connection with an instruction execution system, apparatus, or device. The machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. Machine-readable storage media can include, without limitation, 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 can include, but are not limited to, an electrical connection based on one or more wires, a portable computer diskette, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or Flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0066] Moreover, while operations can be depicted in a particular, serial order, this should not be understood as requiring or implying that such operations be performed in the particular order shown, or in sequential order, or that all illustrated operations be performed, to achieve desirable results. In certain circumstances, multitasking and parallel processing can be advantageous. Likewise, while specific implementations are discussed herein, these should not be understood to limit the scope of the application, which is defined by the appended claims. Certain features that are described in the context of separate embodiments can also be implemented in combination in a single embodiment. Conversely, various features that are described in the context of a single embodiment can also be implemented in subcombination or as separate embodiments, apart from the other features described in a single embodiment.
[0067] Although the subject matter has been described in language specific to structural features and / or methodological acts, it is to be understood that the subject matter defined in the appended claims is not necessarily limited to the specific features or acts described above. Rather, the specific features and acts described above are disclosed as example forms 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, a clustering algorithm is used to divide historical days into different meteorological categories, and a training set for the corresponding meteorological categories 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 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.
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 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
Short-term power load prediction method combining CDC-VMD and echo state network
CN116090627A
Photovoltaic power ultra-short-term prediction method based on multi-mode decomposition and multi-branch input
CN116995670A
Short-term photovoltaic power prediction method, computer readable storage medium and electronic equipment
CN118739256A
Cited By
Photovoltaic power generation power prediction method based on mode perception adaptive deep learning
CN121216441A
A Photovoltaic Power Generation Prediction Method Based on Pattern-Aware Adaptive Deep Learning
CN121216441B