Photovoltaic power prediction method and device, storage medium and electronic equipment
By performing multi-mode decomposition and feature extraction on the historical data of photovoltaic power generation, the combined prediction model of the double-layer LSTM module and the residual module is used to solve the accuracy of the ultra-short-term output power prediction of photovoltaic power generation, and the accuracy of prediction and feature expression capabilities are improved.
Patent Information
- Application Number
- CN202411717343.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-27
- Publication Date
- 2025-03-18
AI Technical Summary
The prior art is difficult to accurately predict the ultra-short-term output power of photovoltaic power generation, which has led to the threat of the stability of the power system.
By obtaining the historical data of photovoltaic power generation, multi-modal decomposition is performed to extract the decomposition power and decompose meteorological variables, and input them into the double-layer LSTM module and residual module in the combined prediction model for feature extraction and merging, and finally generate the photovoltaic power prediction value.
It improves the accuracy of ultra-short-term prediction of photovoltaic power generation, reduces the input data volume and redundant data, enhances the characteristic characterization force, and can more accurately reflect the fluctuations of photovoltaic power generation.
Smart Images

Figure CN119646485A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of data processing technology, and in particular to a photovoltaic power prediction method, device, storage medium and electronic equipment. Background Art
[0002] With the continuous grid connection of my country's large-scale photovoltaic installed capacity, new impetus has been injected into the power system, alleviating the energy shortage problem caused by the insufficient output of traditional hydropower and coal-fired units to a certain extent. However, photovoltaic power stations are often built in uninhabited areas such as deserts or mountains, and are extremely dependent on the weather, which makes photovoltaic power generation highly volatile and random, and thus brings serious safety hazards to the power system when connected to the grid on a large scale. Therefore, accurate and reliable prediction of photovoltaic output power is extremely important for the stable operation of the power system.
[0003] The deep learning model can be used to predict photovoltaic output power. Photovoltaic output power is mainly affected by a variety of external factors. Different external factors have different scales, which can easily interfere with the training of the model, resulting in low model accuracy. Summary of the invention
[0004] The present application provides a photovoltaic power prediction method, device, storage medium and electronic equipment, which can improve the accuracy of ultra-short-term prediction of photovoltaic power generation.
[0005] In a first aspect, the present application provides a photovoltaic power prediction method, comprising:
[0006] Acquiring photovoltaic power generation historical data, wherein the photovoltaic power generation historical data includes output power during a historical period and meteorological variables related to the output power;
[0007] Perform multi-mode decomposition on the photovoltaic power generation historical data to obtain decomposed power and decomposed meteorological variables;
[0008] The decomposed power and the decomposed meteorological variables are used as input samples and respectively input into different branches of the combined prediction model;
[0009] Each branch includes a double-layer LSTM module and a residual module, wherein the double-layer LSTM module extracts the temporal features of the input samples, and the residual module extracts the spatial features of the input;
[0010] The time series feature and the spatial feature are combined, and a photovoltaic power prediction value is obtained based on the combined features.
[0011] According to the photovoltaic power prediction method in this embodiment, the meteorological factors related to the photovoltaic output power are considered for prediction, which can reduce the amount of input data and redundant data; then, by performing multi-mode decomposition on the output power and meteorological variables, the complexity and non-stationarity of the original signal can be highlighted from different angles, so that the rules between the sub-modes are closer and the representation of the features is improved; the residual module is used to extract spatial information, the LSTM module is used to extract time series information, and the comprehensive space and time series are used for prediction, which can more accurately reflect the fluctuation details of real photovoltaic power generation and improve the accuracy of power prediction.
[0012] In a second aspect, the present application provides a photovoltaic power prediction device, comprising:
[0013] A prediction variable determination module is used to obtain photovoltaic power generation history data, wherein the photovoltaic power generation history data includes the output power of photovoltaic power generation in a historical period and meteorological variables related to the output power;
[0014] A data decomposition module, used for performing multi-mode decomposition on the photovoltaic power generation historical data to obtain decomposed power and decomposed meteorological variables;
[0015] A model processing module, used for taking the decomposed power and the decomposed meteorological variables as input samples and inputting them into different branches of the combined prediction model respectively;
[0016] Each branch includes a double-layer LSTM module and a residual module, wherein the double-layer LSTM module extracts the temporal features of the input samples, and the residual module extracts the spatial features of the input;
[0017] The model prediction module is used to merge the time series features with the spatial features, and obtain the photovoltaic power prediction value within the prediction step based on the merged features.
[0018] In a third aspect, the present application provides an electronic device, the electronic device comprising a memory and one or more processors. The memory stores one or more computer programs, the computer programs comprising instructions, and when the instructions are executed by the processor, the electronic device can execute the photovoltaic power prediction method as in the first aspect.
[0019] In a fourth aspect, the present application provides a computer-readable storage medium having instructions stored therein. When the instructions are executed on an electronic device, the electronic device executes the photovoltaic power prediction method as in the first aspect.
[0020] In a fifth aspect, the present application provides a computer program product. When the computer program product is run on an electronic device, the electronic device executes the photovoltaic power prediction method as described in the first aspect.
[0021] It can be understood that the beneficial effects that can be achieved by the photovoltaic power prediction device, electronic device, computer-readable storage medium, and computer program product provided above can refer to the beneficial effects in the first aspect and will not be repeated here. BRIEF DESCRIPTION OF THE DRAWINGS
[0022] Figure 1 A schematic diagram of a photovoltaic power prediction method provided in an embodiment of the present application;
[0023] Figure 2 A schematic diagram of the system architecture of the photovoltaic power prediction method provided in an embodiment of the present application;
[0024] Figure 3 A schematic diagram of another system architecture in the photovoltaic power prediction method provided in an embodiment of the present application;
[0025] Figure 4 Another schematic diagram of the photovoltaic power prediction method provided in the embodiment of the present application;
[0026] Figure 5 A structural diagram of a combined prediction model in a photovoltaic power prediction method provided in an embodiment of the present application;
[0027] Figure 6 Another structural diagram of the combined prediction model in the photovoltaic power prediction method provided in the embodiment of the present application;
[0028] Figure 7 A schematic diagram of the structure of a photovoltaic power prediction device provided in an embodiment of the present application;
[0029] Figure 8 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0030] In order to facilitate the clear description of the technical solutions of the embodiments of the present application, in the embodiments of the present application, the words "first", "second" and the like are used to distinguish the same items or similar items with substantially the same functions and effects. For example, the first chip and the second chip are only used to distinguish different chips, and their order is not limited. Those skilled in the art can understand that the words "first", "second" and the like do not limit the quantity and execution order, and the words "first", "second" and the like do not necessarily limit the difference. It should be noted that in the embodiments of the present application, the words "exemplary" or "for example" are used to indicate examples, illustrations or explanations. Any embodiment or design described as "exemplary" or "for example" in the present application should not be interpreted as being more preferred or more advantageous than other embodiments or design solutions. Specifically, the use of words such as "exemplary" or "for example" is intended to present related concepts in a specific way. In the embodiments of the present application, "at least one" refers to one or more, and "more" refers to two or more.
[0031] It should be noted that the “at…” in the embodiments of the present application may be the instant when a certain situation occurs, or may be a period of time after the occurrence of a certain situation, and the embodiments of the present application do not specifically limit this.
[0032] The implementation of this embodiment will be described in detail below with reference to the accompanying drawings.
[0033] This embodiment provides a photovoltaic power prediction method. By way of example, the photovoltaic power prediction method can be applied to various electronic devices such as computers (PCs), tablet computers, virtual reality / augmented reality devices, wearable devices, industrial computers, and car computers; it can also be applied to servers, cloud computing, server clusters, etc., and this embodiment does not make any special limitations on this.
[0034] Figure 1 A schematic flow chart of a photovoltaic power prediction method provided in an embodiment of the present application is shown.
[0035] like Figure 1 As shown, the photovoltaic power prediction method may include the following steps:
[0036] Step 101: Acquire photovoltaic power generation history data, wherein the photovoltaic power generation history data includes the output power of photovoltaic power generation in a historical period and meteorological variables related to the output power.
[0037] Photovoltaic output power is mainly affected by external factors. External factors include meteorological factors such as irradiance, ambient humidity, temperature, rainfall, wind speed, and atmospheric pressure. However, different external factors have different effects on photovoltaic output power. If all external factors are considered, too many irrelevant variables will be introduced, which will interfere with model training. Therefore, it is necessary to conduct a correlation analysis between photovoltaic output power and external factors, screen the main influencing factors, eliminate redundant variables, and obtain the meteorological variables that have the greatest impact on output power.
[0038] This embodiment specifically includes: acquiring historical data, the historical data including output power and multiple variables; performing correlation analysis on the output power and the multiple variables, filtering the variables in the historical data based on the correlation analysis, and obtaining photovoltaic power generation historical data including the output power and meteorological variables related to the output power.
[0039] Multiple variables can include meteorological factors such as irradiance, ambient humidity, temperature, rainfall, wind speed, atmospheric pressure, etc.
[0040] The Pearson and Spearman correlation coefficients can be used to calculate the correlation between various meteorological factors and photovoltaic output power. The specific calculation method is:
[0041]
[0042] in, Respectively represent x i ,y i The average value, x i is the ith output power, y i is the i-th variable; R(x i ) and R(y i ) are x i and i The ranking in their respective vectors. The value of the Pearson correlation coefficient is between [-1,1]. When the Pearson correlation coefficient is negative, the two variables are negatively correlated; otherwise, they are positively correlated.
[0043] The Pearson and Spearman correlation coefficients between the six types of meteorological factors and the photovoltaic output power are calculated by the above formulas (1) and (2), and the six external meteorological factors with the strongest correlation with the photovoltaic output power are obtained. The calculation results are shown in Table 2.
[0044] Table 2 Correlation coefficients between output power and meteorological factors
[0045] Meteorological factors Pearson Spearman Irradiance 0.913 0.928 temperature 0.422 0.389 Wind speed 0.097 0.114 wind direction -0.165 -0.231 Rainfall -0.051 -0.186 Atmospheric pressure -0.024 -0.071
[0046] As shown in Table 2, in the positive correlation, the photovoltaic output power has the greatest correlation with irradiance, which is extremely strongly correlated, followed by temperature, which is moderately correlated, and the weakest correlation with wind speed, which is extremely weakly correlated; in the negative correlation, wind direction, rainfall and atmospheric pressure are all negatively correlated with photovoltaic output power. Considering that wind speed is extremely weakly correlated with photovoltaic output power, it is ignored with the three types of meteorological factors that are negatively correlated, and only irradiance and temperature are selected as meteorological factors related to output power, and the three factors of photovoltaic output power are used as input features to form the photovoltaic power generation history data F in this paper. in =[X P ,X T ,X I ] to predict the output power of the photovoltaic power plant. Among them, X P is the output power, X T is temperature, X I is the irradiance.
[0047] Step 102: Perform multi-mode decomposition on the photovoltaic power generation historical data to obtain decomposed power and decomposed meteorological variables.
[0048] Multi-mode decomposition refers to decomposing photovoltaic power generation historical data through multiple decomposition algorithms to obtain multiple components. The decomposition algorithms may include singular spectrum decomposition (SSD), variational mode decomposition (VMD) and swarm decomposition (SWD), etc., but the present embodiment is not limited thereto.
[0049] This embodiment also includes: clustering the photovoltaic power generation historical data to obtain multiple data sets, each data set corresponding to a weather type; performing data enhancement on the data set to obtain an enhanced data set; and performing multi-mode decomposition on the enhanced data set.
[0050] Since there is less historical data on rainy days and some extreme weather conditions, in this embodiment, the historical data on photovoltaic power generation is classified according to weather types through clustering, thereby enhancing the data set with a small number of samples, increasing the data volume of the data set, and ensuring the training effect of the model.
[0051] Clustering may include a K-means clustering algorithm, a Balanced Iterative Reducing and Clustering Using Hierarchies (BIRCH), etc., but the present embodiment is not limited thereto.
[0052] The BIRCH clustering algorithm uses a tree structure to quickly cluster and reduce data. By building a clustering feature tree, the clustering structure of the data can be quickly discovered.
[0053] K-Means clustering algorithm is an algorithm based on distance clustering. According to the principle of proximity of similarity, highly similar objects are divided into one cluster, and data with high dissimilarity are divided into different clusters.
[0054] This embodiment takes K-Means as an example. The photovoltaic output power also takes the change of similarity as the starting point, and has a convergent change trend under similar meteorological conditions. The K-Means clustering algorithm is used to classify similar weather types, and the model is trained according to the training set divided according to each different weather type. The detailed steps of the K-Means clustering algorithm are as follows:
[0055] Input part: Photovoltaic output power input data set F in =[X Pm ,X Tm ,X Im ], the number of clusters is k, and the value range of k is set to [3,7].
[0056] Output part: Cluster classification C = {C1, C2, ..., C k}.
[0057] Step (1): Initialization. From the dataset F in Randomly select k samples as the initial mean vector {μ1,μ2,…,μ k};
[0058] Step (2): Determine the cluster to which each sample belongs based on the current cluster center. i (i=1,2,…,n), calculate the sample and each cluster center μ j Distance:
[0059] d ij :=dist(x i ,μ j )=||x i -μ j ||2 (3)
[0060] The sample x i Assign it to the cluster that is closest to you.
[0061] Step (3): Update the center of each cluster. i (i=1,2,…,k), calculate the new behavior vector:
[0062]
[0063] Step (4): If ||μ' j -μ j ||2≤ε(i=1,2,…,k), the iteration is terminated; otherwise, μ j :=μ′ j Go to step (2).
[0064] At the same time, the photovoltaic output power signal is closely related to the meteorological changes of weather types and has a strong periodicity. Its periodicity is particularly evident in stable weather. When the power change amplitude is large, it can be considered as the superposition of signals of different frequencies. The power signal is converted from the time domain to the frequency domain through fast Fourier transform, which can effectively extract the features of different signals, and then cluster them to effectively improve the clustering effect of the clustering algorithm. It is generally believed that if the silhouette coefficient is greater than 0.5, it means that the clustering results are clear and the effect is excellent. If it is less than 0.5, it means that some clustering results overlap. If it is less than 0.2, it means that the clustering results are unreasonable and the clustering structure lacks substance. Since K-Means clustering requires manual determination of the number of silhouettes, k=3,4,…,7 is set in turn to calculate its silhouette coefficients, which are: 0.506, 0.527, 0.563, 0.477, 0.428, respectively. From the calculation results, it can be seen that the clustering effect is best when k=5. After the power is processed by fast Fourier transform and K-Means clustering together with irradiance and temperature, the following is obtained. Figure 2 There are five types of weather shown: sunny in winter, sunny in summer, cloudy, rainy and extreme weather.
[0065] The weather types in this embodiment include sunny summer days, sunny winter days, cloudy days, overcast and rainy days, and extreme weather. The data enhancement of the data set to obtain an enhanced data set includes: using an improved generative adversarial network to enhance the data sets corresponding to the overcast and rainy days and the extreme weather days, respectively, to obtain an enhanced data set; the data volume of the enhanced data set is greater than the data volume of the data set before the enhancement.
[0066] Since there is less non-stationary weather type data in the original data and it is difficult to predict non-stationary weather types, if there is no sufficient historical data to train the model, the prediction results will be low in accuracy. Therefore, the improved generative adversarial network (wasserstein GAN with gradient penalty, WGAN-GP) is used to expand the data of meteorological factors and photovoltaic output power of rainy and extreme weather to generate high-quality samples that conform to the distribution of the original data.
[0067] Taking extreme weather as an example, the WGAN-GP network is used to multiply the power, temperature, and irradiance data required by the model. The generated data are as follows: Figure 3 shown.
[0068] It is understandable that data enhancement can be performed on any one or more data sets to increase the number of samples in the data set. Data enhancement can increase the number of data sets with a smaller number, ensure the model's ability to learn various types of data, and improve the accuracy of the model.
[0069] The enhanced data set is then subjected to multi-mode decomposition processing. Specifically, multiple decomposition methods are used to decompose the enhanced data set to obtain multiple decomposition components; wherein the decomposition methods include one or more of a singular spectrum decomposition method, a variational mode decomposition method, and a group decomposition method; the output power component in the decomposition component is extracted to obtain the decomposition power; the meteorological variable component in the decomposition component is extracted to obtain the decomposed meteorological variable.
[0070] Aiming at the problem that the historical data of photovoltaic power generation is highly random, volatile, and has unclear regular features, a data feature enhancement method based on multi-mode decomposition is proposed. The three decomposition methods simultaneously perform mixed decomposition on photovoltaic output power, temperature, and irradiance, weakening the complexity of the original sequence. The multi-scale intrinsic mode components obtained after decomposition have stronger regularity, achieving feature complementarity between multi-scale components of different modes, and providing more regular and rich features for subsequent deep learning models.
[0071] Singular spectrum decomposition is an adaptive time-frequency analysis method that can adaptively decompose non-stationary signals into several singular spectrum components in the order of high frequency to low frequency. It overcomes the problem of traditional singular spectrum analysis methods that manually select the embedding dimension M based on experience, and can better suppress modal aliasing and eliminate false components. Variational mode decomposition is a completely non-recursive variational signal decomposition algorithm that can decompose non-stationary and nonlinear signals into finite bandwidth signals with different center frequencies. Group decomposition is a new signal processing method proposed on the basis of swarm filtering (SWF). It decomposes non-stationary and nonlinear signals into multiple single-mode oscillation components through iterative group filtering. The main frequency of the oscillation component can be selected by adjusting the group filter parameters. Compared with EMD and wavelet-based multi-resolution analysis, SWD has higher decomposition accuracy.
[0072] Taking the power data of a sunny winter day as an example, 8 sub-components are obtained by VMD, such as Figure 4As shown, IMF is the intrinsic mode component and RES is the residual component, which is obtained by subtracting the sum of the intrinsic mode components from the original data. Similarly, 11 components can be obtained by SWD and 5 sub-components can be obtained by SSD. The components of the power data obtained by each decomposition method are merged together to form a matrix as the decomposed power after multi-mode decomposition. The meteorological variable components obtained by each decomposition method are merged together to form a matrix as the decomposed meteorological variables of multi-mode decomposition. Meteorological variables include temperature and irradiance, and the decomposed meteorological variables include decomposed temperature and decomposed irradiance.
[0073] The feature matrix after multi-mode decomposition has more regular time series characteristics, which can highlight the complexity and non-stationarity of the original signal from different angles and make the regularity between the sub-modes closer.
[0074] Step 103: The decomposed power and the decomposed meteorological variables are used as input samples and are respectively input into different branches of the combined prediction model. Each branch includes a double-layer LSTM module and a residual module, wherein the double-layer LSTM module extracts the temporal features of the input samples and the residual module extracts the spatial features of the input.
[0075] Step 104: Merge the time series feature with the spatial feature, and obtain a photovoltaic power prediction value within a prediction step based on the merged features.
[0076] The photovoltaic power generation data before the current day can be used as historical data to predict the photovoltaic power prediction value of the current day, or to predict the photovoltaic power prediction value for a period of time in the future. In this embodiment, the prediction step size can include one day, three days, one week, etc.
[0077] In order to improve the prediction accuracy of photovoltaic output power, the model structure design is more refined. A MBI-PRL-DAT combined prediction model based on multi-branch parallel input is proposed. The model structure is as follows: Figure 5 As shown in the figure. The MBI-PRL-DAT model consists of three independent input branches. Branches 1, 2, and 3 take photovoltaic power, temperature, and irradiance decomposed by multi-mode as inputs respectively. Except for the different input matrices, the model structures of the three branches are completely consistent. Each branch consists of two parts: one is a two-layer LSTM structure for extracting temporal features, and the other is a residual structure for extracting spatial features. The temporal features and spatial features extracted by each branch are respectively sent to the multi-head self-attention mechanism and the channel attention mechanism for feature enhancement. The enhanced features are merged and the prediction results are output using two layers of full connection.
[0078] Taking branch 1 as an example, the time series extraction structure is implemented by stacking two layers of long short-term memory (LSTM) modules vertically. The input feature matrix is flattened by the flatten function and then input into the first layer of LSTM to obtain the output h t That corresponds to Figure 5 The LSTM output f1 is shown 1 Similarly, the output of the second layer LSTM is The output That is the time series feature. The LSTM structure calculation process is as follows:
[0079]
[0080] Where: f t 、i t , o t Respectively represent the forget gate, input gate, and output gate; x tt , C t 、h t is the input at time t, the output of the candidate layer, the output of the memory unit, and the output of the hidden layer; W f , W i , W C , W o and b f 、b i 、b C 、b o is the weight matrix and bias parameter; is the Hadamard product (the product of corresponding elements between vectors); σ is the sigmoid activation function.
[0081] Spatial feature extraction is completed by the residual module, which consists of two parallel convolution blocks (Covn). Two convolution blocks with different receptive fields can be used to provide feature relationships from different perspectives. The calculation process is as follows:
[0082]
[0083] Where: X P is the model input; “*” is the convolution operation (Covn); and Output features for the first and second convolution layers of convolution block 1; Output features of convolution block 2; and is the weight matrix and bias parameter of the i-th filter of convolution block 1 and convolution block 2; δ(·) is the ReLU activation function; F LFlatten is the flattening function; the output obtained by adding the features extracted by convolution block 1 and convolution block 2 The output is the spatial representation of the input.
[0084] The combined prediction model also includes a multi-head sub-attention mechanism and a channel attention mechanism. The temporal features output by each branch are merged (Concat), and the merged temporal features are enhanced by a multi-head self-attention mechanism (SAM); the spatial features output by each branch are merged, and the merged spatial features are enhanced by a channel attention mechanism (squeeze-and-excitation network, SENet).
[0085] The features extracted from the time series parts of branches 1, 2, and 3 are merged and input into the multi-head self-attention mechanism, so that it builds global feature dependencies regardless of the time interval, making the model focus on f L The important information contained in it can improve the feature expression ability. The calculation process is as follows:
[0086]
[0087] Where: They are the outputs of the timing parts of branches 1, 2, and 3 respectively. The output after the three are combined is f L ; Concat is the matrix concatenation operation; W i Q , W i K , W i V are the query, key, and value linear mapping matrices corresponding to the multi-head self-attention head i; Q i , K i 、V i are the query matrix, key matrix, and value matrix corresponding to head i respectively; Softmax is the normalization function; T is the matrix transpose; is the normalization parameter; head i is the i-th head of the multi-head attention mechanism; W O is the parameter matrix of the multi-head self-attention mechanism; is the final output obtained after multi-head self-attention operation.
[0088] The features extracted from the residual parts of branches 1, 2, and 3 are combined and input into SENet. The association relationship is built for the feature channels of the residual part, the association information between channels is learned, the weight information of each feature channel is obtained, the feature channels carrying important information are enhanced, the feature channels carrying redundant information are suppressed, and the performance of the residual module is improved. The calculation process is as follows:
[0089]
[0090] Where: They are the outputs of the residual parts of branches 1, 2, and 3 respectively, and the output after merging the three is f R ; Concat3 is a 3D tensor Merge operation is performed in channel dimension C; δ(·) is the ReLU activation function; σ(·) is the sigmoid activation function; W1∈R (C / r)×C and W2∈R C×(C / rr) are the parameters of the two fully connected layers; f R,c f R The matrix of the cth channel; s c is the weight of the cth channel of the weight vector s; F scale (·,·) is the multiplication of channel dimensions.
[0091] After embedding into the residual using SENet, the channels are weighted while retaining spatial information, strengthening important features and suppressing redundant information. Taking advantage of the same calculation distance for any position, SAM is used to enhance the receptive field of the LSTM module. At the same time, the attention mechanism has the advantage of focusing on important features and improving the model representation ability.
[0092] The features extracted by the dual attention mechanism and After merging and adding nonlinear expression to the two layers of full connection, the photovoltaic power prediction output F is obtained. The calculation formula is:
[0093]
[0094] Where: W C , W and b C , b are the weight matrices and bias parameters of the two fully connected layers.
[0095] Among them, SAM performs self-attention calculation by setting multiple pairs of (key, query, value) at the same time, which is equivalent to multiple sub-self-attention mechanism modules. Each sub-module is called a head. The weights between multiple heads are not shared. The results obtained by multiple self-attention mechanisms are linearly transformed and merged to obtain the results of the multi-head attention mechanism. The calculation formula of the multi-head attention mechanism is as follows:
[0096]
[0097] Where: Concat(·) is the matrix concatenation operation; h is the number of heads of the multi-head attention mechanism; W i Q , W i K , Wi V are projection parameter matrices. Compared with the self-attention mechanism, the multi-head self-attention mechanism uses parallel attention calculations, allowing the model to learn features from multiple angles and enhance the model's expressiveness.
[0098] SENet is a modular lightweight structure, which mainly includes two parts: compression (Squeeze) and excitation (Excitation). It can be conveniently embedded in deep learning network models with convolution. This is because the convolution operation gives the same weight to the information brought by each channel in the process of multi-channel information fusion, but the importance of the information carried by each channel is different. If all channels are simply given the same weight, the channels with important information will not be given enough attention. To solve this problem, SENet regards the feature channel of each feature map as a whole, considers the connection between each feature channel, calibrates its importance, and configures different weights by autonomously learning the importance of each feature channel. The structure diagram of SENet is shown below. Figure 6 shown.
[0099] like Figure 6 As shown, the input feature map X is a 3D tensor with a channel number of C′ and a data dimension of W′×H′, which is input into the convolution operation F tr Then we get the output feature map U, which has C channels and W×H data dimensions. After the convolution operation, the three main operations of SENet are:
[0100] Compression: Perform global average pooling on the acquired feature map U, compress the spatial distribution information through pooling, compress the feature map of the feature channel into a 1×1 feature factor, characterize the feature information of the feature channel, and obtain a 1×1×C feature vector z for C feature channels, so that the network can obtain a global receptive field. The calculation formula of the Cth element is as follows:
[0101]
[0102] Excitation: The excitation operation is used to learn the correlation between each feature channel and assign weights. The excitation part consists of two fully connected layers, which perform dimensionality reduction and dimensionality increase operations respectively. The channel dimension is first reduced to C / r by the first fully connected layer (r is the dimensionality reduction parameter, generally set to 16), and the activation function is ReLU; then the second fully connected layer is used to increase the channel dimension from C / r to C, and the activation function is sigmoid. The calculation formula is as follows:
[0103] s=F ex (z,W)=σ(g(z,W))=σ(W2δ(W1z)) (12)
[0104] Where: δ(·) is the ReLU activation function; σ(·) is the sigmoid activation function; W1∈R (C / r)×C and W2∈R C×(C / r) are the parameters of the two fully connected layers.
[0105] Feature recalibration: The weight parameter s obtained by the excitation operation represents the importance of each feature channel. The weight parameter is used to weight the original feature map to complete the feature recalibration of the original feature map in each feature channel dimension. The calculation formula is as follows:
[0106]
[0107] In the above formula: u c is the feature map of channel c (u c ∈R H×W );s c is the weight parameter of channel c obtained by excitation (s c ∈R); F scale (·,·) is the multiplication of channel dimensions.
[0108] In order to objectively evaluate the accuracy of the prediction results, the mean absolute percentage error (MAPE), mean absolute error (MAE) and root mean squared error (RMSE) are used to evaluate the experimental prediction results. MAPE is widely used in sequence trend prediction, indicating the average deviation of the predicted value from the true value; MAE can measure the average absolute difference between the predicted value and the true value to avoid the problem of errors offsetting each other due to positive and negative errors; RMSE is the square root of the square average of the interpolated values between the predicted value and the true value.
[0109] The combined prediction model MBI-PRL-DAT of this application improves the traditional model by introducing a dual attention mechanism. The same three days of five weather types, namely, sunny summer days, sunny winter days, cloudy days, overcast days, and extreme weather days, are predicted one step, six steps, and 12 steps ahead (10 minutes / step). To avoid accidental errors, each group of prediction experiments is repeated 10 times, and the average of the 10 experimental prediction values is taken as the prediction result, and the results shown in Table 2 are obtained.
[0110] Table 2 Comparison of prediction errors of MBI-PRL-DAT model
[0111]
[0112] When the sliding step length is 1 step, 6 steps and 12 steps, it can be seen from Table 2 that the corresponding e MAPE 、eMAE and e RMSE The three error indicators are all the smallest when the step length is 1, and then increase in turn. On sunny days in winter and summer, the error shows a relatively stable increasing trend, while in cloudy, rainy and extreme weather, the error increases in a leap-like manner when the sliding step length is 12 steps. This shows that with the increase of the step length, the network's extraction of data is also weakened accordingly, especially in unstable weather conditions, which makes the prediction itself more difficult. When the step length is increased, the prediction difficulty is further superimposed. Compared with 1-step sliding, multiple step-length sliding has insufficient utilization of some intermediate data, which cannot be expressed more accurately and the regularity is weakened.
[0113] From the horizontal comparison of the three indicators, it can be seen that MAE has the best prediction effect and is the lowest in the five weather types. Taking 6 steps of sunny winter days as an example, it is 88.30% and 27.54% lower than MAPE and RMSE; even in rainy and extreme weather with large output power fluctuations, the MBI-PRL-DAT prediction model can achieve good prediction results.
[0114] Through visual comparative analysis with the true value, the prediction accuracy of the MBI-PRL-DAT prediction model maintains good results. Especially in weather conditions with large power fluctuations, it can also reflect the real fluctuation details with high sensitivity, which verifies the effectiveness of the proposed model.
[0115] Furthermore, this embodiment also provides a photovoltaic power prediction device, which can be used to execute the above photovoltaic power prediction method.
[0116] like Figure 7 As shown, the photovoltaic power prediction device 700 may include: a prediction variable determination module 701, which is used to obtain photovoltaic power generation history data, wherein the photovoltaic power generation history data includes the output power of photovoltaic power generation in the historical period and the meteorological variables related to the output power; a data decomposition module 702, which is used to perform multi-mode decomposition on the photovoltaic power generation history data to obtain decomposed power and decomposed meteorological variables; a model processing module 703, which is used to use the decomposed power and decomposed meteorological variables as input samples and input them into different branches of the combined prediction model respectively; each branch includes a double-layer LSTM module and a residual module, the double-layer LSTM module extracts the time series features of the input samples, and the residual module extracts the spatial features of the input; a model prediction module 704, which is used to merge the time series features with the spatial features, and obtain the photovoltaic power prediction value within the prediction step based on the merged features.
[0117] In an exemplary embodiment, the combined prediction model also includes a multi-head sub-attention mechanism and a channel attention mechanism, and the photovoltaic power prediction device also includes: a multi-head self-attention mechanism module, which is used to merge the timing features of each branch output, and use the multi-head self-attention mechanism to enhance the merged timing features; a channel attention mechanism module, which is used to merge the spatial features of each branch output, and use the channel attention mechanism to enhance the merged spatial features.
[0118] In an exemplary embodiment, the prediction variable determination module is specifically used to obtain historical data, which includes output power and multiple variables; perform correlation analysis on the output power and the multiple variables, and filter the variables in the historical data based on the correlation analysis to obtain photovoltaic power generation historical data including the output power and meteorological variables related to the output power.
[0119] In an exemplary embodiment, the data decomposition module also includes a classification module, which is used to cluster the photovoltaic power generation historical data to obtain multiple data sets, each data set corresponding to a weather type; perform data enhancement on the data set to obtain an enhanced data set; and perform multi-mode decomposition on the enhanced data set.
[0120] In an exemplary embodiment, the data decomposition module is specifically used to: use multiple decomposition methods to decompose the enhanced data set respectively to obtain multiple decomposition components; wherein the decomposition methods include one or more of a singular spectrum decomposition method, a variational mode decomposition method, and a group decomposition method; extract the output power component in the decomposition component to obtain the decomposition power; extract the meteorological variable component in the decomposition component to obtain the decomposed meteorological variable.
[0121] In an exemplary embodiment, the meteorological variables include irradiance and temperature, and the decomposed meteorological variables include decomposed temperature and decomposed irradiance.
[0122] In an exemplary embodiment, the weather types include sunny summer days, sunny winter days, cloudy, rainy, and extreme weather; the classification module is also used to enhance the data sets corresponding to the rainy and extreme weather, respectively, using an improved generative adversarial network to obtain enhanced data sets; the data volume of the enhanced data set is greater than the data volume of the data set before enhancement.
[0123] The specific details of each module or unit in the above photovoltaic power prediction device have been described in detail in the corresponding photovoltaic power prediction method, so they will not be repeated here.
[0124] The embodiment of the present application also provides an electronic device, Figure 8A schematic diagram of the structure of an electronic device suitable for implementing the embodiments of the present disclosure is shown. Figure 8 The electronic device 600 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0125] like Figure 8 As shown, electronic device 600 includes a central processing unit (CPU) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage part 608 into a random access memory (RAM) 603. In RAM 603, various programs and data required for system operation are also stored. CPU 601, ROM 602 and RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to bus 604.
[0126] The following components are connected to the I / O interface 605: an input section 606 including a keyboard, a mouse, etc.; an output section 607 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 608 including a hard disk, etc.; and a communication section 609 including a network interface card such as a LAN card, a modem, etc. The communication section 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to the I / O interface 605 as needed. A removable medium 611, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 610 as needed, so that a computer program read therefrom is installed into the storage section 608 as needed.
[0127] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a computer-readable storage medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 609, and / or installed from the removable medium 611. When the computer program is executed by the central processing unit (CPU) 601, the above-mentioned functions defined in the embodiment of the present application are executed.
[0128] It should be noted that the computer-readable medium shown in the present disclosure may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer disk, 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 disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present disclosure, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present disclosure, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, in which a computer-readable program code is carried. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.
[0129] The flow charts and block diagrams in the accompanying drawings illustrate the possible architecture, functions and operations of the systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.
[0130] The units involved in the embodiments described in the present disclosure may be implemented by software or hardware, and the units described may also be arranged in a processor. The names of these units do not, in some cases, constitute limitations on the units themselves.
[0131] As another aspect, the present application also provides a computer-readable medium, which may be included in the electronic device described in the above embodiment; or may exist independently without being assembled into the electronic device. The above computer-readable medium carries one or more programs, and the one or more programs include instructions, and when the instructions are executed by the electronic device, the electronic device implements the method described in the above embodiment.
[0132] It should be noted that, although several modules or units of the equipment for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into being embodied by multiple modules or units.
[0133] The above contents are only specific implementation methods of the present application, but the protection scope of the present application is not limited thereto. Any changes or substitutions within the technical scope disclosed in the present application shall be included in the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.
Claims
1. A photovoltaic power prediction method, characterized in that: include: Acquiring photovoltaic power generation historical data, wherein the photovoltaic power generation historical data includes the output power of photovoltaic power generation in a historical period and meteorological variables related to the output power; Perform multi-mode decomposition on the photovoltaic power generation historical data to obtain decomposed power and decomposed meteorological variables; The decomposed power and the decomposed meteorological variables are used as input samples and input into different branches of the combined prediction model respectively; Each branch includes a double-layer LSTM module and a residual module, wherein the double-layer LSTM module extracts the temporal features of the input samples, and the residual module extracts the spatial features of the input; The time series feature and the spatial feature are combined, and the photovoltaic power prediction value within the prediction step is obtained based on the combined features.
2. The photovoltaic power prediction method according to claim 1, characterized in that: The combined prediction model also includes a multi-head sub-attention mechanism and a channel attention mechanism, and the method also includes: The temporal features output by each branch are merged, and the merged temporal features are enhanced using a multi-head self-attention mechanism; The spatial features output by each branch are merged, and the channel attention mechanism is used to enhance the merged spatial features.
3. The photovoltaic power prediction method according to claim 1, characterized in that: The obtaining of photovoltaic power generation historical data includes: Acquiring historical data, wherein the historical data includes output power and multiple variables; A correlation analysis is performed on the output power and the multiple variables, and the variables in the historical data are filtered according to the correlation analysis to obtain photovoltaic power generation historical data including the output power and meteorological variables related to the output power.
4. The photovoltaic power prediction method according to claim 1, characterized in that: The multi-mode decomposition of the photovoltaic power generation historical data includes: Clustering the photovoltaic power generation historical data to obtain multiple data sets, each data set corresponding to a weather type; Performing data enhancement on the data set to obtain an enhanced data set; Perform multimodal decomposition on the augmented dataset.
5. The photovoltaic power prediction method according to claim 4, characterized in that: The photovoltaic power generation historical data is subjected to multi-mode decomposition to obtain decomposed power and decomposed meteorological variables, including: A plurality of decomposition methods are used to decompose the enhanced data set respectively to obtain a plurality of decomposition components; Wherein, the decomposition method includes one or more of a singular spectrum decomposition method, a variational mode decomposition method, and a group decomposition method; Extracting the output power component from the decomposed components to obtain decomposed power; The meteorological variable components in the decomposed components are extracted to obtain decomposed meteorological variables.
6. The photovoltaic power prediction method according to claim 5, characterized in that: The meteorological variables include irradiance and temperature, and the decomposed meteorological variables include decomposition temperature and decomposition irradiance.
7. The photovoltaic power prediction method according to claim 4, characterized in that: The weather types include sunny summer days, sunny winter days, cloudy days, rainy days, and extreme weather; The step of performing data enhancement on the data set to obtain an enhanced data set includes: Using an improved generative adversarial network to enhance the data sets corresponding to the rainy and extreme weather conditions, respectively, to obtain enhanced data sets; The data volume of the enhanced dataset is larger than that of the dataset before enhancement.
8. A photovoltaic power prediction device, characterized in that: include: A prediction variable determination module is used to obtain photovoltaic power generation history data, wherein the photovoltaic power generation history data includes the output power of photovoltaic power generation in a historical period and meteorological variables related to the output power; A data decomposition module, used for performing multi-mode decomposition on the photovoltaic power generation historical data to obtain decomposed power and decomposed meteorological variables; A model processing module, used to take the decomposed power and the decomposed meteorological variables as input samples and input them into different branches of the combined prediction model respectively; Each branch includes a double-layer LSTM module and a residual module, wherein the double-layer LSTM module extracts the temporal features of the input samples, and the residual module extracts the spatial features of the input; The model prediction module is used to merge the time series features with the spatial features, and obtain the photovoltaic power prediction value within the prediction step based on the merged features. 9 . A computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, the processor executes the photovoltaic power prediction method according to claim 1 .
10. An electronic device, characterized in that: It comprises a processor and a memory, wherein one or more computer programs are stored in the memory, and the one or more computer programs include instructions, and when the instructions are executed by the electronic device, the electronic device executes the photovoltaic power prediction method described in any one of claims 1 to 7.
Citation Information
Cited By
Artificial intelligence photovoltaic power prediction system and method based on secondary dynamic adjustment
CN120951259A