Short-term photovoltaic power generation power prediction method fusing foundation cloud picture segmentation and multivariate data driving
By integrating ground-based cloud image segmentation with multi-source data-driven methods, and utilizing the U-Net network and an improved Transformer structure, the problem of insufficient accuracy in capturing cloud disturbances in photovoltaic power generation forecasting is solved, achieving high-precision short-term photovoltaic power generation forecasting. This method is suitable for intelligent scheduling systems for photovoltaic power plants and meteorological forecasting platforms.
Patent Information
- Application Number
- CN202511074453.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-07-31
- Publication Date
- 2025-11-18
- Estimated Expiration
- Not applicable · inactive patent
AI Technical Summary
Existing photovoltaic power generation prediction methods have accuracy bottlenecks in capturing high-frequency cloud disturbances and rapid shading effects. They lack a unified prediction framework that integrates image segmentation and multi-source heterogeneous variable driving, resulting in low prediction timeliness and accuracy.
A method integrating ground-based cloud map segmentation and multivariate data-driven approach is adopted. Cloud map segmentation is performed through U-Net network, and combined with an improved Transformer structure, a multivariate collaborative short-term photovoltaic power prediction system is constructed. The prediction is performed using structure-aware weighted cloud amount values and multi-source heterogeneous data.
It improves the timeliness and accuracy of short-term photovoltaic power generation forecasts, enhances forecast accuracy and robustness under complex weather conditions, and has good engineering practicality and deployability.
Smart Images

Figure CN120976239A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The application relates to a short-term photovoltaic power prediction method fusing ground-based cloud image segmentation and multi-element data driving, and belongs to the technical field of photovoltaic power generation. BACKGROUND
[0002] In a new energy power system, photovoltaic power generation, as a kind of green renewable energy, has high randomness and intermittency. In order to ensure the safety and stability of the power grid operation, it is of great significance to accurately predict the short-term photovoltaic power. However, the photovoltaic output is influenced by multiple meteorological factors, especially the change of the cloud layer directly affects the light intensity, resulting in rapid fluctuation of the power generation. The traditional photovoltaic prediction method is mostly based on time series modeling or meteorological numerical prediction, but there is still a precision bottleneck in capturing high-frequency cloud disturbance and rapid shading effect.
[0003] With the development of deep learning technology, image segmentation models such as U-Net have excellent performance in medical images and remote sensing fields, and are gradually introduced for cloud image recognition and cloud extraction. At the same time, the improved Transformer structure is also successfully used for time series modeling, and shows strong ability in capturing the dependence relationship between complex features. However, the existing methods often use cloud image information and time series data separately, resulting in low timeliness and accuracy of the prediction, and lack of a unified prediction framework fusing image segmentation and multi-source heterogeneous variable driving, especially without fully considering how the cloud structure features play a global regulation role in time series modeling. Therefore, an innovative method is needed to fuse the image segmentation output of the ground-based cloud image and other meteorological data and historical power data, and to construct a multi-variable collaborative driving short-term photovoltaic power prediction system, so as to improve the timeliness and accuracy of the prediction. SUMMARY
[0004] The purpose of the present application is to provide a short-term photovoltaic power prediction method fusing ground-based cloud image segmentation and multi-element data driving to solve the problem of improving the timeliness and accuracy of the prediction in the prior art.
[0005] The technical solution of the present application is:
[0006] A short-term photovoltaic power prediction method fusing ground-based cloud image segmentation and multi-element data driving, comprising the following steps:
[0007] S1, acquiring continuous T frames of gray cloud images, scaling and numbering each frame of gray cloud images according to the time stamp to form a frame sequence Wherein, t represents the time sequence number of the image frame, and the U-Net network with an encoder-decoder structure is inputted to output a two-dimensional probability segmentation map S t , t = 1, 2,..., T;
[0008] S2, obtaining a two-dimensional probability segmentation map S t normalizing, extracting a probability map of the cloud class, and generating a binary cloud mask map M (t)
[0009] S3, calculating a structure-aware weighted cloud amount value of each frame of image
[0010] S4, obtaining a historical photovoltaic power time series as an endogenous variable sequence X 1:T , wherein T represents the length of the backtracking window of the endogenous variable, and a historical exogenous variable sequence set corresponding to the endogenous variable sequence is obtained , wherein T α represents the length of the backtracking window of the exogenous variable, and the historical exogenous variable sequence set comprises a ground-based cloud segmentation result data sequence and a meteorological data sequence Z met ;
[0011] S5, dividing the endogenous variable sequence X 1:T into N blocks s i , embedding the block s i into a block-level time tag P en through a learnable linear projection and position encoding, introducing a learnable endogenous global tag G en as a macro representation of the endogenous variable sequence X 1:T ;
[0012] S6, embedding each exogenous variable z (i) in the historical exogenous variable sequence set into an exogenous variable tag V ex,i through a learnable linear projector, and obtaining an exogenous variable tag set V ex ;
[0013] S7, inputting the block-level time tag P en and the endogenous global tag G en into an improved Transformer structure, the improved Transformer structure performing self-attention mechanism and cross-attention mechanism, and fusing the exogenous variable tag set V ex to obtain a photovoltaic power prediction value of S period.
[0014] Further, step S2 is specifically,
[0015] S21, extracting a probability map of the cloud class applying a Softmax function to each pixel position (i, j) of the two-dimensional probability segmentation map S t to obtain a probability distribution of the corresponding class
[0016]
[0017] Among them, S 1,i,j In the two-dimensional probability segmentation graph S t The middle pixel position (i, j) is determined as the raw score for the cloud category; S 0,i,j In the two-dimensional probability segmentation graph S t The pixel position (i, j) is assigned the raw score for the non-cloud category; e represents the natural constant.
[0018] S22. According to the probability distribution The binary cloud mask image M is generated by comparing it with a set threshold T∈[0,1]. (t) ∈0,1 H′×W′ Where H′ and W′ represent the height and width of the binary cloud mask, respectively, and M represents the binary cloud mask at each pixel position (i,j). (t) The generation rule for (i,j) is:
[0019]
[0020] Further, step S3 specifically involves,
[0021] S31, Regarding the binary cloud mask image M (t) By applying a connected component labeling algorithm, all cloud block regions R are identified. k Where k = 1, 2, ..., K, and K represents the total number of cloud regions;
[0022] S32, For each cloud region R k Calculate the geometric centroid coordinates of the cloud region. And for cloud block region R k All pixels (i,j) ∈ R k Calculate the centrality distance d k (i,j):
[0023]
[0024] Where, r k For cloud block region R k The normalized scaling parameter for the maximum inscribed circle radius makes d k (i,j)∈[0,1];
[0025] S33. Define the structure weight function ω(i,j):
[0026] ω(i,j)=α·d k (i,j)+(1-α)·(1-e -G(i,j) ),
[0027] Where α∈[0,1] is an adjustable fusion coefficient, G(i,j) represents the gradient magnitude of the image at pixel (i,j), and e represents the natural constant;
[0028] S34. Combining the weight function ω(i,j) with the binary cloud mask M at each pixel position (i,j) (t) (i,j), calculate the structure-aware cloud cover value
[0029]
[0030] Further, step S5 specifically involves,
[0031] The endogenous variable sequence X 1:T Divide into N non-overlapping blocks s of length P. i , Using a block-level representation to capture time variations in endogenous variables, each block s i Projected onto a time stamp P en Introduce learnable endogenous global labels G for each endogenous variable. en As a macroscopic representation, it interacts with exogenous variables:
[0032] {s1,s2,…,s i ,…,s N} = Patchify(X 1:T )
[0033] P en =PatchEmbed(s1,s2,…,s i ,…,s N )
[0034] G en =Learnable(X 1:T ),
[0035] Where s1, s2, ..., s i ,…,s N For the 1st, 2nd, ..., i, ..., Nth blocks, Patchify(x) represents the process of modifying the endogenous variable sequence X. 1:T The data is sliced into equal-length segments of fixed length P to obtain a set of time periods as subsequences; PatchEmbed(·) maps each P-length segment to a D-dimensional vector by adding its positional encoding embedding to a trainable linear projection; Learnable(X 1:T ) represents the sequence of endogenous variables X 1:T A learnable global token vector, globaltoken, is introduced as the endogenous variable sequence X. 1:T The macroscopic representation of .
[0036] Furthermore, in step S7, the improved Transformer structure includes an encoder and a normalization layer of the Transformer with layer L. The encoder of the Transformer with layer L processes the input time stamp P. en Learnable endogenous global marker G en and the exogenous variable label set V ex After iteratively extracting context information, the output is fed to the normalization layer. The normalization layer generates the predicted photovoltaic power generation for time period S. The encoder expression for each Transformer layer is as follows:
[0037]
[0038] in, These are the block-level time stamps for the l-th and (l+1)-th layers, respectively; These are the endogenous global tags for layer l and layer l+1, respectively, and TrmBlock represents the encoder of the Transformer.
[0039] Furthermore, the Transformer encoder includes a Self-Attention layer, a first residual connection layer, a first cross-attention layer, a second residual connection layer, a third residual connection layer, a first normalization layer, a third cross-attention layer, a fourth residual connection layer, a splicing layer, a second normalization layer, and a Feed-Forward layer.
[0040] Self-Attention layer: Time stamping at the block level of the l-th layer. After performing self-attention calculation, output the first time marker;
[0041] First residual connection layer: Connects the first time stamp with the block-level time stamp of the l-th layer. Perform residual connection to output the second time stamp and feed it to the first normalization layer;
[0042] First cross-attention layer: This layer takes the block-level time stamps of the input layer l. and the endogenous global markers of layer l Perform concatenation, apply cross-attention operation to the concatenated sequence, and output the sequence after the first cross-attention operation;
[0043] Second residual connection layer: This layer adds block-level time stamps from layer l. After performing a residual connection with the sequence following the first cross-attention, the first intermediate sequence is output and fed to the first normalization layer.
[0044] Second cross-attention layer: Inherent global labels from layer l are applied. and the time stamp of the block level of the lth layer Perform concatenation, apply cross-attention to the concatenated sequence, and output the sequence after the second cross-attention.
[0045] Third residual connection layer: Endogenous global labeling of layer l After residual connection with the sequence following the second cross-attention, the second intermediate sequence is output to the first normalization layer;
[0046] First normalization layer: After normalizing the second time stamp, output the first intermediate state vector of the time block level representation of the l-th layer. After performing layer normalization on the first intermediate sequence output from the second residual connection layer, the second intermediate state vector, represented by the time block level of the l-th layer, is output. After layer normalization of the second intermediate sequence output from the third residual connection layer, the intermediate state vector of the global label vector of the l-th layer is output.
[0047] Third cross-attention layer: intermediate state vector of the global label vector of layer l. With the input exogenous variable label set V ex Perform concatenation, apply cross-attention to the concatenated sequence, and output the sequence after the third cross-attention.
[0048] Fourth residual connection layer: intermediate state vector of the global label vector of layer l. After performing residual connections with the sequence following the third cross-attention, the output is the second normalized layer of the residual-connected sequence;
[0049] Concatenation layer: The first intermediate state vector of the time block-level representation of the l-th layer. and the second intermediate state vector of the time block level representation of the l-th layer After concatenation, the intermediate state vector of the time block level representation of the l-th layer is output. Give the second normalization layer;
[0050] The second normalization layer: After normalizing the sequence of residual concatenation output from the fourth residual concatenation layer, it outputs the intermediate state vector of the global label vector of the l-th layer. Intermediate state vector of the time block representation of the l-th layer Output time state vector after layer normalization
[0051] Feed-Forward layer: This refers to the time-state vector of the input layer. and global marked state vector Feature transformation is performed using two layers of linear transformation and the nonlinear activation function ReLU to extract nonlinear relationships, and the block-level time stamps of the (l+1)th layer are output. Endogenous global markers in layer l+1
[0052] Furthermore, in the improved Transformer architecture, the encoder of the l-th layer Transformer generates block-level time stamps for the (l+1)-th layer. Endogenous global markers in layer l+1 Specifically,
[0053]
[0054] in, Let be the first intermediate state vector of the time block-level representation of the l-th layer. This is the second intermediate state vector in the time block-level representation of the l-th layer. The intermediate state of the global label vector of the endogenous variables in layer l; LayerNorm1 and LayerNorm2 represent the first and second normalization layers, respectively, and Attention. Self Indicates the self-attention layer. For the block-level time stamping of the l-th layer, Attention Cross1 Attention Cross2 Attention Cross3 These represent the first cross-attention layer, the second cross-attention layer, and the third cross-attention layer, respectively. This represents the endogenous global label of the l-th layer, where l∈{0,…,L-1}. The block-level time stamps representing the initial input of the Transformer's encoder at layer 0 are generated by PatchEmbed(·) embedding; This represents the endogenous global label of the initial input to the Transformer encoder, obtained by initializing Learnable(x). express and Connections along the sequence dimension, with Feed-Forward as the feedforward layer. This is the time state vector of the l-th layer. This is the global labeled state vector of the l-th layer.
[0055] The beneficial effects of this invention are:
[0056] I. This short-term photovoltaic power generation prediction method, which integrates ground-based cloud image segmentation and multi-source data-driven approach, improves the timeliness and accuracy of short-term photovoltaic power generation prediction by introducing a structure-aware cloud extraction mechanism, U-Net network, and improved Transformer structure. It can achieve high-precision prediction of short-term photovoltaic power generation, while taking into account both image spatial features and temporal data representation. It can effectively improve the accuracy and robustness of short-term photovoltaic power generation prediction under complex weather conditions and has good engineering practicality and deployability.
[0057] Second, this method for predicting short-term photovoltaic power generation by integrating ground-based cloud map segmentation and multi-source data-driven approaches achieves high-precision cloud identification and structure-aware cloud volume extraction. It introduces a U-Net-based deep convolutional neural network to perform pixel-level segmentation of the ground-based grayscale cloud map, and combines cloud connectivity analysis and spatial structure weight design to achieve accurate identification of cloud distribution and more physically relevant cloud volume calculation, significantly improving the usability and expressiveness of cloud map information.
[0058] Third, this invention improves prediction accuracy by fusing image information with multi-source time-series variables. The extracted cloud cover sequence, historical photovoltaic power data, meteorological variables and other multi-source heterogeneous data are input into a time series modeling framework based on a variant of Transformer. Under the global-local attention mechanism, the effective fusion of endogenous and exogenous variables is achieved, which greatly improves the model's ability to model rapid power fluctuations under complex weather conditions.
[0059] Fourth, this method for predicting short-term photovoltaic power generation by integrating ground-based cloud map segmentation and multi-source data has good scalability and end-to-end deployment capabilities. This method can quickly process continuous cloud map frames and output short-term photovoltaic power generation prediction results. It has end-to-end modeling capabilities and portability, and is suitable for the efficient deployment of photovoltaic power plant intelligent scheduling systems, edge computing nodes and meteorological forecasting platforms. Attached Figure Description
[0060] Figure 1 This is a flowchart illustrating the short-term photovoltaic power generation prediction method that integrates ground-based cloud map segmentation and multi-source data-driven methods according to an embodiment of the present invention.
[0061] Figure 2 This is a schematic diagram illustrating the encoder of the Transformer in the embodiment. Detailed Implementation
[0062] The preferred embodiments of the present invention will now be described in detail with reference to the accompanying drawings.
[0063] The embodiment provides a short-term photovoltaic power generation prediction method that integrates ground-based cloud map segmentation and multi-source data-driven approaches, such as... Figure 1 This includes the following steps:
[0064] S1. Obtain grayscale cloud images of T consecutive frames. The image is scaled and each grayscale image is numbered by timestamp to form a frame sequence. Where t represents the temporal sequence number of the image frame, and the output is a two-dimensional probability segmentation map after being input into a U-Net network with an encoder-decoder structure. Where t = 1, 2, ..., T, H′ < H, W′ < W, and H′ and W′ represent the two-dimensional probability graph S, respectively. t The height and width of the grayscale cloud image are represented by H and W, respectively.
[0065] In step S1, in one example, the image is uniformly scaled to the input size of the deep network, 572×572, to form the input tensor. Each frame is numbered according to its timestamp, forming a frame sequence.
[0066] S2, for the two-dimensional probability segmentation graph S t Normalization is performed, a probability map of cloud categories is extracted, and a binary cloud mask map M is generated. (t) .
[0067] S21. Extract the probability map of cloud categories. For the two-dimensional probability segmentation graph S t Applying the Softmax function to each pixel position (i,j) yields the probability distribution of the corresponding category.
[0068]
[0069] Among them, S 1,i,j In the two-dimensional probability segmentation graph S t The middle pixel position (i, j) is determined as the raw score for the cloud category; S 0,i,j In the two-dimensional probability segmentation graph S t The pixel position (i, j) is assigned the raw score for the non-cloud category; e represents the natural constant. This is an exponential operation with the natural constant e as the base, the result of which is an amplified score exponent used to calculate the relative probability of cloud categories;
[0070] S22. According to the probability distribution The binary cloud mask image M is generated by comparing it with a set threshold T∈[0,1]. (t) ∈0,1 H′×W′ Where H′ and W′ represent the height and width of the binary cloud mask, respectively, and M represents the binary cloud mask at each pixel position (i,j). (t) The generation rule for (i,j) is:
[0071]
[0072] The threshold T is set to a fixed constant of 0.5, or dynamically set based on the distribution of rare confidence values, and the cloud mask image M... (t) Used for subsequent weighted cloud volume calculation.
[0073] S3. Calculate the structure-aware weighted cloud cover value for each frame of image.
[0074] S31, Regarding the binary cloud mask image M (t) By applying a connected component labeling algorithm, all cloud block regions R are identified. k Where k = 1, 2, ..., K, and K represents the total number of cloud regions;
[0075] S32, For each cloud region R k Calculate the geometric centroid coordinates of the cloud region. And for cloud block region R k All pixels (i,j) ∈ R k Calculate the centrality distance d k (i,j):
[0076]
[0077] Where, r k For cloud block region R k The normalized scaling parameter for the maximum inscribed circle radius makes d k (i,j)∈[0,1];
[0078] S33. Define the structure weight function ω(i,j):
[0079] ω(i,j)=α·d k (i,j)+(1-α)·(1-e -G(i,j) ),
[0080] Where α∈[0,1] is an adjustable fusion coefficient, G(i,j) represents the gradient magnitude of the image at pixel (i,j), and e represents the natural constant;
[0081] S34. Combining the weight function ω(i,j) with the binary cloud mask M at each pixel position (i,j) (t) (i,j), calculate the structure-aware cloud cover value
[0082]
[0083] S4. Obtain the historical photovoltaic power generation time series as an endogenous variable sequence X. 1:TWhere T represents the backtracking window length of the endogenous variable, and the set of historical exogenous variable sequences corresponding to the endogenous variable sequence is obtained. Among them, T α This indicates the backtracking window length of the exogenous variable; the historical exogenous variable sequence set contains the data sequence of the ground cloud map segmentation results. and meteorological data series Z met .
[0084] S5. Transform the endogenous variable sequence X 1:T Divide into N blocks s i , divide into blocks s i Embedded into block-level time stamps P using learnable linear projections and positional encoding. en Introducing learnable endogenous global labels G en As an endogenous variable sequence X 1:T The macroscopic representation. Specifically:
[0085] The endogenous variable sequence X 1:T Divide into N non-overlapping blocks s of length P. i , Using a block-level representation to capture time variations in endogenous variables, each block s i Projected onto a time stamp P en Introduce learnable endogenous global labels G for each endogenous variable. en As a macroscopic representation, it interacts with exogenous variables:
[0086] {s1,s2,…,s i ,…,s N} = Patchify(X 1:T )
[0087] P en =PatchEmbed(s1,s2,…,s i ,…,s N )
[0088] G en =Learnable(X 1:T ),
[0089] Where s1, s2, ..., s i ,…,s N For the 1st, 2nd, ..., i, ..., Nth blocks, Patchify(x) represents the process of modifying the endogenous variable sequence X. 1:T The data is sliced into equal-length segments of fixed length P to obtain a set of time periods as subsequences; PatchEmbed(·) maps each P-length segment to a D-dimensional vector by adding its positional encoding embedding to a trainable linear projection; Learnable(X1:T ) represents the sequence of endogenous variables X 1:T A learnable global token vector, globaltoken, is introduced as the endogenous variable sequence X. 1:T The macroscopic representation of .
[0090] S6. Set the historical exogenous variable sequence Each exogenous variable z in (i) V is labeled as an exogenous variable through learnable linear projector embedding. ex,i And obtain the exogenous variable label set V ex .
[0091] In step S6, a trainable linear projector, VariteEmbed, is used to project each exogenous variable z. (i) Embedding is used to label exogenous variables V ex,i The expression is as follows:
[0092] V ex,i =VariateEmbed(z (i) ), i∈{1,…,C},
[0093] Where C represents the total number of variables, Let z be a real vector space of dimension TeX, where each exogenous variable z (i) It is a real vector of length Tex; A real vector space of dimension D, i.e., the projected V ex,i Let D be a real vector; Label the set of exogenous variables.
[0094] S7, P is a block-level time stamp en and endogenous global marker G en The input is an improved Transformer structure, which performs self-attention and cross-attention mechanisms and integrates the exogenous variable label set V. ex The predicted photovoltaic power generation value for time period S is obtained.
[0095] In step S7, the improved Transformer structure includes an encoder and a normalization layer of the Transformer with layer L. The encoder of the Transformer with layer L processes the input time stamp P. en Learnable endogenous global marker G en and the exogenous variable label set V ex After iteratively extracting context information, the output is fed to the normalization layer. The normalization layer generates the predicted photovoltaic power generation for time period S. The encoder expression for each Transformer layer is as follows:
[0096]
[0097] in, These are the block-level time stamps for the l-th and (l+1)-th layers, respectively; These are the endogenous global tags for layer l and layer l+1, respectively, and TrmBlock represents the encoder of the Transformer.
[0098] like Figure 2 The Transformer encoder includes a Self-Attention layer, a first residual connection layer, a first cross-attention layer, a second residual connection layer, a third residual connection layer, a first normalization layer, a third cross-attention layer, a fourth residual connection layer, a splicing layer, a second normalization layer, and a Feed-Forward layer.
[0099] Self-Attention layer: Time stamping at the block level of the l-th layer. After performing self-attention calculation, output the first time marker;
[0100] First residual connection layer: Connects the first time stamp with the block-level time stamp of the l-th layer. Perform residual connection to output the second time stamp and feed it to the first normalization layer;
[0101] First cross-attention layer: This layer takes the block-level time stamps of the input layer l. and the endogenous global markers of layer l Perform concatenation, apply cross-attention operation to the concatenated sequence, and output the sequence after the first cross-attention operation;
[0102] Second residual connection layer: This layer adds block-level time stamps from layer l. After performing a residual connection with the sequence following the first cross-attention, the first intermediate sequence is output and fed to the first normalization layer.
[0103] Second cross-attention layer: Inherent global labels from layer l are applied. and the time stamp of the block level of the lth layer Perform concatenation, apply cross-attention to the concatenated sequence, and output the sequence after the second cross-attention.
[0104] Third residual connection layer: Endogenous global labeling of layer l After residual connection with the sequence following the second cross-attention, the second intermediate sequence is output to the first normalization layer;
[0105] First normalization layer: After normalizing the second time stamp, output the first intermediate state vector of the time block level representation of the l-th layer. After performing layer normalization on the first intermediate sequence output from the second residual connection layer, the second intermediate state vector, represented by the time block level of the l-th layer, is output. After layer normalization of the second intermediate sequence output from the third residual connection layer, the intermediate state vector of the global label vector of the l-th layer is output.
[0106] Third cross-attention layer: intermediate state vector of the global label vector of layer l. With the input exogenous variable label set V ex Perform concatenation, apply cross-attention to the concatenated sequence, and output the sequence after the third cross-attention.
[0107] Fourth residual connection layer: intermediate state vector of the global label vector of layer l. After performing residual connections with the sequence following the third cross-attention, the output is the second normalized layer of the residual-connected sequence;
[0108] Concatenation layer: The first intermediate state vector of the time block-level representation of the l-th layer. and the second intermediate state vector of the time block level representation of the l-th layer After concatenation, the intermediate state vector of the time block level representation of the l-th layer is output. Give the second normalization layer;
[0109] The second normalization layer: After normalizing the sequence of residual concatenation output from the fourth residual concatenation layer, it outputs the intermediate state vector of the global label vector of the l-th layer. Intermediate state vector of the time block representation of the l-th layer Output time state vector after layer normalization
[0110] Feed-Forward layer: This refers to the time-state vector of the input layer. and global marked state vector Feature transformation is performed using two layers of linear transformation and the nonlinear activation function ReLU to extract nonlinear relationships, and the block-level time stamps of the (l+1)th layer are output. Endogenous global markers in layer l+1
[0111] In the improved Transformer architecture, the encoder of the l-th layer Transformer generates block-level time stamps for the (l+1)-th layer. Endogenous global markers in layer l+1 Specifically,
[0112]
[0113] in, Let be the first intermediate state vector of the time block-level representation of the l-th layer. This is the second intermediate state vector in the time block-level representation of the l-th layer. The intermediate state of the global label vector of the endogenous variables in layer l; LayerNorm1 and LayerNorm2 represent the first and second normalization layers, respectively, and Attention. Self Indicates the self-attention layer. For the block-level time stamping of the l-th layer, Attention Cross1 Attention Cross2 Attention Cross3 These represent the first cross-attention layer, the second cross-attention layer, and the third cross-attention layer, respectively. This represents the endogenous global label of the l-th layer, where l∈{0,…,L-1}. The block-level time stamps representing the initial input of the Transformer's encoder at layer 0 are generated by PatchEmbed(·) embedding; This represents the endogenous global label of the initial input to the Transformer encoder, obtained by initializing Learnable(x). express and Connections along the sequence dimension, with Feed-Forward as the feedforward layer. This is the time state vector of the l-th layer. This is the global labeled state vector of the l-th layer.
[0114] In the improved Transformer architecture, self-attention on endogenous time stamps and a learnable global label are linked between endogenous and endogenous variables, allowing the global label to play an asymmetric role in cross-attention. The block-level time stamp P... en and endogenous global marker G en Input encoder, in the encoder: (a) at block level time stamp P en (a) Perform self-attention computation between them to capture temporal dependencies; (b) in the endogenous global label G en With all block-level time stamps P en Cross-attention calculations are performed between them, enabling the endogenous global label to aggregate sequence information and provide global relevance to time stamps at each block level. (c) Using the endogenous global label Gen As a query, the exogenous variable label set V ex As keys and values, cross-attention calculations are performed to fuse exogenous variable information and output the predicted photovoltaic power generation value for time period S. By introducing a global label as the sole endogenous query channel in the structure and embedding exogenous variables at the variable level, an asymmetric and controllable information fusion path is established.
[0115] This short-term photovoltaic power generation prediction method, which integrates ground-based cloud image segmentation and multi-source data-driven approach, improves the timeliness and accuracy of short-term photovoltaic power generation prediction by introducing a structure-aware cloud extraction mechanism, a U-Net network, and an improved Transformer structure. It can achieve high-precision prediction of short-term photovoltaic power generation, while taking into account both image spatial features and temporal data representation. It can effectively improve the accuracy and robustness of short-term photovoltaic power generation prediction under complex weather conditions and has good engineering practicality and deployability.
[0116] This short-term photovoltaic power generation prediction method, which integrates ground-based cloud image segmentation and multi-source data-driven approaches, first collects continuous frames of ground-based grayscale cloud images as the input data source. The input images are then fed into a U-Net network with an encoder-decoder structure, outputting a probability map of each pixel belonging to the "cloud" or "non-cloud" category. This probability map is then subjected to Softmax normalization to extract the cloud category probability map, and a cloud mask image is generated by applying a set threshold. Based on the cloud mask image, a structure-aware weight function is constructed based on connected regions and cloud centroids to calculate the weighted cloud amount value for each frame, forming a cloud amount time series. Using the cloud amount series and meteorological data as exogenous variables, a combined analysis is performed. The modeling input is constructed using historical photovoltaic power generation sequences (endogenous variables). A block-level time stamp is generated for the endogenous variables using a block embedding mechanism, while a learnable global label is introduced to represent macroscopic features. Linear projection is performed on the exogenous variables to generate variable-level embeddings. The aforementioned time stamps and global labels are input into a Transformer encoder, where self-attention and cross-attention mechanisms are executed to achieve time-dependent modeling and global context aggregation. Cross-variable attention fusion is performed using the endogenous global label as the query and the exogenous variable labels as keys and values. The resulting features are processed by a feedforward neural network (i.e., a feedforward layer) to output multi-step photovoltaic power generation prediction results.
[0117] This short-term photovoltaic power generation prediction method, which integrates ground-based cloud image segmentation and multivariate data-driven approaches, introduces a cloud image structure perception weighting mechanism to incorporate geometric spatial distribution features into traditional cloud cover estimation methods, thereby improving the accuracy of cloud image feature quantification. Simultaneously, by combining historical power data with meteorological sequences and employing a cross-attention mechanism between endogenous and exogenous variables, the method enhances the model's ability to express the evolutionary characteristics of photovoltaic output, effectively improving the model's response to rapid weather changes and cloud movement processes.
[0118] This short-term photovoltaic power generation prediction method, which integrates ground-based cloud image segmentation and multi-source data-driven approach, fully considers the nonlinear coupling relationship between cloud images and photovoltaic power in practical applications. Unlike previous methods that relied solely on historical power or meteorological variables to construct prediction models, this method innovatively introduces image spatial features into the time series modeling process, constructing a structure-aware photovoltaic prediction framework. By segmenting endogenous variables into blocks, introducing global representations, and combining exogenous variable-level embedding expressions, the method utilizes an attention mechanism to dynamically model their interaction relationships, thereby improving the model's ability to model the trend of photovoltaic output changes under complex weather conditions.
[0119] This short-term photovoltaic power generation prediction method, which integrates ground-based cloud map segmentation and multi-source data-driven approaches, possesses end-to-end trainability and strong temporal generalization and spatial adaptability. While ensuring prediction accuracy, it also offers advantages such as high interpretability and flexible deployment, making it suitable for scenarios including photovoltaic power plant scheduling optimization, intelligent distribution network control, and weather-aware energy management. It is particularly applicable to intelligent photovoltaic power output control and prediction applications under complex weather conditions.
[0120] The above are merely embodiments of the present invention and are not intended to limit the invention. Various modifications and variations can be made to the present invention by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principle of the present invention should be included within the scope of the claims of the present invention.
Claims
1. A method for predicting short-term photovoltaic power generation by integrating ground-based cloud map segmentation and multi-source data-driven approaches, characterized in that, Includes the following steps: S1. Obtain grayscale cloud images of T consecutive frames, scale them, and number each frame's grayscale cloud image according to its timestamp to form a frame sequence. Where t represents the temporal sequence number of the image frame, and after being input into a U-Net network with an encoder-decoder structure, the output is a two-dimensional probability segmentation map S. t , t = 1, 2, ..., T; S2, for the two-dimensional probability segmentation graph S t Normalization is performed, a probability map of cloud categories is extracted, and a binary cloud mask map M is generated. (t) ; S3. Calculate the structure-aware weighted cloud cover value for each frame of image. S4. Obtain the historical photovoltaic power generation time series as an endogenous variable sequence X. 1:T Where T represents the backtracking window length of the endogenous variable, and the set of historical exogenous variable sequences corresponding to the endogenous variable sequence is obtained. Among them, T α This indicates the backtracking window length of the exogenous variable; the historical exogenous variable sequence set contains the data sequence of the ground cloud map segmentation results. and meteorological data series Z met ; S5. Transform the endogenous variable sequence X 1:T Divide into N blocks s i , divide into blocks s i Embedded into block-level time stamps P using learnable linear projections and positional encoding. en Introducing learnable endogenous global labels G en As an endogenous variable sequence X 1:T The macroscopic representation; S6. Set the historical exogenous variable sequence Each exogenous variable z in (i) V is labeled as an exogenous variable through learnable linear projector embedding. ex,i And obtain the exogenous variable label set V ex ; S7, P is a block-level time stamp en and endogenous global marker G en The input is an improved Transformer structure, which performs self-attention and cross-attention mechanisms and integrates the exogenous variable label set V. ex The predicted photovoltaic power generation value for time period S is obtained.
2. The method for short-term photovoltaic power generation prediction that integrates ground-based cloud map segmentation and multi-source data-driven methods as described in claim 1, characterized in that: Step S2, specifically, S21. Extract the probability map of cloud categories. For the two-dimensional probability segmentation graph S t Applying the Softmax function to each pixel position (i,j) yields the probability distribution of the corresponding category. Among them, S 1,i,j In the two-dimensional probability segmentation graph S t The middle pixel position (i, j) is determined as the raw score for the cloud category; S 0,i,j In the two-dimensional probability segmentation graph S t The pixel position (i, j) is assigned the raw score for the non-cloud category; e represents the natural constant. S22. According to the probability distribution The binary cloud mask image M is generated by comparing it with a set threshold T∈[0,1]. (t) ∈0,1 H′×W′ Where H′ and W′ represent the height and width of the binary cloud mask, respectively, and M represents the binary cloud mask at each pixel position (i,j). (t) The generation rule for (i,j) is:
3. The method for short-term photovoltaic power generation prediction that integrates ground-based cloud map segmentation and multi-source data-driven methods as described in claim 1, characterized in that: Step S3, specifically, S31, Regarding the binary cloud mask image M (t) By applying a connected component labeling algorithm, all cloud block regions R are identified. k Where k = 1, 2, ..., K, and K represents the total number of cloud regions; S32, For each cloud region R k Calculate the geometric centroid coordinates of the cloud region. And for cloud block region R k All pixels (i,j) ∈ R k Calculate the centrality distance d k (i,j): Where, r k For cloud block region R k The normalized scaling parameter for the maximum inscribed circle radius makes d k (i,j)∈[0,1]; S33. Define the structure weight function ω(i,j): ω(i,j)=α·d k (i,j)+(1-a)·(1-e -G(i,j) ), Where α∈[0,1] is an adjustable fusion coefficient, G(i,j) represents the gradient magnitude of the image at pixel (i,j), and e represents the natural constant; S34. Combining the weight function ω(i,j) with the binary cloud mask M at each pixel position (i,j) (t) (i,j), calculate the structure-aware cloud cover value 4. The method for short-term photovoltaic power generation prediction based on ground-based cloud map segmentation and multi-source data-driven methods as described in any one of claims 1-3, characterized in that: Step S5, specifically, The endogenous variable sequence X 1:T Divide into N non-overlapping blocks s of length P. i , Using a block-level representation to capture time variations in endogenous variables, each block s i Projected onto a time stamp P en Introduce learnable endogenous global labels G for each endogenous variable. en As a macroscopic representation, it interacts with exogenous variables: {s1,s2,…,s i ,…,s N }=Patchify(X 1:T ) P en =PatchEmbed(s1,s2,…,s i ,…,s N ) G en =Learnable(X 1:T ), Where s1, s2, ..., s i ,…,s N For the 1st, 2nd, ..., i, ..., Nth blocks, Patchify(x) represents the process of modifying the endogenous variable sequence X. 1:T The data is sliced into equal-length segments of fixed length P to obtain a set of time periods as subsequences; PatchEmbed(·) maps each P-length segment to a D-dimensional vector by adding its positional encoding embedding to a trainable linear projection; Learnable(X 1:T ) represents the sequence of endogenous variables X 1:T A learnable global token vector is introduced as an endogenous variable sequence X. 1:T The macroscopic representation of .
5. The method for short-term photovoltaic power generation prediction based on ground-based cloud map segmentation and multi-source data-driven methods as described in any one of claims 1-3, characterized in that: In step S7, the improved Transformer structure includes an encoder and a normalization layer of the Transformer with layer L. The encoder of the Transformer with layer L processes the input time stamp P. en Learnable endogenous global marker G en and the exogenous variable label set V ex After iteratively extracting context information, the output is fed to the normalization layer. The normalization layer generates the predicted photovoltaic power generation for time period S. The encoder expression for each Transformer layer is as follows: in, These are the block-level time stamps for the l-th and (l+1)-th layers, respectively; These are the endogenous global tags for layer l and layer l+1, respectively, and TrmBlock represents the encoder of the Transformer.
6. The method for short-term photovoltaic power generation prediction based on ground-based cloud map segmentation and multi-source data as described in claim 5, characterized in that: The Transformer encoder consists of a Self-Attention layer, a first residual connection layer, a first cross-attention layer, a second residual connection layer, a third residual connection layer, a first normalization layer, a third cross-attention layer, a fourth residual connection layer, a splicing layer, a second normalization layer, and a Feed-Forward layer. Self-Attention layer: Time stamping at the block level of the l-th layer. After performing self-attention calculation, output the first time marker; First residual connection layer: Connects the first time stamp with the block-level time stamp of the l-th layer. Perform residual connection to output the second time stamp and feed it to the first normalization layer; First cross-attention layer: This layer takes the block-level time stamps of the input layer l. and the endogenous global markers of layer l Perform concatenation, apply cross-attention operation to the concatenated sequence, and output the sequence after the first cross-attention operation; Second residual connection layer: This layer adds block-level time stamps from layer l. After performing a residual connection with the sequence following the first cross-attention, the first intermediate sequence is output and fed to the first normalization layer. Second cross-attention layer: Inherent global labels from layer l are applied. and the time stamp of the block level of the lth layer Perform concatenation, apply cross-attention to the concatenated sequence, and output the sequence after the second cross-attention. Third residual connection layer: Endogenous global labeling of layer l After residual connection with the sequence following the second cross-attention, the second intermediate sequence is output to the first normalization layer; First normalization layer: After normalizing the second time stamp, output the first intermediate state vector of the time block level representation of the l-th layer. After performing layer normalization on the first intermediate sequence output from the second residual connection layer, the second intermediate state vector, represented by the time block level of the l-th layer, is output. After layer normalization of the second intermediate sequence output from the third residual connection layer, the intermediate state vector of the global label vector of the l-th layer is output. Third cross-attention layer: intermediate state vector of the global label vector of layer l. With the input exogenous variable label set V ex Perform concatenation, apply cross-attention to the concatenated sequence, and output the sequence after the third cross-attention. Fourth residual connection layer: intermediate state vector of the global label vector of layer l. After performing residual connections with the sequence following the third cross-attention, the output is the second normalized layer of the residual-connected sequence; Concatenation layer: The first intermediate state vector of the time block-level representation of the l-th layer. and the second intermediate state vector of the time block level representation of the l-th layer After concatenation, the intermediate state vector of the time block level representation of the l-th layer is output. Give the second normalization layer; The second normalization layer: After normalizing the sequence of residual concatenation output from the fourth residual concatenation layer, it outputs the intermediate state vector of the global label vector of the l-th layer. Intermediate state vector of the time block representation of the l-th layer Output time state vector after layer normalization Feed-Forward layer: This refers to the time-state vector of the input layer. and global marked state vector Feature transformation is performed using two layers of linear transformation and the nonlinear activation function ReLU to extract nonlinear relationships, and the block-level time stamps of the (l+1)th layer are output. Endogenous global markers in layer l+1 7. The method for short-term photovoltaic power generation prediction based on ground-based cloud map segmentation and multi-source data as described in claim 5, characterized in that: In the improved Transformer architecture, the encoder of the l-th layer Transformer generates block-level time stamps for the (l+1)-th layer. Endogenous global markers in layer l+1 Specifically, in, Let be the first intermediate state vector of the time block-level representation of the l-th layer. This is the second intermediate state vector in the time block-level representation of the l-th layer. The intermediate state of the global label vector of the endogenous variables in layer l; LayerNorm1 and LayerNorm2 represent the first and second normalization layers, respectively, and Attention. Self Indicates the self-attention layer. For the block-level time stamping of the l-th layer, Attention Cross1 Attention Cross2 Attention Cross3 These represent the first cross-attention layer, the second cross-attention layer, and the third cross-attention layer, respectively. Denotes the endogenous global label of the l-th layer, l∈0,…,L-1}. The block-level time stamps representing the initial input of the Transformer's encoder at layer 0 are generated by PatchEmbed(·) embedding; This represents the endogenous global label of the initial input to the Transformer encoder, obtained by initializing Learnable(x). express and Connections along the sequence dimension, with Feed-Forward as the feedforward layer. This is the time state vector of the l-th layer. This is the global labeled state vector of the l-th layer.