Photovoltaic data prediction method based on multi-dimensional cross attention mechanism

By constructing a photovoltaic adjacency matrix and a multi-dimensional cross-attention mechanism, cross-dimensional information of photovoltaic data is captured, solving the problem of low accuracy in photovoltaic power generation prediction and achieving higher accuracy in photovoltaic data prediction.

CN115841167BActive Publication Date: 2026-04-17TIANJIN UNIV
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
TIANJIN UNIV
Filing Date
2022-09-05
Publication Date
2026-04-17

AI Technical Summary

Technical Problem

Existing photovoltaic power generation prediction methods suffer from low prediction accuracy due to the systematic uncertainty and high noise of spatiotemporal data, especially since adjacent nodes have extremely high similarity in spatial terms and the correlation between short-term data is not obvious.

Method used

A photovoltaic data prediction method based on a multi-dimensional cross-attention mechanism is adopted. By constructing a photovoltaic adjacency matrix, a feature tensor is generated. Then, by using an initial convolutional preprocessing layer, a cross-attention module, a U-convolutional layer, a cross-attention spatiotemporal layer, and a graph convolutional module, cross-dimensional information of spatiotemporal data is captured, potential connections are established, and photovoltaic data prediction is performed.

Benefits of technology

It greatly improves the accuracy of photovoltaic data prediction, and by capturing time, space and external dependence information, it reduces computational overhead and achieves more accurate photovoltaic power generation prediction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115841167B_ABST
    Figure CN115841167B_ABST
Patent Text Reader

Abstract

The embodiment of the application discloses a photovoltaic data prediction method based on a multidimensional cross attention mechanism, comprising the following steps: constructing a photovoltaic adjacency matrix based on the distribution of a photovoltaic power grid; generating sensor attributes at time t according to data collected by a sensor at time t, embedding the sensor attributes into the photovoltaic adjacency matrix, generating a feature tensor, and inputting the feature tensor into an initial convolution preprocessing layer; inputting three tensors of two-dimensional interaction into corresponding cross attention modules respectively, inputting tensors of the same shape output by each cross attention module into a U convolution layer, and outputting a mapping tensor corresponding to each tensor; inputting the mapping tensor into a cross attention space-time layer to obtain a fusion result; inputting the fusion result y into a graph convolution module, inputting an output result of the graph convolution module into a full connection layer, outputting a photovoltaic data prediction result through the full connection layer, and improving the accuracy of photovoltaic data prediction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of photovoltaic data prediction technology, and in particular to a photovoltaic data prediction method based on a multi-dimensional cross-attention mechanism. Background Technology

[0002] Photovoltaic (PV) power generation is an important way to utilize solar energy, and its research and application have become increasingly widespread in recent years. PV power generation varies greatly depending on the amount of sunlight received, making it highly dependent on weather conditions. Therefore, PV power generation must be supplemented by energy storage or other power generation methods to ensure a stable power supply. Maximizing the utilization of PV power generation capacity while ensuring the safe and economical operation of the power grid is particularly important. Accurate PV power generation forecasting technology is one of the effective ways to improve its utilization rate.

[0003] Photovoltaic power generation prediction can be considered a spatiotemporal prediction problem, which refers to predicting the state of an unknown system in time and space. Spatiotemporal prediction is widely used in many real-world applications, such as weather forecasting, traffic flow prediction, and earthquake prediction. The scope of spatiotemporal prediction is not limited to geographical space but can also include social and virtual spaces. Compared to traditional time series forecasting and spatial interpolation, spatiotemporal prediction models and predicts spatiotemporal dependencies in both spatial and temporal dimensions. Existing spatiotemporal prediction methods can be categorized into three types: spatiotemporal statistics, artificial intelligence, and physical models. With the development of artificial intelligence technology, modern spatiotemporal prediction systems are becoming increasingly intelligent. Intelligent spatiotemporal prediction systems should be able to automatically collect various datasets, knowledge, and rules for model training in real time, learn automatically from known data, have flexible model structures and instant training capabilities, and be able to predict in real-time or near real-time.

[0004] In the process of realizing this invention, the inventors discovered the following technical problem: because spatiotemporal data has strong system uncertainty characteristics, including accidental uncertainty and random uncertainty, and because the system has high noise, the data of adjacent nodes in space are extremely similar, and the correlation of data in the short time is not obvious, the prediction accuracy is not high. Summary of the Invention

[0005] This invention provides a photovoltaic data prediction method based on a multi-dimensional cross-attention mechanism to solve the technical problem of poor prediction accuracy in photovoltaic power generation prediction due to uncertainties in the prior art.

[0006] In a first aspect, embodiments of the present invention provide a photovoltaic data prediction method based on a multi-dimensional cross-attention mechanism, comprising:

[0007] Constructing a photovoltaic adjacency matrix based on the distribution of the photovoltaic power grid Where A is an element in the photovoltaic adjacency matrix, and N is the number of rows or columns in the photovoltaic adjacency matrix;

[0008] The sensor attributes at time t are generated based on the data collected by the sensor at time t, and these sensor attributes are embedded into the photovoltaic adjacency matrix to generate a feature tensor. ,in It is the length of the sequence. It is the number of nodes. It is the number of features of a node;

[0009] The feature tensor The input is an initial convolutional preprocessing layer, which performs dimensionality reduction along the three dimensions of the tensor to obtain three tensors that interact in pairs along each dimension.

[0010] The three tensors that interact in pairs of dimensions are respectively input into the corresponding cross attention module. The cross attention module is used to capture the cross-dimensional information of the tensor and output a tensor with the same shape as the input tensor that interacts in pairs of dimensions.

[0011] Tensors of the same shape output from each cross-attention module are input into a U-convolutional layer, which is used to utilize the input data. As a form of supervision, it establishes potential connections using high-dimensional feature vectors, and the U-convolutional layer outputs a mapping tensor corresponding to each tensor. ;

[0012] The mapping tensor The input is fed into a cross-attention spatiotemporal layer, which is used to process all mapped tensors. The fusion is performed using the activation function in the U-convolutional layer to obtain the fusion result. ;

[0013] The fusion result y is input into a graph convolution module, which is constructed based on the spatial domain and can learn information about node transformations from different neighborhood orders. The graph convolution module is implemented in the following way:

[0014] ,

[0015] in It is a picture The adjacency matrix, It is the parameter matrix of the adjacency matrix. Indicates the input signal. Indicates the output. Represents the model parameter matrix. The power series of the transition matrix is ​​used in the case of an undirected graph. K is the number of convolutional layers in the graph convolution module;

[0016] The output of the graph convolution module is input into the fully connected layer, and the photovoltaic data prediction result is output through the fully connected layer.

[0017] Furthermore, the construction of the photovoltaic adjacency matrix based on the distribution of the photovoltaic power grid includes:

[0018] Using monitoring points as nodes, a set is constructed based on the location of the monitoring points. It means that, among them It is a set of nodes. It is an edge set;

[0019] A photovoltaic adjacency matrix is ​​generated based on the set.

[0020] Furthermore, embedding the sensor attributes into the photovoltaic adjacency matrix includes:

[0021] The sensor data is embedded into the corresponding nodes in the photovoltaic adjacency matrix.

[0022] Furthermore, the initial convolutional preprocessing layer includes:

[0023] The first branch is for input. Along feature dimension conduct Convolution operations, in the time dimension and node dimensions Establish interaction between them and obtain tensor;

[0024] The second branch is for input. Along the time dimension conduct Convolution operation, in the feature dimension and node dimensions Establish interaction between them and obtain tensor;

[0025] The third branch is for input. Perform along the node dimension Convolution operation, in the feature dimension and time dimension Establish interaction between them and obtain tensor;

[0026] Where M is the number of hidden features of the tensor.

[0027] Furthermore, the first branch performs convolution operations in the following manner: , For feature dimensions conduct The result of the convolution operation, It is a linear rectifier unit. For along the feature dimension One-dimensional convolution operation unit, For input tensors;

[0028] The second branch performs convolution operations in the following manner: , Perform for feature dimension t The result of the convolution operation;

[0029] The third branch performs convolution operations in the following manner: , Perform for feature s Results of the convolution operation.

[0030] Furthermore, the U-convolutional layer is implemented in the following way:

[0031] ,

[0032] ,

[0033] in It is a high-dimensional latent variable. , It is a parameter weight matrix. and This is the bias parameter.

[0034] Furthermore, the cross-attention module includes:

[0035] The first branch processing unit is implemented in the following way:

[0036] ;

[0037] The second branch processing unit is implemented in the following way:

[0038] ;

[0039] The third branch processing unit is implemented in the following way:

[0040] ;

[0041] The spatiotemporal attention weights representing learning It is a weight matrix. It is a linear rectifier unit. The formula for the global average pooling function is as follows:

[0042] ,

[0043] The global max-pooling function is defined as follows:

[0044] .

[0045] Furthermore, the third branch processing unit, in The layers are implemented by combining two of the three pooling methods—global average pooling, global max pooling, and global min pooling—in the following way:

[0046] ,

[0047] ,

[0048] ,

[0049] ,

[0050] in It is a hidden dimension for performing pooling operations.

[0051] 9. The method according to claim 1, wherein the cross-attention spatiotemporal layer is implemented in the following manner:

[0052] ,

[0053] in, This represents the activation function. , and These represent the synthesis parameters in each branch. and It controls the weight parameters between the three branches.

[0054] Furthermore, the method also includes:

[0055] The loss function is calculated based on the actual collected data and the corresponding prediction results as follows:

[0056] ,

[0057] in, The model is from Time Steps Predicted values ​​at time steps These are the parameters of the model;

[0058] The comprehensive parameters in each branch are adjusted based on the calculation results of the loss function.

[0059] The photovoltaic data prediction method based on a multi-dimensional cross-attention mechanism provided in this invention constructs a photovoltaic adjacency matrix based on the distribution of the photovoltaic power grid. The sensor attributes at time t are generated based on the data collected by the sensor at time t, and these sensor attributes are embedded into the photovoltaic adjacency matrix to generate a feature tensor. , the feature tensor An initial convolutional preprocessing layer is input, which performs dimensionality reduction along each of the three dimensions of the tensor, resulting in three tensors with pairwise interactions. These three tensors are then input into corresponding cross-attention modules, which capture the cross-dimensional information of the tensors and output tensors with the same shape as the input pairwise interacting tensors. Finally, the tensors with the same shape output from each cross-attention module are input into a U-convolutional layer, which utilizes the input data... As a form of supervision, it establishes potential connections using high-dimensional feature vectors, and the U-convolutional layer outputs a mapping tensor corresponding to each tensor. ; the mapping tensor The input is fed into a cross-attention spatiotemporal layer, which is used to process all mapped tensors. The fusion is performed using the activation function in the U-convolutional layer to obtain the fusion result. The fusion result y is input into a graph convolution module, which is constructed based on the spatial domain and can learn information about node transformations from different neighborhood orders. The output of the graph convolution module is input into a fully connected layer, which outputs the photovoltaic data prediction result. For the input tensor, a three-branch attention mechanism constructs inter-dimensional dependencies through convolution operations and residual transformations. The three branches respectively capture temporal, spatial, and external dependencies in the spatiotemporal data and encode inter-channel and spatial information with extremely low computational overhead. Spatiotemporal data information from the past period is used to predict spatiotemporal data information for the future period, greatly improving the accuracy of photovoltaic data prediction. Attached Figure Description

[0060] Other features, objects, and advantages of the invention will become more apparent from the following detailed description of non-limiting embodiments with reference to the accompanying drawings:

[0061] Figure 1 A flowchart of a photovoltaic data prediction method based on a multi-dimensional cross-attention mechanism provided in an embodiment of the present invention. Detailed Implementation

[0062] The present invention will now be described in further detail with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and not intended to limit it. Furthermore, it should be noted that, for ease of description, the accompanying drawings show only the parts relevant to the present invention, and not all of the structures.

[0063] Figure 1 The flowchart below illustrates a photovoltaic data prediction method based on a multi-dimensional cross-attention mechanism, as provided in this embodiment of the invention. This embodiment is applicable to the accurate prediction of photovoltaic power generation data based on a multi-dimensional cross-attention mechanism, and specifically includes the following steps:

[0064] Step 110: Construct a photovoltaic adjacency matrix based on the distribution of the photovoltaic power grid.

[0065] In this embodiment, the photovoltaic data prediction method based on a multi-dimensional cross-attention mechanism can be applied to the power supply and distribution and power generation systems of municipal facilities such as solar photovoltaic power generation combiner systems, municipal street light power distribution systems, and traffic signal power distribution systems. For photovoltaic power generation systems, the model can learn data features based on historical sensor data. The model predicts information such as power generation from the current time to a future period and compares it with the information collected by real-time sensors. If the difference between the two is too large, it is considered that the current power generation state is abnormal, and the photovoltaic panels may have abnormal conditions. The photovoltaic grid is regarded as a graph, and a single photovoltaic panel or photovoltaic panel array or current convergence point is regarded as a node. In this way, the monitoring point position can be represented by G = (V,E), where V is the set of nodes and E is the set of edges. The data formed by the photovoltaic panel positions can be represented by an adjacency matrix. A∈R^(N×N). If and ,but The value is 1.

[0066] Step 120: Generate sensor attributes at time t based on the data collected by the sensor at time t, and embed the sensor attributes into the photovoltaic adjacency matrix to generate a feature tensor.

[0067] Suppose there are S monitoring points that can collect data such as current, voltage, and power generation, as well as external data such as temperature and weather conditions at any given time. These data are used as attributes of the nodes. Suppose the node has C attributes and collects data once every t time, for a total of T data collections. Then we can obtain a tensor of (T×S×C).

[0068] Assume each node has Each attribute can be obtained for a node. ,in Then the corresponding A sensor network with 10 nodes can yield a tensor:

[0069] .

[0070] Step 130: Input the feature tensor into the initial convolutional preprocessing layer. The initial convolutional preprocessing layer performs dimensionality reduction along the three dimensions of the tensor to obtain three tensors with two-way interaction.

[0071] In this embodiment, given an input tensor, an attention mechanism is used to capture the dependencies between dimensions. Given a sequence... Its history Step information, the model is to learn a function It can predict its next Step information. The mapping relationship is represented as: Simultaneously, it utilizes three-branch cross-attention, with each branch responsible for capturing the cross-dimensional relationship between the spatial and channel dimensions of the input. For example: given a shape... The input tensor, each branch is responsible for aggregating the spatial dimensions. or With channel dimension Cross-dimensional interaction features between them.

[0072] In this embodiment, the initial convolutional preprocessing layer includes: a first branch for input... Along feature dimension conduct Convolution operations, in the time dimension and node dimensions Establish interaction between them and obtain The tensor; the second branch, used for input. Along the time dimension conduct Convolution operation, in the feature dimension and node dimensions Establish interaction between them and obtain The tensor; the third branch, used for input. Perform along the node dimension Convolution operation, in the feature dimension and time dimension Establish interaction between them and obtain The tensor.

[0073] Given an input tensor First, it is passed to the three branches of the proposed preprocessed convolutional layer, and dimensionality reduction is performed along the three dimensions of the tensor. The role of convolution in the first branch is in the time dimension. and node dimensions Establish interaction between them, therefore, input Along feature dimension Perform the convolution operation, that is:

[0074] , For feature dimensions conduct The result of the convolution operation,

[0075] get The tensor. Similarly, in the second branch, in the feature dimension... and node dimensions Establish interaction between them:

[0076] ,

[0077] pass Convolution operation, to obtain The tensor.

[0078] In the third branch, through the feature dimension and time dimension Establish interaction between them

[0079] ,

[0080] It can be obtained The tensor.

[0081] Step 140: Input the three tensors that interact in pairs of dimensions into the corresponding cross-attention modules. The cross-attention modules are used to capture the cross-dimensional information of the tensors and output tensors with the same shape as the input tensors that interact in pairs of dimensions.

[0082] The cross-attention module consists of three parallel branches. It takes an input tensor and outputs a tensor of the same shape. Each branch establishes pairwise interactions between the time, spatial, and feature dimensions to capture cross-dimensional information of the tensor. It is the output of the first branch of the preprocessing layer and the input of the subsequent cross-attention module, where T represents the time length of the tensor. This represents the number of nodes in a tensor. Let the number of hidden features or spatial feature map of the tensor be represented. Then, for the first cross-attention branch, it can be expressed by the following formula.

[0083] ;

[0084] The second cross-attention branch can be expressed by the formula:

[0085] ;

[0086] The third branch can be represented as

[0087] .

[0088] in, The spatiotemporal attention weights representing learning It is a weight matrix. It is a linear rectifier unit. The formula for the global average pooling function is as follows:

[0089] ,

[0090] The global max-pooling function is defined as follows:

[0091] .

[0092] The two pooling functions mentioned above can be used to achieve the aggregation of temporal and spatial features in the cross-attention mechanism.

[0093] The third branch processing unit, in The layers are implemented by combining two of the three pooling methods—global average pooling, global max pooling, and global min pooling—in the following way:

[0094] ,

[0095] ,

[0096] ,

[0097] ,

[0098] in It is a hidden dimension for performing pooling operations.

[0099] Pooling method through layer, layer, The layer performs pooling operations, where Layers and The layer connects the average pooling and max pooling features along the hidden feature dimension, thus transforming the hidden features of the tensor. Reduced to two dimensions. The layer combines two of the three pooling methods—global average pooling, global max pooling, and global min pooling—in pairs. This approach expands the receptive field while compressing features, reducing computational cost. Layers, mathematically, can be expressed as:

[0100] ,

[0101] ,

[0102] ,

[0103] ,

[0104] in It is the hidden dimension used for pooling operations, for example, the shape is Tensors, after pooling, will produce shapes of... The tensor. By combining min-pooling and max-pooling, the tensor dimensionality is reduced while the pooling layer retains rich information about the tensor, and the depth of the tensor is reduced, which can reduce computational cost to some extent.

[0105] Step 150: Input the tensors of the same shape output by each cross-attention module into a U-convolutional layer, where the U-convolution is used to utilize the input data. As a supervisor, it uses high-dimensional feature vectors to establish potential connections, and the U-convolutional layer outputs the mapping tensor corresponding to each tensor.

[0106] Assumption It is the output of the cross-attention module in branch one and the input of the U-convolution module. The U-convolution module uses the input data As a supervisor, it first uses convolution operations to... The mapping is done by a high-dimensional latent variable h, then the high-dimensional feature vectors can be used to establish latent relationships, and finally the high-dimensional latent variable h is restored to the initial dimension to obtain... This non-linear approach of increasing and then decreasing dimensionality allows the neural network to learn hidden information. It's equivalent to projecting the input data into a high-dimensional space and then mapping it back. Therefore, the U-convolutional module can be described as follows:

[0107] ,

[0108] ;

[0109] in It is a high-dimensional latent variable. It is the parameter weight matrix.

[0110] Step 160: Convert the mapping tensor The input is fed into a cross-attention spatiotemporal layer, which is used to process all mapped tensors. The activation function in the U-convolutional layer is used for fusion to obtain the fusion result. .

[0111] Based on the definitions of the modules above, the cross-attention spatiotemporal layer can be defined as a three-branch fusion module, given an input tensor. In the preprocessing of the first branch, we obtain Then, through cross-attention module pooling, we obtain Its shape is Then, attention weights are generated through the U-convolutional layer activation function, and these weights are then fused into... The fusion method is Hadama accumulation.

[0112] Similarly, in the second branch, after the preprocessing layer, we obtain... Then, through a cross-attention module, a max-pooling, min-pooling, and average-pooling fusion layer is obtained. Its shape is Similar to the first branch, attention weights are generated through a U-convolutional layer and activation function, and then fused into the tanh-activated layer. .

[0113] For the last branch, the data is processed by the preprocessing layer to obtain... First, spatial information is extracted through graph convolutional layers, and then pooling operations are performed to obtain... Its shape is Similar to the previous two branches, attention weights are generated through U-convolutional layers and activation functions, and then fused into the tanh-activated layer. Finally, the outputs from the three branches are combined, and two hyperparameters are added to adjust the weights of each branch. In summary, the process of the input tensor passing through the cross-attention spatiotemporal layer can be expressed by the following mathematical formula:

[0114] ,

[0115] in, This represents the activation function. , and These represent the synthesis parameters in each branch. and It controls the weight parameters between the three branches.

[0116] Step 170: Input the fusion result y into the graph convolution module. The graph convolution module is constructed based on the perspective of the spatial domain and can learn information about node transformations from different neighborhood orders.

[0117] The input to the convolutional layer. It is the size of The three-dimensional tensor, in which It is the number of nodes. It is a hidden dimension. It is the sequence length. Slicing is performed along the time axis and the calculation is completed in the graph convolutional layer, i.e. .

[0118] Graph convolution is a fundamental operation that extracts node features based on the structural information of the nodes. Let... Let represent a normalized adjacency matrix with self-loops. Indicates the input signal. Indicates the output. Let the model parameter matrix be represented, then the graph convolutional layer is defined as: This invention uses diffusion graph convolution to model the diffusion process of graph signals, that is...

[0119] ,

[0120] in The power series of the transition matrix is ​​used in the case of an undirected graph. .

[0121] In the graph convolutional layer, the model can learn predefined spatial dependencies by leveraging prior spatial knowledge. Therefore, it's necessary to consider the spatial dependency weights between the source and target nodes. The ReLU activation function and softmax function are used to normalize the adjacency matrix information of the graph and integrate it into the graph convolutional module. Thus, the above formula will be written as...

[0122] ,

[0123] in It is a picture The adjacency matrix, It is the parameter matrix of the adjacency matrix. Thus, the graph convolution module is constructed based on the perspective of the spatial domain, and the graph convolution module can learn information about node transformations from different neighborhood orders.

[0124] Step 180: Input the output of the graph convolution module into the fully connected layer, and output the photovoltaic data prediction result through the fully connected layer.

[0125] The fully connected layer can include a linear transformation layer and an activation function layer, which can integrate the features extracted above to fully reflect time dependence, spatial dependence, and external dependence. The photovoltaic data prediction results are then output through the fully connected layer.

[0126] This embodiment constructs a photovoltaic adjacency matrix based on the distribution of the photovoltaic power grid. The sensor attributes at time t are generated based on the data collected by the sensor at time t, and these sensor attributes are embedded into the photovoltaic adjacency matrix to generate a feature tensor. , the feature tensor An initial convolutional preprocessing layer is input, which performs dimensionality reduction along each of the three dimensions of the tensor, resulting in three tensors with pairwise interactions. These three tensors are then input into corresponding cross-attention modules, which capture the cross-dimensional information of the tensors and output tensors with the same shape as the input pairwise interacting tensors. Finally, the tensors with the same shape output from each cross-attention module are input into a U-convolutional layer, which utilizes the input data... As a form of supervision, it establishes potential connections using high-dimensional feature vectors, and the U-convolutional layer outputs a mapping tensor corresponding to each tensor. ; the mapping tensor The input is fed into a cross-attention spatiotemporal layer, which is used to process all mapped tensors. The fusion is performed using the activation function in the U-convolutional layer to obtain the fusion result. The fusion result y is input into a graph convolution module, which is constructed based on the spatial domain and can learn information about node transformations from different neighborhood orders. The output of the graph convolution module is input into a fully connected layer, which outputs the photovoltaic data prediction result. For the input tensor, a three-branch attention mechanism constructs inter-dimensional dependencies through convolution operations and residual transformations. The three branches respectively capture temporal, spatial, and external dependencies in the spatiotemporal data and encode inter-channel and spatial information with extremely low computational overhead. Spatiotemporal data information from the past period is used to predict spatiotemporal data information for the future period, greatly improving the accuracy of photovoltaic data prediction.

[0127] In a preferred embodiment of this example, the method may further include the following step: calculating the loss function based on the actually collected data and the corresponding prediction results in the following manner: ,in, The model is from Time Steps Predicted values ​​at time steps These are the model parameters; the comprehensive parameters in each branch are adjusted based on the calculation results of the loss function. Since the comprehensive parameters corresponding to each branch in the cross-attention spatiotemporal layer are a set of various parameters that need to be trained, to improve prediction accuracy, it is necessary to adjust and optimize these various parameters using actual data and prediction data. For example, a corresponding loss function can be set, and the parameters in the model can be optimized using data obtained from actual measurements to further improve prediction accuracy.

[0128] Computer program code for performing the operations of this invention can be written in one or more programming languages ​​or a combination thereof, including object-oriented programming languages ​​such as Java, Smalltalk, and C++, as well as conventional procedural programming languages ​​such as "C" or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).

[0129] Note that the above description is merely a preferred embodiment of the present invention and the technical principles employed. Those skilled in the art will understand that the present invention is not limited to the specific embodiments described herein, and various obvious changes, readjustments, and substitutions can be made without departing from the scope of protection of the present invention. Therefore, although the present invention has been described in detail through the above embodiments, the present invention is not limited to the above embodiments, and may include many other equivalent embodiments without departing from the concept of the present invention, the scope of which is determined by the scope of the appended claims.

Claims

1. A photovoltaic data prediction method based on a multi-dimensional cross-attention mechanism, characterized in that, include: Constructing a photovoltaic adjacency matrix based on the distribution of the photovoltaic power grid Where A is an element in the photovoltaic adjacency matrix, and N is the number of rows or columns in the photovoltaic adjacency matrix; The sensor attributes at time t are generated based on the data collected by the sensor at time t, and these sensor attributes are embedded into the photovoltaic adjacency matrix to generate a feature tensor. ,in It is the length of the sequence. It is the number of nodes. It is the number of features of a node; The feature tensor The input is an initial convolutional preprocessing layer, which performs dimensionality reduction along the three dimensions of the tensor to obtain three tensors that interact in pairs along each dimension. The three tensors that interact in pairs of dimensions are respectively input into the corresponding cross attention module. The cross attention module is used to capture the cross-dimensional information of the tensor and output a tensor with the same shape as the input tensor that interacts in pairs of dimensions. Tensors of the same shape output from each cross-attention module are input into a U-convolutional layer, which is used to utilize the input data. As a form of supervision, it establishes potential connections using high-dimensional feature vectors, and the U-convolutional layer outputs a mapping tensor corresponding to each tensor. ; The mapping tensor The input is fed into a cross-attention spatiotemporal layer, which is used to process all mapped tensors. The activation function in the U-convolutional layer is used for fusion to obtain the fusion result. ; The fusion result y is input into a graph convolution module, which is constructed based on the spatial domain and can learn information about node transformations from different neighborhood orders. The graph convolution module is implemented in the following way: , in It is a picture The adjacency matrix, It is the parameter matrix of the adjacency matrix. Indicates the input signal. Indicates the output. Represents the model parameter matrix. The power series of the transition matrix is ​​used in the case of an undirected graph. K is the number of convolutional layers in the graph convolutional module; The output of the graph convolution module is input into the fully connected layer, and the photovoltaic data prediction result is output through the fully connected layer.

2. The method according to claim 1, characterized in that, The construction of the photovoltaic adjacency matrix based on the distribution of the photovoltaic power grid includes: Using monitoring points as nodes, a set is constructed based on the location of the monitoring points. It means that, among them It is a set of nodes. It is an edge set; A photovoltaic adjacency matrix is ​​generated based on the set.

3. The method according to claim 2, characterized in that, The step of embedding the sensor attributes into the photovoltaic adjacency matrix includes: The sensor data is embedded into the corresponding nodes in the photovoltaic adjacency matrix.

4. The method according to claim 1, characterized in that, The initial convolutional preprocessing layer includes: The first branch is for input. Along feature dimension conduct Convolution operations, in the time dimension and node dimensions Establish interaction between them and obtain tensor; The second branch is for input. Along the time dimension conduct Convolution operation, in the feature dimension and node dimensions Establish interaction between them and obtain tensor; The third branch is for input. Perform along the node dimension Convolution operation, in the feature dimension and time dimension Establish interaction between them and obtain tensor; Where M is the number of hidden features of the tensor.

5. The method according to claim 4, characterized in that, The first branch performs convolution operations in the following manner: , For feature dimensions conduct The result of the convolution operation, It is a linear rectifier unit. For along the feature dimension One-dimensional convolution operation unit, For input tensors; The second branch performs convolution operations in the following manner: , Perform for feature dimension t The result of the convolution operation; The third branch performs convolution operations in the following manner: , Perform for feature s Results of the convolution operation.

6. The method according to claim 5, characterized in that, The U-convolutional layer is implemented in the following way: , , in It is a high-dimensional latent variable. , It is a parameter weight matrix. and This is the bias parameter.

7. The method according to claim 6, characterized in that, The cross-attention module includes: The first branch processing unit is implemented in the following way: ; The second branch processing unit is implemented in the following way: ; The third branch processing unit is implemented in the following way: ; The spatiotemporal attention weights representing learning It is a weight matrix. It is a linear rectifier unit. The formula for the global average pooling function is as follows: , The global max-pooling function is defined as follows: 。 8. The method according to claim 7, characterized in that, The third branch processing unit The layers are implemented by combining two of the three pooling methods—global average pooling, global max pooling, and global min pooling—in the following way: , , , , in It is a hidden dimension for performing pooling operations.

9. The method according to claim 6, characterized in that, The cross-attention spatiotemporal layer is implemented in the following way: , in, This represents the activation function. , and These represent the synthesis parameters in each branch. and It controls the weight parameters between the three branches.

10. The method according to claim 9, characterized in that, The method further includes: The loss function is calculated based on the actual collected data and the corresponding prediction results as follows: , in, The model is from Time Steps Predicted values ​​at time steps These are the parameters of the model; Adjust the overall parameters in each branch based on the calculation results of the loss function.

Citation Information

Patent Citations

  • Photovoltaic power prediction method of deep neural network model fused with attention mechanism

    CN110909919A

  • Point cloud registration method based on distribution

    CN113989340A