1. Introduction
With the rapid growth of energy demand, environmental and energy security issues have attracted more and more attention. As an innovative energy generation mode, distributed generation has rapidly developed in recent years. Therefore, accurate prediction of distributed generation is of great significance to realize the balance of power supply and demand [
1,
2,
3,
4]. Improving the ultra-short-term power prediction accuracy of distributed photovoltaic (PV) power is the premise to ensure the safe and stable operation of the distribution network and the reliable consumption of high proportions of distributed PV power. Photovoltaic power generation depends on local weather conditions and cloud dynamics. The generation, movement, and ablation of clouds in the sky are the main reasons for the instability of photovoltaic power output. The accurate analysis of the presence and movement of clouds is the key to the ultra-short-term power prediction of photovoltaic power [
5,
6,
7].
A literature review on existing PV power prediction was implemented. A series of methods considering both satellite images and meteorological data perform well in long-term prediction [
8,
9,
10,
11]. By using surface cameras and satellite images, the cloud dynamic information of the sky can be obtained by processing and analyzing the timeseries images of the sky through digital image processing technology [
12,
13,
14]. For example, a mirror gradient repair method is used to restore the cloud distribution in the real sky [
15]. Distortion correction was carried out on the ground-based cloud map [
16] to improve the radiation prediction accuracy. Through digital image processing technology, the timeseries image of the sky is processed and analyzed [
17], and the cloud extraction algorithm [
18] is used to predict the solar occlusion, followed by predicting the irradiance and PV power. A PV ultra-short-term power prediction model [
18], combining numerical weather prediction and the ground-based cloud map, can be established to predict and correct the power attenuation caused by cloud occlusion. A mathematical model of irradiance conversion and the photovoltaic module model were verified by experiments [
19,
20,
21,
22]. Open operation, quadratic polynomial fitting, gray-level segmentation analysis, centroid angle function, and cluster analysis are used to establish the cloud feature model [
23,
24,
25], and then to carry out ultra-short-term photovoltaic power prediction. Although scholars have carried out a lot of work in cloud analysis and feature modeling and ultra-short-term prediction of photovoltaic power based on cloud analysis and modeling in recent years, there are still problems of difficult modeling [
26], and the cost of deploying and maintaining ground cameras in power grids with a large number of photovoltaic power stations is high [
27,
28,
29,
30,
31].
Using historical operation data to obtain the state information of atmospheric clouds is another mainstream direction, which can capture cloud cover and cloud movement by considering the spatial–temporal relationship between PV sites [
32,
33,
34]. To this end, the convolutional neural network (CNN) is used to extract spatio-temporal correlations [
35,
36,
37]. The method is to stack PV signals into images and reorder their positions in the images according to their positions. In addition, the authors of [
38,
39] also introduced an attention mechanism to capture spatial correlation. Graph signal processing is an emerging field that allows the processing of signals defined by irregular domains by using graphs to capture the interdependencies between PV power generation units in distributed generation areas [
40,
41,
42,
43,
44].
In recent years, the graph neural network (GNN) has been widely studied in the prediction word of many fields [
45,
46,
47], such as traffic prediction, weather forecast, social media prediction, etc. Due to its powerful expression ability and complex data processing ability, the graph neural network can make each node of the graph structure carry out efficient information transmission. The graph neural network has also been extensively studied in the field of photovoltaic power generation prediction. For example, the timeseries of photovoltaic power production at multiple sites is modeled as the signal on the graph [
48,
49,
50]. The graph neural network and the long- and short-term memory recurrent neural network were combined into a spatio-temporal GNN model to analyze the temporal and spatial characteristics of the historical data of photovoltaic power stations [
26,
50,
51]. However, when the prediction model is faced with the fluctuation of power generation, the fluctuation of the predicted value always lags behind that of the actual value.
Although the above studies use the historical information of each PV power generation point of distributed generation, they do not consider the information transmission direction of each PV power generation node in the distributed generation and cannot make full use of the advanced information of auxiliary PV power generation points. As a result, when the forecasting model faces the fluctuation of power generation, the fluctuation of the predicted value always lags behind the fluctuation of the real value.
Facing the challenge that the fluctuation of the predicted value of photovoltaic power generation always lags behind the fluctuation of the true value, we propose a rolling prediction model based on the graph neural network. The original contribution can be summarized as the following three points:
Facing the feature that ‘the fluctuation of the predicted value always lags behind the fluctuation of the real value in the time axis’, this paper attempts to use generation power from neighboring PV panels surrounding the target panel to indicate the lagging information in the prediction model.
The indicated lagging information is generated by a proposed lead–lag relationship analysis on the correlation model. The output of this model is set to the adjacency matrix in the graph neural network.
As the sun position and the cloud condition change in real time, this paper creates a rolling graph neural network, which uses the latest real-time lead–lag relationship result. The numerical study shows that the proposed rolling graph neural network performs better than typical traditional prediction models.
The rest of the paper is organized as follows.
Section 2 presents the architecture and mathematical modeling of the model.
Section 3 details the experimental background.
Section 4 presents the experimental results and discusses them, and the conclusion of this work is drawn in
Section 5.
2. Model Architecture and Mathematical Modeling
The ROLL-GNN model periodically updates the input data of the model to the latest historical power data over time, which leads to different models in different periods, and the structure is the same in each period, including a similarity analysis model and a graph convolutional model.
The similarity analysis model uses the historical data between different power points to calculate the similarity, which can obtain the lead–lag relationship between the data of each power generation point.
The graph convolution model extracts information from the input historical power data according to the adjacency matrix.
2.1. ROLL-GNN
In a suitable period, the lead–lag relationship between the PV power generation units in the distributed generation area is fixed, and this lead–lag relationship can be represented by the adjacency matrix in the graph neural network model. However, over a long period of time, the movement of the cloud layer does not have a single regularity, because of the complex change of the wind direction, and the movement of the cloud layer shows a change of pattern. Therefore, it is represented by multiple different adjacency matrices. Different patterns correspond to different prediction model parameters. We used online rolling training to obtain the adjacency matrix corresponding to this pattern by using the most recent data through similarity analysis. This adjacency matrix determines the direction of information transmission in the graph neural network model, which can reflect the cloud movement law in the current mode. The overall method is shown in
Figure 1.
Figure 1 shows the pattern of rolling predictions. The input for the first period is: X (t − m), X (t − m + 1), …, X (t − 1), and the output is: X (t + H). As the period changes, the input for the second period is: X (t − m + 1), X (t − m + 2), …, X (t), and the output is: X (t + H + 1). In the same way, the input in the third period is: X (t − m + 2), X (t − m + 3), …, X (t + 1), and the output is: X (t + H + 2). The input and output changed with the change of the period, and the similarity analysis model also obtained different adjacency matrices with the change of the input and output, which determined that the graph neural network in different periods was different. It should be noted that the model in the current period was trained on the basis of the model parameters in the previous period. For different forecasting periods, the adjacency matrix was obtained by similarity analysis based on recent historical data, which led to different forecasting models in different periods, which determined the use of rolling forecasting. The specific mathematical formulation is as follows:
where,
S represents the similarity calculation,
p(
t) represents the true value at time
t,
P(
t) represents the predicted value at time
t,
N represents the observation length of the correlation analysis,
M represents the observation length of the graph convolution, and
H represents the length of the discrete time steps after the prediction.
The above shows the rule of rolling prediction on the whole timeseries. The schematic diagram for the network structure is shown in
Figure 2.
Figure 2 shows the principle of ROLL-GNN in one cycle. The model is divided into two structures: similarity analysis and shape feature extraction.
The similarity analysis model includes several links. First, the target point was selected from all the distributed photovoltaic power generation points. Then, the analysis fragments were extracted from the historical data of the target photovoltaic power generation points. The Pearson correlation coefficient and mean-norm calculation of the target fragments were respectively calculated with the historical data of other photovoltaic power generation points. Then, the similarity curve was obtained by multiplying the calculated results of Pearson correlation coefficient and the mean-norm. Finally, the adjacency matrix was obtained by analyzing the similarity curve.
The feature extraction model is composed of graph convolutional layers, and it extracts features from the input historical data according to the direction of node information flow provided by the adjacency matrix.
2.2. Similarity Analysis
Short-term photovoltaic power generation is mainly affected by cloud movement, which is regular. This movement law can be reflected by the lead–lag relationship between the collected data of different sensors in a plane, as shown in
Figure 3, so that the state of the target sensor can be predicted in advance through the auxiliary sensor and the prediction accuracy can be improved. In view of the large amount of information of auxiliary sensors, in order to effectively extract the information with advance prompts, the similarity analysis of the data between the PV power generation units in the distributed generation area can be used to obtain the lead and lag order in the short term. In this paper, the Pearson correlation coefficient and the mean one norm were combined to analyze the data of each PV point, similarly [
42].
where,
C represents the degree of correlation,
n represents the length of the analysis fragment,
xi represents the numerical value in the analysis fragment,
yi represents the numerical value of the target fragment,
X represents the mean value of the whole analysis fragment, and
Y represents the mean value of the whole target fragment.
The process of data processing for correlation analysis is shown in the similarity analysis structure in
Figure 2. Firstly, we selected the target PV power generation point at the distributed generation point. In order to improve the accuracy of similarity, we intercepted the fluctuation segment of a fixed length (100 s) in the historical data of the target PV power generation point and calculated the similarity coefficient with the segment of the same length in the fixed period (3600 s) of the data of other PV power generation points. The segment with the largest similarity coefficient was selected as the segment corresponding to the target analysis segment. According to the position of the corresponding segment in the timeline, all PV power generation points can be sorted by leading and lagging in a cycle. Through the above similarity analysis, we can obtain the time ordering of all PV power generation points in the distributed generation area, and it is stipulated that the two PV power generation nodes closest to each other in time can transmit information; that is, the two nodes are connected. If the two nodes are connected, they will have a value of 1 at the corresponding position of the adjacency matrix of the graph neural network; conversely, they will have a value of 0 at the corresponding position of the adjacency matrix of the graph neural network.
2.3. Graph Convolution
A graph is a data structure that represents relationships between entities, where entities are represented by nodes and relationships are represented by edges. Here, a node is denoted by V and an edge by E. The topology of the graph is determined by its symmetric adjacency matrix, A, of size N × N, whose matrix elements yield the edge weights between vertices.
The Laplacian matrix (L) is the degree matrix (D) minus the adjacency matrix (W), that is, L = D − A. D is the degree matrix, whose diagonal value is the sum of the weights of the edges from the node. The Laplacian matrix is a symmetric, positive, semidefinite matrix, so the eigenvalues of this matrix must be non-negative, and there must be n linearly independent eigenvectors, which are an orthonormal basis in n-dimensional space and form an orthogonal matrix. Spectral decomposition, also known as eigen decomposition, is the method of decomposing a matrix into the product of a matrix represented by its eigenvalues and eigenvectors.
In our model, the graph signal
x represents the vector containing the power generation of all PV power plants at a certain time. Graph convolutions can be divided into two categories: spectral convolutions and spatial graph convolutions. The convolution of a spectrogram is defined in the Fourier domain of the graph: for a real function
h, the convolution of a graph signal
x with
h is defined as:
Convolution definition on graphs: First, the forward Fourier transform was performed on the input signal
x and the convolution kernel
g, and then the Hadamard product was performed on the spectral domain. Finally, the result was returned to the spatial domain by the inverse Fourier transform.
All spectrogram convolutions follow these definitions, the only difference is the choice of filter. Our model employed Chebyshev polynomials to approximate the filter in the spectral domain. In the matrix state, Chebyshev polynomials can be expressed as follows:
The convolution kernel in spectral domain was approximated by the Chebyshev polynomial.
The convolution of a graph signal can be described as follows:
3. Experiment
In this section, the ROLL-GNN model is evaluated on real datasets for distributed generation forecasting. We will first describe the experimental environment and then present the experimental results.
3.1. Dataset
The ROLL-GNN model proposed in this paper was evaluated using real data. We have placed 7 irradiance sensors in the roofs of 7 buildings on the campus of Guangdong University of Technology (Guangzhou, China), as shown in
Figure 4. Each irradiance sensor represents an independent distributed PV power generation. The sampling frequency was 1 s. The collection period each day was from 9:00 a.m. to 15:00 p.m. Data of 207 days in 2020 were collected, of which data from 145 days were used as the training set and from 21 days as the testing set. The validation set was 41 days. Considering that about 10% of the data was missing, linear interpolation was used to fill in the missing data points.
In this paper, we assumed that distributed generation had power supply points at the installation location of each PV sensor, and the area of the photovoltaic power panel at each power generation point was 10 m
2. The relationship between solar irradiance and photovoltaic power generation is given by the following formula:
where,
W represents the power generation per unit area, the unit is W/m
2,
J represents the light intensity per unit area, J/m
2, and
E is the conversion coefficient, which is related to the performance of the photovoltaic power panel.
3.2. Experimental Background Information
Our experiment was run on a PC and its compatible computers, using Windows operating system, the program code was written based on python version 3.7.1 and torch1.10.1, and the program running software was pycharm.
3.3. Data Preprocessing
For ROLL-GNN, BP, and LSTM, the power data of the real dataset were normalized in the same way: the data of each node were normalized according to the maximum power generation in the training year. The resolution of the data was 1 s.
3.4. Evaluation and Metrics
The proposed model and benchmark methods were compared on real datasets. Both the peak normalized mean square error (
MSE) and the mean absolute percentage error (
MAPE) were used as metrics. They are defined as follows:
where
P1(
t) is the predicted value of power generation at time
t,
P(
t) is the true value of power generation at time
t, and
T is the length of the evaluation time.
3.5. Training
The ratio of the training dataset, validation dataset, and test dataset of our model was 7:1:2. All datasets were first randomly shuffled according to the number of days, and then allocated to the training dataset, validation dataset, and test dataset, in proportion. The specific parameters of the model are shown in
Table 1.
3.6. Baselines
The BP neural network and the LSTM prediction model were used as the benchmark of distributed photovoltaic power generation prediction evaluation. BP has an excellent nonlinear mapping capability, and LSTM has a long-term memory function, which is suitable for long-term timeseries prediction. BP neural network and LSTM prediction models are typical models which are popular in various prediction scenarios, so they were selected as benchmark models in this paper.
4. Results and Discussion
We first predicted the total electricity in the distributed generation area for 60 s, 180 s, and 300 s in advance in the whole dataset, and evaluated the performance of the prediction results with the two indicators, MSE and MAPE.
Table 2 shows the experimental results of the MAPE of the three algorithms in the overall dataset at 60 s, 180 s, and 300 s in advance.
The results show that, on the overall dataset, ROLL-GNN was superior to the other two methods in the two prediction modes of 60 s and 180 s in advance, which indicates that ROLL-GNN has a stronger fitting effect than BP and LSTM in these two modes and shows the effectiveness of ROLL-GNN in capturing the cloud dynamics from photovoltaic production data. This result comes from the establishment of the mathematical model of correlation analysis, which can obtain the cloud movement information in a specified period and provides the adjacency matrix based on spatio-temporal correlation for the graph neural network. These adjacency matrices determine the information flow direction of each node in the distributed generation prediction. However, in the prediction mode of 300 s in advance, the prediction accuracy of ROLL-GNN was almost the same as that of the BP neural network, which indicates that the ability of ROLL-GNN to capture the spatio-temporal correlation of PV power production data began to decline, because the distance between PV sensors was too close, which led to the decline of the accuracy of the mathematical model of the correlation analysis. The principle here is that there is a maximum time limit for the cloud to move in the area of the PV sensor, and upon approaching this limit, the cloud movement pattern will change. This limit is determined by the speed at which the cloud moves and the radius of the area where the sensor is placed.
In order to verify the advanced perception ability of the ROLL-GNN model in the face of volatility, we selected two days with different data types (smooth and multi-volatility) in the test set and analyzed the prediction results of these two days in detail. The MSE and MAPE of the corresponding data are shown in
Table 3 and
Table 4.
The above results show that the prediction accuracy of ROLL-GNN was better than that of BP and LSTM in both datasets with smooth data and more fluctuating data, which indicates the effectiveness of ROLL-GN’s ability to sense the fluctuation of photovoltaic production data in advance in both datasets. We first screened out obvious fluctuations (as shown in
Figure 5 and
Figure 6) from the prediction results of the model predicted 60 s in advance for analysis.
Figure 5 shows the prediction mode of 60 s in advance. For the smooth dataset, the real power generation value of the attachment had a large decline at 11:18:00, the predicted value of BP and LSTM algorithms had a large decline at 11:19:00, and the prediction result of the ROLL-GNN model had a large decline at 11:18:30.
Figure 6 also shows the prediction mode of 60 s in advance. For the dataset with more fluctuations, the real power generation value of the attachment greatly decreased at 10:37:30, and the predicted value of BP and LSTM algorithms began to greatly decrease at 10:38:30. The prediction results of the ROLL-GNN model showed a large decline at 10:38:00, which indicates the effectiveness of the ROLL-GNN model in capturing the spatio-temporal correlation and advance perception of PV production data in the prediction mode of 60 s in advance. The prediction results of the 180 s in advance prediction mode were screened for obvious fluctuations, as shown in
Figure 7 and
Figure 8.
Figure 7 shows the prediction mode of 180 s in advance. For the smooth dataset, the real power generation value of the attachment had a large decline at 11:18:00, the predicted value of the BP and LSTM algorithms had a large decline at 11:21:00, and the prediction result of the ROLL-GNN model had a large decline at 10:19:10.
Figure 8 also shows the prediction mode of 180 s in advance. The dataset had more fluctuations, the real power generation value of the attachment greatly decreased at 10:37:30, and the predicted value of the BP and LSTM algorithms began to greatly decrease at 10:41:00. The prediction results of the ROLL-GNN model showed a large decrease at 10:38:45, which indicates the effectiveness of the ROLL-GNN model in capturing the spatio-temporal correlation and advance perception of PV production data in the mode predicted 180 s in advance. The prediction results of the 300 s in advance prediction mode were screened for obvious fluctuations, as shown in
Figure 9 and
Figure 10.
It can be seen from
Figure 9 that in the prediction mode of 300 s in advance, for the smooth dataset, the real power generation value of the attachment had a large decline at 11:18:00, the predicted value of the BP and LSTM algorithms had a large decline at 11:22:00, and the prediction result of the ROLL-GNN model had a large decline at 10:20:00. It can be seen from
Figure 10 that in the prediction mode of 300 s in advance, for the dataset with more fluctuations, the real power generation value of the attachment greatly decreased at 10:37:30. The fitting effect of the predicted value and the real value of the BP and LSTM algorithms was poor, and no similar waveform could be seen. The prediction results of the ROLL-GNN model showed a large decline at 10:41:05, which indicates that in the prediction mode of 300 s in advance, for the data with smooth data features, the ROLL-GNN model captured the spatio-temporal correlation and the effectiveness of advanced perception of photovoltaic production data, and for the data with more fluctuating data features, the ROLL-GNN model can also capture the spatio-temporal correlation of photovoltaic production data and the effectiveness of advanced perception. The advanced perception of ROLL-GNN decreased.
Whether it is a smooth dataset or a dataset with many fluctuations, the degree of fit between the predicted curve and the true value curve of ROLL-GNN was better than that of BP and LSTM. This was seen in two aspects. On the one hand, on sunny days, BP, LSTM, and ROLL-GNN had similar followability to the real data. In the face of PV output fluctuations, most segments of BP- and LSTM-predicted values did not have beating segments similar to the real data. Unlike BP and LSTM, when facing PV output fluctuations, the predicted value of ROLL-GNN had a high similarity with the fluctuation segments of real data. This indicates that the information between PV generation units in distributed generation is transferred to each other through ROLL-GNN, which can improve the accuracy of the prediction. On the other hand, whether in sunny or cloudy weather, ROLL-GNN had a more advanced perception ability than BP and LSTM in the face of a sudden big jump or big lift. The results showed that the prediction curve of ROLL-GNN was closer to the real value curve in the time axis in the face of a sudden big jump or big lift. This shows that the generation point of distributed generation can effectively use the information of other generation points. When the data of other PV generation points changed, such as with a large jump, the target PV generation point could sense the change in advance, which led to the advanced perception ability of ROLL-GNN. This advanced perception ability was realized by the graph neural network in the model.
The ROLL-GNN model proposed in this paper can not only improve the schedule of distributed PV generation prediction but can also make the distributed prediction have an advanced perception ability, which improved the grid’s dispatch ability in the face of sharp changes in the distributed PV power generation. The dispatch department of the grid can dispatch and understand the changes and adopt the frequency modulation measures in advance. Advance sensing helps to quickly start up the reserve capacity and avoid grid collapse.
5. Conclusions
This paper introduced a new graph convolutional neural network architecture for distributed photovoltaic power generation prediction, ROLL-GNN. This work used real data with a resolution of one second to compare ROLL-GNN with BP neural network and LSTM algorithms in three prediction intervals, i.e., 60, 180, and 300 s in advance. The comparison of the experimental results showed that for the test set of the whole dataset, the mean absolute percentage error (MAPE) of ROLL-GNN prediction results in the prediction mode of 60 s in advance was 1.72%, which is 4.01% less than that of the BP neural network and 1.1% less than that of the LSTM algorithm. In the prediction mode of 180 s in advance, the MAPE of ROLL-GNN prediction results was 4.65%, which is 1.59% less than that of the BP neural network and 3.86% less than that of the LSTM algorithm. In the prediction mode 300 s in advance, the MAPE of the prediction results of ROLL-GNN was 7.86%, which is 0.12% less than that of the BP neural network and 2.93% less than that of the LSTM algorithm.
By our estimation, an overly long advanced prediction time will decrease the accuracy. As the accuracy improvement was due to extra irradiance fluctuation information from neighboring PV panels or sensors, ‘how to advance the neighboring information to the target PV panel’ is the critical factor influencing the accuracy in different advance times. For example, if a cloud is coming towards the target panel from the east and there is a neighboring panel located at 200 m east of the target panel, and the wind speed at the cloud level is 2 m/s, then the neighboring panel can obtain about 200/2 = 100 s advance information to the target panel. If the prediction on the target panel is then changed to 5 min, this neighboring panel will lose its usage. In summary, a longer advanced prediction time requires a further neighboring panel to support its accuracy.
Through the similarity analysis of historical data, ROLL-GNN obtains the law of cloud dynamic influence on distributed power generation, which enables ROLL-GNN to have an advanced sensing ability, especially when the distributed PV power generation suddenly drops in a short period of time. Facing the sudden drop in power generation, the grid needs to prepare sufficient spare generation capacity. The benefit of ROLL-GNN is that in the face of the sharp changes of distributed photovoltaic power generation, the grid dispatch department can perceive the sharp change of electricity in advance through the ROLL-GNNY prediction model, and take frequency regulation measures in advance, which can reduce the cost of the power grid to the reserve capacity.
However, one of the limitations for ROLL-GNN is that it takes a long time for the ROLL-GNN model to perform the training calculation. Moreover, because the influence of cloud movement on photovoltaic power generation is related to the distance between the distributed photovoltaic power generation points, the prediction effect will become worse when the distance between the distributed photovoltaic power generation points is small and the advanced prediction time is long. We will further study the influence of distance on the advanced perception of ROLL-GNN in future works.