A photovoltaic power prediction method and a corresponding storage medium
The photovoltaic power prediction method optimized by combining the NARX-LSTM model with the tabu search algorithm solves the problem of insufficient photovoltaic power prediction accuracy in the existing technology, realizes efficient and accurate short-term photovoltaic power prediction, and supports precise control of photovoltaic systems.
Patent Information
- Application Number
- CN202111431182.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-29
- Publication Date
- 2025-11-25
- Estimated Expiration
- 2041-11-29
AI Technical Summary
Existing single machine learning methods are insufficient in short-term accuracy of photovoltaic power prediction and struggle to accurately capture weather changes and uncertainties.
A photovoltaic power prediction method based on the NARX-LSTM model is adopted, which is optimized by tabu search algorithm. Through data cleaning, feature extraction, data segmentation and error correction, a training model is built to predict photovoltaic power.
It improves the accuracy and efficiency of photovoltaic power forecasting, can capture the behavior of weather changes, and generate accurate short-term photovoltaic power forecast results, providing technical support for the precise control of photovoltaic systems.
Smart Images

Figure CN114091343B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of power technology, and in particular to a photovoltaic power prediction method and corresponding storage medium based on a combination of nonlinear autoregressive exogenous neural network and long short-term memory (NARX-LSTM). Background Technology
[0002] The transition to renewable energy is a global trend in the 21st century. Solar energy, with its enormous resource potential, is gradually becoming the leading new energy form driving this shift. Photovoltaic energy boasts advantages such as high availability and long durability, but it also has limitations in terms of low power stability and low power quality. Meanwhile, photovoltaic systems are constantly affected by weather conditions, such as cloud cover, wind speed, and temperature variations. In recent years, due to the explosive development of information technology and improvements in basic infrastructure, the research community has been dedicated to developing effective photovoltaic power prediction technologies to stabilize and ensure grid operation. To date, machine learning (ML) techniques have been proposed to explain the behavior of selected feature patterns that change over time, reconstructing a clear vision of future value. However, traditional single machine learning methods still have significant limitations in short-term photovoltaic power prediction accuracy. Summary of the Invention
[0003] The technical problem to be solved by the present invention is that it provides a photovoltaic power prediction method and a corresponding storage medium, which is based on the NARX-LSTM model and can effectively capture the behavior of weather changes and uncertainties related to point prediction, thereby enabling accurate short-term photovoltaic power prediction.
[0004] To address the aforementioned technical problems, as one aspect of the present invention, a photovoltaic power prediction method is provided, comprising the following steps:
[0005] Step S10: Periodically collect photovoltaic data from a specific area, and perform preprocessing and feature extraction;
[0006] Step S11: Perform data segmentation target determination processing on the processed photovoltaic data to form training samples, verification samples and test samples;
[0007] Step S12: Input the test sample into the trained NARX-LSTM model optimized by tabu search (TSA) to obtain and output the photovoltaic power prediction results.
[0008] Preferably, step S10 further includes:
[0009] Step S100: Periodically collect photovoltaic data from a specific area, clean up missing and invalid sample data, and evaluate the importance of features to avoid their adverse effects on the accuracy of the prediction system.
[0010] Step S101: Normalize the historical electricity price data using the maximum and minimum value standardization method and the following formula:
[0011]
[0012] In the formula, X i X represents the value in the historical photovoltaic power output sequence before normalization; i ' represents the normalized historical photovoltaic power output value; Xmax and Xmin represent the historical photovoltaic power output dataset X i The maximum and minimum values.
[0013] Preferably, step S100 specifically comprises:
[0014] For outliers and missing values in the collected data, the mean imputation method in the following formula is used to extract the n data points before and after the location of the outlier as imputation data:
[0015]
[0016] In the formula, X j Let X be the original data sequence, i be the index of the outlier in the original data sequence, and X be the index of the outlier. i 'This is data obtained using mean interpolation.'
[0017] Preferably, step S11 further includes:
[0018] The typical data separation process between the inputs and outputs from the training and test folds is computed during the object determination phase, thereby dividing the data into training and test sets.
[0019] Preferably, it further includes:
[0020] The steps of pre-building and training a NARX-LSTM model optimized by Tabu Search (TSA) include:
[0021] Step S20: Input the weather information into the NARX neural network to obtain the temporary photovoltaic power prediction value. The error value is calculated based on the predicted value, and vector error correction is performed to obtain the vector error correction function (V);
[0022] Step S21: Input the vector error correction function (V) along with the original training set into the LSTM model optimized by TSA as shown in the following formula to train the LSTM model:
[0023] X(t)=x i (t)+V[y(t;x i (t)] (18)
[0024] The following training data was obtained:
[0025] i t '=σ(W I (x t +V[y t ;x t ])+U I h t-1 +b I (19)
[0026] f t '=σ(W f (x t +V[y t ;x t ])+U f h t-1 +b f (20)
[0027] o t '=σ(W o (x t +V[y t ;x t ])+U o h t-1 +b o ) (twenty one)
[0028]
[0029] h' t =o' t ⊙tanh(c' t ) (twenty three)
[0030] Where X(t) represents the dataset obtained after tabu search; y(t) represents the original dataset; σ represents the sigmoid activation function; W, U, and b represent the coefficients and offset of the linear relationship; h t 'Represents the hidden state at the t-th time, (i t ',f t ',o t ') represent the improved LSTM input gate, forget gate, and output gate, respectively; and c' t These represent the state unit and storage unit of NARX-LSTM, respectively, and Equation (8) represents the process of obtaining the hidden state.
[0031] Step S22: Based on the training data obtained by the LSTM model, evaluate the evaluation model, continue to train the NARX-LSTM model, and finally obtain the trained NARX-LSTM model.
[0032] Preferably, step S20 further includes:
[0033] Step S200: Obtain the NARX network prediction value using the following formula. The error vector E between the true value Yn and the actual value Yn n :
[0034]
[0035] Among them, E n =[e1,e2,...,e n ]; True value Y n =[y1,y2,...,y n Network predictions F and ω represent the nonlinear mapping function and corresponding weights of the NARX network;
[0036] Step S201: Expand the error vector into a multidimensional data matrix to construct the Hankel matrix in the following formula, in order to increase the weight of residual correction:
[0037]
[0038] Where L∈[2≤L≤L(n / 2)] is the window length, and K=n-L+1 is the number of overlapping segments;
[0039] Step S202: Calculate the minimum-maximum transformation of the Hankel error matrix using the following formula;
[0040]
[0041] Where, x n x represents the normalized value. r x is the true value. max and x min These are the maximum and minimum values, respectively.
[0042] Step S203 involves performing a Hilbert transform on the Hankel error matrix using the following formula:
[0043] The Hilbert transform of f(x) is as follows:
[0044]
[0045] Where f(x) is the error function, H() is the Hilbert transform operator, and f(x) corresponds to the Hankel error matrix mentioned above;
[0046] The Hilbert transform is then re-expressed as a convolutional form as follows:
[0047]
[0048] A fast algorithm based on the convolution theorem transforms it into the following expression:
[0049]
[0050] Where fft() and ifft() represent Fast Fourier Transform and Inverse Fast Fourier Transform, respectively.
[0051]
[0052] Where freq and sgn represent the frequency and sign function, respectively; according to formula (8), The filter value represents the Fourier transform input signal, which transforms the frequency components by calculating a phase shift of -90 degrees at the positive frequency and +90 degrees at the negative frequency. -j represents the imaginary part of the complex number.
[0053] Step S204: Obtain the error value vector HT based on the calculation of the inverse Fourier transform of the product, and form the vector error correction function (V).
[0054] Accordingly, another aspect of the present invention also provides a computer-readable storage medium having a series of computer-executable instructions stored thereon, which, when executed by one or more computing devices, cause the one or more computing devices to perform the method as described above.
[0055] Implementing the embodiments of the present invention has the following beneficial effects:
[0056] This invention provides a photovoltaic power prediction method and corresponding storage medium, based on the NARX-LSTM model and optimized using a tabu search algorithm. The NARX neural network is chosen because of its successful handling of self-locking problems and nonlinear system identification; furthermore, LSTM memory reduces gradient loss. By inversely normalizing the normalized photovoltaic power prediction results, the actual photovoltaic power prediction results based on the NARX-LSTM prediction model can be obtained.
[0057] The model proposed in this invention can effectively capture the behavior of weather changes and uncertainties related to point forecasts, thereby generating accurate short-term photovoltaic power forecasts with higher efficiency and accuracy, providing technical support for the precise regulation of photovoltaic systems to participate in demand response. Attached Figure Description
[0058] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, obtaining other drawings based on these drawings without creative effort still falls within the scope of the present invention.
[0059] Figure 1 This is a main flowchart of an embodiment of a photovoltaic power prediction method provided by the present invention;
[0060] Figure 2 This is a more detailed flowchart of a photovoltaic power prediction method according to the present invention;
[0061] Figure 3 This is the standard flowchart of the tabu search algorithm involved in this invention. Detailed Implementation
[0062] The technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments.
[0063] like Figure 1 The diagram shown illustrates the main flow of an embodiment of a photovoltaic power prediction method provided by the present invention. (In conjunction with...) Figure 2 and Figure 3 As shown, in this embodiment, the method includes the following steps:
[0064] Step S10: Periodically collect photovoltaic data from a specific area, and perform preprocessing and feature extraction;
[0065] In a specific example, step S10 further includes:
[0066] Step S100: Periodically collect photovoltaic data from a specific area, clean up missing and invalid sample data, and evaluate the importance of features to avoid their adverse effects on the accuracy of the prediction system.
[0067] Step S101: Normalize the historical electricity price data using the maximum and minimum value standardization method and the following formula:
[0068]
[0069] In the formula, X i X' represents the value in the historical photovoltaic power output sequence before normalization. iXmax and Xmin represent the normalized historical photovoltaic power output values; Xmax and Xmin represent the historical photovoltaic power output dataset X, respectively. i The maximum and minimum values.
[0070] In a specific example, step S100 is as follows:
[0071] For outliers and missing values in the collected data, the mean imputation method in the following formula is used to extract the n data points before and after the location of the outlier as imputation data:
[0072]
[0073] In the formula, X j Let X' be the original data sequence, i be the index of the outlier in the original data sequence, and X' be the index of the outlier. i The data was obtained using mean interpolation.
[0074] It is understandable that, such as Figure 2 As shown, step S10 may also include actions such as generating time series data and sorting features according to data importance.
[0075] Step S11: Perform data segmentation target determination processing on the processed photovoltaic data to form training samples, verification samples and test samples;
[0076] In a specific example, step S11 further includes:
[0077] The typical data separation process between the inputs and outputs from the training and test folds is computed during the object determination phase, thereby dividing the data into training and test sets.
[0078] Step S12: Input the test sample into the trained NARX-LSTM model optimized by tabu search (TSA) to obtain and output the photovoltaic power prediction results.
[0079] It is understood that the method provided by this invention needs to further include:
[0080] The steps of pre-building and training a NARX-LSTM model optimized by Tabu Search (TSA) include:
[0081] Step S20: Input the weather information into the NARX neural network to obtain the temporary photovoltaic power prediction value. The error value is calculated based on the predicted value, and vector error correction is performed to obtain the vector error correction function (V);
[0082] Step S21: Input the vector error correction function (V) along with the original training set into the LSTM model optimized by Tabu Search (TSA) as shown in the following formula to train the LSTM model:
[0083] X(t)=x i (t)+V[y(t;x i (t)] (33)
[0084] By employing this method, the LSTM network acquires the learning potential of the NARX neural network, thereby improving the pattern recognition of the prediction system. The training data obtained after processing with the LSTM gate is as follows:
[0085] i t '=σ(W I (x t +V[y t ;x t ])+U I h t-1 +b I (34)
[0086] f t '=σ(W f (x t +V[y t ;x t ])+U f h t-1 +b f (35)
[0087] o t '=σ(W o (x t +V[y t ;x t ])+U o h t-1 +b o (36)
[0088]
[0089] h' t =o' t ⊙tanh(c' t (38)
[0090] Where X(t) represents the dataset obtained after tabu search; y(t) represents the original dataset; σ represents the sigmoid activation function; W, U, and b represent the coefficients and offsets of the linear relationship; h' t Represents the hidden state at the t-th time, (i t ',f t ',o t') represent the improved LSTM input gate, forget gate, and output gate, respectively; and c' t These represent the state unit and storage unit of NARX-LSTM, respectively, and Equation (8) represents the process of obtaining the hidden state.
[0091] The process of the Tabu Search (TSA) algorithm can be found by referring to... Figure 3 As shown.
[0092] Step S22: Based on the training data obtained by the LSTM model, evaluate the evaluation model, continue to train the NARX-LSTM model, and finally obtain the trained NARX-LSTM model.
[0093] In a specific example, step S20 further includes:
[0094] In step S200, a nonlinear autoregressive exogenous neural network is first used to compute residual correction to reduce the network's sensitivity to time dependencies. Assuming that the additional tap time delay from NARX improves the accuracy of the prediction engine, an error Hankel matrix is used to increase the weight of the residual correction.
[0095] The NARX network prediction value is obtained using the following formula. The error vector E between the true value Yn and the actual value Yn n :
[0096]
[0097] Among them, E n =[e1,e2,...,e n ]; True value Y n =[y1,y2,...,y n Network predictions F and ω represent the nonlinear mapping function and corresponding weights of the NARX network;
[0098] Step S201: Expand the error vector into a multidimensional data matrix to construct the Hankel matrix in the following formula, so as to increase the weight of residual correction and capture the dynamic changes of the model:
[0099]
[0100] Where L∈[2≤L≤L(n / 2)] is the window length, and K=n-L+1 is the number of overlapping segments;
[0101] Next, we calculate two types of transformations for the Hankel error matrix: the min-max transformation and the Hilbert transformation.
[0102] Step S202: Calculate the minimum-maximum transformation of the Hankel error matrix using the following formula;
[0103]
[0104] Where, x n x represents the normalized value. r x is the true value. max and x min These are the maximum and minimum values, respectively.
[0105] Step S203 involves performing a Hilbert transform on the Hankel error matrix using the following formula:
[0106] The Hilbert transform of f(x) is as follows:
[0107]
[0108] Where f(x) is the error function, H() is the Hilbert transform operator, and f(x) corresponds to the Hankel error matrix mentioned above;
[0109] The Hilbert transform is then re-expressed as a convolutional form as follows:
[0110]
[0111] A fast algorithm based on the convolution theorem transforms it into the following expression:
[0112]
[0113] Where fft() and ifft() represent Fast Fourier Transform and Inverse Fast Fourier Transform, respectively.
[0114]
[0115] Where freq and sgn represent the frequency and sign function, respectively; according to formula (8), The filter value represents the Fourier transform input signal, which transforms the frequency components by calculating a phase shift of -90 degrees between the positive frequency and +90 degrees between the negative frequency; the purpose is to transform the frequency components by calculating a phase shift of -90 degrees between the positive frequency and +90 degrees between the negative frequency. -j represents the imaginary part of the complex number.
[0116] Step S204: The error value vector HT is obtained by calculating the inverse Fourier transform of the product, and a vector error correction function (V) is formed. HT is characterized by good multi-resolution signal analysis. It can be understood that the vector error correction is calculated using the minimum-maximum transform and the error value vector HT generated by the NARX neural network.
[0117] Therefore, in step S12, the test sample is input into the trained NARX-LSTM model optimized by tabu search (TSA), and the normalized photovoltaic power prediction result is denormalized to obtain the actual photovoltaic power prediction result based on the NARX-LSTM prediction model.
[0118] In the embodiments of the present invention, the NARX neural network is chosen because of its successful implementation in handling the self-locking problem and nonlinear system identification. On the other hand, LSTM memory reduces gradient loss.
[0119] Accordingly, another aspect of the present invention also provides a computer-readable storage medium having a series of computer-executable instructions stored thereon, which, when executed by one or more computing devices, cause the one or more computing devices to perform as described above. Figures 1 to 3 The method described. For more details, please refer to and combine with the foregoing discussion. Figures 1 to 3 The description of [the subject] will not be elaborated here.
[0120] Implementing the embodiments of the present invention has the following beneficial effects:
[0121] This invention provides a photovoltaic power prediction method and corresponding storage medium, based on the NARX-LSTM model and optimized using a tabu search algorithm. The NARX neural network is chosen because of its successful handling of self-locking problems and nonlinear system identification; furthermore, LSTM memory reduces gradient loss. By inversely normalizing the normalized photovoltaic power prediction results, the actual photovoltaic power prediction results based on the NARX-LSTM prediction model can be obtained.
[0122] The model proposed in this invention can effectively capture the behavior of weather changes and uncertainties related to point forecasts, thereby generating accurate short-term photovoltaic power forecasts with higher efficiency and accuracy, providing technical support for the precise regulation of photovoltaic systems to participate in demand response.
[0123] The above description is merely a preferred embodiment of the present invention and should not be construed as limiting the scope of the invention. Therefore, any equivalent variations made in accordance with the claims of the present invention are still within the scope of the present invention.
Claims
1. A photovoltaic power prediction method, characterized in that, Includes the following steps: Step S10: Periodically collect photovoltaic data from a specific area, and perform preprocessing and feature extraction; Step S11: Perform data segmentation target determination processing on the processed photovoltaic data to form training samples and test samples; Step S12: Input the test sample into the trained NARX-LSTM model optimized by tabu search to obtain and output the photovoltaic power prediction results; Further steps include: pre-building and training a NARX-LSTM model optimized by tabu search, specifically including: Step S20: Input the weather information into the NARX neural network to obtain the temporary photovoltaic power prediction value. Based on the predicted value, the error value is calculated and vector error correction is performed to obtain the vector error correction function V; Step S21: Input the vector error correction function V along with the original training set into the LSTM model optimized by TSA in the following formula to train the LSTM model: X(t)=X(t-1)+V[y(t);X(t-1)] (1) The following training data was obtained: i t '=σ(W I (x t +V[y t ;x t ])+U I h t-1 +b I ) (2) f t '=σ(W f (x t +V[y t ;x t ])+U f h t-1 +b f ) (3) o t '=σ(W o (x t +V[y t ;x t ])+U o h t-1 +b o ) (4) h′ t =o′ t ☉tanh(c′ t ) (6) Where X(t) represents the dataset obtained after tabu search; y(t) represents the original dataset; σ represents the sigmoid activation function; W, U, and b represent the coefficients and offset of the linear relationship; h t 'Represents the hidden state at the t-th time, (i t ',f t ',o t ') represent the improved LSTM input gate, forget gate, and output gate, respectively; and c′ t These represent the state unit and storage unit of NARX-LSTM, respectively, and formula (6) represents the process of obtaining the hidden state. Step S22: Based on the training data obtained by the LSTM model, evaluate the evaluation model, continue to train the NARX-LSTM model, and finally obtain the trained NARX-LSTM model.
2. The method according to claim 1, characterized in that, Step S10 further includes: Step S100: Periodically collect photovoltaic data from a specific area, clean up missing and invalid sample data, and evaluate the importance of features to avoid their adverse effects on the accuracy of the prediction system. Step S101: Normalize the historical electricity price data using the maximum and minimum value standardization method and the following formula: In the formula, X i X represents the value in the historical photovoltaic power output sequence before normalization; i ' represents the normalized historical photovoltaic power output value; Xmax and Xmin represent the historical photovoltaic power output dataset X i The maximum and minimum values.
3. The method as described in claim 2, characterized in that, The specific steps of S100 are as follows: For outliers and missing values in the collected data, the mean imputation method in the following formula is used to extract the n data points before and after the location of the outlier as imputation data: In the formula, X j Let X be the original data sequence, i be the index of the outlier in the original data sequence, and X be the index of the outlier. i 'This is data obtained using mean interpolation.' 4. The method according to claim 3, characterized in that, Step S11 further includes: The typical data separation process between the inputs and outputs from the training and test folds is computed during the object determination phase, thereby dividing the data into training and test sets.
5. The method as described in claim 4, characterized in that, Step S20 further includes: Step S200: Obtain the NARX network prediction value using the following formula. The error vector E between the true value Yn and the actual value Yn n : Among them, E n =[e1,e2,...,e n ]; True value Y n =[y1,y2,...,y n Network predictions F and ω represent the nonlinear mapping function and corresponding weights of the NARX network; Step S201: Expand the error vector into a multidimensional data matrix to construct the Hankel matrix in the following formula, in order to increase the weight of residual correction: Where L∈[2≤L≤L(n / 2)] is the window length, and K=n-L+1 is the number of overlapping segments; Step S202: Calculate the minimum-maximum transformation of the Hankel error matrix using the following formula; Where, x n x represents the normalized value. r x is the true value. max and x min These are the maximum and minimum values, respectively. Step S203 involves performing a Hilbert transform on the Hankel error matrix using the following formula: The Hilbert transform of f(x) is as follows: Where f(x) is the error function, H() is the Hilbert transform operator, and f(x) corresponds to the Hankel error matrix mentioned above; The Hilbert transform is then re-expressed as a convolutional form as follows: A fast algorithm based on the convolution theorem transforms it into the following expression: Where fft() and ifft() represent Fast Fourier Transform and Inverse Fast Fourier Transform, respectively. Where freq and sgn represent the frequency and sign function, respectively; according to formula (6), The filter value represents the Fourier transform input signal, which transforms the frequency components by calculating a phase shift of -90 degrees at the positive frequency and +90 degrees at the negative frequency. -j represents the imaginary part of the complex number. Step S204: Obtain the error value vector HT based on the calculation of the inverse Fourier transform of the product, and form the vector error correction function V.
6. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a series of computer-executable instructions, which, when executed by one or more computing devices, cause the one or more computing devices to perform the method as described in any one of claims 1-5.
Citation Information
Patent Citations
Underwater power flow prediction method adopting LSTM-NARX hybrid model
CN110378518A
Photovoltaic power generation short-term power prediction method
CN112330487A