Photovoltaic power generation power prediction method and system, electronic equipment and storage medium

By correcting and removing rain from ground-based cloud images, combined with dynamic coding and cross-modal attention mechanisms, the accuracy of photovoltaic power generation prediction is improved and the problem of low accuracy in the existing technology is solved.

CN118713066AInactive Publication Date: 2024-09-27HEFEI UNIV OF TECH

Patent Information

Application Number
CN202410826219.0
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-25
Publication Date
2024-09-27
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Existing photovoltaic power generation power prediction methods have low prediction accuracy when considering ground-based cloud images.

Method used

By obtaining the ground-based cloud image fisheye lens image and correcting it, using the pre-trained extended convolution transformer for de-raining, dynamically encoding the ground-based sky image, using the cross-modal attention mechanism to integrate dynamic optical flow coding and time series coding, and finally based on The multi-step prediction decoder outputs the prediction results of photovoltaic power generation.

Benefits of technology

It improves the accuracy of photovoltaic power generation prediction, combines the advantages of CNN and transformer to output more accurate ground-based sky images, and enhances the accuracy of prediction results.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118713066A
    Figure CN118713066A
Patent Text Reader

Abstract

The invention provides a photovoltaic power generation power prediction method and system, electronic equipment and a storage medium, and relates to the technical field of power generation power prediction. According to the method, rain removal is carried out based on the extended convolution transformer model, the advantage of processing local information of the CNN is utilized, the capability of processing global information of the transformer is also utilized, the CNN and the transformer are combined to efficiently output the image after rain removal, a more accurate foundation sky image is provided for subsequent photovoltaic power generation power prediction, and the method has the advantages of being high in practicability and high in practicability. And the accuracy of photovoltaic power generation power prediction can be effectively improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of power generation prediction, and in particular to a photovoltaic power generation prediction method, system, electronic equipment and storage medium. Background Art

[0002] Photovoltaic power generation is a technology that uses the photovoltaic effect of semiconductor interfaces to directly convert light energy into electrical energy. With the development of new energy technologies, photovoltaic power generation, as a form of renewable energy generation with no pollution, low maintenance cost and high durability, has been increasingly widely used. However, photovoltaic power generation is affected by meteorological conditions, and photovoltaic power generation has obvious volatility and intermittency. This unstable power generation mode affects the safe and stable dispatching of the power grid, and thus limits the large-scale grid-connected use of photovoltaic power. Therefore, it is necessary to make high-precision probability predictions of intraday photovoltaic power to ensure the safe and reliable operation of the power grid.

[0003] There have been many studies in the prior art on the prediction of photovoltaic power generation. For example, the patent publication number CN117421566A, entitled Photovoltaic Power Prediction Method Based on IMRFO-StemGNN, proposed to improve the accuracy of photovoltaic power generation prediction by constructing a photovoltaic feature database and building a spectrum time graph neural network, optimizing the model's hyperparameters. The patent publication number CN117791595A, entitled Photovoltaic Short-term Power Prediction Method Based on Weather Clustering and LSTM Combination Model, proposed to first collect and preprocess the data, retain the meteorological data with strong correlation with power generation through correlation analysis, and then divide the data set by using an algorithm, and finally input it into the CNN-BiLSTM model to obtain the prediction result. There are also some other prior arts that propose to predict photovoltaic power generation through ground-based cloud images, such as CN116777066A, a photovoltaic power probability prediction method and device based on ground-based cloud image guided deep decomposition.

[0004] However, the existing photovoltaic power prediction methods directly process ground-based cloud images when considering ground-based cloud images, resulting in low prediction accuracy. Summary of the invention

[0005] 1. Technical issues to be resolved

[0006] In view of the deficiencies in the prior art, the present invention provides a photovoltaic power prediction method, system, electronic device and storage medium, which solve the technical problem of low accuracy of the existing photovoltaic power prediction method.

[0007] (II) Technical solution

[0008] To achieve the above objectives, the present invention is implemented through the following technical solutions:

[0009] In a first aspect, the present invention provides a photovoltaic power generation power prediction method, comprising:

[0010] Obtain the fisheye lens image of the ground-based cloud map and perform correction to obtain the ground-based cloud map;

[0011] The pre-trained dilated convolution transformer is used to derain the obtained ground-based cloud image to obtain the ground-based sky image;

[0012] Dynamically encode the ground-based sky image to obtain dynamic feature encoding information;

[0013] The dynamic optical flow coding and the time series coding are fused through the cross-modal attention mechanism to obtain fused coding information; the time series coding is the information obtained by encoding the historical solar irradiance data using Autoformer;

[0014] Based on the multi-step prediction decoder processing, the fused coding information and time series coding are outputted as the prediction result of photovoltaic power generation.

[0015] Preferably, the dilated convolutional transformer comprises a plurality of stacked dilformer blocks, wherein each of the dilformer blocks comprises a first normalization layer, a sparse attention layer, a second normalization layer and a feedforward network, wherein the sparse attention output is added to the input features of the first normalization layer and then input into the second normalization layer and superimposed with the sparse attention output.

[0016] Preferably, the dynamically encoding the ground-based sky image to obtain dynamic feature encoding information includes:

[0017] Compute optical flow maps between consecutive frames of ground-based sky images;

[0018] Encode multiple frames of optical flow maps to obtain dynamic feature encoding information.

[0019] Preferably, encoding the multi-frame optical flow graphs includes:

[0020] The multi-frame optical flow map is encoded by the vision transformer, where the vision transformer includes alternating multi-head self-attention MSA and fully connected feed-forward network FFN blocks; at the same time, a normalization layer is included before each block, and a residual connection is introduced after each block.

[0021] Preferably, the specific process of encoding the time series obtained by encoding the historical solar irradiance data using Autoformer includes:

[0022] For the historical solar irradiance data X with an input length of x, the decomposition equation is as follows:

[0023] X t =AvgPool(Padding(x))

[0024] X s =XX t

[0025] Among them, X s , X t They are the seasonal part and the extracted trend cycle part respectively; AvgPool(·) is used for moving average;

[0026] Adopt X s , X t =SeriesDecomp(X) summarizes the decomposed equations, specifically:

[0027] The input to the encoder part of the Autoformer is the past I time steps X en ; As a decomposition architecture, the input of the Autoformer decoder contains both the seasonal part X en , which also includes the trend cycle part X det Each initialization consists of two parts: (1) Input X from the encoder en The second half of the decomposition of the components, length I / 2, used to provide the most recent information; (2) a placeholder of length O filled by a scalar, the formula is as follows:

[0028]

[0029] X des =Concat(X ens ,X0)

[0030] X det =Concat(X ent ,X Mean ),

[0031] Among them, X ens , X ent Respectively represent the seasonal part and the trend cycle part, X0, X Mean Represented by 0 and X respectively en The placeholder filled with the average value;

[0032] When there are N encoder layers, the overall equation of the encoder layer is summarized as X l en =Encoder(X l-1 en ), the expression is as follows:

[0033]

[0034] Among them: “-” is the trend part to be eliminated, X 1 en =S l,2 en Represents the output of the first layer encoder;

[0035] The decoder of Autoformer consists of two parts: the cumulative structure of the trend cycle component and the stacked autocorrelation mechanism of the seasonal component; each decoder layer contains internal autocorrelation and encoder-decoder autocorrelation. When there are M decoder layers, the encoder's latent variable X N en Based on , the equation of the first layer decoder can be summarized as: 1 de =Decoder(X 1-1 de , X N en ), the decoder can be formalized as follows:

[0036]

[0037]

[0038] Among them, X de l =S de l,3 represents the output of the lth decoder layer, X 0 de From X de The embedding is used for depth variation, T de 0 =X det Indicates accumulation, represent seasonal components and trend components respectively.

[0039] Preferably, the fusing of dynamic optical flow coding and time series coding through a cross-modal attention mechanism to obtain fused coding information includes:

[0040]

[0041] Among them, Y a is the fusion coding information, α is the dynamic optical flow coding, β is the time series coding, X α ∈R Lα×dα is the size of α, X β ∈R Lβ×dβ is the size of β, X α W QαUpdate Q for the query in the cross-modal attention mechanism α , X β W Kβ is the key K in the cross-modal attention mechanism β , the value is V β =X β W Vβ is the value V in the cross-modal attention mechanism β , where W Qα ∈R dα×dk , W Kβ ∈R dβ×dk , W Vβ ∈R dβ×dv Represent the weights of query update, key, and value respectively.

[0042] In a second aspect, the present invention provides a photovoltaic power generation power prediction system, comprising:

[0043] A correction module is used to obtain the fisheye lens image of the ground-based cloud map and perform correction to obtain the ground-based cloud map;

[0044] The deraining module is used to derain the obtained ground-based cloud image using a pre-trained dilated convolution transformer to obtain a ground-based sky image;

[0045] A dynamic encoding module is used to dynamically encode the ground-based sky image to obtain dynamic feature encoding information;

[0046] A coding fusion module is used to fuse dynamic optical flow coding and time series coding through a cross-modal attention mechanism to obtain fused coding information; the time series coding is information obtained by encoding historical solar irradiance data using Autoformer;

[0047] The decoding module is used to process the fusion coding information and time series coding based on the multi-step prediction decoder and output the prediction result of photovoltaic power generation.

[0048] Preferably, the dilated convolutional transformer comprises a plurality of stacked dilformer blocks, wherein each of the dilformer blocks comprises a first normalization layer, a sparse attention layer, a second normalization layer and a feedforward network, wherein the sparse attention output is added to the input features of the first normalization layer and then input into the second normalization layer and superimposed with the sparse attention output.

[0049] In a third aspect, the present invention provides a computer-readable storage medium storing a computer program for photovoltaic power generation prediction, wherein the computer program enables a computer to execute the photovoltaic power generation prediction method as described above.

[0050] In a fourth aspect, the present invention provides an electronic device, comprising:

[0051] One or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by the one or more processors, and the programs include methods for executing the photovoltaic power generation prediction method as described above.

[0052] (III) Beneficial effects

[0053] The present invention provides a photovoltaic power prediction method, system, electronic device and storage medium. Compared with the prior art, the present invention has the following beneficial effects:

[0054] The present invention first obtains and corrects the fisheye lens image of the ground-based cloud map to obtain the ground-based cloud map; then uses the pre-trained extended convolution transformer to derain the obtained ground-based cloud map to obtain the ground-based sky image; dynamically encodes the ground-based sky image to obtain dynamic feature encoding information; fuses dynamic optical flow encoding and time series encoding through a cross-modal attention mechanism to obtain fused encoding information; the time series encoding is information obtained by encoding historical solar irradiance data using Autoformer; finally, based on a multi-step prediction decoder, the fused encoding information and time series encoding are processed to output the prediction result of photovoltaic power generation. The present invention performs deraining based on the extended convolution transformer model, which not only utilizes the advantages of CNN in processing local information, but also utilizes the ability of transformer to process global information, combines the two to efficiently output the derained image, and provides a more accurate ground-based sky image for subsequent photovoltaic power generation prediction, which can effectively improve the accuracy of photovoltaic power generation prediction. BRIEF DESCRIPTION OF THE DRAWINGS

[0055] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0056] Figure 1 A block diagram of a photovoltaic power generation prediction method according to an embodiment of the present invention;

[0057] Figure 2 Schematic diagram of the structure of the dilformer block of the extended convolutional transformer. DETAILED DESCRIPTION

[0058] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention are clearly and completely described. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0059] The embodiment of the present application provides a photovoltaic power prediction method, system, electronic device and storage medium, which solves the technical problem of low accuracy of the existing photovoltaic power prediction method, and realizes deraining based on the extended convolution transformer model, which not only utilizes the advantages of CNN in processing local information, but also utilizes the ability of transformer in processing global information, and combines the two to efficiently output the derained image, thereby improving the accuracy of the prediction result.

[0060] The technical solution in the embodiment of the present application is to solve the above technical problems, and the overall idea is as follows:

[0061] The embodiment of the present invention proposes a photovoltaic power prediction method combining Dilated Convolutional Transformer and multimodal fusion technology. Convolutional neural network (CNN) and transformer have achieved remarkable success in image signal processing. However, few people have effectively combined the properties of these two architectures to meet image extraction. The embodiment of the present invention first corrects the obtained fisheye lens image, and then proposes an effective training method - dilated convolutional transformer (DCT) to process ground-based cloud images, which can expand the receptive field of the neural network to aggregate global information. In addition, the embodiment of the present invention also uses ReLU to replace the original softmax to enhance the sparsity in the transformer, thereby achieving better feature aggregation. In addition, the embodiment of the present invention also uses Autoformer to process historical solar irradiance data, and finally uses multimodal fusion technology to fuse the processed ground-based cloud images and the historical solar irradiance data processed by Autoformer, and finally outputs the photovoltaic power prediction value.

[0062] In order to better understand the above technical solution, the above technical solution will be described in detail below in conjunction with the accompanying drawings and specific implementation methods.

[0063] The embodiment of the present invention provides a photovoltaic power generation power prediction method, such as Figure 1 As shown, the method includes:

[0064] S1, obtaining a fisheye lens image of a ground-based cloud map and performing correction to obtain a ground-based cloud map;

[0065] S2, using the pre-trained dilated convolution transformer to derain the obtained ground-based cloud image to obtain the ground-based sky image;

[0066] S3, dynamically encode the ground-based sky image to obtain dynamic feature encoding information;

[0067] S4. Fusing dynamic optical flow coding and time series coding through a cross-modal attention mechanism to obtain fused coding information; the time series coding is information obtained by encoding historical solar irradiance data using Autoformer;

[0068] S5. Based on the multi-step prediction decoder, the fused coding information and time series coding are processed to output the prediction result of photovoltaic power generation.

[0069] The embodiment of the present invention performs deraining based on an extended convolution transformer model, which not only utilizes the advantage of CNN in processing local information, but also utilizes the ability of transformer in processing global information. The two are combined to efficiently output derained images, providing more accurate ground-based sky images for subsequent photovoltaic power generation prediction, and can effectively improve the accuracy of photovoltaic power generation prediction.

[0070] The following is a detailed description of each step:

[0071] In step S1, the fisheye lens image of the ground-based cloud map is obtained and calibrated to obtain the ground-based cloud map. The specific implementation process is as follows:

[0072] The fast correction algorithm for edge correction distortion proposed in the embodiment of the present invention first extracts the effective area of ​​the fisheye image and obtains the extracted center (x0, y0) and image radius R. Secondly, based on the longitude correction algorithm, the distortion correction stretch factor k* is introduced to perform correction in the horizontal and vertical directions respectively, and finally the distortion correction is completed by reverse difference. The specific correction process is as follows:

[0073] First, the effective area of ​​the fisheye lens is extracted. The embodiment of the present invention is further simplified on the basis of the line-by-line scanning method, and a smaller threshold is set to directly compare with the image brightness to find the effective area boundary. The specific extraction steps are as follows:

[0074] Step a: set a smaller threshold value T (20-50) and read the brightness of the first column of pixels on the left side of the image;

[0075] Step b: When the brightness value of a point is greater than T, scan the next column. If the brightness value of the next column is still greater than T, it is considered that the left edge of the image has been scanned.

[0076] Step c: According to steps a and b, the left, right, upper and lower boundaries of the effective area of ​​the fisheye image can be obtained respectively; at this point, the extraction of the effective area of ​​the fisheye image is completed.

[0077] Secondly, determine the stretch factor k*. It means stretching the distance from all points in the image to the center of the image by k* times. Then introduce distortion correction based on k*. After introducing the stretch factor, perform distortion correction on the image in the horizontal and vertical directions respectively. In the vertical direction, the vertical coordinate of each point remains unchanged after correction, and the stretch factor is added to the horizontal coordinate. The horizontal distortion correction uses the same method to correct the image in the horizontal direction. After correction, the horizontal coordinate of each point remains unchanged, and the stretch factor is added to the vertical coordinate.

[0078] After correcting the fisheye lens image of the ground-based cloud map by the above method, the ground-based cloud map is obtained.

[0079] In step S2, the pre-trained dilated convolution transformer is used to derain the obtained ground-based cloud image to obtain the ground-based sky image. The specific implementation process is as follows:

[0080] Given an input rainy day image I rain ∈R H×W×3 , where H×W represents the spatial resolution of the feature map, and a standard 3×3 convolutional layer is used as the input and output projection. The network architecture of the extended convolution transformer consists of a series of stacked N i∈[1,2,3,4] Encoder / decoder dilformer blocks, such as Figure 2 As shown in Figure 1, each dilformer block includes the first normalization layer (Layer Norm), sparse attention (MDSA), the second normalization layer and the feedforward network (MDFN), where the sparse attention (MDSA) output is added to the input features of the first normalization layer and then input to the second normalization layer and superimposed with the sparse attention output. This can extract rich information for the entire spatially varying rainfall distribution. This model is not a direct prediction of the derained image. derain , but predict the residual image I res , and add the original input image to the residual image I res , get I derain =I rain +I res In each dilformer block, given the output feature X of the l-1th block l-1 , the encoding process of the dilformer block can be expressed as:

[0081] X′ l =X l-1 +MDSA(LN(X l-1 ))

[0082] X l =X′ l +MDFN(LN(X l ')

[0083] Among them, X' l and X l They represent the outputs of the multi-dilconv sparse attention (MDSA) and multi-dilconv feedforward network (MDFN) of the lth block respectively. LN is the name of layer normalization.

[0084] The pre-trained dilated convolution transformer uses the pixel-by-pixel loss of the L1 function to supervise the learning process during training. The optimization of DCT has the following goals:

[0085] L pixel =||I derain -I gt ||1

[0086] Among them, I derain and I gt The outputs are rain-free image and real image respectively.

[0087] MDSA first applies a 1×1 convolution using linear projection. In the next step, MDSA uses three dilated convolutions to compute multi-scale queries. Despite sharing kernel weights, these convolutions have different dilation rates: 1, 2, and 3. The scale-independent similarities are then added together using weighted counts. The three dilation paths used in the present invention all use dilated convolutions with the same size kernel of 3×3. The embodiment of the present invention uses multi-scale data to calculate the similarity between queries and keys between any pair of spatial positions under the framework of self-attention.

[0088] In addition, the embodiment of the present invention also notes that the softmax normalization in the Transformer will maintain all similarities between the tokens of the query and the key. However, not all tokens in the query are related to the tokens in the key. Using softmax normalization to generate self-attention will affect the following feature aggregation. Therefore, the MDSA in the embodiment of the present invention uses the ReLU activation function to remove negative features while retaining positive features. Formally, the embodiment of the present invention applies a reshaping function to the query Q, key K, and value V respectively, and obtains Q∈R HW×C , K∈R HW×C ,V∈R HW×C Finally, the embodiment of the present invention calculates the sparse attention A∈R C×C :

[0089]

[0090] Among them, α is a learnable parameter.

[0091] Transformer allows data to expand / reduce the dimensions of tokens and performs nonlinear transformations on each token through a feedforward network. Here, an MDFN is proposed in the embodiment of the present invention to enhance locality and increase the size of the receptive field to retrieve more contextual information. In fact, rich multi-scale representations have fully demonstrated their effectiveness in better rain removal. Similar to MDSA, the representations of three convolutional paths with different expansion factors and receptive fields are aggregated to provide the final output features. MDFN also has the ability to apply random expansion rates in the process, automatically expanding the receptive field of the network without adding new modules, which is very important for eliminating rain effects with different appearances.

[0092] In step S3, the ground-based sky image is dynamically encoded to obtain dynamic optical flow encoding. The specific implementation process is as follows:

[0093] The dynamic feature encoder designed for ground-sky images consists of two stages. First, the optical flow map between consecutive frames is calculated. Second, the obtained multi-frame optical flow map is encoded using ViT (vision transformer) to obtain dynamic optical flow encoding.

[0094] In order to reveal the movement of clouds through continuous ground-based sky images, optical flow maps are used as input. Optical flow describes the brightness motion information of an image, making feature mapping easier to learn by the attention mechanism. A dense optical flow calculation method is used to calculate the ground-based original sky image sequence {I t-Lx ,…,I t} to obtain a multi-frame optical flow map along the x-axis {I t-Lx+1 x ,…,I t x} and multi-frame optical flow map along the y-axis {I t-Lx+1 y ,…,I t y}.

[0095] After calculating the optical flow map, ViT for encoding important information was established. Multi-frame optical flow maps were encoded through ViT to obtain dynamic optical flow coding.

[0096] Maintaining consistency with the temporal sequence encoder essentially enables the framework to jointly learn from different modalities. Therefore, the standard Transformer can be directly applied to the image with minimal modifications. Typically, the standard Transformer receives a one-dimensional sequence as input. Therefore, each frame of the multi-frame optical flow map is converted from [I t x ||I t y ]∈R H×W×2 Reconstructed into a set of flat patch sequences x t p ∈R Nx(2·P2) , where (p, p) is the resolution of each image patch, N = H × W / P 2 The number of patches.

[0097] In addition, position embedding is added to the patch embedding, using a standard learnable one-dimensional embedding to preserve the position information, which is defined as follows:

[0098]

[0099] Where E∈R (P2·C)×dmodel is the embedding parameter of the tiled patch, E pos ∈R N×dmodel is the embedded PE (position encoding), indicating the position of each patch in the original image. Furthermore, z t 0 represents the input of ViT at time step t.

[0100] Similar to Transformer, ViT consists of alternating layers of multi-head self-attention (MSA) and FFN blocks. Moreover, LN is applied before each block. Residual connections are introduced after each block to prevent gradient vanishing. The forward pass from the (l-1)th layer to the lth layer at time step t is defined as:

[0101]

[0102] Among them, z t l-1 and z t l They represent the feature maps of the (l-1) layer and the l layer at time step t respectively.

[0103] In step S4, the dynamic optical flow encoding and the time series encoding are fused through the cross-modal attention mechanism to obtain fused encoding information; the time series encoding is the information obtained by encoding the historical solar irradiance data using Autoformer. The specific implementation process is as follows:

[0104] The specific process of time series encoding obtained by using Autoformer to encode historical solar irradiance data is as follows:

[0105] The time series prediction problem is to predict the most likely sequence of length O in the future given a sequence of length 1 in the past, denoted as input-I-predict-O. The long-term prediction setting is to predict the long-term future, that is, a larger O. As described above, the embodiments of the present invention emphasize the difficulties of long-term sequence prediction: processing complex time patterns and breaking the bottlenecks of computational efficiency and information utilization. In order to address these two challenges, the present invention introduces decomposition as a built-in block into the deep prediction model, and proposes Autoformer as a decomposition architecture. In addition, the embodiments of the present invention design an autocorrelation mechanism to discover cycle-based dependencies and aggregate similar subsequences from the underlying cycles. The present invention transforms the Transformer into a deep decomposition architecture, including an internal series decomposition block, an autocorrelation mechanism, and corresponding encoders and decoders.

[0106] In order to learn complex time patterns in the context of long-term prediction, the embodiment of the present invention adopts the idea of ​​decomposition, which can divide the time series into a trend cycle part and a seasonal part. These two parts reflect the long-term and seasonal nature of the series respectively. However, for future series, direct decomposition is not possible because the future is unknown. In order to solve this dilemma, the present invention proposes a sequence decomposition block as an internal operation of the Autoformer, which can gradually extract long-term stable trends from the intermediate hidden variables of the prediction. Specifically, the embodiment of the present invention adjusts the moving average to smooth periodic fluctuations and highlight long-term trends. For an input length of x, this process is:

[0107] X t =AvgPool(Padding(x))

[0108] X s =XX t

[0109] Among them, X s , X t are the seasonal part and the extracted trend cycle part respectively. AvgPool(·) is used for moving average and a padding operation is performed to keep the sequence length unchanged. s , X t =SeriesDecomp(X) summarizes the above equation.

[0110] The input to the encoder part is the past I time steps X en As a decomposition architecture, the input of the Autoformer decoder contains both the season part X en, which also includes the trend cycle part X det Each initialization consists of two parts: input X from the encoder en The second half of the decomposition component, length I / 2, is used to provide the most recent information; the length O placeholder is filled by the scalar. The formula is as follows:

[0111]

[0112] X des =Concat(X ens ,X0)

[0113] X det =Concat(X ent ,X Mean ),

[0114] Among them, X ens , X ent Respectively represent the seasonal part and the trend cycle part, X0, X Mean Represented by 0 and X respectively en The placeholder filled with the mean value.

[0115] The encoder focuses on modeling the seasonal part. The output of the encoder contains past seasonal information and will be used as cross information to help the decoder improve the prediction results. Assume that the embodiment of the present invention has N encoder layers. The overall equation of the encoder layer is summarized as X l en =Encoder(X l-1 en ). Details are as follows:

[0116]

[0117] The “-” is the trend part that is eliminated. 1 en =S l,2 en Represents the output of the first layer encoder.

[0118] The decoder contains two parts: an accumulation structure for the trend cycle component and a stacked autocorrelation mechanism for the seasonal component. Each decoder layer contains internal autocorrelations and encoder-decoder autocorrelations, which can refine the prediction and exploit past seasonal information, respectively. Note that the model extracts latent trends from intermediate latent variables during the decoder, allowing the Autoformer to gradually improve trend predictions and remove noise information in order to discover cycle-based dependencies in the autocorrelations. Assume there are M decoder layers. Take the encoder’s latent variable X as N en Based on , the equation of the first layer decoder can be summarized as: 1de =Decoder(X 1-1 de , X N en ). The decoder can be formalized as follows:

[0119]

[0120] Among them, X de l =S de l,3 represents the output of the lth decoder layer. 0 de From X de The embedding is used for depth variation, T de 0 =X det Indicates accumulation. They represent seasonal components and trend components respectively. The superposition of seasonal components and trend components is the time series coding.

[0121] The dynamic optical flow encoding and time series encoding are fused through the cross-modal attention mechanism to obtain fused encoding information, including:

[0122] The cross-modal attention is proposed to fuse two encoding modes, time series encoding and dynamic optical flow encoding, which are different but play an important role in ultra-short-term solar irradiance prediction. In the above encoder stage, the intrinsic correlation between the two modalities has not been fully explored. Therefore, a new fusion method, cross-modal attention, is proposed to directly learn representations from two unaligned modalities by repeatedly reinforcing the features of one modality and the features of the other modality.

[0123] Assume that there are two modal dynamic optical flow encoding α and time series encoding β, whose sizes are X α ∈R Lα×dα and X β ∈R Lβ×dβ It is speculated that the best way to fuse α and β is to provide a potential adaptation across modalities: that is, β→α. To match the size of the misalignment, the embodiment of the present invention updates the query to Q α =X α W Qα , key is K β =X β W Kβ , the value is V β =X β W Vβ , where the weight is defined as: W Qα ∈R dα×dk , W Kβ ∈R dβ×dk, W Vβ ∈R dβ×dv , where dα is the dimension of α, dk is the dimension of k, and dv is the dimension of v. Since the potential adaptation is achieved between modalities, the adaptation from β to α is defined as cross-modal attention:

[0124]

[0125] Among them, Y a To fuse the encoding information.

[0126] In step S5, based on the multi-step prediction decoder, the fusion coding information and time series coding are processed to output the prediction result of photovoltaic power generation. The specific implementation process is as follows:

[0127] Based on the multi-step prediction task, a standard decoder structure is introduced. Since the use of start tokens has been shown to be effective in dynamic decoding, a long embedded sequence solar irradiance (the original solar irradiance encoding information) X is introduced token ∈R Ltoken×dmodel As a start token. The start symbol indicates a segment of earlier solar irradiance before the forecast sequence, which enables the model to identify trends in solar irradiance. f ∈R Lf×dmodel An embedded placeholder representing the predicted sequence, merging the start token with the predicted sequence X tg =[X token ||Xf]∈R (Ltoken+Lf)×dmodel is defined as the target input. Subsequently, PE is applied to X tg The input is then fed into alternating decoder layers, each of which consists of an identical MSA layer, an identical multithreaded attention layer (Q and K as E fus ) and an identical FFN layer. Afterwards, generative reasoning is used to prevent error accumulation and alleviate speed degradation. The decoder generates multi-step PV power prediction results through an FFN process.

[0128] The embodiment of the present invention further provides a photovoltaic power generation prediction system, comprising:

[0129] A correction module is used to obtain the fisheye lens image of the ground-based cloud map and perform correction to obtain the ground-based cloud map;

[0130] The deraining module is used to derain the obtained ground-based cloud image using a pre-trained dilated convolution transformer to obtain a ground-based sky image;

[0131] A dynamic encoding module is used to dynamically encode the ground-based sky image to obtain dynamic feature encoding information;

[0132] A coding fusion module is used to fuse dynamic optical flow coding and time series coding through a cross-modal attention mechanism to obtain fused coding information; the time series coding is information obtained by encoding historical solar irradiance data using Autoformer;

[0133] The decoding module is used to process the fusion coding information and time series coding based on the multi-step prediction decoder and output the prediction result of photovoltaic power generation.

[0134] It can be understood that the photovoltaic power generation prediction system provided in the embodiment of the present invention corresponds to the above-mentioned photovoltaic power generation prediction method. The explanations, examples, beneficial effects and other parts of its relevant contents can refer to the corresponding contents in the photovoltaic power generation prediction method, and will not be repeated here.

[0135] An embodiment of the present invention further provides a computer-readable storage medium storing a computer program for photovoltaic power generation prediction, wherein the computer program enables a computer to execute the photovoltaic power generation prediction method as described above.

[0136] An embodiment of the present invention further provides an electronic device, including:

[0137] one or more processors;

[0138] Memory; and

[0139] One or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors, the programs including instructions for executing the photovoltaic power generation prediction method as described above.

[0140] In summary, compared with the prior art, the present invention has the following beneficial effects:

[0141] 1. The embodiment of the present invention performs deraining based on the extended convolution transformer model, which not only utilizes the advantage of CNN in processing local information, but also utilizes the ability of transformer in processing global information. The two are combined to efficiently output the derained image, providing more accurate ground-based sky images for subsequent photovoltaic power generation prediction, which can effectively improve the accuracy of photovoltaic power generation prediction.

[0142] 2. The embodiment of the present invention uses Autoformer to encode the historical solar irradiance sequence, which not only improves the encoding efficiency, but also further simplifies the model structure and improves the calculation efficiency.

[0143] 3. The embodiment of the present invention uses ViT to process ground-based sky images, dynamically encodes them, and deeply mines the associated information in the cloud map, further improving the information processing efficiency.

[0144] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0145] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

1. A photovoltaic power generation power prediction method, characterized in that: include: Obtain the fisheye lens image of the ground-based cloud map and perform correction to obtain the ground-based cloud map; The pre-trained dilated convolution transformer is used to derain the obtained ground-based cloud image to obtain the ground-based sky image; Dynamically encode the ground-based sky image to obtain dynamic feature encoding information; The dynamic optical flow coding and the time series coding are fused through the cross-modal attention mechanism to obtain fused coding information; the time series coding is the information obtained by encoding the historical solar irradiance data using Autoformer; Based on the multi-step prediction decoder processing, the fused coding information and time series coding are outputted as the prediction result of photovoltaic power generation.

2. The photovoltaic power generation prediction method according to claim 1, characterized in that: The dilated convolutional transformer includes multiple stacked dilformer blocks, wherein each of the dilformer blocks includes a first normalization layer, a sparse attention layer, a second normalization layer and a feedforward network, wherein the sparse attention output is added to the input features of the first normalization layer and then input into the second normalization layer and superimposed with the sparse attention output.

3. The photovoltaic power generation prediction method according to claim 1, characterized in that: The method of dynamically encoding the ground-based sky image to obtain dynamic feature encoding information includes: Compute optical flow maps between consecutive frames of ground-based sky images; Encode multiple frames of optical flow maps to obtain dynamic feature encoding information.

4. The photovoltaic power generation prediction method according to claim 3, characterized in that: The encoding of the multi-frame optical flow graphs includes: The multi-frame optical flow map is encoded by the vision transformer, where the vision transformer includes alternating multi-head self-attention MSA and fully connected feed-forward network FFN blocks; at the same time, a normalization layer is included before each block, and a residual connection is introduced after each block.

5. The photovoltaic power generation prediction method according to any one of claims 1 to 4, characterized in that: The specific process of time series encoding obtained by using Autoformer to encode historical solar irradiance data includes: For the historical solar irradiance data X with an input length of x, the decomposition equation is as follows: X t =AvgPool(Padding(x)) X s =X-X t Among them, X s , X t They are the seasonal part and the extracted trend cycle part respectively; AvgPool(·) is used for moving average; Adopt X s , X t =SeriesDecomp(X) summarizes the decomposed equations, specifically: The input to the encoder part of the Autoformer is the past I time steps X en ; As a decomposition architecture, the input of the Autoformer decoder contains both the seasonal part X en , which also includes the trend cycle part X det Each initialization consists of two parts: (1) Input X from the encoder en The second half of the decomposition of the components, length I / 2, used to provide the most recent information; (2) a placeholder of length O filled by a scalar, the formula is as follows: X des =Concat(X ens ,X0) X det =Concat(X ent ,X Mean ), Among them, X ens , X ent Respectively represent the seasonal part and the trend cycle part, X0, X Mean Represented by 0 and X respectively en The placeholder filled with the average value of When there are N encoder layers, the overall equation of the encoder layer is summarized as X l en =Encoder(X l-1 en ), the expression is as follows: Among them: "-" is the trend part to be eliminated, X 1 en =S l,2 en Represents the output of the first layer encoder; The decoder of Autoformer consists of two parts: the cumulative structure of the trend cycle component and the stacked autocorrelation mechanism of the seasonal component; each decoder layer contains internal autocorrelation and encoder-decoder autocorrelation. When there are M decoder layers, the encoder's latent variable X N en Based on , the equation of the first layer decoder can be summarized as: 1 de =Decoder(X 1-1 de , X N en ), the decoder can be formalized as follows: Among them, X de l =S de l,3 represents the output of the lth decoder layer, X 0 de From X de The embedding is used for depth variation, T de 0 =X det Indicates accumulation, represent seasonal components and trend components respectively.

6. The photovoltaic power generation prediction method according to any one of claims 1 to 4, characterized in that: The cross-modal attention mechanism is used to fuse dynamic optical flow coding and time series coding to obtain fused coding information, including: Among them, Y a is the fusion coding information, α is the dynamic optical flow coding, β is the time series coding, X α ∈R Lα×dα is the size of α, X β ∈R Lβ×dβ is the size of β, X α W Qα Update Q for the query in the cross-modal attention mechanism α , X β W Kβ is the key K in the cross-modal attention mechanism β , the value is V β =X β W Vβ is the value V in the cross-modal attention mechanism β , where W Qα ∈R dα×dk , W Kβ ∈R dβ×dk , W Vβ ∈R d β×dv Represent the weights of query update, key, and value respectively.

7. A photovoltaic power generation power prediction system, characterized in that: include: A correction module is used to obtain the fisheye lens image of the ground-based cloud map and perform correction to obtain the ground-based cloud map; The deraining module is used to derain the obtained ground-based cloud image using a pre-trained dilated convolution transformer to obtain a ground-based sky image; A dynamic encoding module is used to dynamically encode the ground-based sky image to obtain dynamic feature encoding information; A coding fusion module is used to fuse dynamic optical flow coding and time series coding through a cross-modal attention mechanism to obtain fused coding information; the time series coding is information obtained by encoding historical solar irradiance data using Autoformer; The decoding module is used to process the fusion coding information and time series coding based on the multi-step prediction decoder and output the prediction result of photovoltaic power generation.

8. The photovoltaic power generation prediction system according to claim 7, characterized in that: The dilated convolutional transformer includes multiple stacked dilformer blocks, wherein each of the dilformer blocks includes a first normalization layer, a sparse attention layer, a second normalization layer and a feedforward network, wherein the sparse attention output is added to the input features of the first normalization layer and then input into the second normalization layer and superimposed with the sparse attention output.

9. A computer-readable storage medium, characterized in that: It stores a computer program for photovoltaic power generation prediction, wherein the computer program enables a computer to execute the photovoltaic power generation prediction method according to any one of claims 1 to 6.

10. An electronic device, characterized in that: include: One or more processors, a memory, and one or more programs, wherein the one or more programs are stored in the memory and are configured to be executed by the one or more processors, and the programs include a method for executing the photovoltaic power generation prediction method as described in any one of claims 1 to 6.

Citation Information

Patent Citations

  • Photovoltaic generating capacity prediction system and method based on attention and deep learning

    CN116070799A

  • Autoformer long-term photovoltaic power prediction method based on SG filtering optimization

    CN117650514A

  • Wind power prediction method based on convolutional transformer architecture, and system and device

    WO2023070960A1

Cited By

  • Photovoltaic power generation power prediction method and related device

    CN119419795A

  • Photovoltaic generating capacity prediction method and system based on stability correction

    CN119944672A