Photovoltaic power generation power ultra-short-term prediction method and system based on hybrid neural network
By combining the CEEMDAN decomposition and GRU-Attention neural network, the problem of poor time-dependent modeling capabilities and prediction accuracy in photovoltaic power generation prediction is solved, and high-precision and robust photovoltaic power prediction effect is achieved.
Patent Information
- Application Number
- CN202510078946.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-17
- Publication Date
- 2025-05-02
AI Technical Summary
The prior art has poor modeling ability to achieve time-dependent relationships in the prediction of photovoltaic power generation, the prediction accuracy and calculation efficiency need to be improved, the stability and integrity of the decomposition process are difficult to guarantee, the modal aliasing phenomenon leads to noise interference, and the model has low adaptability and robustness to the fluctuation characteristics of photovoltaic power generation.
Using a hybrid neural network-based method, combined with CEEMDAN decomposition and GRU-Attention neural network, the photovoltaic power signal is decomposed through CEEMDAN, multiple independent modal components are generated, and they are recombined with other features, and input to the GRU-Attention neural network for training to achieve accurate prediction of photovoltaic power generation.
Through the deep combination of the multi-scale decomposition results provided by CEEMDAN and GRU-Attention, the model has the advantages of high-precision prediction and robustness. It still performs excellently under complex fluctuations in photovoltaic power, significantly improving prediction accuracy and computing efficiency, and enhancing the adaptability and robustness of the model.
Smart Images

Figure CN119921311A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of photovoltaic power data processing, and in particular to a method and system for ultra-short-term photovoltaic power prediction based on a hybrid neural network. Background Art
[0002] The existing invention patent application document "Photovoltaic short-term power interval prediction method and related equipment based on CNN-GRU-Attention" with publication number CN116937541A, the existing method includes: obtaining data about photovoltaic power generation; preprocessing the acquired data; setting prediction parameters and using the preprocessed data to predict photovoltaic short-term power intervals based on the CNN-GRU-Attention method; calculating evaluation indicators based on the interval prediction results. The aforementioned prior art introduces a spatial attention mechanism between CNN and GRU, aiming to assign weights to different features through dimension exchange, thereby focusing on important feature dimensions and ignoring unimportant or redundant features. However, this mechanism only assigns weights to feature dimensions, and fails to fully consider the differences in the importance of features at different times in time series modeling. At the same time, due to certain limitations in the feature extraction capability of CNN, the weight allocation of Attention may fail, resulting in limited contribution to the prediction results.
[0003] The existing invention patent application document "A short-term photovoltaic power prediction method based on VMD-BiGRU-AE model" with publication number CN117933751A, the existing method includes: S01: decomposing the pre-processed photovoltaic power data into k modal components of different frequencies through the VMD algorithm; S02: calculating the permutation entropy of different modal components, and merging different components into n recombined sequences according to the permutation entropy value of each component; S03: splicing the recombined sequence matrix with the characteristic information matrix affecting the photovoltaic power, and inputting them into the BiGRU-AE model for prediction; S04: reconstructing and adding the output prediction values to obtain the final prediction value and analyze the error. The above-mentioned prior art uses VMD (variational modal decomposition) to decompose the original photovoltaic power data and disassemble the signal into modal components of different frequencies. Although this method performs well in a low-noise environment, it is difficult to fully separate all modal components when processing complex and multi-noise interference signals. In addition, VMD needs to set the number of modes in advance and cannot be adjusted dynamically according to signal characteristics, which may lead to excessive or insufficient decomposition of modal components, thus affecting the decomposition effect. At the same time, the Attention mechanism in the aforementioned existing solutions mainly allocates weights for input features, and has a weak coupling with the time series modeling process of BiGRU. Although this independent Attention module can optimize feature extraction, it fails to effectively combine time series information, limiting the time series modeling capability of the overall model.
[0004] The existing document "Research on Photovoltaic Power Generation Fluctuation Prediction Based on Deep Learning" includes: proposing a hybrid deep learning model combining a gated recurrent unit (GRU) neural network and an attention mechanism to predict solar irradiance changes in four different seasons. First, the advantages of the Inception neural network and ResNet are combined to extract features from the original data set; second, the extracted features are input into the Recurrent Neural Network (RNN) network for repeated training; finally, the complex features of the time series data are learned. The experimental results show that the proposed hybrid deep learning model is better than the comparison model. The GRU_Attention method in the aforementioned existing document is mainly used for the prediction of solar irradiance. By combining the Inception and ResNet networks, the global and local features of the original solar irradiance data are extracted to capture multi-scale characteristics. However, the aforementioned existing scheme does not decompose the irradiation data into modal components, the components lack independence, and it is difficult to fully reflect the inherent laws of the signal. In addition, the existing technology does not independently model each modal component. The prediction accuracy of the existing scheme, as well as the adaptability and robustness of the model to the fluctuation characteristics of photovoltaic power generation, still need to be improved.
[0005] In summary, the existing technology has the following technical problems: the modeling ability of time dependence is not strong, the prediction accuracy and calculation efficiency of photovoltaic power generation need to be improved, the stability and integrity of the decomposition process are difficult to ensure, the modal aliasing phenomenon causes noise interference, and the model has low adaptability and robustness to the fluctuation characteristics of photovoltaic power generation. Summary of the invention
[0006] The technical problem to be solved by the present invention is: how to solve the technical problems that the existing technology has weak modeling ability for time dependence, the prediction accuracy and calculation efficiency of photovoltaic power generation need to be improved, the stability and integrity of the decomposition process are difficult to ensure, the modal aliasing phenomenon causes noise interference, and the model has low adaptability and robustness to the fluctuation characteristics of photovoltaic power generation.
[0007] The present invention adopts the following technical solutions to solve the above technical problems: The ultra-short-term prediction method of photovoltaic power generation based on hybrid neural network includes:
[0008] S1. Obtain and preprocess historical feature data, process missing values and outliers on the historical feature data, construct the input of the neural network, and obtain the preprocessed feature time series;
[0009] S2. Preprocessing feature time series The original sampling time series of photovoltaic power generation in Perform CEEMDN decomposition to obtain the CEEMDAN decomposition sequence, and recombine the preprocessed feature time series with the CEEMDAN decomposition sequence to obtain the combined feature
[0010] S3, build M+1 GRU-Attention neural network models, input the combined features into the GRU-Attention neural network model to process and obtain the final prediction value IM F of the mth GRU-Attention neural network m ;
[0011] S4. M+1 GRU-Attention neural network models are trained through back propagation and gradient descent algorithms to obtain a photovoltaic power generation short-term prediction model for photovoltaic power generation power prediction.
[0012] The present invention combines CEEMDAN decomposition with GRU-Attention neural network for ultra-short-term prediction of photovoltaic power generation. First, the photovoltaic power generation signal is decomposed by CEEMDAN, and the complex nonlinear signal is disassembled into multiple essential mode functions (IMFs) with different time scales. These modal components are highly independent and can accurately characterize the short-term fluctuation and long-term trend characteristics of photovoltaic power. Subsequently, each modal component is recombined with other features other than photovoltaic power to generate a new feature time series, providing more diversified input for subsequent modeling. Furthermore, the Attention mechanism is embedded in the GRU neural network, and the model's ability to capture the key moment characteristics of the time series is enhanced by dynamically adjusting the weight distribution of the GRU hidden state. Finally, the new feature time series is input into the GRU-Attention network for training to achieve accurate prediction of photovoltaic power. Through the deep combination of multi-scale decomposition results provided by CEEMDAN and GRU-Attention, the model has the advantages of high-precision prediction and robustness, and still performs well under the conditions of complex fluctuations in photovoltaic power.
[0013] In a more specific technical solution, S1 includes:
[0014] S11. Obtain historical characteristic data of each photovoltaic node in the photovoltaic-penetrated distribution network;
[0015] In S11, the characteristic time series of the i-th photovoltaic node is recorded as:
[0016]
[0017] In the formula, represents the characteristic value of the i-th PV node at time tn, representing PV power generation, node voltage, node net injected active power, season, and temperature respectively. t represents the current time, n=0,1,2,...,N, N+1 represents the number of historical characteristic samplings of the PV node, i=1,2,...,M, M represents the total number of PV nodes;
[0018] S12. Perform data preprocessing on the historical feature data to determine the n+1th sampling feature:
[0019]
[0020] Is there an abnormal value or missing value in the data? If there is a missing value, execute the subsequent S13. If it is an abnormal value, execute the subsequent S14. Otherwise, assign n+1 to n and return to S12 until n>N to obtain the preprocessed feature time series. and execute S2;
[0021] S13, using the following logic, for the feature of the n+1th sampling point Perform missing value processing;
[0022]
[0023] In formula (1), express A certain characteristic sampling value in; NULL means that the sampling point is a set of missing values;
[0024] S14, using the following logic, the feature of the n+1th sampling point Perform outlier processing:
[0025]
[0026] In formula (2), X represents arrive All sample values of arrive The average value of all sampling points; Std means arrive Standard deviation of all sampling points.
[0027] In a more specific technical solution, S2 includes:
[0028] S21, feature original sampling time series In the equation, add K different Gaussian white noise ω k , get K new time series Where k = 1, 2, ..., K, represents the parameter controlling the noise intensity in the first stage;
[0029] S22. Using the following logic, all new time series After K times of EMD decomposition, the first empirical mode component with the kth noise added is obtained. ;
[0030]
[0031] In formula (3), EMD1 means performing EMD decomposition on the sequence and taking its first IMF component;
[0032] S23, using the following logic, the K empirical mode components in the first stage Take the average value and get the first empirical mode component ;
[0033]
[0034] S24, the first empirical mode component From the feature raw sample time series Remove it from the equation to get the first residual sequence
[0035] S25, add K different Gaussian white noise ω to the first residual sequence R1 k , get K new time series in represents the parameter for controlling the noise intensity in the second stage. The following formula (5) is used to calculate the K new time series R 1,k Perform K times EMD decomposition and obtain the second empirical mode component IMF by averaging i 2 , and use formula (6) to obtain the second residual sequence R2;
[0036]
[0037]
[0038] S26. Perform analogy operation to obtain the residual sequence of the mth stage:
[0039] S27, to obtain the residual sequence R m Add K different Gaussian white noise ω k , and perform K-times EMD decomposition using the following formula (7). And obtain the m+1th empirical mode component by taking the average value And use the following formula (8) to calculate the m+1th residual sequence R m+1 ;
[0040]
[0041]
[0042] Where, EMD m Indicates that the sequence is decomposed by EMD and its mth IMF component is taken;
[0043] S28, repeat S21 to S27, stop decomposition when the maximum number of IMFs reaches the preset modal number M, and use the following logic to decompose the original sampling time series of features Perform CEEMDAN decomposition:
[0044]
[0045] S29, Order Get the original sampling time series of the feature After CEEMDAN decomposition, the IMF sequence obtained is
[0046] S210, combining the original sampling time series of the feature with the CEEMDAN decomposition sequence to obtain a combined feature in Indicates that the M+1th Recombine with other features except photovoltaic power generation into a new feature time series:
[0047]
[0048] The present invention adopts CEEMDAN (Complete Set Empirical Mode Decomposition) instead of VMD, and gradually removes the modal components by adding Gaussian white noise and performing multiple EMD decompositions, thereby ensuring the stability and integrity of the decomposition process. CEEMDAN significantly reduces the modal aliasing phenomenon and effectively reduces noise interference on the basis of multiple decompositions and noise averaging. In addition, the method does not need to preset the number of modes, and the decomposition process can be adaptively adjusted according to the signal characteristics, which is particularly suitable for processing complex nonlinear signals, thereby improving the accuracy and robustness of the decomposition results. In the use of Attention, this patent directly embeds it into the GRU neural network and deeply integrates it with the time series modeling process. By dynamically assigning weights to the hidden states of GRU at different times, this patent not only strengthens the modeling ability of time dependencies, but also optimizes the overall prediction performance and efficiency of the model. Therefore, this patent provides reliable and efficient technical support for the accurate prediction of photovoltaic power through the deep combination of CEEMDAN and Attention mechanisms.
[0049] The GRU_Attention method adopted in the present invention is mainly used for the prediction of photovoltaic power generation, and CEEMDAN (Complete Ensemble Empirical Mode Decomposition) is introduced in the data processing stage. CEEMDAN decomposes complex photovoltaic signals into multiple essential mode functions (IMFs), and each IMF component represents the signal characteristics of different time scales. These modal components have high independence and can better reflect the inherent laws of the signal, thereby providing accurate and independent frequency component inputs for subsequent models. By independently modeling each modal component, the prediction accuracy is further improved, and the adaptability and robustness of the model to the fluctuation characteristics of photovoltaic power generation are enhanced.
[0050] In a more specific technical solution, S3 includes:
[0051] S31, combining features They are input into M+1 GRU-Attention neural network models respectively, where the number of GRU layers in each GRU-Attention neural network model is set to B layers, and each GRU layer contains a reset gate Z t and an update gate Z t ;
[0052] S32, using the following logic, establish the update gate Z of the GRU layer at time t t , Reset Gate R t And output H t :
[0053]
[0054] In formula (10), W Z , U Z Both represent the update of gate Z at time t t The weight of B Z Indicates that gate Z is updated at time t t Bias of W R , U R Both indicate that the gate R is reset at time t t The weight of B R Reset gate R at time t t Bias of Represents the candidate hidden state at time t, output H at time t-1 t-1 and input X at time t t Obtained by weighted linear combination; W H and U H Both represent the hidden state at time t The weight of B H Indicates the hidden state at time t The bias of ; σ represents the sigmoid activation function; tanh represents the hyperbolic tangent activation function; ο represents the Hadamard product;
[0055] S33. At each time step t, the current hidden state H is calculated using the following logic: t For all hidden states (H1,H2,...,H t-1 )’s attention weight;
[0056]
[0057] Where, f represents f(a,[b,…,z])=[a·b,…,a·z]; They represent the weight and bias of the query vector in the jth attention head respectively; They represent the weight and bias of the key vector in the jth attention head respectively; represents the parameters used for scaling calculation; H t-1 represents the hidden state at time t-1; Represents the hidden state H at time t t For the hidden state H at time t-1 t-1 The attention weight of
[0058] S34, the hidden state H at time t is obtained t Normalize the attention weights of hidden states at other moments;
[0059] S35, calculate the hidden state at other times for the hidden state at time t H t Contribution
[0060] S36, the output vector of D attention heads and the hidden state H at time t t Splicing, calculate the enhanced hidden state at time t
[0061] S37, enhance the hidden state at time t Input to the fully connected layer to generate the final prediction value IM F of the mth GRU-Attention neural network m .
[0062] The present invention directly embeds the Attention mechanism into the GRU neural network and deeply integrates it with the time series modeling process. By dynamically assigning weights to the hidden states of the GRU at different times and adjusting its contribution to time series modeling, it not only significantly enhances the modeling ability of time dependencies, but also further optimizes the prediction performance and computational efficiency of the model, thus effectively making up for the shortcomings of existing invention patents in time series modeling.
[0063] In a more specific technical solution, in S34, the following logic is used to normalize the attention weights:
[0064]
[0065] In formula (12), h,l∈[1,2,…,t-1]; and They represent the hidden state H at time t respectively. t For the hidden state H at time l l and the hidden state H at time h h The attention weight of l Represents the hidden state H at time t after normalization t For the hidden state H at time l l The attention weight.
[0066] In a more specific technical solution, in S35, the following logic is used to obtain the hidden state at other times relative to the hidden state at time t H t Contribution
[0067]
[0068] In formula (13), Respectively represent the weight and bias of the median vector of the jth attention head; O j represents the output of the jth attention head.
[0069] In a more specific technical solution, in S36, the following logic is used to calculate the enhanced hidden state at time t:
[0070]
[0071] In formula (14), O D is the output of the D-th attention head; W represents the weight matrix.
[0072] In a more specific technical solution, in S37, the following logic is used to generate the final prediction value IMF of the mth GRU-Attention neural network: m ;
[0073]
[0074] In formula (15), W y and b y denote the weights and biases of the linear layer respectively.
[0075] In a more specific technical solution, in S4, the loss function L is obtained using the following logic: PUpdate the network parameters until the maximum number of iterations and the convergence position of the loss function value are reached, and obtain the photovoltaic power generation short-term prediction model;
[0076]
[0077] In formula (16), G represents the total number of samples in batch training; It represents the final prediction value of the samples of batch c at time t+1 after the M+1th GRU-Attention neural network; Indicates the actual photovoltaic power generation value at time t+1.
[0078] In a more specific technical solution, the ultra-short-term prediction system for photovoltaic power generation based on hybrid neural network includes:
[0079] The preprocessing module is used to obtain and preprocess historical feature data, process missing values and outliers on the historical feature data, construct the input of the GRU-Attention neural network, and obtain the preprocessed feature time series;
[0080] CEEMDN decomposition module is used to preprocess feature time series The original sampling time series of photovoltaic power generation in Perform CEEMDN decomposition to obtain the CEEMDAN decomposition sequence, and recombine the preprocessed feature time series with the CEEMDAN decomposition sequence to obtain the combined feature The CEEMDN decomposition module is connected to the preprocessing module;
[0081] GRU-Attention neural network model building module, used to build M+1 GRU-Attention neural network models, input the combined features into the GRU-Attention neural network model to process and obtain the final prediction value IMF of the mth GRU-Attention neural network m , the GRU-Attention neural network model building module is connected with the CEEMDN decomposition module;
[0082] The model training module is used to train M+1 GRU-Attention neural network models through back propagation and gradient descent algorithms to obtain a short-term photovoltaic power generation prediction model for photovoltaic power generation power prediction. The GRU-Attention neural network model construction module is connected to the CEEMDN decomposition module.
[0083] Compared with the prior art, the present invention has the following advantages:
[0084] The present invention combines CEEMDAN decomposition with GRU-Attention neural network for ultra-short-term prediction of photovoltaic power generation. First, the photovoltaic power generation signal is decomposed by CEEMDAN, and the complex nonlinear signal is disassembled into multiple essential mode functions (IMFs) with different time scales. These modal components are highly independent and can accurately characterize the short-term fluctuation and long-term trend characteristics of photovoltaic power. Subsequently, each modal component is recombined with other features other than photovoltaic power to generate a new feature time series, providing more diversified input for subsequent modeling. Furthermore, the Attention mechanism is embedded in the GRU neural network, and the model's ability to capture the key moment characteristics of the time series is enhanced by dynamically adjusting the weight distribution of the GRU hidden state. Finally, the new feature time series is input into the GRU-Attention network for training to achieve accurate prediction of photovoltaic power. Through the deep combination of multi-scale decomposition results provided by CEEMDAN and GRU-Attention, the model has the advantages of high-precision prediction and robustness, and still performs well under the conditions of complex fluctuations in photovoltaic power.
[0085] The present invention adopts CEEMDAN (Complete Set Empirical Mode Decomposition) instead of VMD, and gradually removes the modal components by adding Gaussian white noise and performing multiple EMD decompositions, thereby ensuring the stability and integrity of the decomposition process. CEEMDAN significantly reduces the modal aliasing phenomenon and effectively reduces noise interference on the basis of multiple decompositions and noise averaging. In addition, the method does not need to preset the number of modes, and the decomposition process can be adaptively adjusted according to the signal characteristics, which is particularly suitable for processing complex nonlinear signals, thereby improving the accuracy and robustness of the decomposition results. In the use of Attention, this patent directly embeds it into the GRU neural network and deeply integrates it with the time series modeling process. By dynamically assigning weights to the hidden states of GRU at different times, this patent not only strengthens the modeling ability of time dependencies, but also optimizes the overall prediction performance and efficiency of the model. Therefore, this patent provides reliable and efficient technical support for the accurate prediction of photovoltaic power through the deep combination of CEEMDAN and Attention mechanisms.
[0086] The GRU_Attention method adopted in the present invention is mainly used for the prediction of photovoltaic power generation, and CEEMDAN (Complete Ensemble Empirical Mode Decomposition) is introduced in the data processing stage. CEEMDAN decomposes complex photovoltaic signals into multiple essential mode functions (IMFs), and each IMF component represents the signal characteristics of different time scales. These modal components have high independence and can better reflect the inherent laws of the signal, thereby providing accurate and independent frequency component inputs for subsequent models. By independently modeling each modal component, the prediction accuracy is further improved, and the adaptability and robustness of the model to the fluctuation characteristics of photovoltaic power generation are enhanced.
[0087] The present invention directly embeds the Attention mechanism into the GRU neural network and deeply integrates it with the time series modeling process. By dynamically assigning weights to the hidden states of the GRU at different times and adjusting its contribution to time series modeling, it not only significantly enhances the modeling ability of time dependencies, but also further optimizes the prediction performance and computational efficiency of the model, thus effectively making up for the shortcomings of existing invention patents in time series modeling.
[0088] The present invention solves the technical problems existing in the prior art, namely, the weak modeling capability of time dependence, the need to improve the prediction accuracy and calculation efficiency of photovoltaic power generation, the difficulty in ensuring the stability and integrity of the decomposition process, the noise interference caused by the modal aliasing phenomenon, and the low adaptability and robustness of the model to the fluctuation characteristics of photovoltaic power generation. BRIEF DESCRIPTION OF THE DRAWINGS
[0089] Figure 1 This is a schematic diagram of the basic steps of the ultra-short-term prediction method of photovoltaic power generation based on a hybrid neural network according to Example 1 of the present invention;
[0090] Figure 2 This is a schematic diagram of the specific steps of constructing the GRU-Attention neural network input according to Example 1 of the present invention;
[0091] Figure 3 This is a schematic diagram of specific steps of CEEMDN decomposition according to Example 1 of the present invention;
[0092] Figure 4 This is a schematic diagram of the specific steps of constructing a GRU-Attention neural network model in Example 1 of the present invention. DETAILED DESCRIPTION
[0093] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in combination with 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.
[0094] Example 1
[0095] like Figure 1 As shown, the ultra-short-term prediction method of photovoltaic power generation based on hybrid neural network provided by the present invention includes the following basic steps:
[0096] S1. Construct the input of GRU-Attention neural network;
[0097] like Figure 2 As shown, in this embodiment, step S1 of constructing the GRU-Attention neural network input also includes:
[0098] S11, obtaining historical characteristic data of each photovoltaic node in the photovoltaic-penetrated distribution network;
[0099] In this embodiment, the characteristic time series of the i-th photovoltaic node is recorded as:
[0100]
[0101] in, represents the characteristic value of the i-th PV node at time tn, representing PV power generation, node voltage, node net injected active power, season, and temperature respectively. t represents the current time, n=0,1,2,...,N, N+1 represents the number of historical characteristic samplings of the PV node, i=1,2,...,M, M represents the total number of PV nodes;
[0102] S12: Preprocess the historical photovoltaic node feature data to determine the n+1th sampling feature Is there an abnormal value or missing value in the data? If it is a missing value, execute step S13; if it is an abnormal value, execute step S14; otherwise, assign n+1 to n and return to step S12 until n>N, and obtain the characteristic time series after data preprocessing. And execute step S2;
[0103] S13, using the following formula (1), the feature of the n+1th sampling point Perform missing value processing;
[0104]
[0105] In formula (1), express A certain characteristic sampling value in; NULL means that the sampling point is a set of missing values;
[0106] S14. Using formula (2), the feature of the n+1th sampling point Perform outlier processing:
[0107]
[0108] In formula (2), X represents arrive All sample values of arrive The average value of all sampling points; Std means arrive Standard deviation of all sampling points;
[0109] S2. Features after data preprocessing Photovoltaic power generation Perform CEEMDN decomposition;
[0110] like Figure 3 As shown, in this embodiment, step S2 of CEEMDN decomposition includes the following specific steps:
[0111] S21, feature original sampling time series Add K different Gaussian white noises ω to k , get K new time series Where k = 1, 2, ..., K, ζ0 represents the parameter controlling the noise intensity in the first stage;
[0112] S22, using formula (3), all time series After K times of EMD decomposition, the first empirical mode component with the kth noise is obtained.
[0113]
[0114] Among them, EMD1 means to perform EMD decomposition on the sequence and take its first IMF component;
[0115] S23, using formula (4), the K empirical mode components in the first stage Take the average value to get the first empirical mode component
[0116]
[0117] S24, the first empirical mode component From the original signal Remove it from the equation to get the first residual sequence
[0118] S25, add K different Gaussian white noise ω to the residual sequence R1 k , get K new time series in represents the parameter for controlling the noise intensity in the second stage. Using formula (5), we can calculate the K time series R 1,k Perform K times EMD decomposition and calculate the average value to obtain the second empirical mode component IMF i 2 , and use formula (6) to obtain the second residual sequence R2;
[0119]
[0120]
[0121] S26. By analogy, we can know that the residual sequence of the mth stage is
[0122] S27, for the residual sequence R m Add K different Gaussian white noise ω k , and use formula (7) to perform K times EMD decomposition and calculate the average value to obtain the m+1th empirical mode component And use formula (8) to calculate the m+1th residual sequence R m+1 ;
[0123]
[0124]
[0125] Among them, EMD m Indicates that the sequence is decomposed by EMD and its mth IMF component is taken;
[0126] S28, repeating steps S26 to S27, stopping the decomposition when the maximum number of IMFs reaches the preset modal number M, and Perform CEEMDAN decomposition, the expression is shown in formula (9);
[0127]
[0128] S29, Order Original sequence The IMF sequence obtained after CEEMDAN decomposition is
[0129] S210, recombining the characteristic time series and the IMF series into new features in Indicates that the M+1th Recombine with other features except photovoltaic power generation into a new feature time series:
[0130]
[0131] S3. Build M+1 GRU-Attention neural network models;
[0132] like Figure 4 As shown, in this embodiment, step S3 of constructing the GRU-Attention neural network model also includes the following specific steps:
[0133] S31. The characteristic time series They are input into M+1 GRU-Attention neural networks respectively, where the number of GRU layers in each GRU-Attention neural network is set to B layers, and each GRU layer contains a reset gate Z t and an update gate Z t ;
[0134] S32, using formula (10) to establish the GRU layer update gate Z at time t t , Reset Gate R t And output H t ;
[0135]
[0136] In formula (10), W Z , U Z Both represent the update of gate Z at time t t The weight of B Z Indicates that gate Z is updated at time t t Bias of W R , U R Both indicate that the gate R is reset at time t t The weight of B R Reset gate R at time t t Bias of Represents the candidate hidden state at time t, output H at time t-1 t-1 and input X at time t t Obtained by weighted linear combination; W H and U H Both represent the hidden state at time t The weight of B H Indicates the hidden state at time t The bias of ; σ represents the sigmoid activation function; tanh represents the hyperbolic tangent activation function; ο represents the Hadamard product;
[0137] S33. At each time step t, use formula (11) to calculate the current hidden state H t For all hidden states (H1,H2,...,H t-1 )’s attention weight;
[0138]
[0139] Wherein, f represents f(a,[b,…,z])=[a·b,…,a·z]; They represent the weight and bias of the query vector in the jth attention head respectively; They represent the weight and bias of the key vector in the jth attention head respectively; represents the parameters used for scaling calculation; H t-1 represents the hidden state at time t-1; Represents the hidden state H at time t t For the hidden state H at time t-1 t-1 The attention weight of
[0140] S34, using formula (12) to obtain the hidden state H at time t t Normalize the attention weights of the hidden states at other times:
[0141]
[0142] where h,l∈[1,2,…,t-1]; and They represent the hidden state H at time t respectively. t For the hidden state H at time l l and the hidden state H at time h h The attention weight of l Represents the hidden state H at time t after normalization t For the hidden state H at time l l The attention weight of
[0143] S35. For the hidden state H at time t t , the hidden state pair H at other times t The contribution of is calculated by weighted summation using formula (13);
[0144]
[0145] in Respectively represent the weight and bias of the median vector of the jth attention head; O jrepresents the output of the jth attention head;
[0146] S36, the output vector of D attention heads and the hidden state H at time t t Splicing, and using formula (14) to calculate the enhanced hidden state at time t
[0147]
[0148] Among them, O D The output of the Dth attention head; W represents the weight matrix;
[0149] S37, using formula (15), the enhanced hidden state Input to the fully connected layer to generate the final prediction value IMF of the mth GRU-Attention neural network m ;
[0150]
[0151] Among them, W y and b y Represent the weights and biases of the linear layer respectively;
[0152] S4. Train the M+1 GRU-Attention neural network models by back propagation and gradient descent algorithm, and use the loss function L in formula (16) P Update the network parameters until the maximum number of iterations or the convergence position of the loss function value is reached, thereby obtaining a short-term prediction model for photovoltaic power generation;
[0153]
[0154] Where G represents the total number of samples in batch training; It represents the final prediction value of the samples of batch c at time t+1 after the M+1th GRU-Attention neural network; Indicates the actual photovoltaic power generation value at time t+1.
[0155] In summary, the present invention combines CEEMDAN decomposition with GRU-Attention neural network for ultra-short-term prediction of photovoltaic power generation. First, the photovoltaic power generation signal is decomposed by CEEMDAN, and the complex nonlinear signal is disassembled into multiple essential mode functions (IMFs) with different time scales. These modal components are highly independent and can accurately characterize the short-term fluctuations and long-term trend characteristics of photovoltaic power. Subsequently, each modal component is recombined with other features other than photovoltaic power to generate a new feature time series, providing more diverse inputs for subsequent modeling. Furthermore, the Attention mechanism is embedded in the GRU neural network, and the model's ability to capture the key moment characteristics of the time series is enhanced by dynamically adjusting the weight distribution of the GRU hidden state. Finally, the new feature time series is input into the GRU-Attention network for training to achieve accurate prediction of photovoltaic power. Through the deep combination of multi-scale decomposition results provided by CEEMDAN and GRU-Attention, the model has the advantages of high-precision prediction and robustness, and still performs well under the conditions of complex fluctuations in photovoltaic power.
[0156] The present invention adopts CEEMDAN (Complete Set Empirical Mode Decomposition) instead of VMD, and gradually removes the modal components by adding Gaussian white noise and performing multiple EMD decompositions, thereby ensuring the stability and integrity of the decomposition process. CEEMDAN significantly reduces the modal aliasing phenomenon and effectively reduces noise interference on the basis of multiple decompositions and noise averaging. In addition, the method does not need to preset the number of modes, and the decomposition process can be adaptively adjusted according to the signal characteristics, which is particularly suitable for processing complex nonlinear signals, thereby improving the accuracy and robustness of the decomposition results. In the use of Attention, this patent directly embeds it into the GRU neural network and deeply integrates it with the time series modeling process. By dynamically assigning weights to the hidden states of GRU at different times, this patent not only strengthens the modeling ability of time dependencies, but also optimizes the overall prediction performance and efficiency of the model. Therefore, this patent provides reliable and efficient technical support for the accurate prediction of photovoltaic power through the deep combination of CEEMDAN and Attention mechanisms.
[0157] The GRU_Attention method adopted in the present invention is mainly used for the prediction of photovoltaic power generation, and CEEMDAN (Complete Ensemble Empirical Mode Decomposition) is introduced in the data processing stage. CEEMDAN decomposes complex photovoltaic signals into multiple essential mode functions (IMFs), and each IMF component represents the signal characteristics of different time scales. These modal components have high independence and can better reflect the inherent laws of the signal, thereby providing accurate and independent frequency component inputs for subsequent models. By independently modeling each modal component, the prediction accuracy is further improved, and the adaptability and robustness of the model to the fluctuation characteristics of photovoltaic power generation are enhanced.
[0158] The present invention directly embeds the Attention mechanism into the GRU neural network and deeply integrates it with the time series modeling process. By dynamically assigning weights to the hidden states of the GRU at different times and adjusting its contribution to time series modeling, it not only significantly enhances the modeling ability of time dependencies, but also further optimizes the prediction performance and computational efficiency of the model, thus effectively making up for the shortcomings of existing invention patents in time series modeling.
[0159] The present invention solves the technical problems existing in the prior art, namely, the weak modeling capability of time dependence, the need to improve the prediction accuracy and calculation efficiency of photovoltaic power generation, the difficulty in ensuring the stability and integrity of the decomposition process, the noise interference caused by the modal aliasing phenomenon, and the low adaptability and robustness of the model to the fluctuation characteristics of photovoltaic power generation.
[0160] The above embodiments are only used to illustrate the technical solutions of the present invention, rather than to limit the same. Although the present invention has been described in detail with reference to the aforementioned embodiments, those skilled in the art should understand that the technical solutions described in the aforementioned embodiments may still be modified, or some of the technical features may be replaced by equivalents. However, these modifications or replacements do not deviate the essence of the corresponding technical solutions from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. An ultra-short-term prediction method for photovoltaic power generation based on a hybrid neural network, characterized in that: The method comprises: S1. Acquire and preprocess historical feature data, perform missing value processing and outlier processing on the historical feature data, construct the input of the GRU-Attention neural network, and obtain a preprocessed feature time series; S2, preprocessing the feature time series The original sampling time series of photovoltaic power generation in Perform CEEMDN decomposition to obtain a CEEMDAN decomposition sequence, and recombine the preprocessed feature time series with the CEEMDAN decomposition sequence to obtain a combined feature S3, construct M+1 GRU-Attention neural network models, input the combined features into the GRU-Attention neural network model to process and obtain the final prediction value IMF of the mth GRU-Attention neural network m ; S4. The M+1 GRU-Attention neural network models are trained by back propagation and gradient descent algorithms to obtain a photovoltaic power generation short-term prediction model for photovoltaic power generation power prediction.
2. The method for ultra-short-term photovoltaic power generation prediction based on hybrid neural network according to claim 1 is characterized in that: The S1 includes: S11, obtaining the historical characteristic data of each photovoltaic node in the photovoltaic-penetrated distribution network; In S11, the characteristic time series of the i-th photovoltaic node is recorded as: In the formula, represents the characteristic value of the i-th PV node at time tn, representing PV power generation, node voltage, node net injected active power, season, and temperature respectively. t represents the current time, n=0,1,2,...,N, N+1 represents the number of historical characteristic samplings of the PV node, i=1,2,...,M, M represents the total number of PV nodes; S12, preprocess the historical feature data to determine the n+1th sampling feature: Is there an abnormal value or missing value in the data? If there is a missing value, execute the subsequent S13; if it is an abnormal value, execute the subsequent S14; otherwise, assign n+1 to n and return to S12 until n>N to obtain the preprocessed feature time series and executing S2; S13, using the following logic, for the feature of the n+1th sampling point Perform missing value processing; In the formula (1), express A certain characteristic sampling value in; NULL means that the sampling point is a set of missing values; S14, using the following logic, the feature of the n+1th sampling point Perform outlier processing: In the formula (2), X represents arrive All sample values of arrive The average value of all sampling points; Std means arrive Standard deviation of all sampling points.
3. The ultra-short-term prediction method for photovoltaic power generation based on hybrid neural network according to claim 1 is characterized in that: The S2 includes: S21, sampling time series of the original features In the equation, add K different Gaussian white noise ω k , get K new time series Where k = 1, 2, ..., K, represents the parameter controlling the noise intensity in the first stage; S22, using the following logic, all the new time series After K times of EMD decomposition, the first empirical mode component IMF with the kth noise added is obtained. i 1,k ; In the formula (3), EMD1 represents performing EMD decomposition on the sequence and taking its first IMF component; S23, using the following logic, the K empirical mode components IMF in the first stage i 1,k Take the average value and get the first empirical mode component IMF i 1 ; S24, the first empirical mode component IMF i 1 From the said feature original sampling time series Remove it from the equation to get the first residual sequence S25, adding K different Gaussian white noises ω to the first residual sequence R1 k , get K new time series in represents the parameter for controlling the noise intensity in the second stage, and the following formula (5) is used to calculate the K new time series R 1,k Perform K times EMD decomposition and obtain the second empirical mode component IMF by averaging i 2 , and use formula (6) to obtain the second residual sequence R2; R2=R1-IMF i 2 (6) S26, perform analogy operation, and obtain the residual sequence of the mth stage: R m =R m-1 -IMF i m ; S27, to obtain the residual sequence R m Add K different Gaussian white noise ω k , and perform K-times EMD decomposition using the following formula (7). And obtain the m+1th empirical mode component IMF by taking the average value i m+1 , and use the following formula (8) to calculate the m+1th residual sequence R m+1 ; R m+1 =R m -IMF i m+1 (8) Where, EMD m Indicates that the sequence is decomposed by EMD and its mth IMF component is taken; S28, repeat S21 to S27, stop decomposition when the maximum number of IMFs reaches the preset modal number M, and use the following logic to decompose the original sampling time series of the feature Perform CEEMDAN decomposition: S29. Order the IMF i M+1 =R M+1 , get the original sampling time series of the feature After the CEEMDAN decomposition, the IMF sequence obtained is IMF i ={IMF i 1 ,IMF i 2 ,...,IMF i M+1 }; S210, combining the feature original sampling time series with the CEEMDAN decomposition sequence to obtain the combined feature in Indicates that the M+1th IMF i M+1 Recombine with other features except photovoltaic power generation into a new feature time series:
4. The ultra-short-term prediction method for photovoltaic power generation based on hybrid neural network according to claim 1 is characterized in that: The S3 includes: S31, the combined features are respectively input into M+1 of the GRU-Attention neural network models, wherein the number of GRU layers in each of the GRU-Attention neural network models is set to B layers, and each GRU layer includes a reset gate Z t and an update gate Z t ; S32, using the following logic, respectively establish the update gate Z of the GRU layer at time t t , Reset Gate R t And output H t : In the formula (10), W Z , U Z Both represent the update of gate Z at time t t The weight of B Z Indicates that gate Z is updated at time t t Bias of W R , U R Both indicate that the gate R is reset at time t t The weight of B R Reset gate R at time t t Bias of Represents the candidate hidden state at time t, output H at time t-1 t-1 and input X at time t t Obtained by weighted linear combination; W H and U H Both represent the hidden state at time t The weight of B H Indicates the hidden state at time t Bias of ; σ represents the sigmoid activation function; tanh represents the hyperbolic tangent activation function; represents the Hadamard product; S33. At each time step t, the current hidden state H is calculated using the following logic: t For all hidden states (H1,H2,...,H t-1 )’s attention weight; Where, f represents f(a,[b,…,z])=[a·b,…,a·z]; They represent the weight and bias of the query vector in the jth attention head respectively; They represent the weight and bias of the key vector in the jth attention head respectively; represents the parameters used for scaling calculation; H t-1 represents the hidden state at time t-1; Represents the hidden state H at time t t For the hidden state H at time t-1 t-1 The attention weight of S34, the hidden state H at time t is obtained t Normalize the attention weights of hidden states at other moments; S35, obtaining the hidden state at other times for the hidden state H at time t t Contribution S36, the output vector of D attention heads and the hidden state H at time t t Splicing, calculate the enhanced hidden state at time t S37, enhancing the hidden state at time t Input to the fully connected layer to generate the final prediction value IMF of the mth GRU-Attention neural network m .
5. The method for ultra-short-term prediction of photovoltaic power generation based on hybrid neural network according to claim 4 is characterized in that: In S34, the attention weight normalization is performed using the following logic: In the formula (12), h,l∈[1,2,…,t-1]; and They represent the hidden state H at time t respectively. t For the hidden state H at time l l and the hidden state H at time h h The attention weight of Λ l Represents the hidden state H at time t after normalization t For the hidden state H at time l l The attention weight.
6. The method for ultra-short-term prediction of photovoltaic power generation based on hybrid neural network according to claim 4 is characterized in that: In S35, the following logic is used to obtain the hidden state at the remaining time relative to the hidden state at time t H: t Contribution In the formula (13), Respectively represent the weight and bias of the median vector of the jth attention head; O j represents the output of the jth attention head.
7. The ultra-short-term prediction method for photovoltaic power generation based on hybrid neural network according to claim 1 is characterized in that: In S36, the following logic is used to calculate the enhanced hidden state at time t: In the formula (14), O D is the output of the D-th attention head; W represents the weight matrix.
8. The method for ultra-short-term prediction of photovoltaic power generation based on hybrid neural network according to claim 4 is characterized in that: In S37, the following logic is used to generate the final prediction value IMF of the mth GRU-Attention neural network: m ; In the formula (15), W y and b y denote the weights and biases of the linear layer respectively.
9. The method for ultra-short-term photovoltaic power generation prediction based on hybrid neural network according to claim 1, characterized in that: In S4, the loss function L is obtained using the following logic: P Updating the network parameters until the maximum number of iterations and the convergence position of the loss function value are reached, thereby obtaining the photovoltaic power generation short-term prediction model; In formula (16), G represents the total number of samples in batch training; It represents the final prediction value of the samples of batch c at time t+1 after the M+1th GRU-Attention neural network; Indicates the actual photovoltaic power generation value at time t+1.
10. The ultra-short-term prediction system of photovoltaic power generation based on hybrid neural network is characterized by: The system comprises: A preprocessing module is used to obtain and preprocess historical feature data, perform missing value processing and outlier processing on the historical feature data, construct the input of the GRU-Attention neural network, and obtain a preprocessed feature time series; CEEMDN decomposition module, used to pre-process the feature time series The original sampling time series of photovoltaic power generation in Perform CEEMDN decomposition to obtain a CEEMDAN decomposition sequence, and recombine the preprocessed feature time series with the CEEMDAN decomposition sequence to obtain a combined feature The CEEMDN decomposition module is connected to the preprocessing module; The GRU-Attention neural network model construction module is used to construct M+1 GRU-Attention neural network models, and input the combined features into the GRU-Attention neural network model to process and obtain the final prediction value IMF of the mth GRU-Attention neural network. m , the GRU-Attention neural network model building module is connected to the CEEMDN decomposition module; The model training module is used to train the M+1 GRU-Attention neural network models through back propagation and gradient descent algorithms to obtain a photovoltaic power generation short-term prediction model to perform photovoltaic power generation power prediction. The GRU-Attention neural network model construction module is connected to the CEEMDN decomposition module.
Citation Information
Patent Citations
CNN-GRU-Attention-based photovoltaic short-term power interval prediction method and related equipment
CN116937541A
Short-term photovoltaic power prediction method based on VMD-BiGRU-AE model
CN117933751A