Ultra-short-time photovoltaic generation power prediction two-stage GRU optimization method considering main meteorological factors and waveform classification
Through the two-stage GRU optimization method, factor analysis and improved sparrow search algorithm are used to optimize photovoltaic power prediction, which solves the problems of low photovoltaic power prediction accuracy and long training time, and achieves more efficient photovoltaic power generation prediction.
Patent Information
- Application Number
- CN202510269761.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-03-07
- Publication Date
- 2025-07-22
AI Technical Summary
In the prior art, photovoltaic power prediction accuracy is low, training time is long, and meteorological data is not effectively processed, resulting in high model complexity and low prediction efficiency.
The two-stage GRU optimization method is adopted. The main meteorological factors are first extracted through factor analysis, and the fuzzy C clustering algorithm is combined with the fuzzy C clustering algorithm to cluster similar modes of photovoltaic power generation power fluctuations. Then, the structural parameters of GRU are optimized by using the improved sparrow search algorithm to improve prediction accuracy and efficiency.
By reducing data redundancy and improving the training efficiency and prediction accuracy of neural network models, higher photovoltaic power prediction accuracy and shorter training time are achieved.
Smart Images

Figure CN120354987A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of power systems, and particularly to a two-stage GRU optimization method for ultra-short-term photovoltaic power generation prediction considering main meteorological factors and waveform classification. Background Technique
[0002] Photovoltaic power generation is considered one of the most promising renewable energy sources, and its proportion in new energy grid-connected applications has gradually increased in recent years.
[0003] Due to the influence of meteorological factors such as solar radiation, temperature, and cloud cover, the randomness and intermittency of photovoltaic power generation will have various negative impacts on the safety and economy of the power grid. To solve these problems, photovoltaic power prediction has become an effective scientific solution and has received extensive attention and application worldwide.
[0004] The invention patent with the patent number CN117874584A discloses a neural network ultra-short-term photovoltaic power prediction method based on meteorological clustering, including the steps of: 1. constructing quadratic variables; 2. normalizing the measured data and predicted data in the quadratic variables and correcting the irradiance data; 3. screening the normalized measured data, clustering based on an improved ant colony clustering algorithm to obtain three types of variant clustering results of sunny-like, cloudy-like, and rainy-like; 4. screening the three types of variant clustering results based on the random forest feature degree to obtain a feature variable group; 5. training the LSTM neural network, inputting the data in the second step into the LSTM model to obtain the photovoltaic power prediction result; 6. evaluating the photovoltaic power prediction result and optimizing the photovoltaic power prediction result. This method does not process meteorological data, which not only increases the redundancy between data but also increases the computational complexity of the LSTM model, increases the training and prediction time. Secondly, the structural parameters of the LSTM are not optimized, and improper setting of the structural parameters will lead to the problem of low prediction accuracy.
[0005] In summary, for the ultra-short-term photovoltaic power prediction technology, improving the prediction accuracy of photovoltaic power and reducing the learning and testing time of the neural network are important technical problems that need to be solved urgently by the scientific and technological personnel in this field. Summary of the Invention
[0006] To solve the above technical problems, the present invention provides a two-stage GRU optimization method for ultra-short-term photovoltaic power generation prediction considering main meteorological factors and waveform classification, which solves the problems of insignificant classification effect of similar daily photovoltaic power patterns, low photovoltaic power prediction accuracy, and long training time.
[0007] To achieve the above object, the present invention provides the following technical solutions:
[0008] A two-stage GRU optimization method for ultra-short-term photovoltaic power prediction considering main meteorological factors and waveform classification, including: an input data optimization stage and a GRU optimization stage, characterized in that the input data optimization stage includes main meteorological factor extraction, fluctuation feature extraction, dataset division, similar pattern clustering, most similar pattern recognition, and the GRU optimization stage includes ISSA-based GRU offline training stage optimization and GRU online prediction stage combined with most similar pattern recognition. The specific steps are as follows: 1. Perform main meteorological factor extraction and fluctuation feature extraction; 2. Perform dataset division; 3. Input the training set data and the fluctuation characteristics of the photovoltaic power curve into similar pattern clustering; 4. Input the results of similar pattern clustering into GRU offline training respectively; 5. Use ISSA to optimize GRU offline training; 6. Perform most similar pattern recognition on the test set data; 7. Determine the GRU online prediction model corresponding to the GRU offline training stage in combination with the results of most similar pattern recognition; 8. The test set data passes through the GRU online prediction model, and finally the prediction result is output.
[0009] Furthermore, for the main meteorological factor extraction, the specific steps include: 1. Input the original meteorological data.
[0010] 2. Use FA to calculate the factor contribution rate. The basic calculation steps of FA mainly include: calculating the Pearson correlation coefficient matrix R, calculating the factor loading matrix A, and calculating the cumulative factor score G. s , and the FA mathematical model is as follows:
[0011] X = A·C + ε
[0012]
[0013]
[0014] W = A′ T R -1 X
[0015]
[0016] In the formula, X = (X1, X2, …, X p ) T represents the initial variable matrix, A = (a i′j′ ) pq represents the factor loading matrix, a i′j′ represents the factor loading of the i'-th variable on the j'-th common factor c j′ q T ) p represents the common factor vector matrix, ε = (ε1, ε2, …, ε T ) TDenote the special factor vector; r ij is the correlation coefficient of the standardized indicators i and j, r ii = 1, r ij = r ji ; q is the number of common factors; κ is the total number of sample variables, λ1≥λ2≥…≥λ q ≥0 are the eigenvalues of the initial variable correlation matrix R, S is the leading main factor determining the cumulative contribution rate G s of the leading main factors, l1, l2, …, l S are the eigenvectors corresponding to the eigenvalues λ1, λ2, …, λ S , W is the factor score matrix, and A' is the rotated factor loading matrix.
[0017] 3. Determine the main meteorological factors according to the cumulative factor contribution rate as follows:
[0018]
[0019] In the formula, I is the main meteorological factor matrix obtained based on FA, I s This is the s-th main factor, i ts is the value of the s-th main factor at time t. The main meteorological factors for photovoltaic prediction include radiation factor, temperature factor, cloud factor, humidity factor, and wind speed factor.
[0020] Furthermore: The dataset division includes the reconstruction of the meteorological photovoltaic dataset, dividing the training set and the test set. The total reconstructed dataset is as follows:
[0021] Data = [P, I]
[0022] P = [p1, p2, ..., p t
[0023] In the formula, Data is the total dataset, P is the photovoltaic power generation data, p t is the photovoltaic power generation value at time t. The training set is all historical data, and the test set is the data of the day to be predicted.
[0024] Furthermore, the specific steps of the similar pattern clustering include: 1. Extract the fluctuation characteristics (D2) according to the historical photovoltaic data, including difference, relative fluctuation number, and average power value. The fluctuation characteristics of the daily photovoltaic power curve are calculated as follows:
[0025] ΔP t = P t - P t-1
[0026]
[0027]
[0028]
[0029] Wherein, ΔP t is the difference of the daily photovoltaic power at time t, and p t is the photovoltaic power value at time t, C t is the fluctuation coefficient of the photovoltaic power curve, N PF represents the relative fluctuation number of the daily photovoltaic power sequence, P is the daily average photovoltaic power value, and l is the number of time periods within a day; 2. Taking the daily photovoltaic power curve as a sample and the fluctuation characteristics as the classification feature factors of the sample, clustering the daily power curves of the training set data by using the FCM algorithm, 3. Outputting the clustering results of the similar patterns and obtaining sub-data clusters, 4. Inputting the training sub-data clusters into the GRU offline training model respectively.
[0030] Furthermore, the most similar pattern recognition specifically includes the following steps: 1. Using the combination of GCA and CS to calculate the similarity between the test data and each training sub-data cluster, 2. Selecting the training sub-data cluster with the largest similarity, 3. Determining the GRU online prediction model corresponding to the test set according to the most similar pattern recognition. The calculation formulas of GCA and CS are as follows:
[0031]
[0032]
[0033]
[0034] Wherein, is the weight coefficient of feature k', ξ t′k′ (k′) is the grey correlation coefficient, γ′ is the discrimination coefficient, and its value range is 0 - 1. C0(k′) is the normalized value of the training data feature k', and C t′ (k′) is the normalized value of the test data feature k' at date t', and N′ is the total number of features k'.
[0035] Furthermore, the optimization of the GRU offline training stage based on ISSA specifically includes the following steps: 1. Inputting the sub-data cluster into the GRU offline training model, 2. Using Equation (7) as the fitness function of ISSA in the optimization of the GRU offline training stage, 3. Using ISSA to optimize the structural parameters of GRU,
[0036] Wherein, RMSE is the root mean square error, and z τ' is the actual value of the photovoltaic power generation at time τ', is the predicted value of the photovoltaic power generation at time τ', and M is the total number of prediction times.
[0037] Furthermore, the structural parameters of the ISSA-optimized GRU include the learning rate u of the GRU, the number of neurons h1 in the first layer of the GRU, and the number of neurons h2 in the second layer of the GRU.
[0038] Furthermore, ISSA adopts a reverse learning strategy to improve the initial population compared with SSA to obtain higher convergence, and the calculation is as follows:
[0039] Y′ = rand(ul + ll) - Y
[0040] In the formula, Y is the position matrix of the traditional initial population, Y' is the position matrix of the initial population improved by the reverse learning strategy, rand is a random function, and its value range is [0,1]. ul and ll are the upper and lower limits of the search space, respectively, both set within the range of [0,1]. At the same time, two random parameters ω and ψ of the early warning position update model are improved to enhance the global optimization performance, and the calculation is as follows:
[0041]
[0042]
[0043]
[0044] In the formula, and respectively represent the best position and the worst position at the t'-th iteration, is the position information of the ρ'-th sparrow in the η'-th dimension at the t'-th iteration, and f w * respectively represent the current best and worst fitness values, represents the fitness value of the current sparrow, and T' is the maximum number of iterations.
[0045] Furthermore, combining the GRU online prediction with the most similar pattern recognition, the test data is input into the GRU online prediction model corresponding to the pattern, and the prediction result is output to evaluate the prediction performance of this method.
[0046] The beneficial effects of the present invention are as follows: 1. The present invention uses the FA algorithm to extract the main meteorological factors, reducing the redundancy brought by a large amount of data to the model, reducing the time and space complexity of the neural network model, and improving the training efficiency of the neural network model.
[0047] 2. The present invention extracts the photovoltaic power fluctuation characteristics and uses the FCM algorithm to perform similar pattern clustering on the daily photovoltaic power samples to obtain multiple training data clusters with similar fluctuation patterns, improving the correlation between the prediction data and the training data of the neural network model and improving the accuracy of photovoltaic power prediction.
[0048] 3. The present invention uses the combination of GCA and CS to calculate the similarity between the test day data and the training data clusters, improve the accuracy of pattern recognition, determine the corresponding LSTM model, and achieve the matching of the test data and the online prediction model.
[0049] 4. The present invention proposes an optimization method for the offline GRU training stage based on ISSA, determines the structural parameters of the GRU neural network, improves the learning ability of the GRU neural network, and further improves the accuracy of ultra-short-term photovoltaic power prediction. Description of the Drawings
[0050] Figure 1 It is the framework of the two-stage GRU optimization method for ultra-short-term photovoltaic power prediction of the present invention.
[0051] Figure 2 It is the GRU cell unit structure.
[0052] Figure 3 It is the specific flowchart of the data optimization stage of the present invention.
[0053] Figure 4 It is the specific flowchart of the GRU optimization stage of the present invention.
[0054] Figure 5 They are the prediction results of different models under sunny days.
[0055] Figure 6 They are the deviation errors of different models under sunny days.
[0056] Figure 7 They are the prediction results of different models under cloudy days.
[0057] Figure 8 They are the deviation errors of different models under cloudy days.
[0058] Figure 9 They are the prediction results of different models under rainy days.
[0059] Figure 10 They are the deviation errors of different models under rainy days.
[0060] In the figure, the markings are: D1: extraction of main meteorological factors, D2: extraction of fluctuation characteristics, D3: dataset division, D4: similar pattern clustering, D5: recognition of the most similar pattern, G1: offline GRU training, G2: improved sparrow search algorithm, G3: online GRU prediction, G4: output of prediction results. Detailed Embodiments
[0061] The above solution will be further described below in conjunction with specific embodiments. It should be understood that these embodiments are for illustrative purposes only and do not limit the scope of the present application. The implementation conditions adopted in the embodiments can be further adjusted according to specific conditions, and the implementation conditions not specified are usually those in conventional experiments.
[0062] Embodiment 1
[0063] As Figure 1 and Figure 3 shown, a two-stage GRU optimization method for ultra-short-term photovoltaic power prediction considering main meteorological factors and waveform classification according to the present invention. In the input data optimization stage D, it includes main meteorological factor extraction D1, fluctuation feature extraction D2, data set division D3, similar pattern clustering D4, and most similar pattern recognition D5. First, perform main meteorological factor extraction D1 and fluctuation feature extraction D2, and then perform data set division D3. The training set data and the fluctuation features of the photovoltaic power curve are input into similar pattern clustering D4, and the results of similar pattern clustering D4 are respectively input into GRU offline training G1, and the test set data is subjected to most similar pattern recognition D5.
[0064] The main meteorological factor extraction D1 specifically includes the following steps: 1. Input the original meteorological data; 2. Calculate the factor contribution rate using FA; 3. Determine the main meteorological factors according to the cumulative factor contribution rate. The FA mathematical model is as follows:
[0065] X = A·C + ε
[0066] In the formula, X = (X1, X2,..., X p ) T represents the initial variable matrix, A = (a i′j′ ) pq represents the factor loading matrix, a i′j′ represents the factor loading of the i'-th variable on the j'-th common factor c j′ , C = (c1, c2,..., c q ) T represents the common factor vector matrix, and ε = (ε1, ε2,..., ε p ) T represents the special factor vector. The basic calculation steps of FA mainly include: calculating the Pearson correlation coefficient matrix R, calculating the factor loading matrix A, and calculating the cumulative factor score G s .
[0067]
[0068]
[0069] W = A ′T R -1 X
[0070]
[0071] where r ij is the correlation coefficient of the standardized indicators i and j, r ii = 1, r ij = r ji ; q is the number of common factors. κ is the total number of sample variables, λ1 ≥ λ2 ≥ … ≥ λ q ≥ 0 are the eigenvalues of the correlation matrix R of the initial variables, S is the leading main factor determining the cumulative contribution rate G s , l1, l2, …, l S are the eigenvectors corresponding to the eigenvalues λ1, λ2, …, λ S , and W is the factor score matrix, and A' is the rotated factor loading matrix.
[0072] The above-mentioned fluctuation feature extraction D2 includes: performing fluctuation feature extraction D2 based on historical photovoltaic data, and calculating the fluctuation features of the daily photovoltaic power curve, including difference, relative fluctuation number, and average power value. The fluctuation feature calculation model is as follows:
[0073] ΔP t = P t - P t-1
[0074]
[0075]
[0076]
[0077] where ΔP t is the difference of the daily photovoltaic power at time t, p t is the photovoltaic power value at time t, C t is the fluctuation coefficient of the photovoltaic power curve, N PF represents the relative fluctuation number of the daily photovoltaic power sequence, is the daily average photovoltaic power value, and l is the number of time periods within a day.
[0078] The above-mentioned dataset partitioning D3 includes reconstructing the meteorological photovoltaic dataset, partitioning the training set and the test set. The reconstructed total dataset is as follows:
[0079] Data = [P, I]
[0080] P = [p1, p2,..., p t
[0081] where Data is the total dataset, P is the photovoltaic power generation data, and p t is the photovoltaic power generation value at time t. The training set is all historical data, and the test set is the data of the day to be predicted.
[0082] The specific steps of the similar pattern clustering D4 are as follows: 1. Extract the fluctuation characteristics D2 according to the historical photovoltaic data. 2. Taking the daily photovoltaic power curve as a sample and the fluctuation characteristics as the classification feature factors of the sample, use the FCM algorithm to cluster the daily power curves of the training set data. 3. Output the similar pattern clustering result and obtain the sub-data clusters. The FCM model is as follows:
[0083]
[0084]
[0085]
[0086]
[0087] In the formula, c is the number of clusters, N is the total number of samples, u αβ is the membership degree of sample β belonging to type α, m is the fuzzy index (m>1), d αβ represents the Euclidean distance between the sample and the cluster center, v α is the cluster center of type α.
[0088] The specific steps of the most similar pattern recognition D5 are as follows: 1. Use the combination of GCA and CS to calculate the similarity between the test data and each training sub-data cluster. 2. Select the training sub-data cluster with the largest similarity. 3. Determine the GRU online prediction G3 model corresponding to the test set according to the most similar pattern recognition D5. The calculation formulas of GCA and CS are as follows:
[0089]
[0090]
[0091]
[0092] In the formula, is the weight coefficient of feature k', ξ t′k′ (k′) is the grey correlation coefficient, γ′ is the distinguishing coefficient, and its value range is 0-1. C0(k′) is the normalized value of training data feature k', C t′ (k′) is the normalized value of test data feature k' at date t'. N′ is the total number of feature k'.
[0093] Before the staff uses the neural network model to predict the photovoltaic power, historical data optimization processing and similar pattern recognition of test data are required. First, initialize the basic parameters of FA, FCM, GCA, and CS, and then split the original data into a meteorological data set and a photovoltaic power data set. The meteorological data is input into the FA algorithm (the specific calculation steps are shown in the above formulas (16)-(20)) to obtain the main meteorological factors. Combine the historical photovoltaic data to obtain the total data set, and divide the total data set into a training set and a test set. The test set is the data of the day to be predicted for subsequent dates, and the training set is the previous historical data set. Calculate the fluctuation characteristics based on the photovoltaic power data set, and use the daily data set as the sample fluctuation characteristics as the clustering characteristic factor to input into the FCM algorithm (the specific calculation steps are shown in the above formulas (27)-(30)) to obtain the classified similar pattern clustering results. Input the results of the similar pattern clustering D4 into GRU for offline training G1 respectively. Before the prediction of the test set, first calculate the GCA and CS correlation similarities between the data of the day to be predicted in the test set and the historical day data in the training set, perform the most similar pattern recognition on the day to be predicted, and select the training data cluster with the largest similarity and the corresponding GRU online prediction model. In this way, before the training of the neural network, the extraction of the main input data is completed, reducing data redundancy, reducing the computational complexity of the neural network, and improving the training efficiency of the neural network. Secondly, it can effectively classify the daily data of different similar patterns, making the training data have high similarity and relevance, and improving the effects of neural network offline training and online prediction. Finally, perform the most similar pattern recognition on the test day data, select the neural network online prediction model corresponding to the most similar pattern for prediction, and further improve the prediction accuracy.
[0094] Example 2
[0095] On the basis of Example 1, as Figure 1 and Figure 4 shown, it further includes a GRU optimization stage G, including the optimization of the GRU offline training G1 stage based on the improved sparrow search algorithm G2, and the GRU online prediction G3 stage combined with the most similar pattern recognition D5. The GRU cell unit structure is as Figure 2 shown, and the GRU mathematical model is as follows:
[0096] z t =σ(W z ×[h t-1 ,x t )
[0097] r t =σ(W r ×[h t-1 ,x t )
[0098]
[0099]
[0100] Wherein, z t is the update gate; r t is the reset gate; x t is the current input, h t-1 is the state information of the previous node, represents the candidate hidden state; W z , W r and W are the connection weight matrices of the update gate, reset gate and candidate hidden state respectively, and σ(·) and tanh(·) are activation functions.
[0101] The optimization of the GRU offline training G1 stage based on the improved sparrow search algorithm G2 is as follows: 1. Input the sub-data cluster into the GRU offline training G1 model; 2. Equation (38) is used as the fitness function of the improved sparrow search algorithm G2 in the optimization of the GRU offline training G1 stage; 3. Use the improved sparrow search algorithm G2 to optimize the structural parameters of the GRU;
[0102]
[0103] τ' is the actual value of photovoltaic power generation at time τ'; is the predicted value of photovoltaic power generation at time τ', and M is the number of prediction times.
[0104] The improved sparrow search algorithm G2 adopts a reverse learning strategy to improve the initial population to obtain higher convergence, and at the same time improves the two random parameters ω and ψ of the early warning position update model to enhance the global optimization performance. The mathematical calculation model of the improved sparrow search algorithm is as follows:
[0105] Y′ = rand(ul + ll) - Y
[0106]
[0107]
[0108]
[0109]
[0110]
[0111] Wherein, is the position information of the ρ′-th sparrow in the η′-th dimension at the t'-th iteration. Equations (40), (41), and (44) are the position update formulas for the discoverer, follower, and vigilant, respectively. Q is a random number following a normal distribution, L is a 1×d matrix of all 1s, κ is a random number between 0 and 1, R2 is the early warning value with a range of [0,1], ST is the safety value with a range of [0.5,1]; A is a 1×d random matrix with values of -1 or 1, A + = A T (AA T ) -1 ; and represent the best position and the worst position at the t'-th iteration, respectively, and represent the current best and worst fitness values, respectively, represents the fitness value of the current sparrow, T' is the maximum number of iterations; ω and ψ are random numbers; Y is the initial sparrow position, and Y′ is the initial sparrow population improved by the reverse learning strategy.
[0112] The GRU online prediction G3 combined with the most similar pattern recognition D5 inputs the test data into the GRU online prediction G3 model corresponding to the pattern, outputs the prediction result G4, and evaluates the prediction performance of this method. The evaluation indicators include but are not limited to: mean absolute error (MAE), root mean square error (RMSE), model goodness of fit (MGF), etc. The mathematical calculation model is as follows:
[0113]
[0114]
[0115]
[0116] In the formula, z τ' is the actual value of photovoltaic power generation at the τ'-th moment, is the predicted value of photovoltaic power generation at the τ'-th moment, and M is the number of prediction times.
[0117] When the staff in this field needs to predict the photovoltaic power, the specific operation steps are as follows:
[0118] Step 1: Initialize the basic parameters of GRU and ISSA, and initialize the first-generation sparrow population according to formula (8).
[0119] Step 2: Input the training set data into the GRU offline training model.
[0120] Step 3: Select the subsequent 10% of the data as the validation set to verify the effect of GRU offline training.
[0121] Step 4: Calculate the root mean square error of the prediction results of the validation set as the fitness function of the ISSA algorithm.
[0122] Step 5: Determine whether the condition for stopping the ISSA iteration is reached.
[0123] If \(t < T\), find the optimal sparrow position and its corresponding fitness value, update the sparrow position according to formulas (40)-(44), and then update the corresponding GRU structure parameters (including the learning rate \(u\), the number of hidden layers \(h1\) in the first layer, and the number of hidden layers \(h2\) in the second layer), and repeat steps 2-5;
[0124] Otherwise, output the optimal GRU structure parameters (\(u\), \(h1\), \(h2\)) and its corresponding GRU online prediction model.
[0125] Step 6: Input the test set data into the optimized and trained GRU online prediction model for photovoltaic power prediction.
[0126] Step 7: Output the photovoltaic power prediction results, and evaluate the final prediction performance using the metrics shown in formulas (45)-(47). The prediction results show that the prediction accuracy has been significantly improved compared to other traditional photovoltaic prediction models.
[0127] To verify the superiority of the present invention, comprehensive comparisons were made with existing technologies such as GRU, LSTM-GRU, VMD-SSA-GRU, VMD-CNN-LSTM, Attention-CNN-GRU, FA-FCM-SSA-GRU, etc. The comparison results of the photovoltaic power prediction curve under different modes are as Figure 5 、 Figure 7 and Figure 9 shown, the photovoltaic power prediction deviation errors under different modes are as Figure 6 、 Figure 8 and Figure 10 shown, and the evaluation indexes of the photovoltaic power prediction results under different modes are shown in Table 1. Table 1 Evaluation indexes of photovoltaic power prediction results under different modes
[0128] Combined with Embodiment 1 and Embodiment 2, in the input data optimization stage of the present invention, the extraction of main meteorological factors is realized, the meteorological data is reduced, the correlation between factor variables is improved, the data clustering of similar patterns is realized, the similarity of input data is improved, and the most similar pattern recognition of test set data is realized; in the GRU optimization stage, the parameter optimization of the GRU offline training model is realized, and the accuracy of photovoltaic power prediction is further improved.
Claims
1. A two-stage GRU optimization method for ultra-short-term photovoltaic power prediction considering main meteorological factors and waveform classification, including: an input data optimization stage (D) and a GRU optimization stage (G), characterized in that, The input data optimization stage (D) includes main meteorological factor extraction (D1), fluctuation feature extraction (D2), dataset division (D3), similar pattern clustering (D4), most similar pattern recognition (D5). The GRU optimization stage (G) includes the optimization of the GRU offline training (G1) stage based on the improved sparrow search algorithm (ISSA) (G2), and the GRU online prediction (G3) stage combined with the most similar pattern recognition (D5). The specific steps are as follows:
1. Perform main meteorological factor extraction (D1) and fluctuation feature extraction (D2); 2. Conduct dataset division (D3); 3. Input the training set data and the fluctuation features of the photovoltaic power curve into similar pattern clustering (D4); 4. Input the results of similar pattern clustering (D4) into GRU offline training (G1) respectively; 5. Use ISSA (G2) to optimize GRU offline training (G1); 6. Perform the most similar pattern recognition (D5) on the test set data; 7. Determine the GRU online prediction (G3) model corresponding to the GRU offline training (G1) stage in combination with the results of the most similar pattern recognition (D5); 8. The test set data passes through the GRU online prediction model (G3), and finally the prediction result (G4) is output.
2. A two-stage GRU optimization method for ultra-short-term photovoltaic power prediction considering main meteorological factors and waveform classification according to claim 1, characterized in that, The specific steps of the main meteorological factor extraction (D1) include:
1. Input the original meteorological data; 2. Calculate the factor contribution rate using factor analysis (FA). The basic calculation steps of FA mainly include: calculating the Pearson correlation coefficient matrix R, calculating the factor loading matrix A, and calculating the cumulative factor score G s , and the FA mathematical model is as follows: X = A·C + ε W = A' T R -1 X where X = (X1, X2, …, X p ) T represents the initial variable matrix, A = (a i′j′ ) pq represents the factor loading matrix, a i′j′ represents the factor loading of the i'-th variable on the j'-th common factor c j′ C = (c1, c2, …, c q ) T represents the common factor vector matrix, ε = (ε1, ε2, …, ε p ) T represents the specific factor vector; r ij is the correlation coefficient of the standardized indices i and j, r ii = 1, r ij = r ji ; q is the number of common factors; κ is the total number of sample variables, λ1 ≥ λ2 ≥ … ≥ λ q ≥ 0 are the eigenvalues of the initial variable correlation matrix R, S is the leading main factor determining the cumulative contribution rate G s , l1, l2, …, l S are the eigenvectors corresponding to the eigenvalues λ1, λ2, …, λ S , W is the factor score matrix, and A' is the rotated factor loading matrix; 3. The main meteorological factors determined according to the cumulative factor contribution rate are as follows: where I is the main meteorological factor matrix obtained based on FA, I s is the sth main factor, i ts is the value of the sth main factor at time t. The main meteorological factors (D1) for photovoltaic prediction include irradiance factor, temperature factor, cloud cover factor, humidity factor, and wind speed factor.
3. A two-stage GRU optimization method for ultra-short-term photovoltaic power prediction considering main meteorological factors and waveform classification according to claim 2, characterized in that, The dataset division (D3) includes the reconstruction of the meteorological photovoltaic dataset, the division of the training set and the test set. The total reconstructed dataset is as follows: Data = [P, I] P = [p1, p2,..., p t Where Data is the total data set, P is the photovoltaic power generation data, and p t is the photovoltaic power value at time t. The training set is all historical data, and the test set is the data of the day to be predicted.
4. A two-stage GRU optimization method for ultra-short-term photovoltaic power prediction considering main meteorological factors and waveform classification according to claim 3, characterized in that, The specific steps of the similar pattern clustering (D4) include:
1. Perform fluctuation feature extraction (D2) based on historical photovoltaic data, including difference, relative fluctuation number and average power value. The fluctuation features of the daily photovoltaic power curve are calculated as follows: ΔP t = P t - P t-1 where ΔP t is the difference of the daily PV power at time t, and p t is the PV power value at time t, C t is the fluctuation coefficient of the PV power curve, N PF represents the relative fluctuation number of the daily PV power sequence, is the daily average PV power value, and l is the number of time periods in a day; 2. Taking the daily PV power curve as a sample and the fluctuation characteristics as the classification characteristic factors of the sample, use the fuzzy c-means (FCM) algorithm to cluster the daily power curves of the training set data; 3. Output the clustering results of similar patterns and obtain sub-data clusters; 4. Input the training sub-data clusters into the GRU offline training (G1) model respectively.
5. A two-stage GRU optimization method for ultra-short-term photovoltaic power prediction considering main meteorological factors and waveform classification according to claim 4, characterized in that, The specific steps of the most similar pattern recognition (D5) include:
1. Use the grey relational analysis (GCA) and cosine similarity (CS) to jointly calculate the similarity between the test data and each training sub-data cluster; 2. Select the training sub-data cluster with the largest similarity; 3. Determine the GRU online prediction (G3) model corresponding to the test set according to the most similar pattern recognition (D5). The calculation formulas of GCA and CS are as follows: In the formula, is the weight coefficient of feature k', and ξ t′k′ (k′) is the grey correlation coefficient, γ′ is the distinguishing coefficient, with a value range of 0 - 1, C0(k′) is the normalized value of the training data feature k', and C t′ (k′) is the normalized value of the test data feature k' at date t', and N′ is the total number of features k'.
6. A two-stage GRU optimization method for ultra-short-term photovoltaic power prediction considering main meteorological factors and waveform classification according to claim 5, characterized in that, The specific steps for the optimization of the GRU offline training (G1) stage based on ISSA (G2) are:
1. Input the sub-data clusters obtained by similar pattern clustering (D4) into the GRU offline training (G1) model; 2. Calculate the root mean square error (RMSE) between the predicted value and the actual value as the fitness function of ISSA (G2) in the optimization of the GRU offline training (G1) stage; 3. Use ISSA (G2) to optimize the structural parameters of GRU. where RMSE is the root mean square error, z τ' is the actual value of photovoltaic power generation at time τ', is the predicted value of photovoltaic power generation at time τ', and M is the total number of prediction times.
7. A two-stage GRU optimization method for ultra-short-term photovoltaic power prediction considering main meteorological factors and waveform classification according to claim 6, characterized in that The structural parameters of GRU optimized by ISSA (G2) include the learning rate u of GRU, the number of neurons h1 in the first layer of GRU, and the number of neurons h2 in the second layer of GRU.
8. A two-stage GRU optimization method for ultra-short-term photovoltaic power prediction considering main meteorological factors and waveform classification according to claim 6, characterized in that, The ISSA (G2) improves the initial population by adopting a reverse learning strategy compared with SSA, and the calculation is as follows: Y′ = rand(ul + ll) - Y Wherein, Y is the position matrix of the traditional initialized population, Y' is the position matrix of the initialized population improved by the reverse learning strategy, rand is a random function, and its value range is [0, 1]. ul and ll are respectively the upper and lower limits of the search space, both of which are set within the range of [0, 1]. At the same time, two random parameters ω and ψ of the early warning position update model are improved to enhance the global optimization performance, and the calculation is as follows: Wherein, and respectively represent the best position and the worst position at the t'-th iteration, is the position information of the ρ'-th sparrow in the η'-th dimension at the t'-th iteration, and respectively represent the current best and worst fitness values, represents the fitness value of the current sparrow, and T' is the maximum number of iterations.
9. A two-stage GRU optimization method for ultra-short-term photovoltaic power prediction considering main meteorological factors and waveform classification according to claim 6, characterized in that For the GRU online prediction (G3) combined with the most similar pattern recognition (D5), the test data is input into the GRU online prediction (G3) model corresponding to the pattern, and the prediction result (G4) is output to evaluate the prediction performance of this method.
Citation Information
Patent Citations
Neural network ultra-short-term photovoltaic power prediction method based on meteorological clustering
CN117874584A
Cited By
Short-term photovoltaic power interval prediction method based on multi-dimensional clustering and secondary decomposition
CN121749126A