Large-scale photovoltaic cluster short-term photovoltaic power prediction method
By combining a time-dynamic graph neural network and a spatiotemporal attention mechanism network with a graph convolutional network, the problem that existing photovoltaic power prediction methods do not consider the spatial correlation between adjacent photovoltaic power plants is solved, and high-precision short-term photovoltaic power prediction of photovoltaic clusters is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- PETROCHINA CO LTD
- Filing Date
- 2024-11-01
- Publication Date
- 2026-05-12
AI Technical Summary
Existing photovoltaic power prediction methods fail to effectively utilize the spatial correlation between adjacent photovoltaic power plants, resulting in low prediction accuracy and efficiency.
A time-dynamic graph neural network is used to cluster photovoltaic clusters, and a topological graph network and a spatiotemporal attention mechanism network are constructed. A graph convolutional network is combined to predict photovoltaic power. An adjacency matrix is constructed using the geographical location of neighboring photovoltaic power plants and the numerical weather forecast feature ranked first in importance. The photovoltaic power prediction model is trained using the numerical weather forecast features ranked first in importance.
It improved the accuracy and stability of short-term photovoltaic power prediction for photovoltaic clusters, with a root mean square error of 0.0541, a mean absolute error of 0.0438, and an accuracy of 94.59%, significantly improving prediction precision.
Smart Images

Figure CN122020007A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of photovoltaic power prediction technology, and relates to a method for short-term photovoltaic power prediction of large-scale photovoltaic clusters. Background Technology
[0002] In recent years, new energy power generation has begun to replace thermal power generation and will gradually become the main form of power generation in the future. Photovoltaic power generation, as a clean energy source, has characteristics such as being renewable and green, but it also has characteristics such as high randomness, strong fluctuations, and difficulty in regulation. If the electricity generated by large-scale photovoltaic clusters is directly connected to the power grid, it will cause fluctuations in the power system, resulting in losses for users and power plants. In severe cases, it can interfere with the normal operation of the power system and cause large-scale blackouts and other accidents. Therefore, predicting the power generation of photovoltaic clusters can help anticipate changes and fluctuations in photovoltaic power in advance, thereby facilitating dispatchers to determine dispatch plans and further improving the stability of power system operation.
[0003] To improve the accuracy of photovoltaic (PV) cluster power prediction, commonly used methods almost universally rely on feature construction and artificial intelligence models. Examples include Chinese patent CN118487275A, published on August 13, 2024, which discloses a method, apparatus, equipment, and medium for predicting distributed PV cluster power; Chinese patent CN118313496A, published on July 9, 2024, which discloses a method for predicting distributed PV cluster power based on deep similarity clustering; and Chinese patent CN118157231A, published on June 7, 2024. Methods for improving the accuracy of photovoltaic cluster power prediction based on photovoltaic cluster division; Chinese patent CN117217357A, published on December 12, 2023, discloses a method and system for constructing a photovoltaic cluster prediction model; Chinese patent CN114447916A, published on May 6, 2022, discloses a method and device for predicting the power of a distributed photovoltaic cluster. However, the photovoltaic power prediction methods disclosed in these patents do not consider the spatial correlation between adjacent photovoltaic power stations, and the feature construction methods and artificial intelligence models are relatively complex, resulting in low prediction efficiency.
[0004] Currently, with the continuous expansion of photovoltaic (PV) power plants, the dispatching scope of PV power plants is constantly increasing, necessitating research into short-term PV power prediction methods for large-scale PV clusters. Current PV cluster prediction methods generally include the overall method, the cumulative method, and the cluster partitioning method. The overall method and the cumulative method cannot utilize the spatial correlation information between PV power plants, resulting in low prediction accuracy. Furthermore, Euclidean distance-based clustering methods have significant partitioning errors for PV clusters with non-Euclidean distances, thus affecting prediction performance. Additionally, PV power plant data is a collection of data provided by individual PV power plants, exhibiting a certain degree of divergence. The power output of adjacent PV power plants has a certain spatial correlation, but existing PV power prediction methods generally do not consider the spatial correlation between adjacent PV power plants, and their feature construction methods and artificial intelligence models are complex, resulting in low prediction efficiency and accuracy. Summary of the Invention
[0005] The purpose of this invention is to provide a method for short-term photovoltaic power prediction of large-scale photovoltaic clusters, which solves the problem that existing photovoltaic power prediction methods generally do not consider the spatial correlation between adjacent photovoltaic power stations, resulting in low accuracy of prediction results.
[0006] The technical solution adopted in this invention is a method for short-term photovoltaic power prediction of large-scale photovoltaic clusters, comprising the following steps:
[0007] Step 1: Collect historical datasets of photovoltaic clusters, calculate the importance of various numerical weather forecast features in the historical datasets using the random forest algorithm, and select the most important numerical weather forecast features as the primary features for cluster partitioning to classify photovoltaic clusters.
[0008] Step 2: Use a time-dynamic graph neural network to cluster the photovoltaic power stations in the photovoltaic cluster into several sub-clusters;
[0009] Step 3: Construct a topological graph network based on the geographical coordinates of the photovoltaic power stations in each sub-cluster and the numerical weather forecast feature ranked first in importance, and obtain the corresponding adjacency matrix.
[0010] Step 4: Construct the spatiotemporal attention mechanism network of the photovoltaic cluster and fuse it with the topological graph network in Step 3 to obtain the graph convolutional network model with fused spatiotemporal attention mechanism, i.e., the photovoltaic power prediction model.
[0011] Step 5: Train the photovoltaic power prediction model by using the top three most important numerical weather forecast features and the corresponding measured photovoltaic power in the historical dataset, and then obtain the predicted photovoltaic power of each sub-cluster by using the numerical weather forecast features for future periods.
[0012] Step 6: Sum the predicted power of all photovoltaic sub-clusters to obtain the final prediction result.
[0013] In step 2, a time-dynamic graph neural network is used to cluster the photovoltaic power stations in the photovoltaic cluster. The input is the geographical coordinates of each photovoltaic power station and the most important numerical weather forecast features, and the output is the category number.
[0014] The time-based dynamic graph neural network consists of two vectors, Z and Ψ, with length d for each time interval t. All elements are randomly initialized, learnable parameters. Z is calculated... T The product of Ψ and Ψ yields the initial adjacency matrix A of the time series:
[0015] A = Z T ·Ψ (1)
[0016] idx,idy=argtopk(A[:,:]),idx≠idy (2)
[0017] A[-idx,-idy]=0 (3)
[0018] Where Z = [z1, z2, ..., z d ], Let Z represent the random initialization of the learnable node embedding, where Z represents the geographical coordinates of the photovoltaic power station, (x, y) represents the coordinate point, z1 represents the geographical coordinates of the first photovoltaic power station, z2 represents the geographical coordinates of the second photovoltaic power station, and z... d This represents the geographical coordinates of the d-th photovoltaic power station, where Ψ represents the numerical weather prediction characteristics. The first numerical weather forecast feature within time period t, The second numerical weather prediction feature within time period t, The d-th numerical weather forecast feature within time period t, the argtopk(·) function can return the indices of the first k maximum values of the adjacency matrix A. Through formulas (2)-(3) sparse adjacency matrix, for each time period adjacency matrix, only the elements with the first k maximum weights are retained, and the other values are set to zero.
[0019] Dynamic graph neural networks completely separate different time-series data in the same dimension after dynamic graph transformation. The same vertex in different time periods typically aggregates information from different vertex sets. A dynamic graph isomorphic network is defined as follows:
[0020]
[0021] in, This represents the output of the graph isomorphic network at time t in layer l for node v. This is a simple implementation of dynamic graph transformation, applicable to the case where t > 2, with edge weight w. ijNormalized to w ij ε is a learning parameter, and t represents a time point. Indicates multiple The concatenation is performed; in addition, the adjacency matrix H l The expression is as follows:
[0022]
[0023] Among them, H l Represents the adjacency matrix. Let ε represent the sum of the adjacency matrix and the identity matrix. l H represents the error factor, I represents the identity matrix, MLP represents the multilayer perceptron, and H represents the multilayer perceptron. l-1 H represents the output tensor of the l-th graph isomorphic network layer. l-1 [t1:t T-1 [] indicates that data alignment is performed in the second time period, A through After normalization, D is the degree matrix of A;
[0024] Pooling is performed using convolutional parameters. A two-dimensional convolutional neural network (CNN) layer is used, and nodes are clustered into clusters according to a given parameter merging ratio. Nodes serve as channels for feature extraction in the CNN, and the temporal convolution kernel size is assigned to the corresponding convolution kernel size, X. l Let X be the input node embedding tensor of the l-th layer, and calculate the output embedding tensor X. l+1 The CNN is represented as:
[0025]
[0026] Here, ◇ is a valid 2D cross-correlation operator, and N represents the number of nodes in or outside the pooling module. Note that for the l-th layer, N... l Equal to internal nodes, N l+1 Equals to external nodes, weight indicates the weight ratio operation, and bias indicates the bias value;
[0027] In generating output tensor X l+1 Next, it is necessary to calculate its corresponding adjacency matrix and learn the weights W. l The shape is [N l+1 N l If [1, kernel_size] is used, then a vector V consisting of the learnable parameters of the l-th layer is generated. l ∈R l×k It is possible to compute a learnable allocation matrix. Its row corresponds to N l+1 There are N nodes or clusters, and the columns correspond to N. l Given a cluster, a matrix M and the adjacency matrix A of the input data at that layer. (l)The following equation is used to generate the output adjacency matrix A( l+1 ):
[0028]
[0029] Formulas (7) to (8) provide all the steps of time-graph pooling (TGP). In formula (7), X l+1 This represents the output cluster embedding after the aggregated input embedding, in formula (8), A (l+1) This represents the connection relationships and corresponding weights of the new cluster. Additionally, each element... This represents the connection weight between i and j.
[0030] In step 4, the spatiotemporal attention mechanism network of the photovoltaic cluster is constructed as follows:
[0031] Within the Seq2Seq framework, a spatiotemporal attention neural network is constructed. In the encoder-decoder structure, attention mechanisms are introduced from both spatial and temporal dimensions. STAN provides a spatiotemporal context vector directly aligned with the output variable. In the decoder layer, a separate spatial attention mechanism parallel to temporal attention is designed to simultaneously attend to the most relevant time steps and the most important variables. The inputs to spatial and temporal attention are spatial embeddings and temporal embeddings, respectively, and the generation of temporal and spatial embeddings is independent of each other.
[0032] Let X = [X] be a multivariate time series with N features. 1 ,X 2 ,…,X N ] T ∈R N×k Let X be a two-dimensional matrix, and k represent the length of the input sequence. 1 X represents the type of numerical weather prediction feature 1. 2 X represents the type of the second type of numerical weather prediction feature. N The type representing the Nth type of numerical weather forecast feature;
[0033] For the i-th type of numerical weather forecast feature Spatial embedding is calculated using a feedforward neural network. This represents the value of the i-th numerical weather forecast feature at the k-th time point, given the input data X = [X...]. 1 ,X 2 ,…,X N ] T The embedding calculation result of all input variables is D = [D 1 D 2 ,…,D N ] T ∈R N ×k D1 D 2 ... D N X 1 X 2 ... X N The computational result after being input into the feedforward neural network;
[0034] A feedforward neural network is used as the alignment model to calculate spatial attention weights. For output time step j, the spatial attention weights for the i-th time step are... As shown in formulas (9) and (10):
[0035]
[0036] Where [h′ j-1 ;d i ]∈R p+m , h′ j-1 ∈R p d represents the upper hidden layer state of the LSTM decoder. i ∈R m b represents the spatial embedding of the i-th feature. e The bias value representing the spatial attention weights. We represents the intermediate variable, and We represents the spatial attention weight value. The spatial context vector g is then calculated based on the spatial attention weight. j ;
[0037] For the output time step j, h is calculated using the alignment model. t Corresponding time attention weight α j t α j t It's about h t and the previous hidden layer state h′ of the decoder j-1 The function is shown in formula (11):
[0038]
[0039] Among them, h t Represents the current state of the hidden layer, b a The bias value represents the temporal attention weight, Wa represents the temporal attention weight value, [h′ j-1 h t ]∈R p+m Further based on the spatiotemporal context vector s j Calculate attention weights Spatial and temporal attention depend on the hidden layer states of the LSTM decoder—LSTM G and LSTM S In the computation space context vector g jAt that time, the hidden layer state and neuron state of LSTM are defined as h′, respectively. G and c′ G For output time step j, the input to spatial attention is the decoder hidden layer state h′. G,j-1 The calculated g j r G,j and the previous time step By splicing Input to LSTM G To update the hidden layer state h′ G,j As shown in formula (12):
[0040]
[0041] r G,j Represents the output result. Represents r G,j and the previous time step The value obtained by concatenation, W G b represents the weight value of the output result. G The bias value represents the output result;
[0042] For the LSTM time context vector s j The hidden layer and neuron states of the LSTM are h′, respectively. S ∈R p and c′ S ∈R p At time step j, h′ S,j-1 Represents the temporal attention used to compute the temporal context vector, concatenated. and r S,j And input into LSTM S Update hidden layer state h′ S,j As shown in formula (13):
[0043]
[0044] Before predicting photovoltaic power, the final step is to connect the hidden state updates of the two LSTMs to [h′]. G,j h′ S,j ], h′ G,j h′ represents the hidden layer state of the decoder. S,j This represents the temporal attention used to compute the temporal context vector.
[0045] In a graph convolutional network model, the graph structure is obtained through the Laplacian matrix and eigenvalues. The spectral convolution result on the graph is achieved by transforming the graph signal x∈R. N×1 Obtained by convolving with the graph kernel function Θ.
[0046]
[0047] in, It is a graph convolution operator, where U is the orthogonal matrix of the Fourier basis of the Laplacian eigenvalue decomposition, and Λ is the diagonal matrix of eigenvalues, Λ=diag(λ0,λ1,…,λ N-1 ), where λ0 represents the 0th eigenvalue, λ1 represents the 1st eigenvalue, and λ N-1 Representing the N-1 The eigenvalues, the Fourier coefficients of the graph, are obtained through the Fourier transform x = U T X is obtained, where L represents the Laplacian matrix, L = DA, A is the adjacency matrix, and D ∈ R is the diagonal matrix. N×N It is a degree matrix, and the normalized form of L is shown in equation (15):
[0048]
[0049] Among them, I N It is an identity matrix of dimension N×N, R N×N It is an N×N dimensional real matrix;
[0050]
[0051] in, It is a k-th order Chebyshev polynomial, when k=0, When k=1 It is an N×N real matrix, λ max It is the largest eigenvalue of the Laplace, θ k These are the k-th order Chebyshev coefficients, where K is the kernel size, which determines the maximum radius of the convolution starting from the center node.
[0052] To determine the dynamic dependence of the local space, the k-th Chebyshev inequality is... Combined with W, we get e stands for Adama, and W represents the weight value.
[0053]
[0054] Numerical characteristics of various weather forecasts include irradiance, surface temperature, temperature at 2 meters below the ground, upper-level cloud cover, mid-level cloud cover, lower-level cloud cover, humidity at 2 meters below the ground, wind speed, wind direction, and surface air pressure.
[0055] The most important numerical weather forecast features are selected as the primary features for cluster division to classify photovoltaic clusters. The most important numerical weather forecast features are those that have the greatest impact on photovoltaic power.
[0056] A photovoltaic power prediction model is trained using the top three most important numerical weather prediction features and the corresponding historical measured photovoltaic power data. Before training the model, the data is normalized.
[0057]
[0058] Where x represents the eigenvector before normalization, and x′ represents the eigenvector after normalization, x min and x max These represent the maximum and minimum values of x, respectively.
[0059] During the prediction phase, the prediction results are restored to the original power range using the inverse normalization formula, which is:
[0060] x=x'(x max -x min )+x min (twenty one).
[0061] The beneficial effects of this invention are as follows: First, the importance of various numerical weather prediction features in the historical dataset is calculated using the random forest algorithm. The most important numerical weather prediction feature is selected as the primary feature for cluster partitioning to classify photovoltaic clusters. Then, a time-dynamic graph neural network is used to divide the photovoltaic power stations in the photovoltaic clusters into several sub-clusters. Next, a topological graph network is constructed based on the geographical coordinates of the photovoltaic power stations in each sub-cluster and the numerical weather prediction feature ranked first in importance, resulting in an adjacency matrix that reflects the correlation strength between the various photovoltaic power stations. Finally, a spatiotemporal attention mechanism network for photovoltaic clusters is constructed and fused with the topological graph network to obtain a photovoltaic power prediction model. An attention mechanism network is used to assign weights to the input features of a graph convolutional network. The weighted numerical weather forecast features are then input into the graph convolutional network to obtain the final short-term predicted power of the photovoltaic cluster. Experimental verification shows that the root mean square error of the short-term photovoltaic power prediction result for this large-scale photovoltaic cluster is 0.0541, the mean absolute error is 0.0438, and the accuracy is 94.59%. Compared with the prior art, the method proposed in this invention fully considers the spatial correlation between adjacent photovoltaic power stations, has higher accuracy and stability, and its prediction accuracy is higher than that of the prior art. This provides a new method for regional power supply security and promoting the development of green new power systems. Attached Figure Description
[0062] Figure 1 This is a flowchart illustrating the short-term photovoltaic power prediction method for large-scale photovoltaic clusters according to the present invention.
[0063] Figure 2 This is a schematic diagram of the time dynamic graph neural network in the large-scale photovoltaic cluster short-term photovoltaic power prediction method of the present invention;
[0064] Figure 3 This is a graph showing the relationship between the number of clusters and the silhouette coefficient in Embodiment 4 of the present invention;
[0065] Figure 4 This is a schematic diagram of the Pearson correlation coefficient for predicting irradiance in Embodiment 4 of the present invention;
[0066] Figure 5 This is a schematic diagram of the short-term photovoltaic power prediction results of a large-scale photovoltaic cluster in Embodiment 4 of the present invention. Detailed Implementation
[0067] The present invention will now be described in detail with reference to the accompanying drawings and specific embodiments.
[0068] Example 1
[0069] A method for short-term photovoltaic power prediction of large-scale photovoltaic clusters includes the following steps:
[0070] Step 1: Collect historical datasets of photovoltaic clusters, calculate the importance of various numerical weather forecast features in the historical datasets using the random forest algorithm, and select the most important numerical weather forecast features as the primary features for cluster partitioning to classify photovoltaic clusters.
[0071] Step 2: Use a time-dynamic graph neural network to cluster the photovoltaic power stations in the photovoltaic cluster into several sub-clusters;
[0072] Step 3: Construct a topological graph network based on the geographical coordinates of the photovoltaic power stations in each sub-cluster and the numerical weather forecast feature ranked first in importance, and obtain the corresponding adjacency matrix.
[0073] Step 4: Construct the spatiotemporal attention mechanism network of the photovoltaic cluster and fuse it with the topological graph network in Step 3 to obtain the graph convolutional network model with fused spatiotemporal attention mechanism, i.e., the photovoltaic power prediction model.
[0074] Step 5: Train the photovoltaic power prediction model by using the top three most important numerical weather forecast features and the corresponding measured photovoltaic power in the historical dataset, and then obtain the predicted photovoltaic power of each sub-cluster by using the numerical weather forecast features for future periods.
[0075] Step 6: Sum the predicted power of all photovoltaic sub-clusters to obtain the final prediction result.
[0076] Example 2
[0077] A method for short-term photovoltaic power prediction for large-scale photovoltaic clusters, see [link / reference] Figure 1 This includes the following steps:
[0078] Step 1: Collect historical datasets of photovoltaic clusters, including various numerical weather forecast features and corresponding measured photovoltaic power. Calculate the importance of various numerical weather forecast features in the historical dataset using the random forest algorithm. Select the most important numerical weather forecast features as the primary features for cluster partitioning to classify photovoltaic clusters. The numerical weather forecast features that have the greatest impact on photovoltaic power are the most important numerical weather forecast features.
[0079] Numerical characteristics of various weather forecasts include irradiance, surface temperature, temperature at 2 meters below the ground, upper-level cloud cover, mid-level cloud cover, lower-level cloud cover, humidity at 2 meters below the ground, wind speed, wind direction, and surface air pressure.
[0080] Step 2: Use a time-dynamic graph neural network to cluster the photovoltaic power stations in the photovoltaic cluster into several sub-clusters. The input is the geographical coordinates of each photovoltaic power station and the most important numerical weather forecast features, and the output is the category number.
[0081] Step 3: Construct a topological graph network based on the geographical coordinates of the photovoltaic power stations in each sub-cluster and the numerical weather forecast feature ranked first in importance, and obtain the corresponding adjacency matrix.
[0082] Step 4: Construct the spatiotemporal attention mechanism network of the photovoltaic cluster and fuse it with the topological graph network in Step 3 to obtain the graph convolutional network model with spatiotemporal attention mechanism (STANGCN), which is the photovoltaic power prediction model.
[0083] Step 5: Train the photovoltaic power prediction model by using the top three most important numerical weather forecast features and the corresponding measured photovoltaic power in the historical dataset, and then obtain the predicted photovoltaic power of each sub-cluster by using the numerical weather forecast features for future periods.
[0084] Step 6: Sum the predicted power of all photovoltaic sub-clusters to obtain the final prediction result.
[0085] Example 3
[0086] A method for short-term photovoltaic power prediction of large-scale photovoltaic clusters includes the following steps:
[0087] Step 1: Collect historical datasets of photovoltaic clusters, calculate the importance of various numerical weather forecast features in the historical datasets using the random forest algorithm, and select the most important numerical weather forecast features as the primary features for cluster partitioning to classify photovoltaic clusters.
[0088] Step 2: Use a time-dynamic graph neural network to cluster the photovoltaic power stations in the photovoltaic cluster into several sub-clusters. The input is the geographical coordinates of each photovoltaic power station and the most important numerical weather forecast features, and the output is the category number.
[0089] See Figure 2 The time-based dynamic graph neural network consists of two vectors, Z and Ψ, with a length of d for each time interval t. All elements are randomly initialized learnable parameters. Z is calculated... T The product of Ψ and Ψ yields the initial adjacency matrix A of the time series, and the value of the adjacency matrix can be optimized through training:
[0090] A = Z T ·Ψ (1)
[0091] idx,idy=argtopk(A[:,:]),idx≠idy (2)
[0092] A[-idx,-idy]=0 (3)
[0093] Where Z = [z1, z2, ..., z d ], Let Z represent the random initialization of the learnable node embedding, where Z represents the geographical coordinates of the photovoltaic power station, (x, y) represents the coordinate point, z1 represents the geographical coordinates of the first photovoltaic power station, z2 represents the geographical coordinates of the second photovoltaic power station, and z... d This represents the geographical coordinates of the d-th photovoltaic power station, where Ψ represents the numerical weather prediction characteristics. The first numerical weather forecast feature within time period t, The second numerical weather prediction feature within time period t, The d-th numerical weather forecast feature within time period t, the argtopk(@) function can return the indices of the first k maximum values of the adjacency matrix A. Through formulas (2)-(3) sparse adjacency matrix, for each time period adjacency matrix, only the elements with the first k maximum weights are retained, and the other values are set to zero, which can reduce the computational cost.
[0094] Compared to static graph neural networks, dynamic graph neural networks completely separate different time-series data within the same dimension after dynamic graph transformation. In fact, the same vertex at different time periods often aggregates information from different vertex sets. A dynamic graph isomorphic network is defined as:
[0095]
[0096] in, This represents the output of the graph isomorphic network at time t in layer l for node v. This is a simple implementation of dynamic graph transformation, applicable to the case where t > 2, with edge weight w. ij Normalized to w ij ε is a learning parameter, and t represents a time point. Indicates multiple The concatenation is performed; in addition, the adjacency matrix H l The expression is as follows:
[0097]
[0098] Among them, H l Represents the adjacency matrix. Let ε represent the sum of the adjacency matrix and the identity matrix. l H represents the error factor, I represents the identity matrix, MLP represents the multilayer perceptron, and H represents the multilayer perceptron. l-1 H represents the output tensor of the l-th graph isomorphic network layer. l-1 [t1:t T-1 [] indicates that data alignment is performed in the second time period, A through After normalization, D is the degree matrix of A;
[0099] The novel Temporal Graph Pooling (TGP) combines graph pooling and temporal processes. Temporal graph pooling technology provides a solution through a hierarchical pooling approach. The core idea of this algorithm is to control the reduction of the number of nodes by learning to assign nodes to clusters.
[0100] Pooling is performed using convolutional parameters. A two-dimensional convolutional neural network (CNN) layer is used, and nodes are clustered into clusters according to a given parameter merging ratio. Nodes serve as channels for feature extraction in the CNN. To avoid disrupting the receptive field window, the temporal convolution kernel size is allocated to the corresponding convolution kernel size, X. l Let X be the input node embedding tensor of the l-th layer, and calculate the output embedding tensor X. l+1 The CNN is represented as:
[0101]
[0102] Here, ◇ is a valid 2D cross-correlation operator, and N represents the number of nodes in or outside the pooling module. Note that for the l-th layer, N... l Equal to internal nodes, N l+1 Equals to external nodes, weight indicates the weight ratio operation, and bias indicates the bias value;
[0103] In generating output tensor X l+1 Next, it is necessary to calculate its corresponding adjacency matrix and learn the weights W. l The shape is [N l+1 N l If [1, kernel_size] is used, then a vector V consisting of the learnable parameters of the l-th layer is generated. l ∈R l×k It is possible to compute a learnable allocation matrix. Its row corresponds to N l+1 There are N nodes or clusters, and the columns correspond to N. l Given a cluster, a matrix M and the adjacency matrix A of the input data at that layer. (l) The following equation is used to generate the output adjacency matrix A( l+1 ):
[0104]
[0105] Formulas (7) to (8) provide all the steps of time-graph pooling (TGP). In formula (7), X l+1 This represents the output cluster embedding after the aggregated input embedding, in formula (8), A (l+1) This represents the connection relationships and corresponding weights of the new cluster. Additionally, each element... This represents the connection weight between i and j. Therefore, the temporal graph pooling implements a hierarchical differentiable graph pooling with temporal information and optimizes the clustering aggregation method during training.
[0106] Step 3: Construct a topological graph network based on the geographical coordinates of the photovoltaic power stations in each sub-cluster and the numerical weather prediction feature ranked first in importance, and obtain the corresponding adjacency matrix. The adjacency matrix is used to describe the strength of the correlation between the photovoltaic power stations. The solved adjacency matrix is used as one of the inputs to the photovoltaic power prediction model.
[0107] Step 4: Construct the spatiotemporal attention mechanism network of the photovoltaic cluster and fuse it with the topological graph network in Step 3 to obtain the graph convolutional network model with spatiotemporal attention mechanism (STANGCN), which is the photovoltaic power prediction model.
[0108] Using this method, the spatiotemporal attention mechanism can better capture temporal and spatial features when processing sequence data, thereby improving the model's performance in processing sequence data.
[0109] In a graph convolutional network model, the graph structure is obtained through the Laplacian matrix and eigenvalues. The spectral convolution result on the graph is achieved by transforming the graph signal x∈R. N×1 Obtained by convolving with the graph kernel function Θ.
[0110]
[0111] in, It is a graph convolution operator, where U is the orthogonal matrix of the Fourier basis of the Laplacian eigenvalue decomposition, and Λ is the diagonal matrix of eigenvalues, Λ=diag(λ0,λ1,…,λ N-1 ), where λ0 represents the 0th eigenvalue, λ1 represents the 1st eigenvalue, and λ N-1 Representing the N-1The eigenvalues, the Fourier coefficients of the graph, are obtained through the Fourier transform x = U T x gives us L, which represents the Laplacian matrix, L = DA, where A is the adjacency matrix and D ∈ R. N×N L is a degree matrix, and its normalized form is shown in equation (10):
[0112]
[0113] Among them, I N It is an identity matrix of dimension N×N, R N×N It is an N×N dimensional real matrix;
[0114]
[0115] in, It is a k-th order Chebyshev polynomial, when k=0, When k=1 It is an N×N real matrix, λ max It is the largest eigenvalue of the Laplace, θ k These are the k-th order Chebyshev coefficients, where K is the kernel size, which determines the maximum radius of the convolution starting from the center node.
[0116] To determine the dynamic dependence of the local space, the k-th Chebyshev inequality is... Combined with W, we get e stands for Adama, and W represents the weight value.
[0117]
[0118] Step 5: Train the photovoltaic power prediction model by using the top three most important numerical weather forecast features and the corresponding measured photovoltaic power in the historical dataset, and then obtain the predicted photovoltaic power of each sub-cluster by using the numerical weather forecast features for future periods.
[0119] Step 6: Sum the predicted power of all photovoltaic sub-clusters to obtain the final prediction result.
[0120] Example 4
[0121] A method for short-term photovoltaic power prediction of large-scale photovoltaic clusters is presented, using measured data and numerical weather prediction of a photovoltaic cluster consisting of 30 photovoltaic power stations in a certain area as an example. The sampling interval is 15 minutes, and the total installed capacity of the photovoltaic cluster is 1395MW. The method includes the following steps:
[0122] Step 1: Collect historical datasets of the photovoltaic cluster and calculate the importance of various numerical weather prediction features in the historical dataset using the random forest algorithm. The calculation results are shown in Table 1.
[0123] Table 1. Importance of Numerical Weather Prediction Features
[0124] Feature Name Feature Importance Feature Name Feature Importance Forecast Irradiance 0.77399 Low-altitude cloud cover 0.00017 ground temperature 0.05146 Humidity at 2 meters from the ground 0.01978 Temperature at 2 meters below the ground 0.05946 wind speed 0.02750 High-altitude cloud cover 0.00659 wind direction 0.03418 Mid-level cloud cover 0.00173 Ground air pressure 0.02514
[0125] The most important numerical weather prediction features were selected as the primary features for cluster division to classify photovoltaic clusters. As shown in Table 1, the top three numerical weather prediction features in terms of importance are predicted irradiance, surface temperature, and temperature at 2 meters. Among them, the feature importance of predicted irradiance is much higher than that of other numerical weather prediction features. Therefore, predicted irradiance was selected as the primary feature for inputting the dynamic graph neural network algorithm.
[0126] Step 2: Use a time-dynamic graph neural network to cluster the photovoltaic power stations in the photovoltaic cluster into several sub-clusters. The input is the geographical coordinates of each photovoltaic power station and the most important numerical weather forecast features, and the output is the category number.
[0127] The time-based dynamic graph neural network consists of two vectors, Z and Ψ, with length d for each time interval t. All elements are randomly initialized, learnable parameters. Z is calculated... T The product of Ψ and Ψ yields the initial adjacency matrix A of the time series, and the value of the adjacency matrix can be optimized through training:
[0128] A = Z T ·Ψ (15)
[0129] idx,idy=argtopk(A[:,:]),idx≠idy (16)
[0130] A[-idx,-idy]=0 (17)
[0131] Where Z = [z1, z2, ..., z d ], Let Z represent the random initialization of the learnable node embedding, where Z represents the geographical coordinates of the photovoltaic power station, (x, y) represents the coordinate point, z1 represents the geographical coordinates of the first photovoltaic power station, z2 represents the geographical coordinates of the second photovoltaic power station, and z... d This represents the geographical coordinates of the d-th photovoltaic power station, where Ψ represents the numerical weather prediction characteristics. The first numerical weather forecast feature within time period t, The second numerical weather prediction feature within time period t, The d-th numerical weather forecast feature within time period t, the argtopk(·) function can return the index of the first k maximum values of the adjacency matrix A. Through formula (16)-(17) sparse adjacency matrix, for each time period adjacency matrix, only the elements with the first k maximum weights are retained, and the other values are set to zero, which can reduce the computational cost.
[0132] Compared to static graph neural networks, dynamic graph neural networks completely separate different time-series data within the same dimension after dynamic graph transformation. In fact, the same vertex at different time periods often aggregates information from different vertex sets. A dynamic graph isomorphic network is defined as:
[0133]
[0134] in, This represents the output of the graph isomorphic network at time t in layer l for node v. This is a simple implementation of dynamic graph transformation, applicable to the case where t > 2, with edge weight w. ij Normalized to w ij ε is a learning parameter, and t represents a time point. Indicates multiple The concatenation is performed; in addition, the adjacency matrix H l The expression is as follows:
[0135]
[0136] Among them, H l Represents the adjacency matrix. Let ε represent the sum of the adjacency matrix and the identity matrix. l H represents the error factor, I represents the identity matrix, MLP represents the multilayer perceptron, and H represents the multilayer perceptron. l-1 H represents the output tensor of the l-th graph isomorphic network layer. l-1 [t1:t T-1 [] indicates that data alignment is performed in the second time period, A through After normalization, D is the degree matrix of A;
[0137] Pooling is performed using convolutional parameters. A two-dimensional convolutional neural network (CNN) layer is used, and nodes are clustered into clusters according to a given parameter merging ratio. Nodes serve as channels for feature extraction in the CNN. To avoid disrupting the receptive field window, the temporal convolution kernel size is allocated to the corresponding convolution kernel size, X. l Let X be the input node embedding tensor of the l-th layer, and calculate the output embedding tensor X. l+1 The CNN is represented as:
[0138]
[0139] Here, ◇ is a valid 2D cross-correlation operator, and N represents the number of nodes in or outside the pooling module. Note that for the l-th layer, N... l Equal to internal nodes, N l+1 Equals to external nodes, weight indicates the weight ratio operation, and bias indicates the bias value;
[0140] In generating output tensor X l+1 Next, it is necessary to calculate its corresponding adjacency matrix and learn the weights W. l The shape is [N l+1 N l If [1, kernel_size] is used, then a vector V consisting of the learnable parameters of the l-th layer is generated. l ∈R l×k It is possible to compute a learnable allocation matrix. Its row corresponds to N l+1 There are N nodes or clusters, and the columns correspond to N. l Given a cluster, a matrix M and the adjacency matrix A of the input data at that layer. (l) The following equation is used to generate the output adjacency matrix A( l+1 ):
[0141]
[0142] Formulas (21) to (22) provide all the steps of time-graph pooling (TGP). In formula (21), X l+1 This represents the output cluster embedding after the aggregated input embedding, in formula (22), A (l+1) This represents the connection relationships and corresponding weights of the new cluster. Additionally, each element... This represents the connection weight between i and j. Therefore, the temporal graph pooling implements a hierarchical differentiable graph pooling with temporal information and optimizes the clustering aggregation method during training.
[0143] Adjacent photovoltaic (PV) power plants exhibit strong spatial correlation due to similar solar irradiance. Simply using the overall method and cumulative method to predict PV cluster power would fail to utilize this spatial correlation information. Therefore, a cluster partitioning method is employed to predict PV cluster power generation. To determine the optimal number of clusters for partitioning PV power plants, a dynamic graph neural network algorithm is used to partition the PV clusters with 2-5 clusters. The silhouette coefficient values for each cluster size are obtained, as shown below. Figure 3 As shown.
[0144] Depend on Figure 3It can be seen that the silhouette coefficient reaches its maximum value when the number of clusters is 2, therefore the silhouette coefficient is set to 2. The dynamic graph neural network algorithm is used to divide the photovoltaic clusters in southwestern China, and the division results are shown in Table 2:
[0145] Table 2 Cluster Partition Results
[0146]
[0147]
[0148] As shown in Table 2, the 30 photovoltaic power plants are divided into two sub-clusters: Cluster 1 contains 19 photovoltaic power plants with an installed capacity of 1035MW; Cluster 2 contains 11 photovoltaic power plants with an installed capacity of 360MW.
[0149] Simultaneously, the Pearson correlation coefficients between the predicted irradiance of each photovoltaic power station after clustering using the dynamic graph neural network algorithm were calculated, and graphs were plotted as follows: Figure 4 The diagram shows the Pearson correlation coefficients between the photovoltaic power stations after cluster division. As can be seen from the diagram, the predicted irradiance correlation coefficients between each sub-cluster are high and relatively concentrated, which fully demonstrates the effectiveness of the DAEGC algorithm's cluster division results.
[0150] Step 3: Construct a topological graph network based on the geographical coordinates of the photovoltaic power stations in each sub-cluster and the numerical weather prediction feature ranked first in importance, and obtain the corresponding adjacency matrix. The adjacency matrix is used to describe the strength of the correlation between the photovoltaic power stations. The solved adjacency matrix is used as one of the inputs to the photovoltaic power prediction model.
[0151] Step 4: Construct the spatiotemporal attention mechanism network of the photovoltaic cluster and fuse it with the topological graph network in Step 3 to obtain the graph convolutional network model with spatiotemporal attention mechanism (STANGCN), which is the photovoltaic power prediction model.
[0152] The spatiotemporal attention mechanism network for photovoltaic clusters is constructed as follows:
[0153] Within the Seq2Seq framework, a spatiotemporal attention neural network is constructed. In the encoder-decoder structure, attention mechanisms are introduced from both spatial and temporal dimensions to enhance the attention paid to spatial and temporal features during the training phase. STAN provides spatiotemporal context vectors directly aligned with the output variables. In the decoder layer, a separate spatial attention mechanism parallel to temporal attention is designed to simultaneously attend to the most relevant time steps and the most important variables. The inputs to spatial and temporal attention are spatial embeddings and temporal embeddings, respectively, and the generation of temporal and spatial embeddings is independent of each other.
[0154] Let X = [X] be a multivariate time series with N features.1 ,X 2 ,…,X N ] T ∈R N×k Let X be a two-dimensional matrix, and k represent the length of the input sequence. 1 X represents the type of numerical weather prediction feature 1. 2 X represents the type of the second type of numerical weather prediction feature. N The type representing the Nth type of numerical weather forecast feature;
[0155] For the i-th type of numerical weather forecast feature Spatial embedding is calculated using a feedforward neural network. This represents the value of the i-th numerical weather forecast feature at the k-th time point, given the input data X = [X...]. 1 ,X 2 ,…,X N ] T The embedding calculation result of all input variables is D = [D 1 D 2 ,…,D N ] T ∈R N ×k D 1 D 2 ... D N X 1 X 2 ... X N The computational result after being input into the feedforward neural network;
[0156] A feedforward neural network is used as the alignment model to calculate spatial attention weights. For output time step j, the spatial attention weights for the i-th time step are... As shown in formulas (23) and (24):
[0157]
[0158] Where [h′ j-1 ;d i ]∈R p+m , h′ j-1 ∈R p d represents the upper hidden layer state of the LSTM decoder. i ∈R m b represents the spatial embedding of the i-th feature. e The bias value representing the spatial attention weights. We represents the intermediate variable, and We represents the spatial attention weight value. The spatial context vector g is then calculated based on the spatial attention weight. j ;
[0159] For the output time step j, h is calculated using the alignment model. t Corresponding time attention weights It's about h t and the previous hidden layer state h′ of the decoder j-1 The function is shown in formula (25):
[0160]
[0161] Among them, h t Represents the current state of the hidden layer, b a The bias value represents the temporal attention weight, Wa represents the temporal attention weight value, [h′ j-1 h t ]∈R p+m Further based on the spatiotemporal context vector s j Calculate attention weights Spatial and temporal attention depend on the hidden layer states of the LSTM decoder—LSTM G and LSTM S In the computation space context vector g j At that time, the hidden layer state and neuron state of LSTM are defined as h′, respectively. G and c′ G For output time step j, the input to spatial attention is the decoder hidden layer state h′. G,j-1 The calculated g j r G,j and the previous time step By splicing Input to LSTM G To update the hidden layer state h′ G,j As shown in formula (26):
[0162]
[0163] r G,j Represents the output result. Represents r G,j and the previous time step The value obtained by concatenation, W G b represents the weight value of the output result. G The bias value represents the output result;
[0164] For the LSTM time context vector s j The hidden layer and neuron states of the LSTM are h′, respectively. S ∈R p and c′ S ∈R p At time step j, h′ S,j-1Represents the temporal attention used to compute the temporal context vector, concatenated. and r S,j And input into LSTM S Update hidden layer state h′ S,j As shown in formula (27):
[0165]
[0166] Before predicting photovoltaic power, the final step is to connect the hidden state updates of the two LSTMs to [h′]. G,j h′ S,j ], h′ G,j h′ represents the hidden layer state of the decoder. S,j This represents the temporal attention used to compute the temporal context vector.
[0167] This method is used to better capture temporal features: the spatiotemporal attention mechanism allows the model to better capture temporal and spatial features when processing sequence data, further improving the model's performance when processing sequence data.
[0168] In a graph convolutional network model, the graph structure is obtained through the Laplacian matrix and eigenvalues. The spectral convolution result on the graph is achieved by transforming the graph signal x∈R. N×1 Obtained by convolving with the graph kernel function Θ.
[0169]
[0170] in, It is a graph convolution operator, where U is the orthogonal matrix of the Fourier basis of the Laplacian eigenvalue decomposition, and Λ is the diagonal matrix of eigenvalues, Λ=diag(λ0,λ1,…,λ N-1 ), where λ0 represents the 0th eigenvalue, λ1 represents the 1st eigenvalue, and λ N-1 Representing the N-1 The eigenvalues, the Fourier coefficients of the graph, are obtained through the Fourier transform X = U. T X is obtained, where L represents the Laplacian matrix, L = DA, A is the adjacency matrix, and D ∈ R is the diagonal matrix. N×N L is a degree matrix, and its normalized form is shown in equation (29):
[0171]
[0172] Among them, I N It is an identity matrix of dimension N×N, R N×N It is an N×N dimensional real matrix;
[0173]
[0174] in, It is a k-th order Chebyshev polynomial, when k=0, When k=1 It is an N×N real matrix, λ max It is the largest eigenvalue of the Laplace, θ k These are the k-th order Chebyshev coefficients, where K is the kernel size, which determines the maximum radius of the convolution starting from the center node.
[0175] To determine the dynamic dependence of the local space, the k-th Chebyshev inequality T is... k (L°) and W are combined to obtain e stands for Adama, and W represents the weight value.
[0176]
[0177] Step 5: Train the photovoltaic power prediction model. Obtain the predicted power of each photovoltaic sub-cluster based on the numerical weather forecast characteristics for future time periods. Sum the predicted powers of all photovoltaic sub-clusters to obtain the final prediction result, as detailed below:
[0178] To standardize the units of measurement and improve computational efficiency, the max-min normalization method is used to normalize the input and output data. Taking a certain feature x as an example, the principle of normalization is as follows:
[0179]
[0180] Where x′ represents the normalized feature vector, x min and x max These represent the maximum and minimum values of x, respectively. During the prediction phase, the prediction results are restored to the original power range based on the inverse normalization formula. The inverse normalization principle is shown in formula (40):
[0181] x=x'(x max -x min )+x min (35)
[0182] The predicted irradiance, ground temperature, and 2-meter altitude temperature of the two sub-clusters were input into the TimesNet model for training. The training, validation, and test sets were configured in proportions of 70%, 10%, and 20%, respectively. The photovoltaic power prediction model was then used to predict the photovoltaic power of each sub-cluster. Finally, the predicted photovoltaic power of the two sub-clusters was summed to obtain the final predicted photovoltaic power for the entire photovoltaic cluster. The photovoltaic power prediction model uses a 24-hour single-step prediction timescale. Key hyperparameters of the photovoltaic power prediction model are shown in Table 3. The final short-term prediction results are as follows: Figure 5 As shown, by Figure 5 As can be seen, the predicted curve of photovoltaic power can accurately track the actual curve with a high accuracy rate.
[0183] Table 3 Training Parameters
[0184] hidden_size epoch batch_size learning_rate dropout 128 50 64 0.001 0.15
[0185] In Table 3, hidden_size refers to the number of hidden units, epoch refers to the period, that is, the number of times the entire training dataset is learned by the model, batch_size refers to the number of samples selected in one training session, learning_rate refers to the learning rate, and dropout refers to the rate of neurons dropped during model training.
[0186] The predicted value represents the photovoltaic power value predicted by the photovoltaic power prediction model in this invention, while the actual value represents the actual photovoltaic power value. Figure 5 It can be seen that the prediction curve of the short-term photovoltaic power prediction method for photovoltaic clusters can track the actual power curve relatively accurately with small error.
[0187] Error analysis was performed on the predicted photovoltaic power, and the root mean square error was calculated using the following formula:
[0188]
[0189] The formula for calculating the mean absolute error is:
[0190]
[0191] The formula for calculating accuracy is:
[0192]
[0193] In the formula, R rmse R represents the root mean square error. mae Let y represent the mean absolute error, r represent the accuracy, and y represent the mean absolute error. i This represents the actual power at time i. Represents the predicted power at time i, n represents the test set length, and Cap represents the actual installed capacity of the photovoltaic power plant.
[0194] The short-term photovoltaic power prediction method for large-scale photovoltaic clusters of the present invention is compared with the prediction methods disclosed in five Chinese patents in the background art. The prediction results and comparison of each prediction method are shown in Table 4.
[0195] Table 4. Prediction Results and Comparison of Various Prediction Methods
[0196]
[0197] Table 4 shows that prediction method 1 uses the distributed photovoltaic cluster power prediction method disclosed in Chinese patent CN118487275A, prediction method 2 uses the distributed photovoltaic cluster power prediction method based on deep similarity clustering disclosed in Chinese patent CN118313496A, prediction method 3 uses the method based on photovoltaic cluster division to improve the accuracy of photovoltaic cluster power prediction disclosed in Chinese patent CN118157231A, prediction method 4 uses the photovoltaic cluster prediction method disclosed in Chinese patent CN117217357A, and prediction method 5 uses the distributed photovoltaic cluster power prediction method disclosed in Chinese patent CN114447916A. As can be seen from Table 4, compared with existing prediction methods, the large-scale photovoltaic cluster short-term photovoltaic power prediction method of this invention has the lowest error, with an RMSE of 0.0541, a MAE of 0.0438, and an accuracy of 94.59%. It exhibits stable prediction performance and higher accuracy, making a greater contribution to ensuring regional power supply capacity.
Claims
1. A method for short-term photovoltaic power prediction of large-scale photovoltaic clusters, characterized in that, Includes the following steps: Step 1: Collect historical datasets of photovoltaic clusters, calculate the importance of various numerical weather forecast features in the historical datasets using the random forest algorithm, and select the most important numerical weather forecast features as the primary features for cluster partitioning to classify photovoltaic clusters. Step 2: Use a time-dynamic graph neural network to cluster the photovoltaic power stations in the photovoltaic cluster into several sub-clusters; Step 3: Construct a topological graph network based on the geographical coordinates of the photovoltaic power stations in each sub-cluster and the numerical weather forecast feature ranked first in importance, and obtain the corresponding adjacency matrix. Step 4: Construct the spatiotemporal attention mechanism network of the photovoltaic cluster and fuse it with the topological graph network in Step 3 to obtain the graph convolutional network model with fused spatiotemporal attention mechanism, i.e., the photovoltaic power prediction model. Step 5: Train the photovoltaic power prediction model using the top three most important numerical weather forecast features and the corresponding measured photovoltaic power in the historical dataset, and then obtain the predicted photovoltaic power of each sub-cluster using the numerical weather forecast features for future periods. Step 6: Sum the predicted power of all photovoltaic sub-clusters to obtain the final prediction result.
2. The method for short-term photovoltaic power prediction of large-scale photovoltaic clusters according to claim 1, characterized in that, In step 2, a time-dynamic graph neural network is used to cluster the photovoltaic power stations in the photovoltaic cluster. The input is the geographical coordinates of each photovoltaic power station and the most important numerical weather forecast features, and the output is the category number.
3. The method for short-term photovoltaic power prediction of large-scale photovoltaic clusters according to claim 2, characterized in that, The time-based dynamic graph neural network includes two vectors, Z and Ψ, of length d for each time interval t. All elements are randomly initialized learnable parameters. Z is calculated... T The product of Ψ and Ψ yields the initial adjacency matrix A of the time series: A=Z T ·Ψ (1) idx,idy=argtopk(A[:,:]),idx≠idy (2) A[-idx,-idy]=0 (3) Where Z = [z1, z2, ..., z d ], Let Z represent the random initialization of the learnable node embedding, where Z represents the geographical coordinates of the photovoltaic power station, (x, y) represents the coordinate point, z1 represents the geographical coordinates of the first photovoltaic power station, z2 represents the geographical coordinates of the second photovoltaic power station, and z... d This represents the geographical coordinates of the d-th photovoltaic power station, where Ψ represents the numerical weather prediction characteristics. The first numerical weather forecast feature within time period t, The second numerical weather prediction feature within time period t, The d-th numerical weather forecast feature within time period t, the argtopk(·) function can return the indices of the first k maximum values of the adjacency matrix A. Through formulas (2)-(3) sparse adjacency matrix, for each time period adjacency matrix, only the elements with the first k maximum weights are retained, and the other values are set to zero. Dynamic graph neural networks completely separate different time-series data in the same dimension after dynamic graph transformation. The same vertex in different time periods typically aggregates information from different vertex sets. A dynamic graph isomorphic network is defined as follows: in, This represents the output of the graph isomorphic network at time t in layer l for node v. This is a simple implementation of dynamic graph transformation, applicable to the case where t > 2, with edge weight w. ij Normalized to w ij ε is a learning parameter, and t represents a time point. Indicates multiple The concatenation is performed; in addition, the adjacency matrix H l The expression is as follows: Among them, H l Represents the adjacency matrix. Let ε represent the sum of the adjacency matrix and the identity matrix. l H represents the error factor, I represents the identity matrix, MLP represents the multilayer perceptron, and H represents the multilayer perceptron. l-1 H represents the output tensor of the l-th graph isomorphic network layer. l-1 [t1:t T-1 [] indicates that data alignment is performed in the second time period, A through After normalization, D is the degree matrix of A; Pooling is performed using convolutional parameters. A two-dimensional convolutional neural network (CNN) layer is used, and nodes are clustered into clusters according to a given parameter merging ratio. Nodes serve as channels for feature extraction in the CNN, and the temporal convolution kernel size is assigned to the corresponding convolution kernel size, X. l Let X be the input node embedding tensor of the l-th layer, and calculate the output embedding tensor X. l+1 The CNN is represented as: Here, ◇ is a valid 2D cross-correlation operator, and N represents the number of nodes in or outside the pooling module. Note that for the l-th layer, N... l Equal to internal nodes, N l+1 Equals to external nodes, weight indicates the weight ratio operation, and bias indicates the bias value; In generating output tensor X l+1 Next, it is necessary to calculate its corresponding adjacency matrix and learn the weights W. l The shape is [N l+1 N l If [1, kernel_size] is used, then a vector V consisting of the learnable parameters of the l-th layer is generated. l ∈R l×k It is possible to compute a learnable allocation matrix. Its row corresponds to N l+1 There are N nodes or clusters, and the columns correspond to N. l Given a cluster, a matrix M and the adjacency matrix A of the input data at that layer. (l) The following equation is used to generate the output adjacency matrix A( l+1 ): Formulas (7) to (8) provide all the steps of time-graph pooling (TGP). In formula (7), X l+1 This represents the output cluster embedding after the aggregated input embedding, in formula (8), A (l+1) This represents the connection relationships and corresponding weights of the new cluster. Additionally, each element... This represents the connection weight between i and j.
4. The method for short-term photovoltaic power prediction of large-scale photovoltaic clusters according to claim 3, characterized in that, In step 4, the spatiotemporal attention mechanism network of the photovoltaic cluster is constructed as follows: Within the Seq2Seq framework, a spatiotemporal attention neural network is constructed. In the encoder-decoder structure, attention mechanisms are introduced from both spatial and temporal dimensions. STAN provides a spatiotemporal context vector directly aligned with the output variable. In the decoder layer, a separate spatial attention mechanism parallel to temporal attention is designed to simultaneously attend to the most relevant time steps and the most important variables. The inputs to spatial and temporal attention are spatial embeddings and temporal embeddings, respectively, and the generation of temporal and spatial embeddings is independent of each other. Let X = [X] be a multivariate time series with N features. 1 ,X 2 ,…,X N ] T ∈R N×k Let X be a two-dimensional matrix, and k represent the length of the input sequence. 1 X represents the type of numerical weather prediction feature 1. 2 X represents the type of the second type of numerical weather prediction feature. N The type representing the Nth type of numerical weather forecast feature; For the i-th type of numerical weather forecast feature Spatial embedding is calculated using a feedforward neural network. This represents the value of the i-th numerical weather forecast feature at the k-th time point, given the input data X = [X...]. 1 ,X 2 ,…,X N ] T The embedding calculation result of all input variables is D = [D 1 D 2 ,…,D N ] T ∈R N×k D 1 D 2 ... D N X 1 X 2 ... X N The computational result after being input into the feedforward neural network; A feedforward neural network is used as the alignment model to calculate spatial attention weights. For output time step j, the spatial attention weights for the i-th time step are... As shown in formulas (9) and (10): Where [h′ j-1 ;d i ]∈R p+m , h′ j-1 ∈R p d represents the upper hidden layer state of the LSTM decoder. i ∈R m b represents the spatial embedding of the i-th feature. e The bias value representing the spatial attention weights. We represents the intermediate variable, and We represents the spatial attention weight value. The spatial context vector g is then calculated based on the spatial attention weight. j ; For the output time step j, h is calculated using the alignment model. t Corresponding time attention weights It's about h t and the previous hidden layer state h′ of the decoder j-1 The function is shown in formula (11): Among them, h t Represents the current state of the hidden layer, b a The bias value represents the temporal attention weight, Wa represents the temporal attention weight value, [h′ j-1 h t ]∈R p+m Further based on the spatiotemporal context vector s j Calculate attention weights Spatial and temporal attention depend on the hidden layer states of the LSTM decoder—LSTM G and LSTM S In the computation space context vector g j At that time, the hidden layer state and neuron state of LSTM are defined as h′, respectively. G and c′ G For output time step j, the input to spatial attention is the decoder hidden layer state h′. G,j-1 The calculated g j , will r G,j and the previous time step By splicing Input to LSTM G To update the hidden layer state h′ G,j As shown in formula (12): r G,j Represents the output result. Represents r G,j and the previous time step The value obtained by concatenation, W G b represents the weight value of the output result. G The bias value representing the output result; For the LSTM time context vector s j The hidden layer and neuron states of the LSTM are h′, respectively. S ∈R p and c′ S ∈R p At time step j, h′ S,j-1 Represents the temporal attention used to compute the temporal context vector, concatenated. and r S,j And input into LSTM S Update hidden layer state h′ S,j As shown in formula (13): Before predicting photovoltaic power, the final step is to connect the hidden state updates of the two LSTMs to [h′]. G,j h′ S,j ], h′ G,j h′ represents the hidden layer state of the decoder. S,j This represents the temporal attention used to compute the temporal context vector.
5. The method for short-term photovoltaic power prediction of large-scale photovoltaic clusters according to claim 4, characterized in that, In the graph convolutional network model, the graph structure is obtained through the Laplacian matrix and eigenvalues. The spectral convolution result on the graph is achieved by transforming the graph signal x∈R. N×1 Obtained by convolving with the graph kernel function Θ. in, It is a graph convolution operator, where U is the orthogonal matrix of the Fourier basis of the Laplacian eigenvalue decomposition, and Λ is the diagonal matrix of eigenvalues, Λ=diag(λ0,λ1,…,λ N-1 ), where λ0 represents the 0th eigenvalue, λ1 represents the 1st eigenvalue, and λ N-1 Representing the N-1 The eigenvalues, the Fourier coefficients of the graph, are obtained through the Fourier transform x = U T x gives us L, which represents the Laplacian matrix, L = DA, where A is the adjacency matrix and D ∈ R. N×N It is a degree matrix, and the normalized form of L is shown in equation (15): Among them, I N It is an identity matrix of dimension N×N, R N×N It is an N×N dimensional real matrix; in, It is a k-th order Chebyshev polynomial, when k=0, When k=1 It is an N×N real matrix, λ max It is the largest eigenvalue of the Laplace, θ k These are the k-th order Chebyshev coefficients, where K is the kernel size, which determines the maximum radius of the convolution starting from the center node.
6. The method for short-term photovoltaic power prediction of large-scale photovoltaic clusters according to claim 5, characterized in that, To determine the dynamic dependence of the local space, the k-th Chebyshev inequality is... Combined with W, we get e stands for Adama, and W represents the weight value.
7. The method for short-term photovoltaic power prediction of large-scale photovoltaic clusters according to claim 1, characterized in that, Numerical characteristics of various weather forecasts include irradiance, surface temperature, temperature at 2 meters below the ground, upper-level cloud cover, mid-level cloud cover, lower-level cloud cover, humidity at 2 meters below the ground, wind speed, wind direction, and surface air pressure.
8. The method for short-term photovoltaic power prediction of large-scale photovoltaic clusters according to claim 1, characterized in that, The most important numerical weather forecast features are selected as the primary features for cluster division to classify photovoltaic clusters. The most important numerical weather forecast features are those that have the greatest impact on photovoltaic power.
9. The method for short-term photovoltaic power prediction of large-scale photovoltaic clusters according to claim 1, characterized in that, Before training the photovoltaic power prediction model, data normalization is performed: Where x represents the eigenvector before normalization, and x′ represents the eigenvector after normalization, x min and x max These represent the maximum and minimum values of x, respectively. During the prediction phase, the prediction results are restored to the original power range using the inverse normalization formula, which is: x=x'(x max -x min )+x min (21)。