Photovoltaic power accurate prediction method considering fusion of global information and local information
By adopting a hybrid prediction model with a dual-branch architecture in photovoltaic power prediction, integrating global information and local information, the problem of difficult to accurately predict the power generation of the photovoltaic power system is solved, accurate prediction of photovoltaic power is achieved, and the operation efficiency of the power system is improved.
Patent Information
- Application Number
- CN202411769339.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Priority Date
- 2024-11-27
- Filing Date
- 2024-12-04
- Publication Date
- 2025-03-28
- Estimated Expiration
- 2044-12-04
AI Technical Summary
The power generation volume of photovoltaic power generation systems is difficult to accurately predict, resulting in the imbalance of power supply and demand.
A hybrid prediction model based on a long and short-term memory network and a dual-branch architecture of Transformer is adopted, combining the time-mode attention mechanism and a multi-directional long and short-term memory network to design global branches and local branches, and integrating global information and local information to achieve accurate prediction of photovoltaic power.
By integrating global information and local information, the model can effectively capture the long-term dependence and local dependence of the time series, realize accurate prediction of photovoltaic power, and improve the overall operating efficiency of the power system.
Smart Images

Figure CN119721752A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of photovoltaic power prediction, and in particular to a photovoltaic power accurate prediction method that considers the fusion of global information and local information. Background Art
[0002] Photovoltaic power generation has become an important source of electric energy, but photovoltaic power generation systems have inherent characteristics such as distribution, intermittency and volatility, which makes it difficult to accurately predict their power generation. In order to improve the overall operating efficiency of the power system and deal with the imbalance of power supply and demand caused by photovoltaic power fluctuations, a photovoltaic power accurate prediction method considering the fusion of global information and local information is proposed. First, a bidirectional stacked long short-term memory model based on temporal pattern attention is established as a global branch to process all input sequences and capture the long-term dependency of time series; secondly, considering the use of historical similar information by the photovoltaic power prediction model, an improved Transformer model based on similar time series matching is established as a local branch to process local input sequences to capture the dependency between the prediction period and nearby time nodes; finally, a hybrid prediction model based on a dual-branch architecture of long short-term memory network and Transformer is established, and two independent branches are designed to extract global information and local information respectively, and these two types of information are integrated through a special decoder module to maximize their complementarity. The results of the example show that the model proposed in this invention can achieve accurate prediction of photovoltaic power. Summary of the invention
[0003] Purpose of the invention: The purpose of the present invention is to provide a method for accurate photovoltaic power prediction that considers the fusion of global information and local information. A hybrid prediction model based on a dual-branch architecture of long short-term memory network and Transformer is established, and a global branch that captures the long-term dependency of the time series and a local branch that extracts the dependency between the prediction period and nearby time nodes are designed. These two types of information are integrated through a special decoder module to maximize their complementarity. Accurate prediction of photovoltaic power is achieved.
[0004] Technical solution: The specific steps of the present invention are as follows:
[0005] S1: Construct a neural network architecture that combines the temporal pattern attention (TPA) mechanism and the multi-directional long short-term memory (MBLSTM) network: The architecture includes an input layer, an MBLSTM layer, a TPA layer, a flattening layer (Flatten), a fully connected layer (Dense), and an output layer. The task of the input layer is to serialize time series data such as historical power and meteorological conditions into the model; the MBLSTM layer focuses on extracting complex features from these input data; the TPA layer further processes the feature vectors generated by the MBLSTM layer and assigns attention weights on the temporal pattern to them to emphasize those time periods that are more critical to prediction; the flattening layer converts the multi-dimensional feature matrix output by the TPA layer into a one-dimensional array; then, through the fully connected layer and the corresponding activation function, these features are mapped to the final label space, thereby realizing the prediction output of photovoltaic power.
[0006] S2: Design a historical similar time series matching method: First, the FCM clustering algorithm is used to process the historical photovoltaic power data, and the photovoltaic power data of each time period is classified into three weather modes: "sunny", "cloudy", and "overcast". On the basis of the above clustering, the Pearson correlation coefficient of the photovoltaic power curve in different daily search periods and the maximum mutual information number of the NWP data curve in different daily prediction periods are further calculated, and the average value of the two is calculated, and the n time series with the highest similarity are selected as the results of historical similar time series matching.
[0007] S3: Construct an improved Transformer model based on similar time series matching: The Transformer model shows more significant advantages in processing long-distance dependencies, promoting the interaction of global information, and supporting parallel computing. In the encoder stage, the time series data of the search period of the day to be predicted and the search period of similar days are firstly mapped into feature vectors Q, K and V through linear transformation, and the feature vectors are processed through the self-attention mechanism, and a unique feedforward channel is designed to reduce information loss and make the model output more stable; in the decoder stage, the result of weighted average of the data of the time period of similar days to be predicted according to the similarity is used as the input vector, and two self-attention mechanisms are introduced to focus on the time period to be predicted itself and the contextual information about the similar time period respectively.
[0008] S4: Construct a hybrid prediction model based on a dual-branch architecture of long short-term memory network and Transformer: This model is designed with two independent branches to pass input data, and the two branches are used to capture and extract different types of information: global information and local information. The upper branch is composed of the TPA-MBLSTM model, which is used to extract global information, which reflects the long-term dependencies in the sequence. The lower branch is composed of an improved Transformer model based on similar time series matching, which focuses on capturing local information, which reflects the dependency between the time period to be predicted and nearby time nodes. The unique decoder module is designed specifically to integrate these two types of information to maximize their complementarity.
[0009] S5: Design different experiments to analyze and verify the effectiveness of the proposed model: Use the mean absolute error, root mean square error and determination coefficient of the prediction results as the criteria for measuring model performance, and compare the prediction results of the proposed model with different models on typical days and atypical days on the same data set.
[0010] In step S1, a neural network architecture combining the temporal pattern attention (TPA) mechanism and the multi-directional long short-term memory (MBLSTM) network is constructed: the architecture mainly includes an MBLSTM model and a TPA layer, and its mathematical model is as follows.
[0011] (1) MBLSTM model
[0012] The MBLSTM prediction model is a further application and development of the BLSTM neural network. It combines a multi-layer forward LSTM architecture with a multi-layer backward LSTM architecture to form a more complex network structure, namely MBLSTM. In this model, each layer is built based on BLSTM, and each BLSTM layer receives output information from the previous BLSTM layer, which helps to improve the accuracy of the prediction task. The mathematical model of MBLSTM is expressed as follows:
[0013] s t ' (1) =f(U′ (1) x t +W′ (1) s t ' +1 )
[0014]
[0015] s t ' (i) =f(U′ (i) s′ t (i-1) +W′ (i) s t '+1 )
[0016]
[0017]
[0018] Where i represents the number of BLSTM layers; are the hidden layer values of the i-th BLSTM forward loop layer at time t and time t-1 respectively; are the hidden layer values of the i-th BLSTM backward loop layer at time t and time t-1 respectively; o t is the value of the output layer at time t. From the BLSTM structure, we can see that the weights in the forward and backward calculation processes are independent of each other. In the forward calculation, V (i) , U (i) , W (i) Respectively represent the connection weight matrix between the layers of the forward loop layer in the i-th layer BLSTM; when calculating in reverse, V′ (i) , U′ (i) , W′ (i) They represent the connection weight matrices between the layers of the backward recurrent layer in the i-th layer of BLSTM.
[0019] (2)TPA layer
[0020] Assume that the hidden layer information generated by the MBLSTM network is H = {h t-ω ,h t-ω+1 ,...,h t-1}, where h t is the hidden layer information at the tth moment; ω represents the length of the time sliding window used to select a certain length of time data; T represents the time length that the time attention mechanism is concerned about, which is generally equal to the window sliding length. Use k convolution kernels to perform convolution operations on the original hidden layer information H to generate an n*k dimensional matrix:
[0021]
[0022] For the next prediction h t , through its The operation between them calculates the weight α i , which indicates Each row in the table is for the h to be predicted. t The impact strength of each time series on h t The effect size, W α ∈R k×m , the calculation process is as follows:
[0023]
[0024] in, Indicates H C The vector of the i-th row in .
[0025] Then perform weighted summation, v t Represents All rows for h t The combined impact of time:
[0026]
[0027] Finally, add v to the operation t The factors finally get the predicted value:
[0028] h t '=W h h t +W v v t
[0029] In step S2, a historical similar time series matching method is designed. First, the FCM clustering algorithm is used to process the photovoltaic power historical data, and the photovoltaic power data of each time period is classified into three weather modes: "sunny", "cloudy", and "overcast". On the basis of the above clustering, the Pearson correlation coefficient of the photovoltaic power curve in different daily search periods and the maximum mutual information number of the NWP data curve in different daily prediction periods are further calculated, and the average value of the two is calculated and the n time series with the highest similarity are selected as the result of historical similar time series matching. The above model expression formula is as follows.
[0030] (1) FCM clustering algorithm
[0031] Traditional hard clustering methods require that each data point strictly belongs to one cluster, which works well in scenarios where data points can be clearly assigned to a unique cluster. However, these traditional methods are lacking when faced with data full of noise, ambiguity, and uncertainty. The introduction of fuzzy clustering fills this gap. Unlike hard clustering methods, fuzzy clustering allows samples to belong to multiple clusters with a certain probability or membership, rather than being clearly assigned to a specific cluster. This flexibility enables fuzzy clustering to show significant advantages when dealing with complex and uncertain data, providing more accurate clustering results for many practical scenarios. The basic steps of the FCM clustering algorithm are as follows:
[0032] Randomly select n samples as the initial cluster centers and assign an initial membership to each sample, usually a value in the range of [0, 1]. Define the objective function of fuzzy C-means, that is, the target to be minimized. The objective function represents the sum of the weighted Euclidean distances of the sample's membership to the cluster center, and is defined as follows:
[0033]
[0034] Where: J(U,C) represents the objective function, m is the ambiguity parameter, u ij is the sample x i Belongs to cluster c j The membership degree of ||x i -c j || 2 Represents sample x i With cluster center c j The Euclidean distance between .
[0035] Update the membership by calculating the membership of each sample for each cluster and using the following formula:
[0036]
[0037] Update the cluster center C and use the new membership matrix to calculate the center position of each cluster. The specific formula is as follows:
[0038]
[0039] Check whether the changes in membership and cluster center are small enough, or the predetermined number of iterations is reached. If the termination condition is met, the algorithm ends. Otherwise, return to the step of updating membership and continue iterating.
[0040] (2) Pearson correlation coefficient
[0041] The Pearson correlation coefficient is a linear correlation coefficient used to reflect the degree of linear correlation between two variables. Its value is between -1 and 1. The larger the absolute value, the stronger the correlation. Its calculation formula is as follows.
[0042]
[0043] (3) Maximum mutual information
[0044] The maximum mutual information coefficient is universal. When the sample size is large enough, it can capture the association between variables that is not limited to linear relationships, and can cover all functional relationships. Its main idea is to discretize the relationship between two variables in a two-dimensional space and represent it with a scatter plot. Then, the two-dimensional space is divided into certain intervals along the X and Y directions, and the probability of the scatter points falling into the interval is checked. The calculation method is as follows:
[0045]
[0046] Among them, a and b are the number of cells on the x and y axes corresponding to the grid division, and B is an adjustable parameter, which is usually around 0.6 of the total data volume.
[0047] In step S3, an improved Transformer model based on similar time series matching is constructed. In the encoder stage, the time series data of the search period of the day to be predicted and the search period of similar days are firstly mapped into feature vectors Q, K and V through linear transformation, and the feature vectors are processed through the self-attention mechanism, and a unique feedforward channel is designed to reduce information loss and make the model output more stable; in the decoder stage, the result of weighted average of the data of the time period to be predicted on similar days according to the similarity is used as the input vector, and two self-attention mechanisms are introduced to focus on the time period to be predicted itself and the contextual information about the similar time period respectively.
[0048] (1) Transformer model encoder
[0049] First, we need to obtain the search period data for the day to be predicted. Search time data for similar days Perform linear transformation to obtain query vector Q, key vector K and value vector V.
[0050] V=Linear(p 0 )=W V p 0 +b V
[0051] Q=Linear(p 0 )=W Q p 0 +b Q
[0052] K=Linear(P n )=W K P n +b K
[0053] Among them, W v ,W q ,W k is the weight matrix of the linear transformation, b v ,b q ,b k is the bias term
[0054] Next, we use the attention mechanism to calculate the feature vector X 3 The core of the attention mechanism is to calculate the similarity between the query vector Q and the key vector K, and perform a weighted summation of the numerical vector V according to the similarity.
[0055]
[0056] The vector X calculated by the attention mechanism 3 With QK T The results are added to get the final encoder output
[0057] X 4 =X 3 +QK T
[0058] (2) Transformer model decoder
[0059] The data of the similar period to be predicted According to the similarity calculated in step S2, a weighted average is performed to obtain the input vector X 5 The first attention mechanism uses X 5 Self-attention is calculated as the query vector Q, the key vector K and the value vector V.
[0060]
[0061] The second attention mechanism uses the encoder output X 4 As the query vector Q and the key vector K, the output X of the first attention mechanism 6 As a numerical vector V, cross-attention calculation is performed as the final output of the model.
[0062]
[0063] In step S4, a hybrid prediction model based on a dual-branch architecture of long short-term memory network and Transformer is constructed. The upper branch is composed of TPA-MBLSTM model, which is used to extract global information, which reflects the long-term dependencies in the sequence. The lower branch is composed of an improved Transformer model based on similar time series matching, which focuses on capturing local information, reflecting the dependencies between the time period to be predicted and nearby time nodes. The unique decoder module is designed specifically to integrate these two types of information to maximize their complementarity. Its mathematical model is as follows.
[0064] (1) Hybrid Model Encoder
[0065] In the encoder part, there are two parallel branches. The upper branch is composed of TPA-MBLSTM model, which is used to extract global information z global , which reflects the long-term dependencies in the sequence. The lower branch is composed of an improved Transformer model based on similar period analysis, focusing on capturing local information z local ,It reflects the dependency between the time period to be predicted and nearby time nodes.
[0066] z global =Branch global (X)
[0067] z local =Branch local (X)
[0068] (2) Hybrid Model Decoder
[0069] In the decoder part, in order to enhance the utilization of global and local information, the decoder module designed in this section converts the global information (z global ) and local information (z local ) and outputs the prediction result. The decoder module mainly contains a cross-attention module, which is designed to ensure that the historical information in the time series is effectively represented. We map the global information and local information to the hidden dimension, and then use the global information as the query vector (q), the local information as the key vector (k) and the value vector (v).
[0070] q=MLP(z global )
[0071] k=MLP(z local ),v=MLP(z local )
[0072] By using local information to query global information, global and local information can be effectively integrated.
[0073]
[0074] (3) RevIN normalization method
[0075] RevIN is a data normalization method designed specifically for time series forecasting tasks. This method can normalize time series data by removing statistical properties such as mean and variance in the sequence, and can restore the sequence to its original scale after prediction, thereby improving the performance of the forecasting model. Since it can be inserted into models such as Transformer as an independent component, it is called a "plug-and-play" method. In order to solve the problem of distribution shift between training data and test data, the RevIN method is used to enhance the robustness of the model. We first calculate each set of input data The mean and standard deviation of :
[0076]
[0077] Using this data, we can use the learnable affine parameter vector γ,β∈R K Normalize the input data:
[0078]
[0079] The normalized data is then fed into the model for prediction. Finally, by reversing the initial normalization, we reverse the normalization process to obtain the prediction results.
[0080] In step S5, different experiments are designed to analyze and verify the effectiveness of the proposed model: the mean absolute error, root mean square error and determination coefficient of the prediction results are used as criteria for measuring model performance, and the prediction results of the proposed model and different models on typical days and atypical days are compared on the same data set.
[0081] (1) Mean absolute error
[0082] MAE measures the average absolute difference between the predicted value and the true value. It is a linear measure, which means that all individual differences are treated equally. The MAE calculation formula is as follows:
[0083]
[0084] (2) Root mean square error
[0085] RMSE measures the square root of the mean of the squared differences between the predicted values and the true values. It is more sensitive to larger errors because the errors are squared first. The RMSE calculation formula is as follows:
[0086]
[0087] (3) Coefficient of determination
[0088] R 2 Represents the proportion of variability explained by the model, that is, the part of the data variability explained by the model to the total data variability. R 2 The closer it is to 1, the better the model fit is. 2 The calculation formula is as follows:
[0089]
[0090] Experimental results:
[0091] In order to improve the overall operating efficiency of the power system and deal with the imbalance of power supply and demand caused by photovoltaic power fluctuations, a photovoltaic power accurate prediction method considering the fusion of global information and local information is proposed. First, a bidirectional stacked long short-term memory model based on temporal pattern attention is established as a global branch to process all input sequences and capture the long-term dependency of time series; secondly, considering the use of historical similar information by the photovoltaic power prediction model, an improved Transformer model based on similar time series matching is established as a local branch to process local input sequences to capture the dependency between the prediction period and nearby time nodes; finally, a hybrid prediction model with a dual-branch architecture based on long short-term memory network and Transformer is established, and two independent branches are designed to extract global information and local information respectively, and these two types of information are integrated through a special decoder module to maximize their complementarity. The example results show that the model proposed in this invention can achieve accurate prediction of photovoltaic power.
[0092] Description of the accompanying tables and graphs
[0093] Figure 1 It is a diagram of historical similar time series matching method.
[0094] Figure 2 It is a diagram of the improved Transformer encoder model structure.
[0095] Figure 3 It is a diagram of the improved Transformer decoder model structure.
[0096] Figure 4 This is the structure diagram of the hybrid prediction model with a dual-branch architecture DETAILED DESCRIPTION
[0097] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0098] A photovoltaic power accurate prediction method considering the fusion of global information and local information includes the following steps:
[0099] S1: Construct a neural network architecture that combines the temporal pattern attention (TPA) mechanism and the multi-directional long short-term memory (MBLSTM) network: The architecture includes an input layer, an MBLSTM layer, a TPA layer, a flattening layer (Flatten), a fully connected layer (Dense), and an output layer. The task of the input layer is to serialize time series data such as historical power and meteorological conditions into the model; the MBLSTM layer focuses on extracting complex features from these input data; the TPA layer further processes the feature vectors generated by the MBLSTM layer and assigns attention weights on the temporal pattern to them to emphasize those time periods that are more critical to prediction; the flattening layer converts the multi-dimensional feature matrix output by the TPA layer into a one-dimensional array; then, through the fully connected layer and the corresponding activation function, these features are mapped to the final label space, thereby realizing the prediction output of photovoltaic power.
[0100] S2: Design a historical similar time series matching method: First, the FCM clustering algorithm is used to process the historical photovoltaic power data, and the photovoltaic power data of each time period is classified into three weather modes: "sunny", "cloudy", and "overcast". On the basis of the above clustering, the Pearson correlation coefficient of the photovoltaic power curve in different daily search periods and the maximum mutual information number of the NWP data curve in different daily prediction periods are further calculated, and the average value of the two is calculated, and the n time series with the highest similarity are selected as the results of historical similar time series matching.
[0101] S3: Construct an improved Transformer model based on similar time series matching: The Transformer model shows more significant advantages in processing long-distance dependencies, promoting the interaction of global information, and supporting parallel computing. In the encoder stage, the time series data of the search period of the day to be predicted and the search period of similar days are firstly mapped into feature vectors Q, K and V through linear transformation, and the feature vectors are processed through the self-attention mechanism, and a unique feedforward channel is designed to reduce information loss and make the model output more stable; in the decoder stage, the result of weighted average of the data of the time period of similar days to be predicted according to the similarity is used as the input vector, and two self-attention mechanisms are introduced to focus on the time period to be predicted itself and the contextual information about the similar time period respectively.
[0102] S4: Construct a hybrid prediction model based on a dual-branch architecture of long short-term memory network and Transformer: This model is designed with two independent branches to pass input data, and the two branches are used to capture and extract different types of information: global information and local information. The upper branch is composed of the TPA-MBLSTM model, which is used to extract global information, which reflects the long-term dependencies in the sequence. The lower branch is composed of an improved Transformer model based on similar time series matching, which focuses on capturing local information, which reflects the dependency between the time period to be predicted and nearby time nodes. The unique decoder module is designed specifically to integrate these two types of information to maximize their complementarity.
[0103] S5: Design different experiments to analyze and verify the effectiveness of the proposed model: Use the mean absolute error, root mean square error and determination coefficient of the prediction results as the criteria for measuring model performance, and compare the prediction results of the proposed model with those of different models on typical days and atypical days on the same data set; Compare the changes in the mean absolute error of the proposed model with that of different models within a day over time to reflect the prediction error of the model in different time periods.
[0104] Finally, it should be noted that the above is only a preferred embodiment of the present invention and is not intended to limit the present invention. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art can still modify the technical solutions described in the aforementioned embodiments or replace some of the technical features therein by equivalents. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A photovoltaic power accurate prediction method considering the fusion of global information and local information, characterized by: The following steps are involved: S1: Construct a neural network architecture that combines the temporal pattern attention (TPA) mechanism and the multi-directional long short-term memory (MBLSTM) network: The architecture includes an input layer, an MBLSTM layer, a TPA layer, a flattening layer (Flatten), a fully connected layer (Dense), and an output layer. The task of the input layer is to serialize time series data such as historical power and meteorological conditions into the model; the MBLSTM layer focuses on extracting complex features from these input data; the TPA layer further processes the feature vectors generated by the MBLSTM layer and assigns attention weights on the temporal pattern to them to emphasize those time periods that are more critical to prediction; the flattening layer converts the multi-dimensional feature matrix output by the TPA layer into a one-dimensional array; then, through the fully connected layer and the corresponding activation function, these features are mapped to the final label space, thereby realizing the prediction output of photovoltaic power. S2: Design a historical similar time series matching method: First, the FCM clustering algorithm is used to process the historical photovoltaic power data, and the photovoltaic power data of each time period is classified into three weather modes: "sunny", "cloudy", and "overcast". On the basis of the above clustering, the Pearson correlation coefficient of the photovoltaic power curve in different daily search periods and the maximum mutual information number of the NWP data curve in different daily prediction periods are further calculated, and the average value of the two is calculated, and the n time series with the highest similarity are selected as the results of historical similar time series matching. S3: Construct an improved Transformer model based on similar time series matching: The Transformer model shows more significant advantages in processing long-distance dependencies, promoting the interaction of global information, and supporting parallel computing. In the encoder stage, the time series data of the search period of the day to be predicted and the search period of similar days are firstly mapped into feature vectors Q, K and V through linear transformation, and the feature vectors are processed through the self-attention mechanism, and a unique feedforward channel is designed to reduce information loss and make the model output more stable; in the decoder stage, the result of weighted average of the data of the time period of similar days to be predicted according to the similarity is used as the input vector, and two self-attention mechanisms are introduced to focus on the time period to be predicted itself and the contextual information about the similar time period respectively. S4: Construct a hybrid prediction model based on a dual-branch architecture of long short-term memory network and Transformer: This model is designed with two independent branches to pass input data, and the two branches are used to capture and extract different types of information: global information and local information. The upper branch is composed of the TPA-MBLSTM model, which is used to extract global information, which reflects the long-term dependencies in the sequence. The lower branch is composed of an improved Transformer model based on similar time series matching, which focuses on capturing local information, which reflects the dependency between the time period to be predicted and nearby time nodes. The unique decoder module is designed specifically to integrate these two types of information to maximize their complementarity. S5: Design different experiments to analyze and verify the effectiveness of the proposed model: Use the mean absolute error, root mean square error and determination coefficient of the prediction results as the criteria for measuring model performance, and compare the prediction results of the proposed model with different models on typical days and atypical days on the same data set.
2. According to claim 1, a photovoltaic power accurate prediction method considering the fusion of global information and local information is characterized by: In the step S1, a neural network architecture combining a temporal pattern attention (TPA) mechanism and a multi-directional long short-term memory (MBLSTM) network is constructed: the architecture mainly includes an MBLSTM model and a TPA layer, and its mathematical model is as follows. (1) MBLSTM model The MBLSTM prediction model is a further application and development of the BLSTM neural network. It combines a multi-layer forward LSTM architecture with a multi-layer backward LSTM architecture to form a more complex network structure, namely MBLSTM. In this model, each layer is built based on BLSTM, and each BLSTM layer receives output information from the previous BLSTM layer, which helps to improve the accuracy of the prediction task. The mathematical model of MBLSTM is expressed as follows: Where i represents the number of BLSTM layers; are the hidden layer values of the i-th BLSTM forward loop layer at time t and time t-1 respectively; are the hidden layer values of the i-th BLSTM backward loop layer at time t and time t-1 respectively; o t is the value of the output layer at time t. From the BLSTM structure, we can see that the weights in the forward and backward calculation processes are independent of each other. In the forward calculation, V (i) , U (i) , W (i) Respectively represent the connection weight matrix between the layers of the forward loop layer in the i-th layer BLSTM; when calculating in reverse, V′ (i) , U′ (i) , W′ (i) They represent the connection weight matrices between the layers of the backward recurrent layer in the i-th layer of BLSTM. (2)TPA layer Assume that the hidden layer information generated by the MBLSTM network is H = {h t-ω ,h t-ω+1 ,...,h t-1 }, where h t is the hidden layer information at the tth moment; ω represents the length of the time sliding window used to select a certain length of time data; T represents the time length that the time attention mechanism is concerned about, which is generally equal to the window sliding length. Use k convolution kernels to perform convolution operations on the original hidden layer information H to generate an n*k dimensional matrix: For the next prediction h t , through its The operation between them calculates the weight α i , which indicates Each row in the table is for the h to be predicted. t The impact strength of each time series on h t The effect size, W α ∈R k×m , the calculation process is as follows: in, Indicates H C The vector of the i-th row in . Then perform weighted summation, v t Represents All rows for h t The combined impact of time: Finally, add v to the operation t The factors finally get the predicted value: h t '=W h h t +W v v t 3. The photovoltaic power accurate prediction method considering the fusion of global information and local information according to claim 1 is characterized by: In step S2, a historical similar time series matching method is designed. First, the FCM clustering algorithm is used to process the photovoltaic power historical data, and the photovoltaic power data of each time period is classified into three weather modes: "sunny", "cloudy", and "overcast". On the basis of the above clustering, the Pearson correlation coefficient of the photovoltaic power curve of different daily search periods and the maximum mutual information number of the NWP data curve of different daily prediction periods are further calculated, and the average value of the two is calculated and the n time series with the highest similarity are selected as the result of historical similar time series matching. The above model expression formula is as follows. (1) FCM clustering algorithm Traditional hard clustering methods require each data point to strictly belong to one cluster, which works well in scenarios where data points can be clearly assigned to a unique cluster. However, these traditional methods are lacking when faced with data full of noise, ambiguity, and uncertainty. The introduction of fuzzy clustering fills this gap. Unlike hard clustering methods, fuzzy clustering allows samples to belong to multiple clusters with a certain probability or membership, rather than being clearly assigned to a certain cluster. This flexibility enables fuzzy clustering to show significant advantages when processing complex and uncertain data, and provides more accurate clustering results for many practical scenarios. The basic steps of the FCM clustering algorithm are as follows: Randomly select n samples as the initial cluster centers and assign an initial membership to each sample, usually a value in the range of [0, 1]. Define the objective function of fuzzy C-means, that is, the target to be minimized. The objective function represents the sum of the weighted Euclidean distances of the sample's membership to the cluster center, and is defined as follows: Where: J(U,C) represents the objective function, m is the ambiguity parameter, u ij is the sample x i Belongs to cluster c j The membership degree of ||x i -c j || 2 Represents sample x i With cluster center c j The Euclidean distance between . Update the membership by calculating the membership of each sample for each cluster and using the following formula: Update the cluster center C and use the new membership matrix to calculate the center position of each cluster. The specific formula is as follows: Check whether the changes in membership and cluster center are small enough, or the predetermined number of iterations is reached. If the termination condition is met, the algorithm ends. Otherwise, return to the step of updating membership and continue iterating. (2) Pearson correlation coefficient The Pearson correlation coefficient is a linear correlation coefficient used to reflect the degree of linear correlation between two variables. Its value is between -1 and 1. The larger the absolute value, the stronger the correlation. Its calculation formula is as follows. (3) Maximum mutual information The maximum mutual information coefficient is universal. When the sample size is large enough, it can capture the association between variables that is not limited to linear relationships, and can cover all functional relationships. Its main idea is to discretize the relationship between two variables in a two-dimensional space and represent it with a scatter plot. Then, the two-dimensional space is divided into certain intervals along the X and Y directions, and the probability of the scatter points falling into the interval is checked. The calculation method is as follows: Among them, a and b are the number of cells on the x and y axes corresponding to the grid division, and B is an adjustable parameter, which is usually around 0.6 of the total data volume.
4. The photovoltaic power accurate prediction method considering the fusion of global information and local information according to claim 1 is characterized by: The step S3 constructs an improved Transformer model based on similar time series matching. In the encoder stage, the time series data of the search period of the day to be predicted and the search period of similar days are firstly mapped into feature vectors Q, K and V through linear transformation, and the feature vectors are processed through a self-attention mechanism, and a unique feedforward channel is designed to reduce information loss and make the model output more stable; in the decoder stage, the result of weighted average of the data of the time period to be predicted on similar days according to the similarity is used as the input vector, and two self-attention mechanisms are introduced to respectively focus on the time period to be predicted itself and the contextual information about the similar time period. (1) Transformer model encoder First, we need to obtain the search period data for the day to be predicted. Search time data for similar days Perform linear transformation to obtain query vector Q, key vector K and value vector V. V=Linear(p0)=W V p0+b V Q=Linear(p0)=W Q p0+b Q K=Linear(P n )=W K P n +b K Among them, W v ,W q ,W k is the weight matrix of the linear transformation, b v ,b q ,b k is the bias term Next, we use the attention mechanism to calculate the feature vector X3. The core of the attention mechanism is to calculate the similarity between the query vector Q and the key vector K, and perform a weighted summation of the numerical vector V according to the similarity. The vector X3 calculated by the attention mechanism is combined with QK T The results are added to get the final encoder output X4=X3+QK T (2) Transformer model decoder The data of the similar period to be predicted The weighted average is performed according to the similarity calculated in step S2 to obtain the input vector X5. The first attention mechanism uses X5 as the query vector Q, key vector K and value vector V for self-attention calculation. The second attention mechanism uses the encoder output X4 as the query vector Q and the key vector K, and the output X6 of the first attention mechanism is used as the numerical vector V for cross-attention calculation as the final output of the model.
5. The photovoltaic power accurate prediction method considering the fusion of global information and local information according to claim 1 is characterized by: The construction of step S4 is based on a hybrid prediction model of a dual-branch architecture of a long short-term memory network and a Transformer. The upper branch is composed of a TPA-MBLSTM model, which is used to extract global information, and it reflects the long-term dependencies in the sequence. The lower branch is composed of an improved Transformer model based on similar time series matching, which focuses on capturing local information, and it reflects the dependencies between the time period to be predicted and nearby time nodes. The unique decoder module is designed specifically to integrate these two types of information to maximize their complementarity. Its mathematical model is as follows. (1) Hybrid Model Encoder In the encoder part, there are two parallel branches. The upper branch is composed of TPA-MBLSTM model, which is used to extract global information z global , which reflects the long-term dependencies in the sequence. The lower branch is composed of an improved Transformer model based on similar period analysis, focusing on capturing local information z local ,It reflects the dependency relationship between the time period to be predicted and the nearby time nodes. z global =Branch global (X) z local =Branch local (X) (2) Hybrid Model Decoder In the decoder part, in order to enhance the utilization of global and local information, the decoder module designed in this section converts the global information (z global ) and local information (z local ) and outputs the prediction result. The decoder module mainly contains a cross-attention module, which is designed to ensure that the historical information in the time series is effectively represented. We map the global information and local information to the hidden dimension, and then use the global information as the query vector (q), the local information as the key vector (k) and the value vector (v). q=MLP(z global ) k=MLP(z local ),v=MLP(from local ) By using local information to query global information, global and local information can be effectively integrated. (3) RevIN normalization method RevIN is a data normalization method designed specifically for time series forecasting tasks. This method can normalize time series data by removing statistical properties such as mean and variance in the sequence, and can restore the sequence to its original scale after prediction, thereby improving the performance of the forecasting model. Since it can be inserted into models such as Transformer as an independent component, it is called a "plug-and-play" method. In order to solve the distribution shift problem between training data and test data, the RevIN method is used to enhance the robustness of the model. We first calculate each set of input data The mean and standard deviation of : Using this data, we can use the learnable affine parameter vector γ,β∈R K Normalize the input data: The normalized data is then fed into the model for prediction. Finally, by reversing the initial normalization, we reverse the normalization process to obtain the prediction results.
6. The photovoltaic power accurate prediction method considering the fusion of global information and local information according to claim 1 is characterized by: Different experiments are designed in step S5 to analyze and verify the effectiveness of the proposed model: the mean absolute error, root mean square error and determination coefficient of the prediction results are used as criteria for measuring model performance, and the prediction results of the proposed model and different models on typical days and atypical days are compared on the same data set. (1) Mean absolute error MAE measures the average absolute difference between the predicted value and the true value. It is a linear measure, which means that all individual differences are treated equally. The MAE calculation formula is as follows: (2) Root mean square error RMSE measures the square root of the mean of the squared differences between the predicted values and the true values. It is more sensitive to larger errors because the errors are squared first. The RMSE calculation formula is as follows: (3) Coefficient of determination R 2 Represents the proportion of variability explained by the model, that is, the part of the data variability explained by the model to the total data variability. R 2 The closer it is to 1, the better the model fit is. 2 The calculation formula is as follows:
7. The photovoltaic power accurate prediction method considering the fusion of global information and local information according to claim 1 is characterized by: The photovoltaic power accurate prediction method based on the fusion of global information and local information can improve the photovoltaic power prediction model's utilization of historical similar information, comprehensively consider global information and local information, and realize the accurate prediction of photovoltaic power.
Citation Information
Patent Citations
Photovoltaic power generation power prediction method based on multi-view adaptive feature fusion
CN115829126A
Distributed photovoltaic power short-term prediction method and system
CN118035718A
Hybrid deep learning photovoltaic power prediction method, system and device and storage medium thereof
CN118336708A
Short-term wind power prediction method and system based on hybrid clustering
CN118521172A
Ultra-short-term photovoltaic power prediction method and system based on multi-mode and multi-scale characteristics
CN118690902A
Cited By
Intelligent whole-house hot water circulation management system
CN120851554A
Online time sequence event analysis method and system based on heterogeneous memory fusion
CN121301743A
Photovoltaic power prediction method and system based on sequence recombination and multi-resolution modeling
CN121412587A