Multi-site photovoltaic power generation prediction method and system based on graph attention network

By adopting a graph attention network-based method in photovoltaic power generation prediction, a space and time-dependent model is built and missing data is filled, the problem of insufficient dependence and targeting of historical data in the prior art is solved, and higher prediction accuracy and applicability are achieved.

CN119358776BActive Publication Date: 2025-03-11STATE GRID ZHEJIANG ELECTRIC POWER COMPANY TAIZHOU POWER SUPPLY
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202411920480.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-12-25
Publication Date
2025-03-11
Estimated Expiration
2044-12-25

AI Technical Summary

Technical Problem

The prior art relies on complete historical operating data in photovoltaic power prediction and is poorly targeted, especially in large-scale and multi-site scenarios, and the static graph structure model is limited in the face of dynamically changing environmental conditions.

Method used

The multi-site photovoltaic power generation prediction method based on graph attention network is adopted. By constructing a spatial dependence model containing site spatial relationships and a time dependence model containing site time relationships, combined with the spatiotemporal data processing layer, missing data filling is reduced, and the requirements for training data are improved, and the targetedness and accuracy of predictions are improved.

Benefits of technology

It improves the accuracy and model applicability of photovoltaic power generation prediction, and can provide higher prediction accuracy and robustness without relying on detailed and complete input data, and is suitable for large-scale and multi-site scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119358776B_ABST
    Figure CN119358776B_ABST
Patent Text Reader

Abstract

The present application discloses a multi-site photovoltaic power generation prediction method and system based on a graph attention network, the method comprising the following steps: obtaining a spatial dependency model including the spatial relationship of sites according to the site dependency relationship based on the graph attention network; constructing a temporal dependency model including the temporal relationship of sites based on an autoregressive long short-term memory network combined with a probability framework; constructing a first missing data filling layer according to a spatial feature compensation strategy, constructing a second missing data filling layer according to a temporal feature compensation strategy, constructing a third missing data filling layer according to the temporal and spatial correlation of a set of neighboring sites, thereby constructing a spatiotemporal data processing layer; using the historical operation data of photovoltaic sites to construct a photovoltaic power generation prediction model according to the spatial dependency model, the temporal dependency model and the spatiotemporal data processing layer. The beneficial effects of the present application: reducing the requirements for training data, improving the pertinence of photovoltaic power generation prediction, and improving the accuracy of photovoltaic power generation prediction and the applicability of the model.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of photovoltaic power generation prediction, and in particular to a multi-site photovoltaic power generation prediction method and system based on a graph attention network. Background Art

[0002] With the gradual maturity of photovoltaic power generation technology and the promotion of market incentive mechanisms at all levels, the planning and construction of distributed photovoltaic projects have been rapidly promoted. However, due to the randomness and volatility of its power output, it is easily affected by various factors such as seasons and weather, which increases the uncertainty and complexity of the power system. Therefore, accurately predicting and analyzing the power output of distributed photovoltaics and improving the accuracy and stability of predictions are of great significance for promoting the safe grid connection of distributed photovoltaics, the smooth operation of the power system, and achieving economical and efficient energy utilization.

[0003] In the related technology, the method based on artificial neural network and long short-term memory network is effective in dealing with small-scale photovoltaic systems. However, in large-scale, multi-site scenarios, due to the large amount of calculation and high requirements for detailed data integrity, this method cannot be flexibly modeled and cannot effectively manage a large number of photovoltaic site models. Although some graph-based machine learning methods can capture the spatial correlation between photovoltaic sites, they rely on static graph structures and cannot flexibly respond to dynamically changing weather conditions. When faced with changing environmental conditions, the performance of these static graph structures will be limited. In addition, in practical applications, due to sensor failures, communication problems and other reasons, the operating data of photovoltaic sites is often incomplete. Although the spatiotemporal denoising autoencoder is used to complete some data when dealing with missing data, when faced with large-scale data missing scenarios with too many photovoltaic sites, there are still problems of high computational complexity and insufficient robustness.

[0004] The patent "A photovoltaic daily output prediction method and device", publication number: CN118279084A, publication date: July 2, 2024, specifically discloses that the K medoids clustering algorithm is used to cluster historical output data under different weather conditions in view of the volatility and intermittent characteristics of photovoltaic output. Compared with the commonly used K means clustering, it is more inclusive of noise data, has a faster calculation speed, and a fixed number of convergence times. It effectively avoids clustering bias caused by the existence of some abnormal points, reduces the complexity of the prediction model and the risk of overfitting, and improves the prediction efficiency; at the same time, it combines quantile regression theory and deep learning theory to adopt a bidirectional long short-term memory network to overcome the defect of insufficient data information mining of the unidirectional LSTM network. However, this solution lacks regional specificity and is easily disturbed by historical operating data in other regions when there are differences in geographical regions, resulting in prediction errors.

[0005] The patent "A method, device, equipment and medium for training a power generation prediction model", publication number: CN118713054A, publication date: September 27, 2024, specifically discloses a method including: preprocessing the acquired historical power generation data to obtain a power generation data sample set; splitting the power generation data sample set to obtain a data sample set of the channel dimension and a data sample set of the time dimension; processing the data sample set of the channel dimension through the first channel to obtain a first eigenvector, and processing the data sample set of the time dimension through the second channel to obtain a second eigenvector; training the power generation prediction model according to the first eigenvector and the second eigenvector to obtain power generation prediction information; using the trained distributed photovoltaic power generation system's power generation prediction model as the power generation prediction model. This solution is also based only on the information contained in the time-frequency domain, and is susceptible to interference from historical operating data in other regions when there are differences in geographical regions, resulting in prediction errors. Summary of the invention

[0006] In order to solve the technical problem that photovoltaic power generation prediction in the prior art relies on complete historical operation data and has poor pertinence, the present application provides a multi-site photovoltaic power generation prediction method and system based on a graph attention network. The spatial and temporal dependency relationship of photovoltaic power generation is reflected by constructing a spatial dependency model including the spatial relationship of sites and a temporal dependency model including the temporal relationship of sites. At the same time, the missing data of historical operation data is filled by approximating the three missing data filling results of the spatiotemporal data processing layer, thereby reducing the requirements for training data, improving the pertinence of photovoltaic power generation prediction, and improving the accuracy of photovoltaic power generation prediction and the applicability of the model.

[0007] To achieve the above technical objectives, a technical solution provided by the present application is a multi-site photovoltaic power generation prediction method based on a graph attention network, comprising the following steps: S1: obtaining a spatial dependency model including the spatial relationship of sites based on the site dependency relationship based on the graph attention network; S2: constructing a temporal dependency model including the temporal relationship of sites based on an autoregressive long short-term memory network combined with a probabilistic framework; S3: constructing a first missing data filling layer according to a spatial feature compensation strategy, constructing a second missing data filling layer according to a temporal feature compensation strategy, constructing a third missing data filling layer according to the spatiotemporal correlation of a set of neighboring sites, and constructing a spatiotemporal data processing layer with the first missing data filling layer, the second missing data filling layer and the third missing data filling layer; S4: constructing a photovoltaic power generation prediction model based on the spatial dependency model, the temporal dependency model and the spatiotemporal data processing layer using the historical operation data of photovoltaic sites; S5: the photovoltaic power generation prediction model obtains multi-site photovoltaic power generation prediction data in response to current photovoltaic operation data.

[0008] Furthermore, S1 also includes: obtaining the longitude and latitude information of the photovoltaic site, and obtaining the Haversine distance between each photovoltaic site according to the longitude and latitude information of the photovoltaic site; obtaining the neighboring site set of each photovoltaic site according to the Haversine distance based on the K nearest neighbor algorithm; and constructing a site dependency graph according to the neighboring site set and the adjacency weighted matrix.

[0009] Furthermore, the step of constructing a site dependency graph based on the neighbor site set and the adjacency weighted matrix further includes:

[0010] The first connection weight of each photovoltaic site in the neighboring site set and the second connection weight between the neighboring site sets are calculated using the adjacency weight matrix; and a site dependency graph is constructed according to the first connection weight, the second connection weight and the neighboring site set.

[0011] Furthermore, S1 also includes: using a geolocation encoder to convert the longitude and latitude information of the photovoltaic site into a high-dimensional vector, and updating the site dependency graph; inputting the updated site dependency graph into a graph attention network to construct a spatial dependency model including the spatial relationship of the sites.

[0012] Furthermore, the step of inputting the updated site dependency graph into the graph attention network and constructing a spatial dependency model including the spatial relationship of the sites also includes: replacing the fusion layer of the graph attention network layer based on the average recombination strategy, and updating the graph attention network layer; constructing an initial spatial dependency model with the updated graph attention network layer and the feature concatenation layer; and obtaining a spatial dependency model with the site dependency graph and the initial spatial dependency model.

[0013] Furthermore, S2 also includes: constructing an LSTM layer including a probability layer based on an autoregressive long short-term memory network combined with a recursive prediction framework; and constructing a time-dependent model based on a negative log-likelihood loss function and the LSTM layer including a probability layer.

[0014] Furthermore, constructing the first missing data filling layer according to the spatial feature compensation strategy includes: using the average of the feature values ​​of the neighboring sites of the missing data site as the first filling value of the missing data site.

[0015] Furthermore, constructing the second missing data filling layer according to the time feature compensation strategy includes: using the predicted distribution mean of the previous time step of the missing data site as the second filling value of the missing data site.

[0016] Furthermore, the method of constructing the third missing data filling layer according to the spatiotemporal correlation of the neighboring site set also includes: obtaining the second connection weight and the connection set corresponding to the neighboring site set according to the neighboring site set of the missing data site; obtaining the historical operation data of the time series corresponding to the connection set, and calculating the third filling value based on the historical operation data of the time series corresponding to the connection set and the second connection weight; wherein the second connection weight represents the weight between the neighboring site sets.

[0017] Furthermore, constructing the spatiotemporal data processing layer with the first missing data filling layer, the second missing data filling layer and the third missing data filling layer also includes: calculating the average value with the first filling value, the second filling value and the third filling value as the output of the spatiotemporal data processing layer.

[0018] Furthermore, S4 also includes: obtaining a set of neighboring sites in each historical time series based on the historical operation data of the photovoltaic site; performing cluster analysis on each set of neighboring sites using a clustering algorithm to obtain a cluster combination; dividing the historical operation data of the photovoltaic site according to the cluster combination, and training a photovoltaic power generation prediction model corresponding to the cluster combination based on the divided historical operation data of the photovoltaic site.

[0019] Furthermore, S5 also includes: obtaining current photovoltaic operation data, and obtaining a set of neighboring sites in the current time series according to the current photovoltaic operation data; selecting a corresponding photovoltaic power generation prediction model for parallel calculation according to the matching result between the set of neighboring sites in the current time series and the cluster combination; and performing weighted averaging according to the parallel calculation results and the matching proportion between the set of neighboring sites in the current time series and the cluster combination to obtain a final prediction value.

[0020] A technical solution provided by the present application is a multi-site photovoltaic power generation prediction system based on a graph attention network, which is used to implement the method as described above, including: a data acquisition module, used to obtain photovoltaic operation data; a model construction module, including a spatial dependence model construction unit, a time dependence model construction unit, a spatiotemporal data processing layer construction unit and a fusion unit, used to construct a photovoltaic power generation prediction model; a prediction analysis module, used to output multi-site photovoltaic power generation prediction data based on the current photovoltaic operation data output by the data acquisition module and the photovoltaic power generation prediction model constructed by the model construction unit.

[0021] The beneficial effects of this application are: 1. The precise geographical location distance between sites is obtained through Haversine distance, so as to construct the spatial dependency relationship between sites, and the information of adjacent nodes is dynamically aggregated through the graph attention network to improve the ability to capture complex spatial relationships and improve the accuracy of prediction. At the same time, an autoregressive long short-term memory network is combined with a probabilistic framework to construct a time dependency model that includes the time relationship of sites to capture the time dependency in photovoltaic site power prediction. A photovoltaic power generation prediction model that takes into account the spatiotemporal dependency is obtained by fusion construction of the spatial dependency model and the temporal dependency model, and the three missing data filling results of the spatiotemporal data processing layer are used to approximate each other to fill in the input data, ensuring the accuracy of the photovoltaic power generation prediction. At the same time, it does not need to rely on the detailed completeness of the input data, and has higher applicability.

[0022] 2. The adjacency weighted matrix constructs the first connection weight through the Haversine distance, and by constructing the second connection weight, the site dependency graph can not only show the geographical correlation of each adjacent site, but also the correlation between non-adjacent site sets in the same time series. Therefore, in the final prediction, not only can the accurate prediction value be approximated through the same geographical relationship, but also a secondary verification can be performed through the non-adjacent site set to avoid errors in the final prediction result caused by errors in sites with the same geographical relationship, thereby further improving the prediction accuracy.

[0023] 3. Use the average recombination strategy to replace the fusion layer of the graph attention network layer, and obtain a comprehensive feature representation by directly calculating the average value of the output of all attention heads, thereby reducing the complexity of the model and the risk of overfitting.

[0024] 4. Calculate the average value based on the first filling value, the second filling value, and the third filling value, and use the average value as the filling value of the missing data. It can be understood that the average value can generally be closer to the actual value, thereby reducing the error. Since the third filling value also takes into account the geographic location dependency and timing influence of other sets, the actual value is further approximated by the deployment value, thereby improving the accuracy and robustness of missing data filling.

[0025] 5. Multiple matching photovoltaic power generation prediction models are calculated in parallel, and weighted average is performed according to the matching ratio to obtain the final prediction value, so that the final prediction value is more targeted. At the same time, the parallel calculation of photovoltaic power generation prediction models is used to improve the calculation efficiency and ensure the timeliness of the prediction value output. BRIEF DESCRIPTION OF THE DRAWINGS

[0026] Figure 1 This is a flow chart of the multi-site photovoltaic power generation prediction method based on graph attention network in this application. DETAILED DESCRIPTION

[0027] In order to make the purpose, technical solutions and advantages of the present application more clear, the present application is further described in detail below in conjunction with the drawings and examples. It should be understood that the specific implementation method described here is only an optimal embodiment of the present application, which is only used to explain the present application and does not limit the scope of protection of the present application. All other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present application.

[0028] like Figure 1 As shown in the figure, as the first embodiment of the present application, the multi-site photovoltaic power generation prediction method based on the graph attention network includes the following steps:

[0029] S1: Based on the graph attention network, a spatial dependency model including the spatial relationship of sites is obtained according to the site dependency;

[0030] S2: A temporal dependency model including temporal relationships of sites is constructed based on an autoregressive long short-term memory network combined with a probabilistic framework;

[0031] S3: construct a first missing data filling layer according to the spatial feature compensation strategy, construct a second missing data filling layer according to the temporal feature compensation strategy, construct a third missing data filling layer according to the spatiotemporal correlation of the neighboring site set, and construct a spatiotemporal data processing layer with the first missing data filling layer, the second missing data filling layer and the third missing data filling layer;

[0032] S4: Use the historical operation data of photovoltaic sites to build a photovoltaic power generation prediction model based on the spatial dependence model, time dependence model and spatiotemporal data processing layer;

[0033] S5: The photovoltaic power generation prediction model obtains multi-site photovoltaic power generation prediction data in response to current photovoltaic operation data.

[0034] In this embodiment, the Haversine distance is used to obtain the precise geographical location distance between sites, so as to construct the spatial dependency relationship between sites, and the information of adjacent nodes is dynamically aggregated through the graph attention network to improve the ability to capture complex spatial relationships and improve the accuracy of prediction. At the same time, an autoregressive long short-term memory network is combined with a probabilistic framework to construct a time dependency model that includes the time relationship of sites, so as to capture the time dependency in the power prediction of photovoltaic sites. The photovoltaic power generation prediction model that considers the spatiotemporal dependency is obtained by fusion construction of the spatial dependency model and the temporal dependency model, and the three missing data filling results of the spatiotemporal data processing layer are used to approximate each other to fill in the input data, so as to ensure the accuracy of the photovoltaic power generation prediction, and at the same time, it does not need to rely on the detailed integrity of the input data, and has higher applicability.

[0035] Specifically, the operation data at least includes the latitude and longitude information of the photovoltaic site, the type information of the photovoltaic site, the status information of the photovoltaic site, the photovoltaic power generation data, the weather data and the time data. The photovoltaic site type information at least includes the power generation characteristics of the photovoltaic site. The photovoltaic site status information at least includes the power generation loss of the photovoltaic site. Step S1 also includes:

[0036] Obtain the longitude and latitude information of the photovoltaic sites, and obtain the Haversine distance between each photovoltaic site based on the longitude and latitude information of the photovoltaic sites;

[0037] Based on the K-nearest neighbor algorithm, the neighboring site set of each photovoltaic site is obtained according to the Haversine distance;

[0038] A site dependency graph is constructed based on the set of neighboring sites and the adjacency weighted matrix.

[0039] Haversine distance, also known as great circle distance, is a mathematical formula used to calculate the shortest distance between two points on the earth's surface based on spherical trigonometry and taking into account the curvature of the earth. The Haversine distance between each photovoltaic site is obtained based on the latitude and longitude information of the photovoltaic site:

[0040] ;

[0041] in, represents the Haversine distance between photovoltaic site i and photovoltaic site j; r represents the radius of the earth; represents the latitude information of photovoltaic site i, Indicates the latitude information of photovoltaic site j; Indicates the longitude information of photovoltaic site i, Indicates the longitude information of PV site j.

[0042] The K nearest neighbor algorithm is used to find the nearest photovoltaic site set for each photovoltaic site based on the calculated Haversine distance, and the adjacency weighted matrix is ​​used to A To represent the strength of the connection and build a site dependency graph.

[0043] The adjacency weighted matrix is ​​used to represent the connection strength between two PV sites i and j:

[0044] ;

[0045] in, A Represents the adjacency weighted matrix, which is a symmetric matrix with each element A(i,j) That is, it indicates the connection between PV site i and PV site j. The larger the value, the closer the connection between the two PV sites. d(i,j)represents the Haversine distance between PV site i and PV site j; max(d) represents the maximum value of the Haversine distance, and min(d) represents the minimum value of the Haversine distance; represents the set of photovoltaic site connection edges, Indicates that there is a connection relationship between photovoltaic site i and photovoltaic site j, Indicates that there is no connection relationship between photovoltaic site i and photovoltaic site j. If there is a connection relationship between photovoltaic site i and photovoltaic site j, the element has a positive weight value. If there is no connection relationship between photovoltaic site i and photovoltaic site j, the weight of the element is 0.

[0046] In this embodiment, Haversine distance is used as the distance measurement method in the K nearest neighbor algorithm, and the connection relationship between each photovoltaic site is weighted using a weighted adjacency matrix, so as to more intuitively obtain the spatial distribution and mutual dependence between photovoltaic sites. The mutual relationship between the sites is quantified and displayed through the adjacency weighted matrix, which is convenient for subsequent prediction calculations and improves the reliability of site dependencies.

[0047] In other cases, constructing a site dependency graph based on a set of neighboring sites and an adjacency weight matrix also includes:

[0048] Calculate the first connection weight of each photovoltaic site in the neighboring site set and the second connection weight between the neighboring site sets by using the adjacency weight matrix according to the neighboring site set;

[0049] A site dependency graph is constructed according to the first connection weight, the second connection weight, and the neighbor site set.

[0050] In this case, for each photovoltaic site, the direct connection weight between it and its neighboring sites is calculated as the first connection weight; for the neighboring site sets of different photovoltaic sites, the similarity between each neighboring site set is calculated as the second connection weight. The first connection weight and the second connection weight are used to construct the first edge line and the second edge line in the site dependency graph respectively, and the site dependency graph is constructed in combination with the neighboring site set, so as to not only show the connection relationship between the sites, but also show the similarity relationship between the aggregated sites. At this time, the adjacency weighted matrix constructs the first connection weight through the Haversine distance, and constructs the second connection weight through the historical power output correlation, so that the site dependency graph can not only show the geographical correlation of each adjacent site, but also show the correlation between non-adjacent site sets at the same time sequence, so that in the final prediction, not only can the accurate prediction value be approximated through the same geographical relationship, but also the non-adjacent site set can be verified twice, so as to avoid the error of the final prediction result caused by the error of the sites with the same geographical relationship, and further improve the prediction accuracy. Of course, in other embodiments, the second connection weight can also be constructed by the similarity in the neighboring site set, such as calculating the number or proportion of common sites in the two sets and using it as a measure of the second connection weight.

[0051] In some other embodiments, calculating the first connection weight of each photovoltaic site in the neighboring site set and the second connection weight between the neighboring site sets by using the adjacency weight matrix according to the neighboring site set includes:

[0052] Calculate the first connection weight of each photovoltaic site in the neighboring site set by using the adjacency weight matrix according to the neighboring site set;

[0053] The power generation time series fluctuation of the neighboring site sets under the same weather conditions is obtained, and the second connection weights between the neighboring site sets are constructed based on the similarities between the neighboring site sets and the power generation time series fluctuation.

[0054] By taking the proportion of common sites between the sets of neighboring sites as the benchmark weight, taking the timing fluctuation of power generation as the fluctuation weight, and obtaining the second connection weight with the fluctuation weight and the benchmark weight, the timing fluctuation of power generation can be obtained according to the timing fluctuation of power generation under the same weather conditions within the preset time series. At this time, if the timing fluctuation of power generation of the photovoltaic site under the same weather conditions is smaller, it means that the photovoltaic site is less affected by factors other than weather, and the photovoltaic site is more stable. A more stable photovoltaic site is assigned a higher fluctuation weight, so that when showing the difference in geographical location, the photovoltaic site has smaller other influences as a comparison site, and the accuracy is higher.

[0055] In this embodiment, step S2 further includes:

[0056] The geolocation encoder is used to convert the longitude and latitude information of the photovoltaic sites into high-dimensional vectors, and the site dependency graph is updated.

[0057] The longitude and latitude information of the photovoltaic site is converted into a coordinate matrix C B The coordinate matrix C is first input into the geolocation encoder in the form of B Perform a sine transform and pass the transformed data to a fully connected neural network to further extract complex spatial features, thereby converting the geographic information of the photovoltaic site into a high-dimensional vector, optimizing the node feature representation in the graph structure, and enhancing the complex spatial representation in the graph. The longitude and latitude information of the photovoltaic site is converted into a high-dimensional vector using the geolocation encoder:

[0058] ;

[0059] Among them, C B represents the coordinate matrix; represents the minimum grid size, Indicates the maximum grid size; represents the parameter set of a fully connected neural network; PE represents the position encoding function; represents a fully connected neural network function; ST represents a sine transform.

[0060] pass Coordinate matrix C B Perform a sine transform to change the frequency and amplitude of the coordinate data so that the coordinate information can be further processed and then used Receive the sine transformed data and input it into a fully connected neural network for further processing of the data information.

[0061] The sine transform considers all the data points of the coordinate matrix as a whole and maps them to sine waves of different frequencies to meet the needs of spatial analysis at various scales. The sine transform is:

[0062] ;

[0063] in, Represents a set of sinusoidal transforms, including ST 0 arrive ST S-1 A series of sine transform results; S represents the total number of grid scales, that is, how many sine transforms of different frequency levels are required, and the frequency of the sine wave is adjusted according to the index and the total number of grid scales, that is, the sine wave frequency is adjusted from a grid scale of 0 to a grid scale of S-1.

[0064] The sine transform for a specific scale s and spatial dimension p is:

[0065] ;

[0066] in, Represents the coordinate matrix C B of p dimensional information; S represents the total number of grid scales; s represents the current scale level; .

[0067] Perform a sine transform from 0 to S-1 on each coordinate value in the coordinate matrix to obtain a series of sine wave representations of different frequencies. Combine the sine transform results of different frequencies to form a high-dimensional vector representation. Input this high-dimensional vector into a fully connected neural network to output a high-dimensional vector representation of the photovoltaic site:

[0068] ;

[0069] The high-dimensional vector representation of the PV site is added to the site dependency graph, and the site dependency graph is updated.

[0070] Step S2 also includes:

[0071] The updated site dependency graph is input into the graph attention network to build a spatial dependency model that includes the spatial relationships of sites.

[0072] The spatial feature matrix in the site dependency graph Characteristics of the same photovoltaic site X B The spliced ​​data (including historical power generation data of photovoltaic sites, weather information and other power-related features) are input into the graph attention network (GAT) to obtain the processed spatial feature matrix, thereby providing a richer feature expression for the power prediction task.

[0073] By random sampling, t 0 The characteristics of selecting a portion of PV sites from all PV sites at any time (including historical power generation data of photovoltaic sites, weather information and other power-related features) and coordinates , forming a small batch dataset [X B ,C B ],in is the number of PV sites sampled in the batch, that is, there are N sites in the entire system, which are randomly selected in each iteration Training at each site.

[0074] The characteristic matrix X of the photovoltaic site B and the spatial feature matrix obtained after processing by the geolocation encoder Perform the splicing operation, and use the splicing result express:

[0075] ;

[0076] Among them, || represents the concatenation operation of the features, which combines the two feature matrices in the feature dimension to form a new input matrix .

[0077] The result after splicing The input is input into the first layer of GAT. Through the attention mechanism in GAT, the model can selectively focus on the most important neighboring sites for each node, and update its own features based on the features of these neighboring sites, thereby improving the performance of the model when processing large-scale, multi-site prediction tasks.

[0078] The GAT layers are:

[0079] ;

[0080] in, represents the output features of PV site i at layer l; represents the set of neighboring sites of PV site i; represents the output features of PV site j at the l-1th layer; Represents a learnable weight matrix for linear changes in features; is the activation function, which is used to perform nonlinear transformation on the characteristics of the PV site; is the attention weight between photovoltaic site i and photovoltaic site j; L represents the number of layers of the graph attention network layer.

[0081] Attention Weight for:

[0082] ;

[0083] in, represents the output characteristics of PV site i in layer l-1; is a learnable vector used to calculate the correlation between photovoltaic site i and photovoltaic site j; Used to calculate the normalized attention weight between photovoltaic site i and photovoltaic site j.

[0084] A spatial dependency model including the spatial relationship of sites is constructed through the feature splicing layer and the graph attention network layer to improve the accuracy of capturing the spatial dependency relationship between sites, thereby improving the accuracy of photovoltaic prediction. At the same time, the introduction of the graph attention network layer to process graph structure data helps to adapt to site dependency graphs of different scales and structures and improve the adaptability of the model.

[0085] In other cases, the updated site dependency graph is input into the graph attention network, and constructing a spatial dependency model including the spatial relationship of the sites also includes:

[0086] Replace the fusion layer of the graph attention network layer based on the average recombination strategy and update the graph attention network layer;

[0087] Build the initial spatial dependency model with the updated graph attention network layer and feature concatenation layer;

[0088] The spatial dependency model is obtained using the site dependency graph and the initial spatial dependency model.

[0089] In this case, multi-head attention is used to enhance the expressiveness of the model:

[0090] ;

[0091] Among them, K represents the total number of attention heads; represents the weight matrix of the kth attention head in layer l, represents the attention weight between photovoltaic site i and photovoltaic site j of the kth attention head; || represents the splicing operation, which means splicing the outputs of different attention heads together. The final feature vector contains information from multiple attention heads.

[0092] In this embodiment, the fusion layer of the graph attention network layer is replaced based on the average recombination strategy, that is, in the last layer, the outputs of multiple attention heads are no longer concatenated, but recombined by averaging:

[0093] ;

[0094] Among them, L represents the number of layers of the graph attention network layer, represents the output features of photovoltaic site i output by the Lth layer of the graph attention network layer, represents the weight matrix of the kth attention head in the L-1th layer, Represents the output features of photovoltaic site j output by the L-1th layer of the graph attention network layer.

[0095] Finally, we get the spatial feature matrix after GAT processing. for:

[0096] ;

[0097] in, It is the initial input of the graph attention network layer; Represents the parameters of the graph attention network layer. The site dependency graph is used as the input of the feature concatenation layer, the output of the feature concatenation layer is used as the initial input of the graph attention network layer, and the output of the graph attention network layer is used as the output of the spatial dependency model to build a spatial dependency model. At the same time, the average recombination strategy is used to replace the fusion layer of the graph attention network layer, and a comprehensive feature representation is obtained by directly calculating the average value of the output of all attention heads, which reduces the complexity of the model and reduces the risk of overfitting.

[0098] At the same time, in order to effectively deal with the time dependency problem in PV site power forecasting, an autoregressive long short-term memory network (LSTM) combined with a probabilistic framework is introduced to ensure that both long-term and short-term dependencies of historical data can be considered when processing power forecasts for multiple time steps in the future.

[0099] LSTM captures the relationship between historical power generation data and future power generation trends through a recursive method of multiple time steps. Specifically, for each photovoltaic site i, the power output of each time step between the next time step of the current time step t0 and the time step T is predicted, that is, its future time step t 0 +1 to T power output:

[0100] ;

[0101] in, Indicates that photovoltaic site i has t 0 Power data of Represents the photovoltaic site i from time t 0 +1 to T power prediction value.

[0102] An autoregressive multi-layer LSTM is used to handle dependencies in time series, enabling it to dynamically adjust the state of the current time step based on historical data from past time steps, thereby gradually predicting future power output. The LSTM unit controls the flow of information through input gates, forget gates, and output gates, thereby effectively handling long-term and short-term dependencies.

[0103] The recursive prediction framework combines the time series processing of LSTM and the prediction values ​​generated by the probability layer with spatial features. A complete prediction mechanism has been built to achieve step-by-step prediction over multiple time steps:

[0104] ;

[0105] in, represents the predicted probability; represents the future photovoltaic power generation prediction matrix; X Brepresents the characteristic matrix of the PV site; Z represents the time covariate; Represents the future photovoltaic power generation prediction matrix at time step t; Represents the time step t 0 The prediction matrix of future photovoltaic power generation at time t-1.

[0106] A probability layer is introduced at each time step of the recursive prediction, and the last hidden state after LSTM processing is passed as input to the probability layer to generate future power prediction values ​​and prediction standard deviations, thereby constructing a probability distribution for each time step prediction:

[0107] ;

[0108] ;

[0109] in, represents the predicted value of photovoltaic site i at time step t, that is, the predicted value of power generation; Represents the weight of the fully connected layer of the predicted value; Represents the last hidden state of LSTM at time step t; Represents the bias of the fully connected layer of the predicted value; It represents the prediction standard deviation of PV site i at time step t, representing the uncertainty caused by external conditions; represents the weight of the standard deviation fully connected layer; represents the standard deviation of the fully connected layer bias.

[0110] During the model training process, the negative log-likelihood loss function is used to evaluate and optimize the model, so step S2 also includes:

[0111] Based on the autoregressive long short-term memory network combined with the recursive prediction framework, an LSTM layer including a probability layer is constructed;

[0112] The temporal dependency model is constructed based on the negative log-likelihood loss function and the LSTM layer containing the probability layer.

[0113] Constructing the first missing data filling layer according to the spatial feature compensation strategy includes:

[0114] The first filling value of the missing data site is taken as the mean of the characteristic values ​​of the neighboring sites of the missing data site.

[0115] When constructing a site dependency graph (KNN graph), missing data will affect the construction of the site dependency graph. In order to ensure the integrity of the construction of the site dependency graph, the missing data is filled based on the neighboring sites in the spatial domain. , fill in the missing data by calculating the feature mean of its perfect neighboring sites. If the features of all neighboring sites are also missing, fill their values ​​with 0 to construct the first missing data filling layer:

[0116] ;

[0117] in, represents the set of neighboring sites of photovoltaic site i, Indicates missing data, represents the missing data points of PV site i at time step t, Represents the power data of PV site j at time step t.

[0118] Constructing the second missing data filling layer according to the time feature compensation strategy includes:

[0119] The second filling value for the missing data site is the mean of the predicted distribution at the previous time step for the missing data site.

[0120] When dealing with time series forecasting, missing data affects the model's ability to generate a complete forecast distribution based on the forecast distribution of previous time steps to fill in the current missing data points. Specifically, in order to make up for the missing data points , in time series forecasting, the model uses the previous time step t The predicted distribution mean of -1 To fill the filling value of the current time step t, the second missing data filling layer is constructed:

[0121] ;

[0122] in, represents the power forecast mean generated by the LSTM layer containing the probability layer at the photovoltaic site i at time step t, Represents the power data of PV site i at time step t.

[0123] The negative log-likelihood loss function is modified to cope with missing data. When data is missing, the corresponding value in the negative log-likelihood loss function is set to 0 and does not participate in weight update to avoid introducing large errors in model training.

[0124] Therefore, constructing the third missing data filling layer according to the spatiotemporal correlation of the neighboring site set also includes:

[0125] According to the neighboring site set of the missing data site, obtain the second connection weight and connection set corresponding to the neighboring site set;

[0126] Obtain historical operation data of a time series corresponding to the connection set, and calculate a third filling value based on the historical operation data of the time series corresponding to the connection set and the second connection weight;

[0127] The second connection weight represents the weight between the neighboring site sets.

[0128] In this embodiment, the weight between the neighboring site sets, i.e., the second connection weight, is used to take the neighboring site set that is correlated (similarity in this embodiment) with the neighboring site set of the missing data site as the connection set, and the third filling value is calculated according to the historical operation data of the time series corresponding to the connection set and the second connection weight. For example, if the missing data site exists in set A, and set A has three connection sets B, C, and D, the similarity between set B and set A is 80%, the similarity between set C and set A is 50%, and the similarity between set D and set A is 30%. At this time, the second connection weights of set A and set B are , the second connection weight of set A and set C is , the second connection weight of set A and set D is , calculate the average value of the time series in the connection set. Taking the power generation of photovoltaic sites as an example, the average power generation of the time series in set B is 550w, the average power generation of the time series in set C is 560w, and the average power generation of the time series in set D is 365w. At this time, the third filling value of set A is , obtain the power generation of the time series of the remaining sites in set A, and then calculate the average value according to the first filling value, the second filling value, and the third filling value, and use the average value as the filling value of the missing data.

[0129] Constructing the spatiotemporal data processing layer with the first missing data filling layer, the second missing data filling layer, and the third missing data filling layer also includes:

[0130] The average value is calculated using the first filling value, the second filling value and the third filling value as the output of the spatiotemporal data processing layer.

[0131] Since the first filling value is obtained based on the spatial characteristics of the missing data site, the second filling value is obtained based on the temporal characteristics of the missing data site, and the third filling value is obtained based on the spatiotemporal correlation of the connection set of the missing data site, the three data do not have randomness, and the third filling value is obtained based on both temporal characteristics and spatial characteristics, so the average value of the three can be closer to the actual value, and the two one-way targeted filling values ​​and the one fusion calculated filling value are close to each other, avoiding the error of a single calculation, improving robustness, and ensuring the accuracy of missing data filling. At the same time, the third filling value is obtained based on the site dependency graph that needs to be constructed for the training itself, and only simple calculations are required, with low complexity.

[0132] In this embodiment, the predictive ability of the model is evaluated using a variety of performance evaluation indicators: normalized root mean square error (nRMSE), normalized mean absolute error (NMAE10), prediction interval coverage probability (PICP), normalized prediction interval average width (PINAW), average coverage error (ACE), interval score (IS), and continuous quantile probability score (CRPS). In the normalized root mean square error, this indicator is used to quantify the squared difference between the predicted value and the true value. The smaller the nRMSE (normalized root mean square error) value, the more accurate the model's prediction is. In the normalized mean absolute error, this indicator is used to quantify the absolute error and evaluate the prediction error that exceeds 10% of the PV site capacity. In the prediction interval coverage probability, PICP (prediction interval coverage probability) is used to measure whether the interval predicted by the model covers the actual power output. A higher PICP value indicates that the model's prediction interval better contains the true value. In the prediction interval average width normalized value, PINAW (prediction interval average width normalized value) is used to measure the width of the model prediction interval. R represents the range between the maximum and minimum true values. A smaller PINAW indicates that the model's prediction interval is more compact. In the average coverage error, ACE (average coverage error) is used to measure the reliability of the model prediction interval. ACE The closer it is to 0, the better the balance between the coverage and width of the model prediction interval. In the interval score, the interval score is used to measure the reliability and compactness of the model at the same time. A larger IS indicates a better prediction interval. In the continuous quantile probability score, CRPS (continuous quantile probability score) can comprehensively measure the distribution prediction ability of the model. A smaller CRPS value indicates that the model's prediction distribution is more accurate.

[0133] As a second embodiment of the present application, step S4 further includes:

[0134] Based on the historical operation data of the photovoltaic site, the neighboring site set in each historical time series is obtained;

[0135] Use clustering algorithm to perform cluster analysis on each set of neighboring sites to obtain cluster combinations;

[0136] The historical operation data of photovoltaic sites are divided according to cluster combinations, and a photovoltaic power generation prediction model corresponding to the cluster combination is trained based on the divided historical operation data of photovoltaic sites.

[0137] Correspondingly, step S5 also includes:

[0138] Obtain current photovoltaic operation data, and obtain the neighboring site set in the current time series according to the current photovoltaic operation data;

[0139] According to the matching results of the neighboring site set and the cluster combination in the current time series, the corresponding photovoltaic power generation prediction model is selected for parallel calculation;

[0140] The final prediction value is obtained by taking a weighted average based on the parallel calculation results and the matching proportions of the neighboring site set and the cluster combination in the current time series.

[0141] Haversine distance is used to obtain the neighboring site set in each historical time series, and then the neighboring site set in the historical time series is clustered and analyzed by clustering algorithm to show the neighbor differences in different time series, and the photovoltaic power generation prediction model is constructed and trained for each clustering result. At this time, each photovoltaic power generation prediction model is only for the neighboring site set of the current cluster. The current photovoltaic operation data is obtained, and the corresponding photovoltaic power generation prediction model is matched to the neighboring site set corresponding to the current photovoltaic operation data. Of course, since the site dependency graph has been constructed during the training process, the spatial data in the current photovoltaic operation data can be directly compared with the spatial data in the site dependency graph. If there is no difference, the neighboring site set in the site dependency graph is directly called. If there is a difference, the site dependency graph is updated according to the spatial data in the current photovoltaic operation data. Multiple matching photovoltaic power generation prediction models are calculated in parallel, and weighted average is performed according to the matching proportion to obtain the final prediction value, so that the final prediction value is more targeted. At the same time, the parallel calculation of photovoltaic power generation prediction models improves the calculation efficiency and ensures the timeliness of the prediction value output.

[0142] In this embodiment, the matching ratio can be calculated based on the similarity between the current neighbor site set and each cluster center. For example, the similarity between the neighbor site set Q and the cluster center P1 is 50%, the similarity between the neighbor site set Q and the cluster center P2 is 60%, and the similarity between the neighbor site set Q and the cluster center P3 is 40%. At this time, there is a photovoltaic power prediction model U1 corresponding to the cluster center P1, a photovoltaic power prediction model U2 corresponding to the cluster center P2, and a photovoltaic power prediction model U3 corresponding to the cluster center P3. The similarity can be directly obtained based on the second connection weight. The photovoltaic power prediction model U1 outputs C1, the photovoltaic power prediction model U2 outputs C2, and the photovoltaic power prediction model U3 outputs C3. The matching ratio of the neighbor site set and the cluster combination is:

[0143] The matching ratio between the neighboring site set Q and the cluster center P1 is: ;

[0144] The matching ratio between the neighboring site set Q and the cluster center P2 is: ;

[0145] The matching ratio between the neighboring site set Q and the cluster center P3 is: ;

[0146] The final predicted value is: .

[0147] As a third embodiment of the present application, a multi-site photovoltaic power generation prediction system based on a graph attention network includes:

[0148] Data acquisition module, used to obtain photovoltaic operation data;

[0149] A model building module, including a space-dependent model building unit, a time-dependent model building unit, a spatiotemporal data processing layer building unit, and a fusion unit, for building a photovoltaic power generation prediction model;

[0150] The prediction and analysis module is used to output multi-site photovoltaic power generation prediction data based on the current photovoltaic operation data output by the data acquisition module and the photovoltaic power generation prediction model constructed by the model construction unit.

[0151] In this embodiment, the spatial dependency model construction unit constructs a site dependency graph based on the photovoltaic site data in combination with the Haversine distance, and obtains a spatial dependency model including the spatial relationship of the sites based on the site dependency graph based on the graph attention network; the temporal dependency model construction unit constructs a temporal dependency model including the temporal relationship of the sites based on the autoregressive long short-term memory network combined with the probabilistic framework; the spatiotemporal data processing layer construction unit constructs a first missing data filling layer according to the spatial feature compensation strategy, constructs a second missing data filling layer according to the temporal feature compensation strategy, constructs a third missing data filling layer according to the spatiotemporal correlation of the set of neighboring sites, and constructs a spatiotemporal data processing layer with the first missing data filling layer, the second missing data filling layer and the third missing data filling layer; the fusion unit uses the historical operation data of the photovoltaic sites to construct a photovoltaic power generation power prediction model according to the spatial dependency model, the temporal dependency model and the spatiotemporal data processing layer.

[0152] Among them, the data acquisition module is connected to the model construction module and the prediction analysis module respectively, and the model construction module is connected to the prediction analysis module. The spatial dependency between photovoltaic sites is captured by constructing a site dependency graph (KNN) based on Haversine distance, and the geographic location encoder (GPE) is introduced to embed the geographic location information of the site in high dimensions to enhance the node feature expression ability; then, GAT is used to learn the node features, and the accuracy of photovoltaic power prediction is optimized by combining the spatial features of neighboring sites; then, the autoregressive multi-layer LSTM is combined with the probability framework for multi-step time series prediction to process the time dependency of photovoltaic power; finally, the spatiotemporal data processing layer is constructed through the first missing data filling layer, the second missing data filling layer and the third missing data filling layer, and the characteristics of neighboring sites, probability distribution and correlation of connection sets are used to fill the data gaps, improve the prediction robustness of the model in the case of high-proportion data missing, and achieve reliable power prediction in large-scale, multi-site photovoltaic systems.

[0153] The specific implementation described above is a preferred implementation of the multi-site photovoltaic power generation prediction method and system based on the graph attention network of the present application, and is not intended to limit the specific implementation scope of the present application. The scope of the present application includes but is not limited to the specific implementation embodiment. All equivalent changes made in accordance with the shape and structure of the present application are within the protection scope of the present application.

Claims

1. A multi-site photovoltaic power generation prediction method based on graph attention network, characterized by: The steps include: S1: Based on the graph attention network, a spatial dependency model including the spatial relationship of sites is obtained according to the site dependency; S2: A temporal dependency model including temporal relationships of sites is constructed based on an autoregressive long short-term memory network combined with a probabilistic framework; S3: construct a first missing data filling layer according to the spatial feature compensation strategy, construct a second missing data filling layer according to the temporal feature compensation strategy, construct a third missing data filling layer according to the spatiotemporal correlation of the neighboring site set, and construct a spatiotemporal data processing layer with the first missing data filling layer, the second missing data filling layer and the third missing data filling layer; S4: Use the historical operation data of photovoltaic sites to build a photovoltaic power generation prediction model based on the spatial dependence model, time dependence model and spatiotemporal data processing layer; S5: The photovoltaic power generation prediction model obtains multi-site photovoltaic power generation prediction data in response to current photovoltaic operation data.

2. The multi-site photovoltaic power generation prediction method based on graph attention network according to claim 1, characterized in that: The S1 further comprises: Obtain the longitude and latitude information of the photovoltaic sites, and obtain the Haversine distance between each photovoltaic site based on the longitude and latitude information of the photovoltaic sites; Based on the K-nearest neighbor algorithm, the neighboring site set of each photovoltaic site is obtained according to the Haversine distance; A site dependency graph is constructed based on the set of neighboring sites and the adjacency weighted matrix.

3. The multi-site photovoltaic power generation prediction method based on graph attention network according to claim 2, characterized in that: The step of constructing a site dependency graph based on the neighbor site set and the adjacency weighted matrix further includes: Using the adjacency weight matrix, a first connection weight of each photovoltaic site in the neighboring site set and a second connection weight between the neighboring site sets are calculated; A site dependency graph is constructed according to the first connection weight, the second connection weight, and the neighbor site set.

4. The multi-site photovoltaic power generation prediction method based on graph attention network as claimed in claim 3, characterized in that: The S1 further comprises: Use the geolocation encoder to convert the longitude and latitude information of the photovoltaic site into a high-dimensional vector and update the site dependency graph; The updated site dependency graph is input into the graph attention network to build a spatial dependency model that includes the spatial relationships of sites.

5. The multi-site photovoltaic power generation prediction method based on graph attention network according to claim 4, characterized in that: The step of inputting the updated site dependency graph into the graph attention network and constructing a spatial dependency model including the site spatial relationship further includes: Replace the fusion layer of the graph attention network layer based on the average recombination strategy and update the graph attention network layer; Build the initial spatial dependency model with the updated graph attention network layer and feature concatenation layer; The spatial dependency model is obtained using the site dependency graph and the initial spatial dependency model.

6. The multi-site photovoltaic power generation prediction method based on graph attention network according to claim 1, characterized in that: The S2 further includes: Based on the autoregressive long short-term memory network combined with the recursive prediction framework, an LSTM layer including a probability layer is constructed; The temporal dependency model is constructed based on the negative log-likelihood loss function and the LSTM layer containing the probability layer.

7. The multi-site photovoltaic power generation prediction method based on graph attention network according to claim 1, characterized in that: The constructing of the first missing data filling layer according to the spatial feature compensation strategy includes: The first filling value of the missing data site is taken as the mean of the characteristic values ​​of the neighboring sites of the missing data site.

8. The multi-site photovoltaic power generation prediction method based on graph attention network according to claim 7, characterized in that: The constructing of the second missing data filling layer according to the time feature compensation strategy includes: The second filling value for the missing data site is the mean of the predicted distribution at the previous time step for the missing data site.

9. The multi-site photovoltaic power generation prediction method based on graph attention network according to claim 8, characterized in that: The step of constructing the third missing data filling layer according to the spatiotemporal correlation of the neighboring site set further includes: According to the neighboring site set of the missing data site, obtain the second connection weight and connection set corresponding to the neighboring site set; Obtain historical operation data of a time series corresponding to the connection set, and calculate a third filling value based on the historical operation data of the time series corresponding to the connection set and the second connection weight; The second connection weight represents the weight between the neighboring site sets.

10. The multi-site photovoltaic power generation prediction method based on graph attention network according to claim 9, characterized in that: The step of constructing the spatiotemporal data processing layer with the first missing data filling layer, the second missing data filling layer and the third missing data filling layer further comprises: The average value is calculated using the first filling value, the second filling value and the third filling value as the output of the spatiotemporal data processing layer.

11. The multi-site photovoltaic power generation prediction method based on graph attention network according to claim 1, characterized in that: The S4 further comprises: Based on the historical operation data of the photovoltaic site, the neighboring site set in each historical time series is obtained; Use clustering algorithm to perform cluster analysis on each set of neighboring sites to obtain cluster combinations; The historical operation data of photovoltaic sites are divided according to cluster combinations, and a photovoltaic power generation prediction model corresponding to the cluster combination is trained based on the divided historical operation data of photovoltaic sites.

12. The multi-site photovoltaic power generation prediction method based on graph attention network according to claim 11, characterized in that: The S5 further includes: Obtain current photovoltaic operation data, and obtain the neighboring site set in the current time series according to the current photovoltaic operation data; According to the matching results of the neighboring site set and the cluster combination in the current time series, the corresponding photovoltaic power generation prediction model is selected for parallel calculation; The final prediction value is obtained by taking a weighted average based on the parallel calculation results and the matching proportions of the neighboring site set and the cluster combination in the current time series.

13. A multi-site photovoltaic power generation prediction system based on a graph attention network, used to implement the method according to any one of claims 1 to 12, characterized in that: include: Data acquisition module, used to obtain photovoltaic operation data; A model building module, including a space-dependent model building unit, a time-dependent model building unit, a spatiotemporal data processing layer building unit, and a fusion unit, for building a photovoltaic power generation prediction model; The prediction and analysis module is used to output multi-site photovoltaic power generation prediction data based on the current photovoltaic operation data output by the data acquisition module and the photovoltaic power generation prediction model constructed by the model construction unit.

Citation Information

Patent Citations

  • Photovoltaic intraday output prediction method and device

    CN118279084A

  • Generated power prediction model training method and device, equipment and medium

    CN118713054A

  • Photovoltaic power prediction method based on multi-scale space-time diagram attention convolutional network

    CN117154704A

  • Photovoltaic power prediction method, device and equipment and readable storage medium

    CN117638924A