Distributed photovoltaic power prediction method and system based on multi-spatio-temporal scale fusion
By constructing a distributed photovoltaic power prediction method that integrates multiple spatiotemporal scales, a graph structure network is constructed, and based on the self-attention mechanism and graph structure network, the regional and temporal characteristics of photovoltaic sites are extracted based on the self-attention mechanism, nonlinear fusion is performed, shared representation is generated, and a multi-time scale prediction head is constructed. This solves the spatiotemporal coupling characteristic problem of distributed photovoltaic sites and improves the prediction accuracy.
Patent Information
- Application Number
- CN202510565576.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-04-30
- Publication Date
- 2025-09-19
AI Technical Summary
Existing technologies make it difficult to fully consider the spatiotemporal coupling characteristics between distributed photovoltaic sites, resulting in insufficient accuracy in photovoltaic output forecasting. In particular, insufficient spatial information extraction and limited temporal dynamic capture capabilities make it difficult to accurately predict monthly and annual total electricity consumption.
By constructing a graph structure network, the regional and temporal characteristics of photovoltaic sites are extracted based on the self-attention mechanism, and nonlinear fusion is performed to generate shared representations. The prediction heads at the daily, monthly, and year levels are constructed, and the joint loss function is used to optimize the model parameters.
The accuracy of distributed photovoltaic power prediction has been significantly improved, especially in high-time-resolution data processing, by accurately capturing complex interactive information, dynamically adapting to the physical dependencies between photovoltaic sites, and improving prediction accuracy.
Smart Images

Figure CN120675028A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to photovoltaic power prediction means, belongs to the field of power system prediction, and in particular to a distributed photovoltaic power prediction method and system based on multi-time and space scale fusion. Background Art
[0002] There are a large number of distributed photovoltaic sites, which are widely distributed and regionally dispersed. Predicting each site individually is not only inefficient, but also fails to fully consider their temporal and spatial correlation characteristics. The temporal and spatial coupling characteristics of photovoltaic output are mainly reflected in the fact that photovoltaic output is significantly affected by atmospheric cloud shielding. Taking the north wind as an example, when the north wind blows southward and the atmospheric clouds gradually move southward, the output of the photovoltaic power station in the north will usually decrease first, followed by the output of the photovoltaic power station in the south. The correlation between the two is related to the distance between the photovoltaic power station in the north and the photovoltaic power station in the south and the wind speed. Therefore, when predicting cluster photovoltaic output, only considering the time and space characteristics without considering the temporal and spatial coupling characteristics will make it difficult to accurately model this physical phenomenon.
[0003] Traditional distributed photovoltaic output prediction methods mostly use fixed-weight graph convolution and simple feature splicing, which have many shortcomings. On the one hand, fixed weights cannot dynamically reflect the complex physical dependencies between sites, resulting in insufficient spatial information extraction and difficulty in fully characterizing regional characteristics. On the other hand, single-time scale modeling cannot capture the nonlinear interaction information contained in the load data of each period, and thus it is difficult to effectively and comprehensively predict the total monthly and annual electricity consumption, and the ability to capture temporal dynamics is limited. In addition, simple splicing or linearly weighted information fusion methods cannot fully express the complex relationship between spatial and temporal characteristics, and cannot effectively integrate multi-dimensional information to improve prediction accuracy. Summary of the Invention
[0004] The purpose of the present invention is to overcome the above-mentioned defects and problems existing in the prior art and to provide a distributed photovoltaic power prediction method and system based on multi-time and space scale fusion that fully considers the time and space coupling characteristics to improve the prediction accuracy.
[0005] To achieve the above objectives, the technical solution of the present invention is: a distributed photovoltaic power prediction method based on multi-time and space scale fusion, comprising:
[0006] Obtain historical power data, meteorological data, installed capacity, and geographic location information of distributed photovoltaic sites, and build a graph-structured network;
[0007] Based on the graph structure network, the regional characteristics of distributed photovoltaic sites are extracted; based on the self-attention mechanism, the temporal characteristics of distributed photovoltaic sites are extracted;
[0008] Perform nonlinear fusion of regional characteristics and time characteristics to obtain fusion characteristics;
[0009] The regional characteristics, temporal characteristics and fusion characteristics are spliced together through nonlinear transformation to form a shared representation;
[0010] Based on the shared representation, prediction heads at the day, month, and year levels are constructed for different time scales.
[0011] A photovoltaic power prediction model is constructed based on the daily, monthly and annual prediction heads, and photovoltaic power predictions are performed at the daily, monthly and annual levels.
[0012] The method of extracting regional characteristics of distributed photovoltaic sites based on a graph structure network specifically includes:
[0013] Based on the graph structure network, the graph convolutional network is improved by self-attention weights, and the improved dynamic weighted graph convolutional network is used to extract the regional characteristics of distributed photovoltaic sites. The expression is as follows:
[0014]
[0015] Where: R i is the regional characteristic, φ is the activation function; is the characteristic vector of photovoltaic site i in the lth layer; W R is the learnable weight matrix; b R is the bias vector; is the characteristic vector of photovoltaic site i in the l+1th layer; α ij is the self-attention weight; W (l) The learnable weight matrix of layer l; R i 、R j are the regional characteristic vectors of photovoltaic site i and photovoltaic site j respectively; is the dot product; ||R i ||、||R j || are all Euclidean norms; β is the sensitivity parameter; ∈ is a constant; R k R i The number of traversals; w ij is the fixed edge weight between photovoltaic site i and photovoltaic site j in the graph structure network; d ij is the geographical distance between PV site i and PV site j; σ d is the distance normalization parameter; cosθ ij is the cosine similarity of the historical power data of PV site i and PV site j; C i 、C j are the installed capacities of PV sites i and j respectively; max(C) is the maximum installed capacity of all PV sites; α, β, and γ are all hyperparameters. is the characteristic vector of photovoltaic site j in the lth layer.
[0016] The temporal characteristics of distributed photovoltaic sites are extracted based on the self-attention mechanism, specifically including:
[0017] Combine the historical power data of distributed photovoltaic sites with meteorological data to construct the feature matrix X t , which is expressed as follows:
[0018] X t =[P t ;M t ];
[0019] Where: P t is the historical power data of the photovoltaic site in period t, M t is the meteorological data of the photovoltaic site in period t;
[0020] For the feature matrix X t Perform linear transformation to embed feature weights and obtain the embedded feature matrix E, which is expressed as follows:
[0021] E=X t W E +b E ;
[0022] Where: W E is the feature embedding weight matrix, b E is the bias vector;
[0023] Based on the embedded feature matrix E, the query vector, key vector and value vector are generated, and their expressions are as follows:
[0024] Q=E·W Q , K=E·W K , V=E·W V ;
[0025] Where: Q is the query vector, K is the key vector, V is the value vector, W Q 、W K 、W V are the linear transformation matrices for generating query vector, key vector and value vector respectively;
[0026] Based on the query vector, key vector and value vector, the attention matrix A is calculated, which is expressed as follows:
[0027]
[0028] Where: d k is the dimension of the key vector, and softmax is the normalization operation;
[0029] Based on the attention matrix A, the value vector V is weighted averaged to obtain the time characteristic T of the distributed photovoltaic site, which is expressed as follows:
[0030] T=A·V.
[0031] The regional characteristics and the time characteristics are nonlinearly fused to obtain the fusion characteristics, which are expressed as follows:
[0032]
[0033] Among them: F i is the fusion feature, R i is the regional characteristic vector of photovoltaic site i, T i is the time characteristic vector of photovoltaic site i, ⊙ is the element-by-element multiplication, ||R i ||、||T i || are both Euclidean norms, and ∈ is a constant.
[0034] The regional characteristics, time characteristics, and fusion characteristics are spliced together through nonlinear transformation to form a shared representation, which is expressed as follows:
[0035] S=σ(W S ·([R i ;T i ; F i ])+b S );
[0036] Among them: S is the shared representation, R i is the regional characteristic, T i is the time characteristic, F i is the fusion characteristic, W S is the weight matrix, b S is the bias vector and σ is the activation function.
[0037] Based on the shared representation, prediction heads at the day, month, and year levels are constructed for different time scales, and their expressions are as follows:
[0038]
[0039] Among them: Among them: is the daily forecast head, which represents the actual daily total electricity consumption, and t represents the actual load data of the t-th period on a certain day; is the monthly prediction head, which represents the actual monthly total electricity consumption; is the grade prediction head, which represents the actual annual total electricity consumption; W day 、W month 、W year are the weights of the prediction heads for day, month and grade respectively; b day 、b month 、b year are the bias constants of the day-level, month-level, and year-level prediction heads, respectively.
[0040] The photovoltaic power prediction model uses a joint loss function for back propagation to update the parameters of the photovoltaic power prediction model. The expression of the joint loss function is as follows:
[0041] L=λ day L day +λ month L month +λ year L year ;
[0042]
[0043]
[0044] Where: L day 、L month 、L year are daily, monthly and yearly losses respectively; λ day ,λ month ,λ year are the weights of daily, monthly and year-level losses respectively; n is the number of daily prediction periods.
[0045] A distributed photovoltaic power prediction system based on multi-time and space scale fusion is applied to the above method, and the system includes:
[0046] The data preprocessing module is used to obtain historical power data, meteorological data, installed capacity and geographic location information of distributed photovoltaic sites and build a graph structure network;
[0047] The regional and temporal feature extraction module is used to extract the regional features of distributed photovoltaic sites based on a graph structure network; and to extract the temporal features of distributed photovoltaic sites based on a self-attention mechanism;
[0048] The feature fusion module is used to nonlinearly fuse regional features and temporal features to obtain fusion features;
[0049] The nonlinear transformation splicing module is used to splice regional features, temporal features, and fusion features through nonlinear transformation to form a shared representation;
[0050] A multi-timescale prediction head construction module is used to construct prediction heads at the daily, monthly, and grade levels for different time scales based on shared representations.
[0051] The photovoltaic power prediction module is used to build a photovoltaic power prediction model based on the daily, monthly and annual prediction heads, and to perform daily, monthly and annual photovoltaic power predictions.
[0052] A distributed photovoltaic power prediction device based on multi-time and space scale fusion, the device comprising a processor and a memory;
[0053] The memory is used to store computer program code and transmit the computer program code to the processor;
[0054] The processor is used to execute the above-mentioned distributed photovoltaic power prediction method based on multi-time and space scale fusion according to the instructions in the computer program code.
[0055] A distributed photovoltaic power prediction storage medium based on multi-time and space scale fusion has a computer program stored thereon. When the computer program is executed by a processor, the distributed photovoltaic power prediction method based on multi-time and space scale fusion is implemented.
[0056] Compared with the prior art, the present invention has the following beneficial effects:
[0057] The present invention provides a distributed photovoltaic power prediction method and system based on multi-spatiotemporal scale fusion. The method first obtains data of distributed photovoltaic sites and constructs a graph structure network, extracts regional characteristics and time characteristics therefrom, then obtains fusion characteristics by nonlinearly fusing the regional characteristics and time characteristics, and then splices the regional characteristics, time characteristics and fusion characteristics to form a shared representation. Then, based on the shared representation, prediction heads of different time scales are constructed to perform photovoltaic power prediction. In application, this design accurately captures the complex interaction between regional characteristics and time characteristics to generate numerically stable and information-rich fusion characteristics, and again splices the fusion characteristics with regional characteristics and time characteristics to form a shared representation to capture the complementary information of multiple spatiotemporal characteristics, dynamically adapt to the complex physical dependency between photovoltaic sites that changes with weather, seasons, etc., fully considers the spatiotemporal coupling characteristics therein, improves the performance when processing high-time resolution data, and thus significantly improves prediction accuracy. BRIEF DESCRIPTION OF THE DRAWINGS
[0058] Figure 1 It is a flow chart of the method of the present invention.
[0059] Figure 2 This is a schematic diagram of the photovoltaic site distribution in Example 1 of the present invention.
[0060] Figure 3 Schematic diagram of the comparison of the daily prediction results in Example 1 of the present invention.
[0061] Figure 4 It is a schematic diagram of the comparison of the monthly prediction results in Example 1 of the present invention.
[0062] Figure 5 2 is a schematic diagram comparing the grade prediction results in Example 1 of the present invention.
[0063] Figure 6 It is a system structure diagram of the present invention.
[0064] Figure 7 It is a diagram of the equipment structure of the present invention.
[0065] In the figure: data preprocessing module 1, regional and temporal feature extraction module 2, feature fusion module 3, nonlinear transformation splicing module 4, multi-time scale prediction head construction module 5, photovoltaic power prediction module 6, processor 7, memory 8, computer program code 81. DETAILED DESCRIPTION
[0066] The present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments.
[0067] Example 1:
[0068] See also Figure 1 , a distributed photovoltaic power prediction method based on multi-temporal and spatial scale fusion, including:
[0069] Obtain historical power data, meteorological data, installed capacity, and geographic location information of distributed photovoltaic sites, and build a graph-structured network;
[0070] In this solution, historical power data is used to represent the output power of PV sites at different time points. For example, 96 data points are recorded daily, with one data point every 15 minutes. Meteorological data includes solar irradiation, temperature, and wind speed to reflect the impact of the environment on the load. Installed capacity is used to represent the installed capacity of each PV site. Geographical location information is the longitude and latitude of each PV site.
[0071] Furthermore, after obtaining the above data, it is necessary to first normalize the data to unify the data scale and eliminate the influence of different units to facilitate model training; the normalized expression is as follows:
[0072]
[0073] Where: x′ is the normalized data, ranging from [0, 1]; x is the original data value, such as power or temperature; min(x) and max(x) are the minimum and maximum values of the original data in the data set, respectively;
[0074] Furthermore, an undirected graph G = (V, E) is constructed based on the normalized data; V represents the vertex set and E represents the edge set. The graph structure network can quantify the physical dependencies between photovoltaic sites and provide an accurate spatial information basis for the extraction of regional characteristics.
[0075] Then determine the fixed edge weight w between photovoltaic site i and photovoltaic site j in the graph structure network ij, which is expressed as follows:
[0076]
[0077] Where: d ij is the geographical distance between PV site i and PV site j; σ d is the distance normalization parameter; cosθ ij is the cosine similarity of the historical power data of PV site i and PV site j; C i 、C j are the installed capacities of PV sites i and j respectively; max(C) is the maximum installed capacity of all PV sites; α, β, and γ are all hyperparameters.
[0078] Based on the graph structure network, the regional characteristics of distributed photovoltaic sites are extracted. The specific steps include:
[0079] Based on the graph structure network, the graph convolutional network is improved by self-attention weights, and the improved dynamic weighted graph convolutional network is used to extract the regional characteristics of distributed photovoltaic sites. The expression is as follows:
[0080]
[0081] The expression of the self-attention weight is as follows:
[0082]
[0083] Where: R i is the regional characteristic, φ is the activation function; is the characteristic vector of photovoltaic site i in the lth layer; is the feature vector of photovoltaic site j in the lth layer, which has a connection relationship with photovoltaic site i; W R is the learnable weight matrix; b R is the bias vector; is the characteristic vector of photovoltaic site i in the l+1th layer; α ij is the self-attention weight; W (l) The learnable weight matrix of layer l is used to map the features of layer l to the feature space of layer l+1. This weight matrix is a parameter updated by backpropagation during model training. It controls how graph convolution transforms photovoltaic site features and helps the model learn more useful photovoltaic site representations. i 、R j are the regional feature vectors of photovoltaic site i and photovoltaic site j respectively, The mapped information is used to describe the spatial information of the photovoltaic site, which is obtained from the photovoltaic site features through a learnable nonlinear mapping; is the dot product, used to measure R i With Rj The larger the value, the higher the similarity; || R i ||、||R j || are both Euclidean norms, indicating the size of the vector; β is a sensitivity parameter used to adjust the degree of influence of similarity on the weight and control the concentration of attention distribution. In this scheme, the initial value is set to 1.0, and the optimal value is obtained by tuning the validation set. A larger β value makes the weight distribution more concentrated on photovoltaic sites with high similarity, while a smaller β value makes the weight distribution more uniform. This parameter solves the problem that fixed weights in traditional graph convolution cannot dynamically adapt to changes in the relationship between photovoltaic sites; ∈ is a constant used to prevent division by zero, for example: ∈ = 10 -6 ; R k R i The number of traversals.
[0084] The neighborhood information aggregation weight is dynamically adjusted through the self-attention mechanism, so that the extracted regional characteristics are more consistent with the actual physical relationship, which helps to capture the local correlation in the load data in each period of the day.
[0085] Based on the self-attention mechanism, the temporal characteristics of distributed photovoltaic sites are extracted. The specific steps include:
[0086] Combine the historical power data of distributed photovoltaic sites with meteorological data to construct the feature matrix X t , which is expressed as follows:
[0087] X t =[P t ;M t ];
[0088] Where: P t is the historical power data of the photovoltaic site in period t, M t is the meteorological data of the PV site during period t; by fusing the two types of data, the model can capture both load and environmental dynamic information.
[0089] For the feature matrix X t Perform linear transformation to embed feature weights and obtain the embedded feature matrix E, which is expressed as follows:
[0090] E=X t W E +b E ;
[0091] Where: W E is the feature embedding weight matrix, b E is the bias vector; this operation is used to reduce the dimension and remove noise, preparing for the subsequent self-attention mechanism calculation.
[0092] Based on the embedded feature matrix E, the query vector, key vector and value vector are generated, and their expressions are as follows:
[0093] Q=E·W Q , K=E·W K , V=E·W V ;
[0094] Where: Q, K, V represent the feature information of each time step; Q is the query vector, K is the key vector, V is the value vector; W Q 、W K 、W V Generate linear transformation matrices for query vectors, key vectors, and value vectors respectively; this operation provides the basis for the self-attention mechanism, enabling the model to calculate the relevance and importance between time steps.
[0095] Based on the query vector, key vector and value vector, the attention matrix A is calculated, which is expressed as follows:
[0096]
[0097] Where: d k is the dimension of the key vector, which is used for scaling; softmax is a normalization operation that ensures that the sum of the weights of each row is 1; this operation can automatically identify the correlation between time steps and strengthen the focus on key information.
[0098] Based on the attention matrix A, the value vector V is weighted averaged to obtain the time characteristic T of the distributed photovoltaic site, which is expressed as follows:
[0099] T=A·V.
[0100] The regional characteristics and time characteristics are nonlinearly fused to obtain the fusion characteristics, which are expressed as follows:
[0101]
[0102] Among them: F i is the fusion characteristic; R i is the regional feature vector of photovoltaic site i, used to describe spatial information; T i is the time characteristic vector of photovoltaic site i, which is used to describe the load and meteorological dynamics in each period of the day; ⊙ is the element-by-element multiplication, which is used to calculate R i and T i Multiply the corresponding elements to capture nonlinear interactions; ||R i ||、||T i || are both Euclidean norms, indicating the magnitude or energy of a vector; ∈ is a constant used to prevent division by zero, for example, ∈ = 10 -6 .
[0103] This scheme adopts element-by-element multiplication to capture the interactive relationship between spatial and temporal features, and combines L2 norm normalization. This design not only captures the nonlinear interaction between spatial and temporal features through element-by-element multiplication, but also avoids the gradient explosion and gradient vanishing problems through L2 norm normalization operation, ensuring the numerical stability of the fusion characteristics; at the same time, this fusion method is particularly suitable for processing the change pattern of cluster photovoltaic sites at different time scales (day, month, year), effectively integrating short-term fluctuation information and long-term change trends; through nonlinear fusion, R is accurately captured. i With T i The complex interaction between them generates the fusion feature F i The values are more stable, providing high-quality features for building shared representations.
[0104] In this solution, the output of all PV sites is fed into a self-attention weighted graph convolutional network and weighted by regional features. Regional characteristics are related to the distance between PV sites. The closer the PV plants, the stronger the correlation, which is consistent with physical properties. However, this correlation has a time lag, with the lag increasing with greater distance. Therefore, regional characteristics are superimposed on temporal characteristics to account for nonlinear effects in time and space. For example, the impact of the temporal characteristics of site A at a certain time period on the temporal characteristics of site B at a certain time period is not immediate; there is a lag effect. The magnitude of this lag depends on the distance between the two sites. The greater the distance, the greater the difference in regional characteristics and the greater the lag effect.
[0105] The regional characteristics, time characteristics, and fusion characteristics are spliced together through nonlinear transformation to form a shared representation; its expression is as follows:
[0106] S=σ(W S ·([R i ;T i ; F i ])+b S );
[0107] Among them: S is the shared representation; R i It is a regional characteristic used to provide the spatial topology and geographic information of photovoltaic sites; T i It is a time characteristic, used to provide the dynamic change pattern of the time series; F i is a fusion feature used to provide interactive information of spatial and temporal features; W S is the weight matrix used to map the concatenated vector to the new representation space, Where d′ is the dimension after mapping, which is optimized together with other network parameters through back propagation. The initialization method is Xavier or He, which is used to map the concatenated vector to the new representation space; b S is the bias vector, For use with WS The parameters are optimized together through back-propagation; σ is the activation function, such as ReLU; by introducing the nonlinear transformation σ(·), the features from different sources are compressed and integrated into a unified semantic space.
[0108] In this scheme, [R i ;T i ; F i ] means to set R i 、T i 、F i A comprehensive feature vector is formed by splicing columns together. The shared representation S can capture the complementary information of multiple spatiotemporal features, which also includes the original spatial information, temporal dynamic information and their nonlinear interaction information. It can provide rich and comprehensive feature support for downstream load forecasting tasks and can support daily, monthly and annual forecasting tasks at the same time.
[0109] Based on the shared representation, prediction heads at the day, month, and year levels are constructed for different time scales. Their expressions are as follows:
[0110]
[0111] Among them: Among them: is the daily forecast head, which represents the actual daily total electricity consumption, and t represents the actual load data of the t-th period on a certain day; is the monthly prediction head, which represents the actual monthly total electricity consumption; is the grade prediction head, which represents the actual annual total electricity consumption; W day 、W month 、W year are the weights of the prediction heads at the day level, month level, and grade level, respectively; b day 、b month 、b year are the bias constants of the day-level, month-level, and year-level prediction heads, respectively.
[0112] A photovoltaic power prediction model is constructed based on the daily, monthly and annual prediction heads, and photovoltaic power predictions are performed at the daily, monthly and annual levels.
[0113] Furthermore, the photovoltaic power prediction model uses a joint loss function for back propagation to update the parameters of the photovoltaic power prediction model. The expression of the joint loss function is as follows:
[0114] L=λ day L day +λ month L month +λ year L year ;
[0115] Among them: Daily loss uses mean square error (MSE) to ensure prediction accuracy, and its expression is as follows:
[0116]
[0117] Monthly loss uses the mean absolute percentage error (MAPE) to ensure prediction accuracy, and its expression is as follows:
[0118]
[0119] The grade loss uses logarithmic mean square error (Log-MSE) to ensure prediction accuracy, and its expression is as follows:
[0120]
[0121] Where: L day , L month , L year are daily, monthly and yearly losses respectively; λ day ,λ month ,λ year are the weights of daily, monthly and grade-level losses respectively. In this scheme, λ day Preferably 0.4, λ month Preferably 0.3, λ year It is preferably 0.3; n is the number of daily forecast periods.
[0122] In this scheme, the joint loss function directly calculates the error between the predicted value and the actual value. The daily loss calculates the mean square error on the data of each time period of each day to ensure the prediction accuracy of each time period; the monthly and yearly losses are optimized for the total power consumption to ensure the overall prediction accuracy.
[0123] In this embodiment, a simulation analysis is carried out based on a data set of 10 distributed photovoltaic sites in a certain area. The site distribution and installed capacity of the 10 distributed photovoltaic sites are as follows: Figure 2 As shown; the longitude and latitude coordinates of the dots in the figure represent the geographical location of each distributed photovoltaic site, and the color represents the corresponding installed capacity.
[0124] The dataset obtained by simulation contains historical power data, meteorological data, installed capacity and geographical location information collected daily from 10 photovoltaic sites. The historical power data is recorded at 1 data point every 15 minutes, with 96 data points recorded daily. The learning rate of the photovoltaic power prediction model is set to 0.001, the batch size is 32, and the loss weight is set to λ. day =0.4,λ month =0.3,λ year=0.3, the sensitivity parameter β is 1.0; based on the method in this embodiment, power prediction at different time scales is performed on 10 photovoltaic sites, and the prediction accuracy of a photovoltaic site at different time scales is shown in the following table.
[0125]
[0126] As can be seen from the table, in the daily forecast, the forecast model predicts the load data for each of the 96 periods of each day. The average actual data on a certain day is 15.0kW, the predicted average is 15.2kW, and the daily mean square error (MSE) is about 1.5kW, indicating that the forecast model has a high accuracy in short-term load forecasting.
[0127] In the monthly forecast, the forecast model predicted the total monthly electricity consumption to be approximately 435kW, which is about 3.2% compared with the actual 450kW, which is better than the >5% error commonly seen in traditional methods.
[0128] In the grade-level forecast, the logarithmic mean square error is used for calculation, and the MAPE of the forecast model in the annual total electricity forecast is about 2%, indicating that the long-term trend forecast is smooth and accurate.
[0129] Figure 3 This is a comparison chart of the daily prediction results. As can be seen from the figure, the average error between the predicted and actual values of the load data of the photovoltaic site in 96 time periods on a certain day is about 1.5kW. It can be seen that this method accurately predicts its photovoltaic output curve.
[0130] Figure 4 and Figure 5 The following charts compare the results of monthly and yearly forecasts. The monthly forecast shows that the actual monthly total electricity consumption is approximately 450 kW, while the predicted monthly total electricity consumption is approximately 435 kW. The yearly forecast shows that the actual annual total electricity consumption is approximately 5000 kW, while the predicted annual total electricity consumption is approximately 4900 kW, with a MAPE error of 2%. This means that our forecasting method achieves excellent accuracy for both monthly and yearly forecasts.
[0131] Example 2:
[0132] See also Figure 6 A distributed photovoltaic power prediction system based on multi-time and space scale fusion is applied to the method described in Example 1, and the system includes:
[0133] Data preprocessing module 1 is used to obtain historical power data, meteorological data, installed capacity and geographical location information of distributed photovoltaic sites and build a graph structure network;
[0134] Regional and temporal feature extraction module 2 is used to extract the regional features of distributed photovoltaic sites based on a graph structure network; and to extract the temporal features of distributed photovoltaic sites based on a self-attention mechanism;
[0135] Furthermore, the region and time feature extraction module 2 extracts the region features according to the following method:
[0136] Based on the graph structure network, the graph convolutional network is improved by self-attention weights, and the improved dynamic weighted graph convolutional network is used to extract the regional characteristics of distributed photovoltaic sites. The expression is as follows:
[0137]
[0138]
[0139] Where: R i is the regional characteristic, φ is the activation function; is the characteristic vector of photovoltaic site i in the lth layer; W R is the learnable weight matrix; b R is the bias vector; is the characteristic vector of photovoltaic site i in the l+1th layer; α ij is the self-attention weight; W (l) The learnable weight matrix of layer l; R i 、R j are the regional characteristic vectors of photovoltaic site i and photovoltaic site j respectively; is the dot product; ||R i ||、||R j || are all Euclidean norms; β is the sensitivity parameter; ∈ is a constant; R k R i The number of traversals; w ij is the fixed edge weight between photovoltaic site i and photovoltaic site j in the graph structure network; d ij is the geographical distance between PV site i and PV site j; σ d is the distance normalization parameter; cosθ ij is the cosine similarity of the historical power data of PV site i and PV site j; C i 、C j are the installed capacities of PV sites i and j respectively; max(C) is the maximum installed capacity of all PV sites; α, β, and γ are all hyperparameters. is the characteristic vector of photovoltaic site j in the lth layer.
[0140] Furthermore, the region and time feature extraction module 2 extracts the time feature in the following manner:
[0141] Combine the historical power data of distributed photovoltaic sites with meteorological data to construct the feature matrix X t , which is expressed as follows:
[0142] X t =[P t ;M t ];
[0143] Where: P t is the historical power data of the photovoltaic site in period t, M t is the meteorological data of the photovoltaic site in period t;
[0144] For the feature matrix X t Perform linear transformation to embed feature weights and obtain the embedded feature matrix E, which is expressed as follows:
[0145] E=X t W E +b E ;
[0146] Where: W E is the feature embedding weight matrix, b E is the bias vector;
[0147] Based on the embedded feature matrix E, the query vector, key vector and value vector are generated, and their expressions are as follows:
[0148] Q=E·W Q , K=E·W K , V=E·W V ;
[0149] Where: Q is the query vector, K is the key vector, V is the value vector, W Q 、W K 、W V are the linear transformation matrices for generating query vector, key vector and value vector respectively;
[0150] Based on the query vector, key vector and value vector, the attention matrix A is calculated, which is expressed as follows:
[0151]
[0152] Where: d k is the dimension of the key vector, and softmax is the normalization operation;
[0153] Based on the attention matrix A, the value vector V is weighted averaged to obtain the time characteristic T of the distributed photovoltaic site, which is expressed as follows:
[0154] T=A·V.
[0155] Feature fusion module 3, used to perform nonlinear fusion of regional features and time features to obtain fusion features;
[0156] Furthermore, the feature fusion module 3 performs nonlinear fusion according to the following method:
[0157] The regional characteristics and the time characteristics are nonlinearly fused to obtain the fusion characteristics, which are expressed as follows:
[0158]
[0159] Among them: F i is the fusion feature, R i is the regional characteristic vector of photovoltaic site i, T i is the time characteristic vector of photovoltaic site i, ⊙ is the element-by-element multiplication, ||R i ||、||T i || are both Euclidean norms, and ∈ is a constant.
[0160] Non-linear transformation splicing module 4, used for splicing regional characteristics, time characteristics, and fusion characteristics through non-linear transformation to form a shared representation;
[0161] Furthermore, the nonlinear transformation splicing module 4 performs nonlinear transformation splicing according to the following method:
[0162] The regional characteristics, time characteristics, and fusion characteristics are spliced together through nonlinear transformation to form a shared representation, which is expressed as follows:
[0163] S=σ(W S ·([R i ;T i ; F i ])+b S );
[0164] Among them: S is the shared representation, R i is the regional characteristic, T i is the time characteristic, F i is the fusion characteristic, W S is the weight matrix, b S is the bias vector and σ is the activation function.
[0165] Multi-time-scale prediction head construction module 5 is used to construct prediction heads at the daily, monthly, and grade levels for different time scales based on the shared representation;
[0166] Furthermore, the prediction heads constructed by the multi-time-scale prediction head construction module 5 are as follows:
[0167]
[0168] Among them: Among them: is the daily forecast head, which represents the actual daily total electricity consumption, and t represents the actual load data of the t-th period on a certain day; is the monthly prediction head, which represents the actual monthly total electricity consumption; is the grade prediction head, which represents the actual annual total electricity consumption; W day 、W month 、W year are the weights of the prediction heads for day, month and grade respectively; b day 、b month 、b year are the bias constants of the day-level, month-level, and year-level prediction heads, respectively.
[0169] The photovoltaic power prediction module 6 is used to build a photovoltaic power prediction model based on the daily, monthly and yearly prediction heads, and perform photovoltaic power prediction at the daily, monthly and yearly levels.
[0170] Furthermore, the photovoltaic power prediction module 6 updates the parameters of the photovoltaic power prediction model according to the following method:
[0171] The photovoltaic power prediction model uses a joint loss function for back propagation to update the parameters of the photovoltaic power prediction model. The expression of the joint loss function is as follows:
[0172] L=λ day L day +λ month L month +λ year L year ;
[0173]
[0174] Where: L day 、L month 、L year are daily, monthly and yearly losses respectively; λ day ,λ month ,λ year are the weights of daily, monthly and year-level losses respectively; n is the number of daily prediction periods.
[0175] Example 3:
[0176] See also Figure 7 , a distributed photovoltaic power prediction device based on multi-time and space scale fusion, the device comprising a processor 7 and a memory 8;
[0177] The memory 8 is used to store computer program code 81 and transmit the computer program code 81 to the processor 7;
[0178] The processor 7 is configured to execute the distributed photovoltaic power prediction method based on multi-spatiotemporal scale fusion described in Example 1 according to the instructions in the computer program code 81 .
[0179] This embodiment also includes a computer-readable storage medium on which a computer program is stored. The computer-readable storage medium stores computer-executable instructions. When the computer-executable instructions are executed on a computer, the distributed photovoltaic power prediction method based on multi-spatiotemporal scale fusion described in Example 1 is implemented.
[0180] Generally speaking, computer instructions for implementing the method of the present invention may be carried by any combination of one or more computer-readable storage media. Non-transitory computer-readable storage media may include any computer-readable media except for signals that are temporarily propagating.
[0181] Computer-readable storage media can be, for example, but not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices or components, or any combination thereof. More specific examples (a non-exhaustive list) of computer-readable storage media include: an electrical connection having one or more wires, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EKROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof. In the present invention, a computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, device or device.
[0182] Computer program code for performing the operations of the present invention can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, SMalltalk, C++, and conventional procedural programming languages such as "C" or similar programming languages, in particular, Python suitable for neural network computing and platform frameworks based on TensorFlow, PyTorch, etc. can be used. The program code can be executed entirely on the user's computer, partially on the user's computer, as a separate software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In the case of a remote computer, the remote computer can be connected to the user's computer through any type of network, including a local area network (LAN) or a wide area network (WAN), or to an external computer (for example, using an Internet service provider to connect through the Internet).
[0183] The above-mentioned device and non-transitory computer-readable storage medium can be referred to the detailed description of a distributed photovoltaic power prediction method based on multi-temporal and spatial scale fusion and its beneficial effects, which will not be repeated here.
[0184] Although the embodiments of the present invention have been shown and described above, it should be understood that the above embodiments are exemplary and should not be construed as limiting the present invention. A person skilled in the art may change, modify, replace and modify the above embodiments within the scope of the present invention.
Claims
1. A distributed photovoltaic power prediction method based on multi-temporal and spatial scale fusion, characterized in that: include: Obtain historical power data, meteorological data, installed capacity, and geographic location information of distributed photovoltaic sites, and build a graph-structured network; Based on the graph structure network, the regional characteristics of distributed photovoltaic sites are extracted; based on the self-attention mechanism, the temporal characteristics of distributed photovoltaic sites are extracted; Perform nonlinear fusion of regional characteristics and time characteristics to obtain fusion characteristics; The regional characteristics, temporal characteristics and fusion characteristics are spliced together through nonlinear transformation to form a shared representation; Based on the shared representation, prediction heads at the day, month, and year levels are constructed for different time scales. A photovoltaic power prediction model is constructed based on the daily, monthly and annual prediction heads, and photovoltaic power predictions are performed at the daily, monthly and annual levels.
2. The distributed photovoltaic power prediction method based on multi-temporal and spatial scale fusion according to claim 1 is characterized by: The method of extracting regional characteristics of distributed photovoltaic sites based on a graph structure network specifically includes: Based on the graph structure network, the graph convolutional network is improved by self-attention weights, and the improved dynamic weighted graph convolutional network is used to extract the regional characteristics of distributed photovoltaic sites. The expression is as follows: Where: R i is the regional characteristic, φ is the activation function; is the characteristic vector of photovoltaic site j in the lth layer; W R is the learnable weight matrix; b R is the bias vector; is the characteristic vector of photovoltaic site i in the l+1th layer; α ij is the self-attention weight; W (l) The learnable weight matrix of layer l; R i 、R j are the regional characteristic vectors of photovoltaic site i and photovoltaic site j respectively; is the dot product; ||R i ||、||R j || are all Euclidean norms; β is the sensitivity parameter; ∈ is a constant; R k R i The number of traversals; w ij is the fixed edge weight between photovoltaic site i and photovoltaic site j in the graph structure network; d ij is the geographical distance between PV site i and PV site j; σ d is the distance normalization parameter; cosθ ij is the cosine similarity of the historical power data of PV site i and PV site j; C i 、C j are the installed capacities of PV sites i and j respectively; max(C) is the maximum installed capacity of all PV sites; α, β, and γ are all hyperparameters. is the characteristic vector of photovoltaic site j in the lth layer.
3. The distributed photovoltaic power prediction method based on multi-temporal and spatial scale fusion according to claim 1 is characterized by: The temporal characteristics of distributed photovoltaic sites are extracted based on the self-attention mechanism, specifically including: Combine the historical power data of distributed photovoltaic sites with meteorological data to construct the feature matrix X t , which is expressed as follows: X t =[P t ;M t ]; Where: P t is the historical power data of the photovoltaic site in period t, M t is the meteorological data of the photovoltaic site in period t; For the feature matrix X t Perform linear transformation to embed feature weights and obtain the embedded feature matrix E, which is expressed as follows: E=X t ·W E +b E ; Where: W E is the feature embedding weight matrix, b E is the bias vector; Based on the embedded feature matrix E, the query vector, key vector and value vector are generated, and their expressions are as follows: Q=E·W Q ,K=E·W K ,V=E·W V ; Where: Q is the query vector, K is the key vector, V is the value vector, W Q 、W K 、W V are the linear transformation matrices for generating query vector, key vector and value vector respectively; Based on the query vector, key vector and value vector, the attention matrix A is calculated, which is expressed as follows: Among them: a k is the dimension of the key vector, and softmax is the normalization operation; Based on the attention matrix A, the value vector V is weighted averaged to obtain the time characteristic T of the distributed photovoltaic site, which is expressed as follows: T=A·V.
4. The distributed photovoltaic power prediction method based on multi-temporal and spatial scale fusion according to claim 1 is characterized by: The regional characteristics and the time characteristics are nonlinearly fused to obtain the fusion characteristics, which are expressed as follows: Among them: F i is the fusion feature, R i is the regional characteristic vector of photovoltaic site i, T i is the time characteristic vector of photovoltaic site i, ⊙ is the element-by-element multiplication, ||R i ||、||T i || are both Euclidean norms, and ∈ is a constant.
5. The distributed photovoltaic power prediction method based on multi-temporal and spatial scale fusion according to claim 4 is characterized by: The regional characteristics, time characteristics, and fusion characteristics are spliced together through nonlinear transformation to form a shared representation, which is expressed as follows: S=σ(W S ·([R i ;T i ;F i ])+b S ); Among them: S is the shared representation, R i is the regional characteristic, T i is the time characteristic, F i is the fusion characteristic, W S is the weight matrix, b S is the bias vector and σ is the activation function.
6. The distributed photovoltaic power prediction method based on multi-temporal and spatial scale fusion according to claim 5 is characterized by: Based on the shared representation, prediction heads at the day, month, and year levels are constructed for different time scales, and their expressions are as follows: in: is the daily forecast head, which represents the actual daily total electricity consumption, and t represents the actual load data of the t-th period on a certain day; is the monthly prediction head, which represents the actual monthly total electricity consumption; is the grade prediction head, which represents the actual annual total electricity consumption; W day 、W month 、W year are the weights of the prediction heads for day, month and grade respectively; b day 、b month 、b year are the bias constants of the day-level, month-level, and year-level prediction heads, respectively.
7. The distributed photovoltaic power prediction method based on multi-spatiotemporal scale fusion according to claim 6 is characterized by: The photovoltaic power prediction model uses a joint loss function for back propagation to update the parameters of the photovoltaic power prediction model. The expression of the joint loss function is as follows: L=λ day L day +λ month L month +λ year L year ; Where: L day 、L month 、L year are daily, monthly and yearly losses respectively; λ day ,λ month ,λ year are the weights of daily, monthly and year-level losses respectively; n is the number of daily prediction periods.
8. A distributed photovoltaic power prediction system based on multi-time and space scale fusion, characterized in that: The system is applied to the method according to any one of claims 1 to 7, and the system comprises: Data preprocessing module (1), used to obtain historical power data, meteorological data, installed capacity and geographical location information of distributed photovoltaic sites, and construct a graph structure network; The regional and temporal feature extraction module (2) is used to extract the regional features of distributed photovoltaic sites based on a graph structure network; and to extract the temporal features of distributed photovoltaic sites based on a self-attention mechanism; The feature fusion module (3) is used to nonlinearly fuse regional features and temporal features to obtain fusion features; A nonlinear transformation splicing module (4) is used to splice regional characteristics, temporal characteristics, and fusion characteristics through nonlinear transformation to form a shared representation; The multi-time-scale prediction head construction module (5) is used to construct prediction heads at the day level, month level, and grade level for different time scales based on the shared representation; The photovoltaic power prediction module (6) is used to construct a photovoltaic power prediction model based on the daily, monthly and yearly prediction heads, and to perform photovoltaic power prediction at the daily, monthly and yearly levels.
9. A distributed photovoltaic power prediction device based on multi-time and space scale fusion, characterized in that: include: The device comprises a processor (7) and a memory (8); The memory (8) is used to store computer program code (81) and transmit the computer program code (81) to the processor (7); The processor (7) is configured to execute the distributed photovoltaic power prediction method based on multi-spatiotemporal scale fusion according to any one of claims 1 to 7 according to the instructions in the computer program code (81).
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: The computer-readable storage medium stores computer-executable instructions. When the computer-executable instructions are executed on a computer, the distributed photovoltaic power prediction method based on multi-spatiotemporal scale fusion according to any one of claims 1 to 7 is implemented.
Citation Information
Cited By
Photoelectric-building group load space-time matching degree prediction system
CN121684334A
A photoelectric-building group load space-time matching degree prediction system
CN121684334B