Multi-site photovoltaic power ultra-short-term prediction method, device, equipment, medium and product
By introducing a multi-scale dynamic graph structure learning module and a spatiotemporal convolution module into the spatiotemporal graph neural network, combined with diffusion graph convolution, the problem that static graph structure cannot capture dynamic spatial dependencies is solved, and the accuracy of ultra-short-term prediction of photovoltaic power is significantly improved.
Patent Information
- Application Number
- CN202411308121.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-19
- Publication Date
- 2025-04-01
AI Technical Summary
When modeling spatial correlations in the current space-time graph neural network, the graph structure used is static and cannot effectively capture the spatial dependence relationship of dynamic changes between photovoltaic sites, resulting in low accuracy of ultra-short-term prediction results of photovoltaic power.
A multi-scale dynamic spatiotemporal graph neural network is adopted to construct a multi-scale dynamic graph structure in real time through the dynamic graph structure learning module, combining the spatiotemporal convolution module and diffusion graph convolution, digging out the spatiotemporal features of different scales and integrating dynamic spatial dependencies to perform ultra-short-term prediction of multi-site photovoltaic power.
It significantly improves the accuracy of power ultra-short-term prediction results of multiple photovoltaic sites, can effectively characterize the rich dynamic spatial dependence between photovoltaic sites, and improves prediction performance.
Smart Images

Figure CN119743093A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of deep learning technology, and in particular to a multi-site photovoltaic power ultra-short-term prediction method, device, equipment, medium and product. Background Art
[0002] With the deployment and promotion of a series of major strategic initiatives such as "dual carbon" and energy transformation, new energy power generation technology has developed rapidly. Among them, photovoltaic power generation has the advantages of safety, efficiency, economy and environmental protection, and its installed capacity has increased year by year. However, affected by uncontrollable meteorological factors such as solar irradiance and relative humidity, photovoltaic output is highly intermittent, volatile and non-stable. Large-scale photovoltaic power generation connected to the grid will cause system peak regulation, current reverse transmission and other problems that threaten the safe and stable operation of the power grid. Therefore, conducting ultra-short-term prediction research on photovoltaic power can effectively reduce the impact of photovoltaic output uncertainty on the power grid, while also improving the photovoltaic absorption rate, which has important scientific research significance and engineering application value.
[0003] At present, with the development of artificial intelligence technology, Graph Neural Network (GNN) has shown excellent performance in modeling spatial correlation of non-Euclidean structured data. Spatial-Temporal Graph Neural Network (STGNN) combined with temporal feature extraction networks such as Temporal Convolutional Network (TCN), Long Short-Term Memory Network (LSTM), and Gated Recurrent Units (GRU) is widely used in traffic flow, meteorology, wind power and other prediction fields. By modeling the temporal and spatial correlations at the same time, the prediction performance is significantly improved.
[0004] However, when the current STGNN performs spatial correlation modeling, it usually predefines the graph structure based on prior information such as actual geographic location information and mutual information coefficient, or constructs an adaptive graph based on learnable node embedding. However, both predefined and adaptive graphs are static graphs. Affected by uncontrollable meteorological factors such as cloud formation and displacement, the spatial dependency between photovoltaic sites changes dynamically and changes significantly at the ultra-short-term prediction time scale, resulting in low accuracy of ultra-short-term power prediction results for multiple photovoltaic sites. Summary of the invention
[0005] The purpose of this application is to provide a multi-site photovoltaic power ultra-short-term prediction method, device, equipment, medium and product, which can improve the accuracy of ultra-short-term power prediction results of multiple photovoltaic sites.
[0006] To achieve the above objectives, this application provides the following solutions:
[0007] In the first aspect, the present application provides a multi-site photovoltaic power ultra-short-term prediction method, which is applied to a pre-constructed multi-scale dynamic spatiotemporal graph neural network, wherein the multi-scale dynamic spatiotemporal graph neural network includes at least a dynamic graph structure learning module, a spatiotemporal convolution module, a fusion module, and an output module. The multi-site photovoltaic power ultra-short-term prediction method includes:
[0008] The power data of the photovoltaic sites are respectively subjected to hollow causal convolution by the multiple spatiotemporal convolution layers in the spatiotemporal convolution module to obtain the convolutional spatiotemporal features of each photovoltaic site; wherein there are multiple photovoltaic sites, and the spatiotemporal convolution layers correspond to the photovoltaic sites one by one;
[0009] The long-term pattern node embedding data and each of the convolutional spatiotemporal features are processed by the dynamic graph structure learning module to obtain a target dynamic adjacency matrix corresponding to each of the spatiotemporal convolutional layers; wherein the long-term pattern node embedding data is obtained based on the power data of each of the photovoltaic sites;
[0010] Performing diffusion graph convolution on the convolutional spatiotemporal features corresponding to the spatiotemporal convolutional layer and the target dynamic adjacency matrix through each of the spatiotemporal convolutional layers to obtain the diffusion spatiotemporal features corresponding to each of the spatiotemporal convolutional layers;
[0011] The diffusion spatiotemporal features are fused by the fusion module to obtain fused spatiotemporal features;
[0012] The fused spatiotemporal features are input into the output module to obtain the multi-site photovoltaic power ultra-short-term prediction results output by the output module.
[0013] Optionally, each of the spatiotemporal convolutional layers includes a temporal convolutional network and a graph convolutional network, and performing a hole causal convolution on the power data of a target photovoltaic site through a target spatiotemporal convolutional layer in the spatiotemporal convolutional module to obtain a target convolutional spatiotemporal feature of the target photovoltaic site specifically includes:
[0014] Obtain a target number of layers of a target spatiotemporal convolution layer in the spatiotemporal convolution module;
[0015] Determining a dilated causal convolution corresponding to the target spatiotemporal convolution layer according to the target number of layers; wherein a convolution kernel of the dilated causal convolution is a preset size, and a receptive field of the dilated causal convolution corresponds to the target number of layers;
[0016] The power data of a target photovoltaic site is convolved by the temporal convolutional network based on the void causal convolution to obtain the target convolutional spatiotemporal features of the target photovoltaic site.
[0017] Optionally, performing diffusion graph convolution on the target convolutional spatiotemporal features corresponding to the target spatiotemporal convolutional layer and a target dynamic adjacency matrix through the target spatiotemporal convolutional layer to obtain the target diffusion spatiotemporal features corresponding to the target spatiotemporal convolutional layer specifically includes:
[0018] Determining a degree matrix corresponding to the target dynamic adjacency matrix;
[0019] The graph convolution network performs diffuse graph convolution on preset feature selector parameters, the target convolution spatiotemporal features corresponding to the target spatiotemporal convolution layer, the target dynamic adjacency matrix and the degree matrix to obtain the target diffuse spatiotemporal features corresponding to the target spatiotemporal convolution layer.
[0020] Optionally, the dynamic graph structure learning module includes a plurality of dynamic graph structure learning submodules, and the dynamic graph learning submodules correspond to the spatiotemporal convolutional layers one by one. The long-term pattern node embedding data and a target convolutional spatiotemporal feature are processed by the dynamic graph structure learning module to obtain a target dynamic adjacency matrix corresponding to the target spatiotemporal convolutional layer, specifically including:
[0021] Perform linear transformation on the target convolutional spatiotemporal matrix to obtain real-time node features;
[0022] The target dynamic graph structure learning submodule corresponding to the target spatiotemporal convolution layer fuses the long-term pattern node embedding data and the real-time node features to obtain an initial dynamic adjacency matrix corresponding to the target spatiotemporal convolution layer;
[0023] Processing the initial dynamic adjacency matrix based on a multi-head attention mechanism to obtain a second dynamic adjacency matrix;
[0024] The long-term pattern node embedding data, the initial dynamic adjacency matrix and the second dynamic adjacency matrix are processed to obtain a target dynamic adjacency matrix corresponding to the target spatiotemporal convolutional layer.
[0025] Optionally, the processing of the initial dynamic adjacency matrix based on the multi-head attention mechanism to obtain a second dynamic adjacency matrix specifically includes:
[0026] Get the preset zoom factor and preset number;
[0027] Based on the scaling factor, the initial dynamic adjacency matrix is linearly transformed a preset number of times to obtain a plurality of dynamic sub-adjacency matrices; wherein the number of the dynamic sub-adjacency matrices is the preset number;
[0028] Performing cosine similarity calculation and regularization processing on the multiple dynamic sub-adjacency matrices to obtain a first dynamic adjacency matrix; wherein the first dynamic adjacency matrix contains multiple processed dynamic sub-adjacency matrices;
[0029] The first dynamic adjacency matrix after linear transformation and summation is processed by the Relu function to obtain a second dynamic adjacency matrix.
[0030] Optionally, the processing of the long-term pattern node embedding data, the initial dynamic adjacency matrix and the second dynamic adjacency matrix to obtain a target dynamic adjacency matrix corresponding to the target spatiotemporal convolutional layer specifically includes:
[0031] Normalizing the second dynamic adjacency matrix and the initial dynamic adjacency matrix after linear transformation and cosine similarity calculation to obtain a third dynamic adjacency matrix;
[0032] Normalizing the third dynamic adjacency matrix and the third dynamic adjacency matrix that has been subjected to the multi-layer perceptron to obtain a fourth dynamic adjacency matrix;
[0033] The fourth dynamic adjacency matrix and the long-term pattern node embedding data calculated by cosine similarity are processed to obtain a target dynamic adjacency matrix corresponding to the target spatiotemporal convolutional layer.
[0034] In the second aspect, the present application provides a multi-site photovoltaic power ultra-short-term prediction device, which is applied to a pre-constructed multi-scale dynamic spatiotemporal graph neural network, wherein the multi-scale dynamic spatiotemporal graph neural network includes at least a dynamic graph structure learning module, a spatiotemporal convolution module, a fusion module, and an output module. The multi-site photovoltaic power ultra-short-term prediction device includes:
[0035] A void causal convolution unit, used to perform void causal convolution on the power data of the photovoltaic sites respectively through the multiple spatiotemporal convolution layers in the spatiotemporal convolution module to obtain the convolutional spatiotemporal features of each photovoltaic site; wherein there are multiple photovoltaic sites, and the spatiotemporal convolution layers correspond to the photovoltaic sites one by one;
[0036] A processing unit, used to process the long-term pattern node embedding data and each of the convolutional spatiotemporal features through the dynamic graph structure learning module to obtain a target dynamic adjacency matrix corresponding to each of the spatiotemporal convolutional layers; wherein the long-term pattern node embedding data is obtained based on the power data of each of the photovoltaic sites;
[0037] A diffusion graph convolution unit, used for performing diffusion graph convolution on the convolutional spatiotemporal features corresponding to the spatiotemporal convolutional layer and the target dynamic adjacency matrix through each of the spatiotemporal convolutional layers, so as to obtain the diffusion spatiotemporal features corresponding to each of the spatiotemporal convolutional layers;
[0038] A fusion unit, used for fusing each of the diffusion spatiotemporal features through the fusion module to obtain a fused spatiotemporal feature;
[0039] The input unit is used to input the fused spatiotemporal features into the output module to obtain the multi-site photovoltaic power ultra-short-term prediction results output by the output module.
[0040] In a third aspect, the present application provides a computer device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of any one of the multi-site photovoltaic power ultra-short-term prediction methods described above.
[0041] In a fourth aspect, the present application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of any of the multi-site photovoltaic power ultra-short-term prediction methods described above.
[0042] In a fifth aspect, the present application provides a computer program product, including a computer program, which, when executed by a processor, implements the steps of any of the multi-site photovoltaic power ultra-short-term prediction methods described above.
[0043] According to the specific embodiments provided in this application, this application discloses the following technical effects:
[0044] The present application provides a multi-site photovoltaic power ultra-short-term prediction method, device, equipment, medium and product, which effectively mines the spatiotemporal features at different scales through a spatiotemporal convolution module of stacked spatiotemporal convolution layers; and the output of each spatiotemporal convolution layer is input to a fusion module, which effectively integrates the spatiotemporal dependencies of each scale, and makes a final prediction through the output module, wherein the graph structure at each scale is inferred in real time according to a dynamic graph structure learning module based on an attention mechanism, and in order to effectively model dynamic spatial dependencies, the dynamic graph structure learning module will also incorporate node embeddings that can represent long-term patterns, which can effectively represent the rich dynamic spatial dependencies between photovoltaic sites, construct a dynamic graph structure scale by scale, and model spatiotemporal dependencies, thereby significantly improving the accuracy of ultra-short-term power prediction results for multiple photovoltaic sites. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0046] Figure 1This is a flow chart of a multi-site photovoltaic power ultra-short-term prediction method in one embodiment of the present application;
[0047] Figure 2 A schematic diagram of a framework of a multi-scale dynamic spatiotemporal graph neural network provided in one embodiment of the present application;
[0048] Figure 3 A schematic diagram of a flow chart of dynamic graph structure learning provided in one embodiment of the present application;
[0049] Figure 4 A flowchart of a multi-head attention mechanism method provided in one embodiment of the present application;
[0050] Figure 5 A schematic diagram of a partial prediction result of a photovoltaic site 7 provided in an embodiment of the present application;
[0051] Figure 6 A schematic diagram of partial prediction results of a photovoltaic site 7 at different prediction step sizes provided in one embodiment of the present application;
[0052] Figure 7 A schematic diagram of a multi-scale dynamic graph structure provided in one embodiment of the present application;
[0053] Figure 8 A schematic diagram of edge weight changes of a multi-scale dynamic graph structure provided by an embodiment of the present application;
[0054] Fig. 9 A schematic diagram of functional modules of a multi-site photovoltaic power ultra-short-term prediction device provided in one embodiment of the present application.
[0055] Fig.10 A schematic diagram of the structure of a computer device provided in one embodiment of the present application. DETAILED DESCRIPTION
[0056] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of this application.
[0057] In order to make the above-mentioned objects, features and advantages of the present application more obvious and easy to understand, the present application is further described in detail below with reference to the accompanying drawings and specific implementation methods.
[0058] In an exemplary embodiment, Figure 1As shown, a multi-site photovoltaic power ultra-short-term prediction method is provided, which is executed by a computer device, specifically, it can be executed by a computer device such as a terminal or a server alone, or it can be executed by a terminal and a server together. The method is applied to a pre-built multi-scale dynamic spatiotemporal graph neural network (Multi-Scale Dynamic Spatial-Temporal Graph Neural Network, MDSTGNN), and the multi-scale dynamic spatiotemporal graph neural network includes at least a dynamic graph structure learning module, a spatiotemporal convolution module, a fusion module and an output module. Please refer to Figure 2 , Figure 2 A schematic diagram of a framework of a multi-scale dynamic spatiotemporal graph neural network provided in one embodiment of the present application. The method includes the following steps 101 to 105. Among them:
[0059] Step 101: Perform atrous causal convolution on the power data of the photovoltaic sites respectively through multiple spatiotemporal convolution layers in the spatiotemporal convolution module to obtain convolutional spatiotemporal features of each photovoltaic site.
[0060] In the embodiment of the present application, there are multiple photovoltaic sites, and the spatiotemporal convolutional layers correspond to the photovoltaic sites one by one. Each of the spatiotemporal convolutional layers includes a temporal convolutional network and a graph convolutional network.
[0061] This application performs ultra-short-term prediction of multi-site photovoltaic power. At time t, the historical power sequence of multiple photovoltaic sites is recorded as Where T is the recorded historical time step; N is the number of photovoltaic sites; is the power data of the photovoltaic site, that is, the power value of the i-th photovoltaic site at time t. Therefore, at time t, the power generation of each site at the next h time is predicted based on historical data. The problem can be described as:
[0062]
[0063] In the formula, f is the fitting function to be learned, and θ is the corresponding parameter;
[0064] When applying GNN to model the spatial dependency between photovoltaic sites, each photovoltaic site is regarded as a node in the graph, and the power value of the site is regarded as a graph signal or node feature. The graph structure G = (V, E). V is the node set; E is the set of edges between node pairs. Adjacency matrix It is the mathematical representation of G, storing the association between each pair of nodes in G, that is, the weight of the corresponding edge. i ,v j )∈E, then A ij >0; otherwise A ij= 0. The MDSTGNN method proposed in the present invention constructs a multi-scale dynamic graph in a purely data-driven manner without any prior knowledge. Therefore, the multi-site photovoltaic power ultra-short-term prediction problem can be restated as:
[0065]
[0066] In the formula, is the graph structure at the kth scale to be learned at time t.
[0067] The framework of the MDSTGNN multi-site photovoltaic power prediction method proposed in this invention is as follows: Figure 2 As shown in the figure, it mainly includes four parts: dynamic graph structure learning module, spatiotemporal convolution module, fusion module, and output module. Among them, the spatiotemporal convolution module is composed of K layers of spatiotemporal convolution layers stacked together. Each spatiotemporal convolution layer is composed of TCN and Graph Convolutional Network (GCN). TCN learns temporal features; GCN captures the spatial features between photovoltaic sites based on the dynamic graph structure inferred in real time by the dynamic graph structure learning module. In order to accelerate the convergence speed during model training, each spatiotemporal convolution layer also uses residual connection. Note that each level of spatiotemporal convolution layer mines spatiotemporal dependencies of different scales. For example, the output of the first spatiotemporal convolution layer represents short-term spatiotemporal dependencies, and the output of the last spatiotemporal convolution layer represents long-term spatiotemporal dependencies. The spatiotemporal features of each scale are jump-connected to the fusion module and effectively integrated through linear layers and Relu activation functions. Finally, the output module maps the integrated spatiotemporal features of each scale to the desired dimension to complete the final prediction. In addition, to control the quality of the graph structure, the graph structure learning losses at each scale are combined with the final prediction loss to complete the end-to-end optimization of the MDSTGNN.
[0068] As an optional implementation, step 101 performs a hole causal convolution on the power data of a target photovoltaic site through a target spatiotemporal convolution layer in the spatiotemporal convolution module to obtain the target convolution spatiotemporal features of the target photovoltaic site, which may specifically include:
[0069] Obtain a target number of layers of a target spatiotemporal convolution layer in the spatiotemporal convolution module;
[0070] Determining a dilated causal convolution corresponding to the target spatiotemporal convolution layer according to the target number of layers; wherein a convolution kernel of the dilated causal convolution is a preset size, and a receptive field of the dilated causal convolution corresponds to the target number of layers;
[0071] The power data of a target photovoltaic site is convolved by the temporal convolutional network based on the void causal convolution to obtain the target convolutional spatiotemporal features of the target photovoltaic site.
[0072] Among them, in this implementation method, TCN specifically uses causal hole convolution to mine the spatiotemporal characteristics of photovoltaic power data. By using causal hole convolution, the sliding input of values on certain time steps is skipped, and the causal hole convolution increases exponentially with the network depth, and the receptive field increases exponentially. TCN can mine long time series features with fewer network layers, thereby reducing the resource occupation of TCN.
[0073] In the embodiment of the present application, TCN is a one-dimensional CNN method for time series. Unlike RNN and its variants such as LSTM, GRU and other recurrent neural network structures, TCN processes time series in a non-recursive manner, can be calculated in parallel, and can alleviate the problems of gradient explosion and low efficiency when processing long time series. For the ultra-short-term prediction of photovoltaic power, the instantaneity and uncertainty require faster training and reasoning speeds, and the fast-responding TCN is obviously more applicable.
[0074] TCN specifically uses a causal hole convolutional network to mine the temporal characteristics of photovoltaic power data. In order to avoid data leakage in the future and improve the actual deployment capability of the model, the causal order in time is maintained by filling the edges of the input, and the prediction at the current time step only involves historical data. By using the hole factor, skipping the sliding input of values at certain time steps, and increasing the hole factor exponentially with the network depth, the receptive field increases exponentially, and TCN can mine long time series features with fewer network layers. In each spatiotemporal convolutional layer of the present invention, at time t, for the power data of each photovoltaic site after edge filling, The number of output channels is C k , a one-dimensional convolutional neural network (CNN) with a convolution kernel size of 1×R 1×R , the dilated causal convolution operation can be expressed as:
[0075]
[0076] In the formula, * represents the convolution operation, K represents the target number of layers; q is the dilation factor, which is used to control the time step jump distance and increases exponentially with the number of spatiotemporal convolution layers. If TCN stacks K layers of causal dilated convolutions, the convolution kernel size is 1×R, and the receptive field F size can be calculated as:
[0077]
[0078] In addition, inspired by the gating mechanism, in order to control the information flow in the spatiotemporal convolution layer, the TCN of the present invention performs two parallel causal dilated convolution operations, and then multiplies them element by element after passing through two nonlinear activation functions, namely:
[0079]
[0080] Where f' 1×R and f" 1×R are two one-dimensional CNNs with the same convolution kernel size and number of output channels; ξ is the Tanh function, which is used to increase the nonlinear fitting ability of TCN; ⊙ is the element-by-element multiplication operation; σ is the Sigmoid function, which is used to control the information ratio flowing into the next spatiotemporal convolution layer. Note that N PV sites share TCN in each spatiotemporal convolution layer, and the output of TCN is the target convolutional spatiotemporal feature of the target PV site.
[0081] Step 102: Process the long-term pattern node embedding data and each of the convolutional spatiotemporal features through the dynamic graph structure learning module to obtain a target dynamic adjacency matrix corresponding to each of the spatiotemporal convolutional layers.
[0082] Please also read Figure 3 and Figure 4 , Figure 3 A schematic diagram of a flow chart of dynamic graph structure learning provided in one embodiment of the present application; Figure 4 A flowchart of a multi-head attention mechanism method provided for one embodiment of the present application.
[0083] In the embodiment of the present application, the long-term mode node embedding data is obtained based on the power data of each photovoltaic site. The dynamic graph structure learning module includes a plurality of dynamic graph structure learning submodules, and the dynamic graph learning submodules correspond to the spatiotemporal convolutional layers one by one.
[0084] As an optional implementation, step 102 processes the long-term pattern node embedding data and a target convolutional spatiotemporal feature through the dynamic graph structure learning module to obtain a target dynamic adjacency matrix corresponding to the target spatiotemporal convolutional layer, which may specifically include:
[0085] Perform linear transformation on the target convolutional spatiotemporal matrix to obtain real-time node features;
[0086] The target dynamic graph structure learning submodule corresponding to the target spatiotemporal convolution layer fuses the long-term pattern node embedding data and the real-time node features to obtain an initial dynamic adjacency matrix corresponding to the target spatiotemporal convolution layer;
[0087] Processing the initial dynamic adjacency matrix based on a multi-head attention mechanism to obtain a second dynamic adjacency matrix;
[0088] The long-term pattern node embedding data, the initial dynamic adjacency matrix and the second dynamic adjacency matrix are processed to obtain a target dynamic adjacency matrix corresponding to the target spatiotemporal convolutional layer.
[0089] Among them, by implementing this implementation method, the long-term spatial dependency between photovoltaic sites can be inferred through the introduced long-term pattern node embedding data, which can be used as the inductive bias of the dynamic adjacency matrix to stabilize the dynamic graph structure and ensure that the dynamic adjacency matrix follows relatively stable long-term pattern fluctuations.
[0090] like Figure 3 As shown in the figure, the dynamic graph structure learning module uses the attention mechanism to measure the correlation between photovoltaic sites in real time and scale by scale, and construct an adjacency matrix, that is, a graph structure. To improve the expression ability, the present invention adopts a multi-head approach to infer the correlation between nodes from multiple subspaces. In addition, considering that the dynamic spatial correlation is not a random fluctuation, but is constrained by a relatively stable long-term pattern, the present invention incorporates a node embedding that can characterize the long-term pattern. (i.e., long-term pattern node embedding data). In each spatiotemporal convolutional layer, GRU is used to integrate real-time node features and node embeddings to construct a long-term pattern inferred based on node embeddings, and use it as an inductive bias for the dynamic graph structure. Note that current research shows that node embedding E is a low-dimensional representation of node features in the graph, d<<N, and it is effective and feasible to infer relatively stable long-term spatial dependency patterns based on E.
[0091] Specifically, if Figure 3 As shown in FIG, inspired by the GRU's use of a gating mechanism to effectively fuse long-term and short-term information, the present invention regards the real-time node features in each spatiotemporal convolutional layer as short-term information and the node embedding as long-term information. The fusion process of the two is as follows:
[0092]
[0093] In the formula, is the real-time node feature, output by TCN Linear transformation; and are the linear transformation weights and biases to be learned respectively; ⊙ is the element-by-element multiplication operation; σ is the Sigmoid nonlinear activation function, with a value range of (0,1); ξ is the Tanh nonlinear activation function, with a value range of (-1,1). It is the information fusion result (i.e., the initial dynamic adjacency matrix corresponding to the target spatiotemporal convolutional layer), which contains both short-term information and relatively stable long-term information.
[0094] Optionally, the method of processing the initial dynamic adjacency matrix based on the multi-head attention mechanism to obtain the second dynamic adjacency matrix may specifically include:
[0095] Get the preset zoom factor and preset number;
[0096] Based on the scaling factor, the initial dynamic adjacency matrix is linearly transformed a preset number of times to obtain a plurality of dynamic sub-adjacency matrices; wherein the number of the dynamic sub-adjacency matrices is the preset number;
[0097] Performing cosine similarity calculation and regularization processing on the multiple dynamic sub-adjacency matrices to obtain a first dynamic adjacency matrix; wherein the first dynamic adjacency matrix contains multiple processed dynamic sub-adjacency matrices;
[0098] The first dynamic adjacency matrix after linear transformation and summation is processed by the Relu function to obtain a second dynamic adjacency matrix.
[0099] Among them, by implementing this implementation method, the numerical stability during the model training process can be improved by scaling factors, and by regularizing multiple dynamic sub-adjacency matrices calculated by cosine similarity, the generalization ability of the model can be improved to avoid overfitting of the dynamic sub-adjacency matrix.
[0100] In the present application embodiment, Figure 4 As shown, based on the multi-head attention mechanism, the information fusion result is linearly transformed L times (i.e., the preset number), and then the cosine similarity function is used to calculate the first dynamic adjacency matrix, that is:
[0101]
[0102] Where <·,·> is the cosine similarity function; is the linear transformation parameter; d l is a scaling factor used to improve the numerical stability of the model during training; the Dropout function regularizes the connection matrix to improve the generalization ability of the model and avoid overfitting. The L subspace learning results are superimposed after linear transformation, and then the second dynamic adjacency matrix is output through the Relu activation function, that is:
[0103]
[0104] In the formula, is a linear transformation function.
[0105] Furthermore, the method of processing the long-term pattern node embedding data, the initial dynamic adjacency matrix and the second dynamic adjacency matrix to obtain the target dynamic adjacency matrix corresponding to the target spatiotemporal convolutional layer may specifically include:
[0106] Normalizing the second dynamic adjacency matrix and the initial dynamic adjacency matrix after linear transformation and cosine similarity calculation to obtain a third dynamic adjacency matrix;
[0107] Normalizing the third dynamic adjacency matrix and the third dynamic adjacency matrix that has been processed by a multi-layer perceptron (MLP) to obtain a fourth dynamic adjacency matrix;
[0108] The fourth dynamic adjacency matrix and the long-term pattern node embedding data calculated by cosine similarity are processed to obtain a target dynamic adjacency matrix corresponding to the target spatiotemporal convolutional layer.
[0109] In this implementation, skip connections and MLP can be introduced to avoid the double exponential convergence of the adjacency matrix to a rank 1 matrix.
[0110] In the embodiment of the present application, inspired by Transformer, the present invention further introduces skip connections and MLP to avoid the double exponential convergence of the adjacency matrix to the rank 1 matrix. The calculation formula of the third dynamic adjacency matrix is:
[0111]
[0112] The calculation formula of the fourth dynamic adjacency matrix is:
[0113]
[0114] Where LN represents the layer normalization function to stabilize the training process of the model; is a linear transformation parameter; MLP consists of two fully connected layers and a Relu nonlinear activation function. Note that the present invention uses the long-term and short-term information fusion results The skip connection is obtained by linear transformation of
[0115] Finally, the long-term spatial dependency between PV sites is inferred based on the node embedding E, which is used as the inductive bias of the real-time adjacency matrix to stabilize the dynamic graph structure and ensure that it follows relatively stable long-term pattern fluctuations. The calculation formula of the target dynamic adjacency matrix is:
[0116]
[0117] In the formula,<E,E> Represents long-term patterns; the Relu function is used to eliminate negative values in the association relationship; the Softmax function is used to normalize the association relationship. For the final dynamic adjacency matrix, store the dynamic graph In addition, it is noted that the current attention mechanism is usually used to capture the optimal node representation, but the present invention is used to measure the association relationship between nodes and construct a dynamic graph structure.
[0118] In addition, in the process of constructing MDSTGNN, in order to avoid excessive reliance on initialization during graph structure learning and to ensure the quality of graph structure learning, that is, to control the smoothness, connectivity, and sparsity of the graph structure, the present invention introduces graph structure learning loss during model training, and together with the prediction loss, completes the end-to-end optimization of MDSTGNN parameters. Specifically, considering that GCN is a special form of Laplace smoothing, in order to ensure the similarity between neighboring nodes, the quadratic term of the Laplace matrix is introduced as a regularization constraint; in order to ensure the sparsity of the graph structure and avoid too many model parameters and overfitting, the F norm of the graph structure is further introduced as an additional constraint, namely:
[0119]
[0120] In the formula, the first term is the regularity constraint; the second term is the additional constraint; represents the weight of the edge between photovoltaic sites i and j. The regularization constraint is used to control the smoothness and connectivity of the graph structure. From the above formula, it can be seen that when the regularization constraint is minimized, the model will have a good relationship with the distance between nodes. When it is larger, create an edge weight with a larger value exist Build a bigger one when you are smaller Therefore, regular constraints will ensure that the information between neighbor nodes tends to be consistent, that is, the graph information is smooth.
[0121] Step 103, performing diffusion graph convolution on the convolutional spatiotemporal features corresponding to the spatiotemporal convolutional layer and the target dynamic adjacency matrix through each of the spatiotemporal convolutional layers, to obtain the diffusion spatiotemporal features corresponding to each of the spatiotemporal convolutional layers.
[0122] As an optional implementation, step 103 performs diffusion graph convolution on the target convolutional spatiotemporal features corresponding to the target spatiotemporal convolutional layer and the target dynamic adjacency matrix through the target spatiotemporal convolutional layer to obtain the target diffusion spatiotemporal features corresponding to the target spatiotemporal convolutional layer. Specifically, the method may include:
[0123] Determining a degree matrix corresponding to the target dynamic adjacency matrix;
[0124] The graph convolution network performs diffuse graph convolution on preset feature selector parameters, the target convolution spatiotemporal features corresponding to the target spatiotemporal convolution layer, the target dynamic adjacency matrix and the degree matrix to obtain the target diffuse spatiotemporal features corresponding to the target spatiotemporal convolution layer.
[0125] Among them, by implementing this implementation method, the diffusion graph convolution can make the graph signal diffuse on the graph structure. During the diffusion process, the graph signal propagates between neighborhood nodes with a certain transfer probability, and reaches information distribution equilibrium after a finite number of diffusion steps. Each node can obtain the updated node representation of each node by aggregating and filtering the information of itself and its neighboring nodes, thereby improving the efficiency of obtaining the target diffusion spatiotemporal features.
[0126] In the embodiments of the present application, the GCN method is divided into two categories: spectral domain and spatial domain. The spectral domain method converts data to the spectral domain for processing based on graph theory. The spatial domain method directly defines the convolution operation in space and updates the node representation by convolution with the features of the neighboring nodes. Due to its greater flexibility and efficiency, the spatial domain GCN method has attracted widespread attention in recent years.
[0127] Diffusion convolution is a commonly used spatial domain GCN method. Its convolution process is regarded as a diffusion process of graph signals on the graph structure. During the diffusion process, the graph signal propagates between neighboring nodes with a certain transfer probability and reaches information distribution equilibrium after a finite number of diffusion steps. Each node can obtain an updated node representation of each node by aggregating and filtering the information of itself and its neighboring nodes. In the present invention, the dynamic adjacency matrix can be regarded as the transition probability in the diffusion process. Therefore, when the input is given, the output of TCN is The formula for diffusion spatiotemporal characteristics can be:
[0128]
[0129] Where D t k Yes A t k The degree matrix of is a diagonal matrix, and parameter It is a feature selector that filters out the important information generated by S diffusion steps. is the updated node feature, which contains temporal and spatial dependency information. In addition, it is noted that in the extreme case where there is no dependency between photovoltaic sites, aggregating neighbor node information will bring useless noise to model training. At this time, the diffusion graph convolution can be adjusted by adjusting the parameters Only the information of each node itself is retained.
[0130] Step 104: fuse the diffusion spatiotemporal features through the fusion module to obtain a fused spatiotemporal feature.
[0131] In the embodiment of the present application, each spatiotemporal convolution layer captures the spatiotemporal features of a specific scale of photovoltaic power data, and the spatiotemporal convolution module stacked with K layers of spatiotemporal convolution layers mines the multi-scale spatiotemporal features from short-term to long-term changes. k=1,2,...,K. The fusion module consists of a linear layer and a Relu activation function, which effectively integrates the mined spatiotemporal features of each scale. Specifically, the temporal features of each scale are superimposed after linear transformation and then output through the Relu activation function to obtain the fused spatiotemporal features, namely:
[0132]
[0133] In the formula, is the linear transformation parameter on the kth scale. The fused spatiotemporal features Among them, C fus It is the hidden dimension that integrates spatiotemporal features.
[0134] Step 105: input the fused spatiotemporal features into the output module to obtain the multi-site photovoltaic power ultra-short-term prediction results output by the output module.
[0135] In the embodiment of the present application, the output module is composed of 2 layers of standard convolution Conv with a convolution kernel size of 1×1 and a Relu activation function. The output of the fusion module is input into the output module to obtain the final multi-site photovoltaic power ultra-short-term prediction result, that is:
[0136]
[0137] At this point, the mean absolute error (MAE) is selected as the prediction loss function, and the end-to-end optimization goal of the present invention is:
[0138]
[0139] Where θ is the MDSTGNN model parameter to be optimized; λ is the graph structure learning loss coefficient; l pre and l gl is the prediction error and graph structure learning loss on the training set Ω, which can be calculated as:
[0140]
[0141] Where |Ω| is the number of samples in the training set; and Y t+h,i They represent the predicted value and the corresponding true value of PV site i on the tth sample respectively.
[0142] For example, simulation verification is carried out based on a public photovoltaic data set, as shown in Table 1. This data set is historical data of 137 photovoltaic sites in Alabama, USA, every 10 minutes in 2016, with a total of 52,560 data points.
[0143] Table 1 Dataset information
[0144] Dataset Date range Data Points Resolution Number of photovoltaic sites Photovoltaic 2016.01.01-2016.12.31 52560 10min 137
[0145] Please also read Figure 5 , Figure 6 , Figure 7 as well as Figure 8 , Figure 5 A schematic diagram of a partial prediction result of a photovoltaic site 7 provided in an embodiment of the present application; Figure 6 A schematic diagram of partial prediction results of a photovoltaic site 7 at different prediction step sizes provided in one embodiment of the present application; Figure 7 A schematic diagram of a multi-scale dynamic graph structure provided in one embodiment of the present application; Figure 8 A schematic diagram of edge weight changes of a multi-scale dynamic graph structure provided by an embodiment of the present application.
[0146] 1. Model parameters and evaluation index settings
[0147] When training the MDSTGNN model, all the data in the dataset are divided into three subsets: training set, validation set, and test set in a ratio of 6:2:2, and the three subsets are Z-score normalized using the mean and standard deviation of the training set. The historical time step is set to T=168; the prediction time step h∈{3,6,12,24}. In addition, the total number of training epochs is set to 50; the mini-batch size is 64; and the learning rate is 0.001. All trainable parameters of the MDSTGNN model are optimized by back propagation using the Adam optimization algorithm. In addition, the optimal hyperparameters are obtained by grid search and cross-validation on the validation set. Among them, the hidden dimension of the node embedding is d=0; in the multi-head attention mechanism, the scaling factor d l =8, number of linear transformations L = 4; number of spatiotemporal convolution layers K = 3; hidden layer dimensions C for each TCN and GCN k =16, k=1,2,...,K; the hidden dimension of each scale linear transformation of the fusion module is 16; in the output module, the number of output channels of the first and second convolution layers are 256 and 1 respectively; the dropout probability is 0.3; the dynamic graph structure learning loss coefficient λ=0.001.
[0148] In addition, the present invention uses two evaluation indicators, Root Relative Squared Error (RRSE) and Coefficient Correlation (CR), to measure the prediction performance of the model. The expressions of the two are as follows:
[0149]
[0150] In the formula, Г represents the test set; and Y iare the predicted photovoltaic power and the corresponding true value of photovoltaic site i in the test set, i = 1, 2, ..., N; Y is the true value of photovoltaic power of all photovoltaic sites in the test; mean is the average value calculation operation. The smaller the RRSE value, the better the prediction performance of the model. On the contrary, the smaller the CR value, the worse the model performance.
[0151] 2. Contrast method settings
[0152] The comparison method uses three categories: traditional statistical methods, DL methods and STGNN methods. Among them, the traditional statistical method uses three models: Auto-Regressive (AR), temporal regularized matrix factorization (TRMF) autoregression and Gaussian process (GP). The DL method uses the VAR-MLP model combining AR and MLP, the RNN-GRU combination model, the LSTNet model combining CNN and RNN, and the TPA-LSTM model that uses the attention mechanism to learn the importance weights of variables at each time step. The STGNN method improves the prediction performance by using GNN to model spatial correlation. The present invention uses the widely used AGCRN and MTGNN models as comparison benchmarks. Among them, MTGNN uses TCN and hybrid jump propagation GNN to model time and space features; AGCRNN replaces the linear conversion unit in RNN with GCN to model time and space features at each time step. Both construct adjacency matrices based on node embedding, only learn graph structures of a single scale, and the graph structure is static. Note that the above models are widely used for performance comparison of photovoltaic public data sets, and the present invention directly adopts their experimental results.
[0153] 3. Analysis of experimental results
[0154] The prediction results of each prediction model are shown in Table 2. Analysis shows that (1) TPA-LSTM has a better prediction performance than traditional statistical methods and other DL methods because it models the importance of each historical time step and photovoltaic site. (2) The two STGNN comparison methods, AGCRN and MTGNN, are better than the statistical and DL prediction methods, indicating the importance of modeling spatial correlation. (3) The MDSTGNN prediction method proposed in the present invention is better than the two GNN comparison methods, further indicating the importance of modeling multi-scale dynamic graph structures and effectively characterizing the rich time-varying correlations between actual photovoltaic sites. The graph structures constructed by the two STGNN comparison methods, AGCRN and MTGNN, based on node embedding are static and single. The MDSTGNN method can fully characterize the multi-scale time-varying spatial correlations between actual photovoltaic sites based on real-time inference of multi-scale graph structures, thereby improving the prediction accuracy. (4) In addition, it can be observed that as the prediction step size h increases, the prediction difficulty increases, and the prediction performance of each method decreases, but the MDSTGNN method still always obtains the best prediction results.
[0155] Table 2 Comparison of prediction performance of different models
[0156]
[0157] To further verify the superiority of the MDSTGNN prediction method, taking photovoltaic site 7 as an example, we visualize some prediction results of the MDSTGNN and MTGNN methods on the test set when the prediction step size h = 6, as shown in the figure below: Figure 6 As shown in the figure, it can be observed that MDSTGNN has better prediction effect in complex situations where photovoltaic output changes suddenly. Compared with the MTGNN suboptimal STGNN comparison method, MDSTGNN can effectively perceive the sudden change and the predicted value is closer to the true value. The prediction results of photovoltaic site 7 under different prediction steps are shown in the figure. Figure 5 As shown in Table 2, it can be observed that, consistent with the conclusion of Table 2, as the prediction step length h increases, the prediction performance of the MDSTGNN method decreases due to the increase in prediction difficulty, and the prediction results are increasingly far away from the true value.
[0158] In order to deeply analyze the effectiveness of the multi-scale dynamic graph structure in the MDSTGNN method in capturing rich spatial features, the graph structures of various scales on a sample in the visual test set are shown in Figure 2. Figure 7As shown in the figure. It can be observed that (1) the graph structures at the three scales all show autocorrelation characteristics, and the elements in the diagonal positions are all non-zero, which is consistent with the characteristics of the actual photovoltaic power time series data. (2) There are vertical lines in all three subgraphs, and the vertical lines in the two subgraphs (a) and (b) are more obvious, such as nodes 3, 14, 45, 96, 120 in (a) and nodes 28 and 96 in (b). This indicates that the multi-scale dynamic graph structure is sparse, and most nodes are not associated with many nodes, but only with the nodes corresponding to the vertical line part. (3) In addition, the graph structure of each scale captures the spatial characteristics of different scales. The graph structure at scale 1 captures short-term spatial correlation. While each PV site captures the autocorrelation of its own power data, it also pays attention to the association with neighboring nodes, and the edge weight distinction between each node pair is more obvious; the graph structure at scale 2 captures medium- and long-term spatial correlation. Compared with scale 1, the edge weight distinction between node pairs at scale 2 is weakened; the graph structure at scale 3 captures long-term spatial correlation. The edge weights between each node pair are almost the same, that is, each PV site has the same long-term output mode.
[0159] To further explore the dynamic patterns of multi-scale graph structures, taking PV sites 1 and 31 as examples, we visualize some of the original power data of the two PV sites on the test set and the corresponding multi-scale dynamic edge weights, as shown in Figure 2. Figure 8 As shown. It can be observed that (1) the graph structure of each scale changes dynamically, showing periodicity and directionality, and is able to capture the sudden changes in photovoltaic output in a timely manner and adaptively adjust the corresponding edge weights. It can be seen from the two subgraphs (b) and (c) that the edge weights of node pairs in the dynamic graph structure show a daily periodic change pattern, which is consistent with the daily periodic change pattern of photovoltaic power in Figure (a). In addition, the dynamic graph structure is directed, and the edge weights from node 1 to node 31 and from node 31 to node 1 in the three subgraphs (b)-(d) are different. (2) In addition, by observing the three subgraphs (b)-(d), it can be found that the edge weights of node pairs at the three scales are different, capturing the spatial correlations at different scales, which is consistent with Figure 7 The conclusions obtained in are consistent. Scale 1 captures short-term spatial correlation, and the edge weights from node 1 to node 31 and from node 31 to node 1 change dynamically; Scale 2 captures medium- and long-term spatial correlation, and the edge weights from node 1 to node 31 change dynamically, but the edge weight from node 31 to node 1 is relatively stable, almost 0; Scale 3 captures long-term spatial correlation, and the edge weights from node 1 to node 31 and from node 31 to node 1 are relatively stable, remaining fixed.
[0160] The MDSTGNN multi-site photovoltaic power ultra-short-term prediction method proposed in the present invention overcomes the problem that the current research graph structure is static and single, and cannot fully characterize the rich time-varying correlation between actual photovoltaic sites, and the prediction accuracy is limited. By designing a spatiotemporal convolution module with stacked spatiotemporal convolution layers, the spatiotemporal features of rows at each scale are effectively mined. After the fusion module integrates the spatiotemporal features of each scale, the final prediction is made through the output module. Among them, the dynamic graph structure on each time convolution layer is inferred in real time based on real-time power data and node embedding by using the attention mechanism. In order to ensure the quality of graph structure learning, the graph structure learning loss is introduced, and the dynamic graph structure learning loss at multiple scales is combined with the prediction error to complete the end-to-end optimization of the MDSTGNN parameters. The simulation experimental results show that compared with traditional statistical methods, DL methods, and the two currently popular STGNN methods of MTGNN and AGCRN, the MDSTGNN method obtains better prediction performance at different prediction steps.
[0161] Implementing the above-mentioned steps 101 to 105 can effectively characterize the rich dynamic spatial dependencies between photovoltaic sites, construct a dynamic graph structure scale by scale, and model spatiotemporal dependencies, thereby significantly improving the accuracy of ultra-short-term power prediction results of multiple photovoltaic sites. In addition, the present application can also reduce the resource usage of TCN. In addition, the present application can also ensure that the dynamic adjacency matrix follows relatively stable long-term pattern fluctuations. In addition, the present application can also improve the generalization ability of the model and avoid overfitting of the dynamic sub-adjacency matrix. In addition, the present application can also avoid the double exponential convergence of the adjacency matrix to a rank 1 matrix. In addition, the present application can also improve the efficiency of obtaining the target diffusion spatiotemporal characteristics.
[0162] The present application also provides an application scenario, which applies the above-mentioned multi-site photovoltaic power ultra-short-term prediction method. Specifically: The multi-site photovoltaic power ultra-short-term prediction method provided in this embodiment can be applied in the ultra-short-term power prediction scenario between photovoltaic sites. By acquiring the power data of each photovoltaic site and processing it with a pre-built multi-scale dynamic spatiotemporal graph neural network, the predicted power of each photovoltaic site in the ultra-short term future can be predicted, thereby significantly improving the accuracy of the ultra-short-term power prediction results of multiple photovoltaic sites.
[0163] Based on the same inventive concept, the embodiment of the present application also provides a multi-site photovoltaic power ultra-short-term prediction device for implementing the multi-site photovoltaic power ultra-short-term prediction method involved above. Applied to a pre-constructed multi-scale dynamic spatiotemporal graph neural network, the multi-scale dynamic spatiotemporal graph neural network includes at least a dynamic graph structure learning module, a spatiotemporal convolution module, a fusion module and an output module. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method. Therefore, the specific limitations in one or more multi-site photovoltaic power ultra-short-term prediction device embodiments provided below can refer to the limitations of the multi-site photovoltaic power ultra-short-term prediction method above, and will not be repeated here.
[0164] In an exemplary embodiment, Fig. 9 As shown, a multi-site photovoltaic power ultra-short-term prediction device is provided, comprising:
[0165] The void causal convolution unit 901 is used to perform void causal convolution on the power data of the photovoltaic sites through the multiple spatiotemporal convolution layers in the spatiotemporal convolution module to obtain the convolutional spatiotemporal features of each photovoltaic site; wherein there are multiple photovoltaic sites, and the spatiotemporal convolution layers correspond to the photovoltaic sites one by one;
[0166] The processing unit 902 is used to process the long-term mode node embedding data and each of the convolutional spatiotemporal features through the dynamic graph structure learning module to obtain a target dynamic adjacency matrix corresponding to each of the spatiotemporal convolutional layers; wherein the long-term mode node embedding data is obtained based on the power data of each of the photovoltaic sites;
[0167] A diffusion graph convolution unit 903 is used to perform diffusion graph convolution on the convolutional spatiotemporal features corresponding to the spatiotemporal convolution layer and the target dynamic adjacency matrix through each of the spatiotemporal convolution layers to obtain diffusion spatiotemporal features corresponding to each of the spatiotemporal convolution layers;
[0168] A fusion unit 904, configured to fuse the diffusion spatiotemporal features through the fusion module to obtain a fused spatiotemporal feature;
[0169] The input unit 905 is used to input the fused spatiotemporal features into the output module to obtain the multi-site photovoltaic power ultra-short-term prediction results output by the output module.
[0170] The implementation of the above-mentioned implementation method can effectively characterize the rich dynamic spatial dependencies between photovoltaic sites, construct a dynamic graph structure scale by scale, and model the spatiotemporal dependencies, thereby significantly improving the accuracy of the ultra-short-term power prediction results of multiple photovoltaic sites.
[0171] In an exemplary embodiment, a computer device is provided. The computer device may be a server or a terminal. The internal structure diagram thereof may be as follows: Fig.10 As shown. The computer device includes a processor, a memory, an input / output interface (Input / Output, referred to as I / O) and a communication interface. The processor, the memory and the input / output interface are connected through a system bus, and the communication interface is connected to the system bus through the input / output interface. The processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store video tag processing data. The input / output interface of the computer device is used to exchange information between the processor and an external device. The communication interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a multi-site photovoltaic power ultra-short-term prediction method is implemented.
[0172] Those skilled in the art will understand that Fig.10 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0173] In an exemplary embodiment, a computer device is further provided, including a memory and a processor, wherein a computer program is stored in the memory, and the processor implements the steps in the above-mentioned method embodiments when executing the computer program.
[0174] In an exemplary embodiment, a computer-readable storage medium is provided, storing a computer program, and when the computer program is executed by a processor, the steps in the above method embodiments are implemented.
[0175] In an exemplary embodiment, a computer program product is provided, including a computer program, and when the computer program is executed by a processor, the steps in the above method embodiments are implemented.
[0176] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, stored data, displayed data, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of relevant data must comply with relevant regulations.
[0177] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM may be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).
[0178] The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. The non-relational database may include a distributed database based on blockchain, etc., but is not limited thereto. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but is not limited thereto.
[0179] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0180] This article uses specific examples to illustrate the principles and implementation methods of this application. The description of the above embodiments is only used to help understand the method and core ideas of this application. At the same time, for those skilled in the art, according to the ideas of this application, there will be changes in the specific implementation methods and application scope. In summary, the content of this specification should not be understood as limiting this application.
Claims
1. A multi-site photovoltaic power ultra-short-term prediction method, characterized in that: Applied to a pre-built multi-scale dynamic space-time graph neural network, the multi-scale dynamic space-time graph neural network includes at least a dynamic graph structure learning module, a space-time convolution module, a fusion module and an output module. The multi-site photovoltaic power ultra-short-term prediction method includes: The power data of the photovoltaic sites are respectively subjected to hollow causal convolution by the multiple spatiotemporal convolution layers in the spatiotemporal convolution module to obtain the convolutional spatiotemporal features of each photovoltaic site; wherein there are multiple photovoltaic sites, and the spatiotemporal convolution layers correspond to the photovoltaic sites one by one; The long-term pattern node embedding data and each of the convolutional spatiotemporal features are processed by the dynamic graph structure learning module to obtain a target dynamic adjacency matrix corresponding to each of the spatiotemporal convolutional layers; wherein the long-term pattern node embedding data is obtained based on the power data of each of the photovoltaic sites; Performing diffusion graph convolution on the convolutional spatiotemporal features corresponding to the spatiotemporal convolutional layer and the target dynamic adjacency matrix through each of the spatiotemporal convolutional layers to obtain the diffusion spatiotemporal features corresponding to each of the spatiotemporal convolutional layers; The diffusion spatiotemporal features are fused by the fusion module to obtain fused spatiotemporal features; The fused spatiotemporal features are input into the output module to obtain the multi-site photovoltaic power ultra-short-term prediction results output by the output module.
2. The multi-site photovoltaic power ultra-short-term prediction method according to claim 1, characterized in that: Each of the spatiotemporal convolutional layers includes a temporal convolutional network and a graph convolutional network. The target spatiotemporal convolutional layer in the spatiotemporal convolutional module performs a hollow causal convolution on the power data of a target photovoltaic site to obtain the target convolutional spatiotemporal features of the target photovoltaic site, specifically including: Obtain a target number of layers of a target spatiotemporal convolution layer in the spatiotemporal convolution module; Determining a dilated causal convolution corresponding to the target spatiotemporal convolution layer according to the target number of layers; wherein a convolution kernel of the dilated causal convolution is a preset size, and a receptive field of the dilated causal convolution corresponds to the target number of layers; The power data of a target photovoltaic site is convolved by the temporal convolutional network based on the void causal convolution to obtain the target convolutional spatiotemporal features of the target photovoltaic site.
3. The multi-site photovoltaic power ultra-short-term prediction method according to claim 2, characterized in that: The step of performing diffusion graph convolution on the target convolutional spatiotemporal features corresponding to the target spatiotemporal convolutional layer and the target dynamic adjacency matrix through the target spatiotemporal convolutional layer to obtain the target diffusion spatiotemporal features corresponding to the target spatiotemporal convolutional layer specifically includes: Determining a degree matrix corresponding to the target dynamic adjacency matrix; The graph convolution network performs diffuse graph convolution on preset feature selector parameters, the target convolution spatiotemporal features corresponding to the target spatiotemporal convolution layer, the target dynamic adjacency matrix and the degree matrix to obtain the target diffuse spatiotemporal features corresponding to the target spatiotemporal convolution layer.
4. The multi-site photovoltaic power ultra-short-term prediction method according to claim 2 or 3, characterized in that: The dynamic graph structure learning module includes a plurality of dynamic graph structure learning submodules, each of which corresponds to the spatiotemporal convolutional layer. The dynamic graph structure learning module processes the long-term pattern node embedding data and a target convolutional spatiotemporal feature to obtain a target dynamic adjacency matrix corresponding to the target spatiotemporal convolutional layer, specifically including: Perform linear transformation on the target convolutional spatiotemporal matrix to obtain real-time node features; The target dynamic graph structure learning submodule corresponding to the target spatiotemporal convolution layer fuses the long-term pattern node embedding data and the real-time node features to obtain an initial dynamic adjacency matrix corresponding to the target spatiotemporal convolution layer; Processing the initial dynamic adjacency matrix based on a multi-head attention mechanism to obtain a second dynamic adjacency matrix; The long-term pattern node embedding data, the initial dynamic adjacency matrix and the second dynamic adjacency matrix are processed to obtain a target dynamic adjacency matrix corresponding to the target spatiotemporal convolutional layer.
5. The multi-site photovoltaic power ultra-short-term prediction method according to claim 4, characterized in that: The processing of the initial dynamic adjacency matrix based on the multi-head attention mechanism to obtain a second dynamic adjacency matrix specifically includes: Get the preset zoom factor and preset number; Based on the scaling factor, the initial dynamic adjacency matrix is linearly transformed a preset number of times to obtain a plurality of dynamic sub-adjacency matrices; wherein the number of the dynamic sub-adjacency matrices is the preset number; Performing cosine similarity calculation and regularization processing on the multiple dynamic sub-adjacency matrices to obtain a first dynamic adjacency matrix; wherein the first dynamic adjacency matrix contains multiple processed dynamic sub-adjacency matrices; The first dynamic adjacency matrix after linear transformation and summation is processed by the Relu function to obtain a second dynamic adjacency matrix.
6. The multi-site photovoltaic power ultra-short-term prediction method according to claim 4, characterized in that: The processing of the long-term pattern node embedding data, the initial dynamic adjacency matrix and the second dynamic adjacency matrix to obtain a target dynamic adjacency matrix corresponding to the target spatiotemporal convolutional layer specifically includes: Normalizing the second dynamic adjacency matrix and the initial dynamic adjacency matrix after linear transformation and cosine similarity calculation to obtain a third dynamic adjacency matrix; Normalizing the third dynamic adjacency matrix and the third dynamic adjacency matrix that has been subjected to the multi-layer perceptron to obtain a fourth dynamic adjacency matrix; The fourth dynamic adjacency matrix and the long-term pattern node embedding data calculated by cosine similarity are processed to obtain a target dynamic adjacency matrix corresponding to the target spatiotemporal convolutional layer.
7. A multi-site photovoltaic power ultra-short-term prediction device, characterized in that: Applied to a pre-built multi-scale dynamic space-time graph neural network, the multi-scale dynamic space-time graph neural network includes at least a dynamic graph structure learning module, a space-time convolution module, a fusion module and an output module, and the multi-site photovoltaic power ultra-short-term prediction device includes: A void causal convolution unit, used to perform void causal convolution on the power data of the photovoltaic sites respectively through the multiple spatiotemporal convolution layers in the spatiotemporal convolution module to obtain the convolutional spatiotemporal features of each photovoltaic site; wherein there are multiple photovoltaic sites, and the spatiotemporal convolution layers correspond to the photovoltaic sites one by one; A processing unit, used to process the long-term pattern node embedding data and each of the convolutional spatiotemporal features through the dynamic graph structure learning module to obtain a target dynamic adjacency matrix corresponding to each of the spatiotemporal convolutional layers; wherein the long-term pattern node embedding data is obtained based on the power data of each of the photovoltaic sites; A diffusion graph convolution unit, used for performing diffusion graph convolution on the convolutional spatiotemporal features corresponding to the spatiotemporal convolution layer and the target dynamic adjacency matrix through each of the spatiotemporal convolution layers, so as to obtain the diffusion spatiotemporal features corresponding to each of the spatiotemporal convolution layers; A fusion unit, used for fusing each of the diffusion spatiotemporal features through the fusion module to obtain a fused spatiotemporal feature; The input unit is used to input the fused spatiotemporal features into the output module to obtain the multi-site photovoltaic power ultra-short-term prediction results output by the output module.
8. A computer device comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the multi-site photovoltaic power ultra-short-term prediction method described in any one of claims 1 to 6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the multi-site photovoltaic power ultra-short-term prediction method described in any one of claims 1 to 6 are implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the multi-site photovoltaic power ultra-short-term prediction method described in any one of claims 1 to 6 are implemented.
Citation Information
Cited By
Energy storage battery state monitoring method and system for high-cold and high-altitude environment
CN120870927A