Short-term power prediction method and system based on Bayesian optimization hybrid neural network
By using a hybrid neural network method combining Bayesian optimization of convolutional neural networks and long short-term memory networks, photovoltaic power output and environmental indicators are optimized, solving the problem of low accuracy in photovoltaic power generation prediction and achieving more efficient photovoltaic power prediction and power system stability assurance.
Patent Information
- Application Number
- CN202411431724.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-14
- Publication Date
- 2025-01-21
AI Technical Summary
Existing photovoltaic and wind power prediction models fail to effectively consider spatiotemporal characteristics, resulting in low prediction accuracy and data redundancy, posing a risk of overfitting and affecting the stability and security of the power system.
A hybrid neural network approach combining a Bayesian optimized convolutional neural network and a long short-term memory network is adopted. By optimizing and decomposing features from photovoltaic power output data and environmental indicators, a hybrid neural network model is constructed. The hyperparameters are then optimized using a Bayesian optimization algorithm to reduce model complexity and improve prediction accuracy.
While reducing model complexity, it significantly improves the accuracy of photovoltaic power prediction, reduces data non-stationarity and redundancy, enhances the model's computational efficiency and generalization ability, and ensures the safe and stable operation of the power system.
Smart Images

Figure CN119340980A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of power system power prediction, and more specifically, to a Bayesian optimized convolutional neural network-long short-term memory network power prediction method and system considering spatiotemporal characteristics. Background Art
[0002] With the rapid development of social economy and science and technology, human demand for energy is increasing. However, the large-scale use of traditional fossil energy has led to a sharp decline in global reserves, triggering a global energy crisis. Therefore, the development and utilization of renewable energy has received more and more attention worldwide. At present, the main renewable energy sources are divided into biomass energy, wind energy, tidal energy and solar energy. Among these forms, solar energy is the most ideal clean energy with huge development prospects, among which photovoltaic power generation is the most widely used. However, the inability to adaptively generate electricity has become the biggest limitation of photovoltaic power generation systems, which requires external control to achieve the regulation of power generation. In addition, wind power is an unstable energy source with random fluctuations. Wind power output has strong waveform and indirectness. Large-scale integration into the power grid will bring severe tests to the stable operation of the power system. In order to make up for the shortcomings of photovoltaic power generation and wind power output, it is very important to accurately predict the output power. Accurately predicting the power generation can reasonably arrange the energy supporting power generation in advance, reduce unnecessary costs and the impact of mutation during photovoltaic power generation, and ensure the stability and safety of the power system.
[0003] At present, load forecasting can be roughly divided into three categories: conventional statistical models, artificial intelligence models and hybrid forecasting models. Among them, conventional statistical models can only take into account historical data, but not other weather conditions related to solar irradiation, and are usually suitable for solar irradiation forecasting based on time series data. However, machine learning can integrate a variety of different types of meteorological data and has the advantage of extracting complex nonlinear features from multiple inputs. However, the existing hybrid network models based on deep learning are mostly directly migrated from other fields for photovoltaic forecasting. The influence of the reasonable combination order of hybrid models on the prediction accuracy is not considered from the spatiotemporal characteristics of photovoltaic data. In addition, a large amount of data in the data is prone to data redundancy and add interference information. It is necessary to perform modal decomposition on photovoltaic and wind power data to extract the main influencing factors. In view of the problem of model overfitting and low efficiency of manual trial and error, it is necessary to optimize the model hyperparameters so that the model can better mine the potential information contained in the time series data. Summary of the invention
[0004] In order to solve the deficiencies in the prior art, the present invention provides a Bayesian optimization convolutional neural network-long short-term memory network power prediction method considering spatiotemporal characteristics. The present invention improves the photovoltaic power prediction accuracy while reducing the overall complexity of the model.
[0005] The present invention adopts the following technical solution.
[0006] A first aspect of the present invention provides a short-term power prediction method based on a Bayesian optimization hybrid neural network, comprising the following steps:
[0007] Collect the photovoltaic output data measured at the photovoltaic array inverter within the set time period to build a photovoltaic output sequence; collect multiple environmental index data of the photovoltaic array space at the same time of photovoltaic output data to build a photovoltaic array space environmental index sequence;
[0008] The first optimization selection of environmental indicator data includes: calculating the correlation between the collected multiple environmental indicators and the photovoltaic output, retaining the environmental indicators exceeding the set threshold according to the set threshold, and obtaining the multi-dimensional spatiotemporal variables of environmental factors;
[0009] A second optimization selection is performed on the multidimensional spatiotemporal variables of environmental factors, including: decomposing and extracting features from the environmental indicator sequence, retaining the environmental indicator feature sequence that exceeds the set threshold according to the set contribution threshold to photovoltaic output, and obtaining the optimal parameter set;
[0010] A hybrid neural network integrating convolutional neural network and long short-term memory network is constructed as a short-term power prediction model, and the Bayesian optimization algorithm is used to optimize the learning rate, number of hidden layers, and number of iterations in the convolutional neural network-long short-term memory network.
[0011] The short-term power prediction model is trained with the optimal parameter set until a preset accuracy is reached, and the trained short-term power prediction model is used to perform short-term power prediction on photovoltaic power generation.
[0012] Preferably, the correlation between the calculated environmental index and the photovoltaic output is expressed as follows:
[0013]
[0014] Where:
[0015] R E,k represents the correlation between the kth environmental indicator and the photovoltaic output;
[0016] P S,j Represents the photovoltaic output sequence P S The photovoltaic output data at the jth time node in , j = 1, 2, ..., T, represents the mean value of T photovoltaic output data samples;
[0017] Ea k,j represents the environmental data of the jth time node of the kth environmental indicator, Represents the mean value of T data samples of the kth environmental indicator.
[0018] Preferably, according to the correlation R between the kth environmental indicator and the photovoltaic output E,k The environmental indicators are optimized in the data interval, which is expressed as follows:
[0019]
[0020] Where:
[0021] R1 represents the first environmental indicator threshold, which is a value greater than 0;
[0022] R2 represents the second environmental indicator threshold, which is a value less than 0;
[0023] After optimization, K2 environmental indicators are retained, K2≤K1, and Eb k Represents the kth environmental indicator sequence, k = 1, 2,…, K2.
[0024] Preferably, decomposing and extracting features includes: for the retained k-th environmental indicator sequence Eb k , which is a time series of T data points. Use a smooth curve to connect T data points, and draw the mean boundary line with the mean of the upper and lower boundary lines, thus obtaining the first characteristic sequence C k,1 , expressed as follows:
[0025] C k,1,j =Eb k,j -Ec k,j (3)
[0026] Where:
[0027] C k,1,j Represents the first characteristic sequence C of the kth environmental indicator k,1 The jth element in , obviously j = 1, 2, ..., T;
[0028] E k,j Represents the kth environmental indicator sequence Eb k The jth data sample in ;
[0029] Ec k,j represents the jth data point on the mean boundary line;
[0030] Take the first characteristic sequence C of the kth environmental indicator k,1 Based on it, continue to extract features and get the second feature sequence C of the kth environmental indicator k,2 It is expressed as the following formula:
[0031] C k,2,j =C k,1,j -Ec1k,j (4)
[0032] Where:
[0033] C k,2,j Represents the second characteristic sequence C of the kth environmental indicator k,2 The jth element in , obviously j = 1, 2, ..., T;
[0034] Ec1 k,j Represents the first characteristic sequence C of the kth environmental indicator k,1 The jth data point on the mean boundary line;
[0035] Repeat the above process N k times, until the kth environmental indicator Nth k Characteristic sequence C k,Nk If the curve is an eigenmode function, or the remaining component is a monotonic function, the decomposition and extraction process is stopped and the j-th environmental indicator sequence Eb k It is expressed as the following formula:
[0036]
[0037] Where:
[0038] C k,q,j represents the jth element in the feature sequence obtained by decomposing and extracting the feature sequence for the qth time;
[0039] CN j Eb represents the decomposition and extraction of feature sequences k,j Represents the kth environmental indicator sequence Eb k The remaining amount of the j-th data sample in .
[0040] Preferably, the number of times N the feature sequence is decomposed and extracted is k Adaptively adjust according to decomposed environmental indicators.
[0041] Preferably, N k The k-th environmental indicator matrix M is constructed by using the characteristic sequence k ;
[0042] Calculate the k-th environmental indicator matrix M k The correlation coefficient matrix MR k , calculate the correlation coefficient matrix MR k The eigenvectors and eigenvalues of k,i represents the i-th eigenvalue, i=1,2,…N k , with λ k,iThe ratio to the sum of all eigenvalues determines the contribution of each feature sequence, which is sorted from large to small. Feature sequences whose cumulative contribution exceeds the set value make substantial contributions to photovoltaic output. These feature sequences are retained and other feature sequences are abandoned.
[0043] Preferably, for the convolutional neural network part, the kth environmental indicator N' k The feature sequence is used as the input of the convolutional neural network part, the output of the convolutional neural network part is used as the input of the long short-term memory network, and the photovoltaic power is used as the output of the long short-term memory network.
[0044] Preferably, multiple indicators are used to judge the prediction effect, and the mean square error, root mean square error and determination coefficient indicators of the test data set are used to finally obtain the future power prediction effect evaluation.
[0045] Preferably, irradiance, relative humidity, ambient temperature and air pressure are retained as retained environmental indicators for forming multidimensional spatiotemporal variables of environmental factors.
[0046] The second aspect of the present invention provides a short-term power prediction system based on a Bayesian optimization hybrid neural network, which runs the short-term power prediction method based on a Bayesian optimization hybrid neural network, including: a data entry module, a data preprocessing module, a hybrid neural network module and a prediction result output module;
[0047] The data entry module is used to enter the photovoltaic output data actually measured at the photovoltaic array inverter within a set time period and multiple environmental index data of the space where the photovoltaic array is located at the same time, and form a photovoltaic output sequence and an environmental index sequence;
[0048] The data preprocessing module is used to perform a first optimization selection on the environmental indicator data to obtain multidimensional spatiotemporal variables of environmental factors, and perform a second optimization selection on the multidimensional spatiotemporal variables of environmental factors to obtain an optimal parameter set;
[0049] The hybrid neural network module uses a Bayesian optimization algorithm to optimize the learning rate, number of hidden layers, and number of iterations in the convolutional neural network-long short-term memory network to form a short-term power prediction model based on the hybrid neural network, and completes the training with the optimal parameter set;
[0050] The prediction result output module outputs the short-term power prediction result of photovoltaic power generation.
[0051] Compared with the prior art, the beneficial effects of the present invention include at least: the purpose of the Bayesian optimization convolutional neural network-long short-term memory network prediction method of the present invention considering the spatiotemporal characteristics is to improve the prediction accuracy of photovoltaic power while reducing the complexity of the model. This invention uses EMD to decompose the environmental factor sequence to determine the changes in meteorological data information at different spatiotemporal scales, thereby reducing the non-stationarity of the environmental factor sequence; secondly, PCA is used to extract the key influencing factors of the feature sequence, eliminate the correlation and redundancy of the original sequence, reduce the dimension of the model input, and achieve the effect of simplifying the complexity of the model. The Bayesian algorithm is then selected to optimize the learning rate, number of hidden layers, and number of iterations in the convolutional neural network-long short-term memory network to obtain the optimal solution of the model, thereby improving the prediction accuracy of photovoltaic power. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] Figure 1 It is a deep learning network structure diagram of the Bayesian optimized convolutional neural network-long short-term memory network power prediction method of the present invention;
[0053] Figure 2 It is a flow chart of the prediction model training of the present invention.
[0054] Figure 3 It is a comparison chart of the prediction results of the training set of the present invention.
[0055] Figure 4 It is a comparison chart of the prediction results of the test set of the present invention.
[0056] Figure 5 It is the prediction error graph of the test set of the present invention.
[0057] Figure 6 It is a test set effect diagram of the present invention. DETAILED DESCRIPTION
[0058] In order to make the purpose, technical scheme and advantages of the present invention clearer, the technical scheme of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. The described embodiments are only embodiments of a part of the present invention, not all embodiments. Based on the spirit of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work belong to the protection scope of the present invention.
[0059] like Figure 1 , 2 As shown, embodiment 1 of the present invention provides a short-term power prediction method based on a hybrid neural network model of a Bayesian optimized convolutional neural network-long short-term memory network under spatiotemporal characteristics, and the prediction object is selected as photovoltaic output, that is, photovoltaic power generation power, including the following steps:
[0060] Step 1: Collect the photovoltaic output data measured at the inverter of the photovoltaic array area within the set time period, build a photovoltaic output sequence, collect multiple environmental indicator data of the space where the photovoltaic array area is located at the same time of photovoltaic output data, and build a photovoltaic array area space environmental indicator sequence.
[0061] Preferably, but not restrictively, the photovoltaic output data measured at the photovoltaic array inverter within a set time period is collected to construct a photovoltaic output sequence P S , where P S,j Represents the photovoltaic output sequence P S The photovoltaic output data at the jth time node in , j = 1, 2, ..., T, T represents the number of photovoltaic output data samples. For example but not limited to, the photovoltaic output data measured at the photovoltaic array inverter every 15 minutes in one year is collected.
[0062] Collect multiple environmental data of the space where the photovoltaic array is located at the same time of photovoltaic output data, and construct a sequence of each environmental indicator in the space where the photovoltaic array is located, among which Ea k Represents the kth environmental indicator sequence, with Ea k,j Represents the environmental data of the jth time node of the kth environmental indicator, k=1,2,…,K1, K1 represents the total number of environmental indicators before optimization selection. In an exemplary but non-limiting implementation, the selected environmental indicators may include: irradiance, relative humidity, ambient temperature, photovoltaic panel temperature, wind speed, air pressure, precipitation and cloud cover, that is, K1=8.
[0063] It is worth noting that with the influence of factors such as the advancement of photovoltaic panel technology, the space where the photovoltaic array is located, the components used by different manufacturers, and different batches of products may be affected by environmental factors in different ways. Therefore, it is necessary to first collect possible relevant factors and optimize them in subsequent steps.
[0064] Step 2: Perform the first optimization selection on the environmental indicator data, including: calculating the correlation between the multiple environmental indicators collected in step 1 and the photovoltaic output, retaining the environmental indicators exceeding the set threshold according to the set threshold, and obtaining the multi-dimensional spatiotemporal variables of the environmental factors.
[0065] Preferably but not restrictively, the correlation between the environmental index and the photovoltaic output is calculated as follows:
[0066]
[0067] Where:
[0068] R E,k represents the correlation between the kth environmental indicator and the photovoltaic output;
[0069] represents the mean value of T photovoltaic output data samples;
[0070] Represents the mean value of T data samples of the kth environmental indicator.
[0071] According to the correlation R between the kth environmental indicator and photovoltaic output E,k The environmental indicators are optimized in the data interval, which is expressed as follows:
[0072]
[0073] Where:
[0074] R1 represents the first environmental index threshold value, which is a value greater than 0, preferably but not limited to, R1 = 0.6;
[0075] R2 represents the second environmental index threshold value, which is a value less than 0, preferably but not limited to, R2 = -0.1.
[0076] After optimization, K2 environmental indicators are retained, K2≤K1, and Eb k Represents the kth environmental indicator sequence, k = 1, 2,…, K2.
[0077] In the above exemplary but non-limiting implementation, taking the measured data of a certain place for one year as an example, the correlation is calculated as shown in the following table:
[0078] Table 1 Example of calculation of correlation between environmental indicators and photovoltaic output
[0079]
[0080]
[0081] Based on the above calculation results, the radiant illumination, relative humidity, ambient temperature and air pressure are optimally selected as the retained environmental indicators, that is, K2=4, and the next step of calculation is carried out with the radiant illumination sequence Eb1, the relative humidity sequence Eb2, the ambient temperature sequence Eb3 and the air pressure sequence Eb4.
[0082] It is worth noting that the essence of the first optimization selection of environmental indicators is to obtain the positive and negative correlation indicators that affect the photovoltaic output while taking into account the temporal and spatial characteristics, and to remove redundant information for the first time.
[0083] Step 3: Perform a second optimization selection on the multidimensional spatiotemporal variables of environmental factors obtained by the optimization selection in step 2, including: decomposing and extracting features from the environmental indicator sequence, retaining the environmental indicator feature sequence that exceeds the set threshold according to the set contribution threshold to photovoltaic output, and obtaining the optimal parameter set.
[0084] Preferably but not restrictively, the K2 environmental indicators are first decomposed and features are extracted, and then optimized and selected.
[0085] Decomposition and extraction of features include: for the retained k-th environmental indicator sequence Eb k , which is a time series of T data points. Use a smooth curve to connect T data points, and draw the mean boundary line with the mean of the upper and lower boundary lines, thus obtaining the first characteristic sequence C k,1 , expressed as follows:
[0086] C k,1,j =Eb k,j -Ec k,j (3)
[0087] Where:
[0088] C k,1,j Represents the first characteristic sequence C of the kth environmental indicator k,1 The jth element in , obviously j = 1, 2, ..., T;
[0089] E k,j Represents the kth environmental indicator sequence Eb k The jth data sample in ;
[0090] Ec k,j represents the jth data point on the mean boundary line;
[0091] Take the first characteristic sequence C of the kth environmental indicator k,1 Based on it, continue to extract features and get the second feature sequence C of the kth environmental indicator k,2 It is expressed as the following formula:
[0092] C k,2,j =C k,1,j -Ec1 k,j (4)
[0093] Where:
[0094] C k,2,j Represents the second characteristic sequence C of the kth environmental indicator k,2 The jth element in , obviously j = 1, 2, ..., T;
[0095] Ec1 k,j Represents the first characteristic sequence C of the kth environmental indicator k,1 The jth data point on the mean boundary line;
[0096] Repeat the above process N k times, until the kth environmental indicator Nth k Characteristic sequence C k,Nk If the curve is an eigenmode function, or the remaining component is a monotonic function, the decomposition and extraction process is stopped and the kth environmental indicator sequence Eb k It is expressed as the following formula:
[0097]
[0098] Where:
[0099] C k,q,j represents the jth element in the feature sequence obtained by decomposing and extracting the feature sequence for the qth time;
[0100] CN j Eb represents the decomposition and extraction of feature sequences k,j Represents the kth environmental indicator sequence Eb k The remaining amount of the j-th data sample in .
[0101] It is worth noting that the number of times N the feature sequence is decomposed and extracted is k It is not a preset value, and it can be adaptively adjusted according to the decomposed environmental indicators. That is to say, in the above exemplary but non-limiting implementation, the four environmental indicators selected for the first optimization can adopt different non-preset decomposition and extraction times, which has obvious advantages over the prior art in terms of automation. However, the inventors of the present invention realize that after the above decomposition and extraction, there may still be redundant information, especially some redundant information contained in the increase of data dimension caused by the decomposition and extraction operation. After removing it, the time and resource consumption of subsequent model training can be significantly reduced.
[0102] Specifically, after the above decomposition feature extraction, from the kth environmental indicator sequence Eb k Extract N k feature sequence, N k The k-th environmental indicator matrix M is constructed by using the characteristic sequence k It is worth noting that the k-th environmental indicator matrix M k M k Table 1 characterizes the influence of the k-th environmental indicator on the photovoltaic output at the characteristic time scale. In order to reduce the complexity of subsequent calculations, in the k-th environmental indicator matrix M k Optimize and select the feature sequences that contribute to photovoltaic output, and abandon the feature sequences that do not contribute.
[0103] It is worth noting that N k Decompose and extract the kth environmental indicator sequence Eb k The characteristic sequence represents different characteristic fluctuation sequences, making the original k-th environmental indicator sequence Eb k The fluctuation characteristics of are prominent at different time scales, but the process of decomposing and extracting features increases the data dimension. However, in fact, the contribution of feature sequences, that is, environmental indicators to photovoltaic output at different time scales is different. In order to improve calculation efficiency and accuracy, feature sequences with low contribution can be abandoned.
[0104] Preferably, but not limitedly, the k-th environmental indicator matrix M is calculated k The correlation coefficient matrix MR k , calculate the correlation coefficient matrix MR k The eigenvectors and eigenvalues of k,i represents the i-th eigenvalue, i=1,2,…N k , with λ k,i The ratio to the sum of all eigenvalues determines the contribution of each feature sequence, which is sorted from large to small. If the cumulative contribution exceeds the set value, for example but not limited to, 80% of the feature sequences make a substantial contribution to the photovoltaic output, these feature sequences are retained and other feature sequences are abandoned.
[0105] Environmental indicator No. K k In the feature sequence, there are finally N' k Feature sequences are retained, N' k ≤N k That is to say, after the above data processing, the characteristic data that have substantial contribution to photovoltaic output have been optimized and selected twice, and the useless and interfering parts of the data have been eliminated, laying the foundation for subsequent efficient and accurate calculations.
[0106] More specifically, as one of the outstanding essential features of the present invention, the method of decomposition extraction coupled with data dimensionality reduction is used to process the data to obtain the optimal parameter set of the data, so as to better mine the data features, optimize the model structure, and improve the accuracy and practicality of the prediction model when processing non-stationary time series data. Decomposition extraction coupled with data dimensionality reduction is more complementary. Decomposition extraction reveals the local fluctuation characteristics of the data through decomposition, while data dimensionality reduction focuses on the global structure. The combination of the two can remove redundant information, optimize the model input, and improve the computational efficiency and accuracy of the prediction model while maintaining the local characteristics of the data. It not only enhances the prediction performance of the model, but also improves the versatility and robustness of the model.
[0107] Step 4: Construct a hybrid neural network that integrates convolutional neural network and long short-term memory network as a short-term power prediction model.
[0108] It is worth noting that convolutional neural networks can achieve weight sharing and local connection. Weight sharing means that the entire set of input data uses the same convolution kernel parameters. All data use the parameters of a filter when passing through it, which can reduce the number of weights, reduce the complexity of the network, and reduce the computational cost of the network. In addition, the characteristic of long short-term memory network is to replace the ordinary hidden nodes in the recursive neural network with memory modules, thereby solving the gradient disappearance or gradient explosion phenomenon that may occur after multiple iterations of the model, and is more suitable for learning from experience to classify and predict time series with long-term time dependence. Combining the two can reduce the complexity of the network while having higher prediction accuracy.
[0109] Specifically, the convolutional neural network part in the hybrid neural network includes: convolution layer Conv1D, pooling layer MaxPooling and flatten layer Flatten. The convolution layer Conv1D uses a one-dimensional convolution kernel to perform a convolution operation on the input sequence to extract the local features of the sequence. The pooling layer Max Pooling downsamples the feature map to reduce the amount of data while retaining the main features. The flattening layer Flatten flattens the output of the previous layer into a one-dimensional vector for connection with the fully connected layer.
[0110] The long short-term memory network part in the hybrid neural network includes: forget gate, input gate and output gate. The network is trained using training data, and the long short-term memory network hyperparameters are adjusted using validation set data.
[0111] Preferably but not restrictively, the parameter acquisition method in the network includes:
[0112] For the convolutional neural network part, the kth environmental indicator N' k The feature sequence is used as the input of the convolutional neural network. The filter performs a sliding convolution operation on the feature sequence through a window of width h to obtain a new feature c t , expressed as follows:
[0113] c t =f(WX t:t+h-1 +b) (6)
[0114] Formula (6) means that the weight matrix W in the convolutional layer is firstly combined with the time series X of t:t+h-1 t Perform a convolution operation, then add it to the bias term of the convolution kernel, and finally obtain the feature map c through the activation function t , where the time series X t That is, after the second optimization in step 3, the retained feature sequence is selected.
[0115] After continuing to convolve the T-order time series, the generated T+h-1 new features form a feature map c
[0116] c=[c1,c2,...,c T-h+1 ] (7)
[0117] Finally, the feature map is input to the max pooling layer, which reduces parameters and computational complexity while retaining the most important features while retaining the maximum value output, thus preventing overfitting.
[0118] In the long short-term memory network part, the memory decay function F f For:
[0119] Fx=σ(W f [h t-1 ,x t ]+b f ) (8)
[0120] h t-1 The network output is the same as x t The network input at each moment is combined, multiplied by the weight and added with the bias through linear transformation, and finally the result is mapped to 0 to 1 through the sigmoid activation function as the memory decay coefficient.
[0121] For the memory at time t:
[0122]
[0123] Apply a linear transformation to the current memory decay function, and map the result to between 0 and 1 as the current decay function through the sigmoid activation function. The memory learned in the current state is multiplied by the attenuation function at the current moment, and the product of the memory learned at the previous moment and the attenuation function at the previous moment is added to obtain the learning state at moment t.
[0124]
[0125] Step 5: Apply the Bayesian optimization algorithm to optimize the learning rate, number of hidden layers, and number of iterations in the convolutional neural network-long short-term memory network, and finally realize intelligent and automatic selection of the optimal network parameters to improve the prediction accuracy and efficiency of the convolutional neural network-long short-term memory network.
[0126] Preferably but not restrictively, the Bayesian optimization optimizes three parameters: the number of hidden nodes, the initial learning rate and the L2 regularization strength.
[0127] For the Bayesian optimization part, the principle of Bayesian optimization is to use Bayes' theorem to estimate the posterior distribution of the objective function, and then select the next hyperparameter combination to be sampled based on the distribution. Make full use of the sampling results of the previous sampling points to improve the shape of the objective function, so as to find the global optimal hyperparameters.
[0128] Let X = x1, x2, …, x n is a set of hyperparameter combinations, f(x) is the objective function about the hyperparameter x, and the principle of Bayesian optimization is to find x∈X so that the following formula is satisfied:
[0129]
[0130] Where:
[0131] A represents the unknown optimal function parameter solution of the target;
[0132] B represents the observed meteorological parameters and the set of observation values;
[0133] o(A|B) represents the posterior probability of A, p(A) represents the prior probability of A, p(B|A) represents the likelihood distribution of y, and p(B) represents the marginal likelihood distribution of B.
[0134] The input of the Bayesian optimization part is expressed as:
[0135] input:f,x,S,M
[0136] Where:
[0137] f represents the unknown objective function, which is unknown to the optimization algorithm at the beginning, and its behavior can only be gradually understood through a series of experiments or observations;
[0138] x represents the hyperparameter input to the model parameter combination;
[0139] S represents the acquisition function, which is used to select the strategy for the next evaluation point (i.e., input parameter combination);
[0140] M represents a model based on the input data assumptions, mainly a Gaussian model.
[0141] The Bayesian optimization initialization obtains the data set as expressed in the following formula:
[0142] InitSamples(f,x)→D (12)
[0143] Where:
[0144] D represents the data set (x, y), x is the hyperparameter, and y is the result corresponding to the hyperparameter.
[0145] The Gaussian model is expressed as follows:
[0146] f(x)~GP(μ(x), k (x,x')) (13)
[0147] Where:
[0148] μ(x)=E(f(x)), E(f(x)) is the mathematical expectation of f(x), and the mean function is usually set to 0;
[0149] GP(·) represents Gaussian function;
[0150] f(x) represents the mean absolute error;
[0151] k(x,x') represents the covariance function of x.
[0152] Assume that the historical information D explored has been obtained from the model l:t ={x l:t ,f l:t}, where f t =f(x t ), the next value to be searched is x t+1 , the covariance matrix K is recorded as:
[0153]
[0154] The joint Gaussian distribution is expressed as:
[0155]
[0156] Where:
[0157] k can be expressed as: k = [k (x t+1 ,x1)·k(x t+1 ,x2)…k(x t+1 ,x t )]
[0158] By finding the marginal density function, we can get f t+1 The posterior probability of is expressed as follows:
[0159]
[0160] Where:
[0161]
[0162] Regarding the acquisition function, it is expressed as follows:
[0163]
[0164] Where:
[0165] u(x) is the reward function;
[0166] Let Y(x)=E[u(x)|x,D], then we have
[0167]
[0168] We only need to find the maximum value of Y(x) to find the x that meets the requirements.
[0169] This process optimizes three hyperparameters: the number of hidden nodes, the initial learning rate, and the L2 regularization strength.
[0170] It is worth noting that if only a single long short-term memory network is used, it is too monotonous and there is a risk of overfitting, resulting in the long short-term memory network model facing limited training data. Due to its complexity and high capacity, even if the model performs well on the training data, the generalization ability on unseen data is poor. The method of hybrid neural network using Bayesian optimization convolutional neural network and long short-term memory network in the present invention focuses more on automated hyperparameter adjustment and model optimization, effectively solving the model overfitting phenomenon and improving prediction accuracy, which can provide strong support for the safe and stable operation of the power system.
[0171] Step 6: Train the short-term power prediction model with the optimal parameter set until a preset accuracy is achieved, and use the trained short-term power prediction model to perform short-term power prediction on photovoltaic power generation.
[0172] Preferably but not restrictively, multiple indicators are used to judge the prediction effect, and the mean square error, root mean square error and determination coefficient indicators of the test data set are used to finally obtain the future power prediction effect evaluation.
[0173] The mean square error is expressed as follows:
[0174]
[0175] Where:
[0176] y i Indicates the true value of photovoltaic output power;
[0177] represents the predicted value of photovoltaic output power;
[0178] m represents the number of test sample sets.
[0179] The root mean square error is expressed as follows:
[0180]
[0181] Where:
[0182] y iIndicates the true value of photovoltaic output power;
[0183] represents the predicted value of photovoltaic output power;
[0184] m represents the number of test sample sets.
[0185] The coefficient of determination index is expressed as follows:
[0186]
[0187] Where:
[0188] y i —The actual value of photovoltaic output power;
[0189] —Predicted value of photovoltaic output power;
[0190] —Average photovoltaic output power.
[0191] Embodiment 2 of the present invention provides a short-term power prediction system based on a Bayesian optimization hybrid neural network, and runs the short-term power prediction method based on a Bayesian optimization hybrid neural network, including: a data entry module, a data preprocessing module, a hybrid neural network module and a prediction result output module;
[0192] The data entry module is used to enter the photovoltaic output data actually measured at the photovoltaic array inverter within a set time period and multiple environmental index data of the space where the photovoltaic array is located at the same time, and form a photovoltaic output sequence and an environmental index sequence;
[0193] The data preprocessing module is used to perform a first optimization selection on the environmental indicator data to obtain multidimensional spatiotemporal variables of environmental factors, and perform a second optimization selection on the multidimensional spatiotemporal variables of environmental factors to obtain an optimal parameter set;
[0194] The hybrid neural network module uses a Bayesian optimization algorithm to optimize the learning rate, number of hidden layers, and number of iterations in the convolutional neural network-long short-term memory network to form a short-term power prediction model based on the hybrid neural network, and completes the training with the optimal parameter set;
[0195] The prediction result output module outputs the short-term power prediction result of photovoltaic power generation.
[0196] In order to more clearly introduce the significant progress brought by the present invention to the prior art, the method disclosed in the present invention is run with an actual case. The case selects four factors of humidity, temperature, atmospheric pressure and solar radiation in photovoltaic data of a certain area for one year as input for analysis. The analysis results are as follows Figure 3 , Figure 4 , Figure 5 as well as Figure 6 shown.
[0197] In summary, the purpose of the Bayesian optimization convolutional neural network-long short-term memory network prediction method of the present invention considering the spatiotemporal characteristics is to improve the prediction accuracy of photovoltaic power while reducing the complexity of the model. This invention uses the method of decomposing and extracting features of different scales to decompose the environmental factor sequence and the changes in meteorological data information at different spatiotemporal scales, thereby reducing the non-stationarity of the environmental factor sequence; secondly, the key influencing factors of the feature sequence are extracted by reducing the dimensionality according to the contribution degree, eliminating the correlation and redundancy of the original sequence, reducing the dimension of the model input, and achieving the effect of simplifying the complexity of the model. Then, the Bayesian algorithm is selected to optimize the learning rate, the number of hidden layers, and the number of iterations in the convolutional neural network-long short-term memory network to obtain the optimal solution of the model, thereby improving the prediction accuracy of photovoltaic power and providing guarantee for the safe and stable operation of the power system.
[0198] The present disclosure may be a system, a method and / or a computer program product. The computer program product may include a computer-readable storage medium carrying computer-readable program instructions for causing a processor to implement various aspects of the present disclosure.
[0199] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the above embodiments, ordinary technicians in the relevant field should understand that the specific implementation methods of the present invention can still be modified or replaced by equivalents, and any modifications or equivalent replacements that do not depart from the spirit and scope of the present invention should be covered within the scope of protection of the claims of the present invention.
Claims
1. A short-term power prediction method based on Bayesian optimization hybrid neural network, characterized in that: The following steps are involved: Collect the photovoltaic output data measured at the photovoltaic array inverter within the set time period to build a photovoltaic output sequence; collect multiple environmental index data of the photovoltaic array space at the same time of photovoltaic output data to build a photovoltaic array space environmental index sequence; The first optimization selection of environmental indicator data includes: calculating the correlation between the collected multiple environmental indicators and the photovoltaic output, retaining the environmental indicators exceeding the set threshold according to the set threshold, and obtaining the multi-dimensional spatiotemporal variables of environmental factors; A second optimization selection is performed on the multidimensional spatiotemporal variables of environmental factors, including: decomposing and extracting features from the environmental indicator sequence, retaining the environmental indicator feature sequence that exceeds the set threshold according to the set contribution threshold to photovoltaic output, and obtaining the optimal parameter set; A hybrid neural network integrating convolutional neural network and long short-term memory network is constructed as a short-term power prediction model, and the Bayesian optimization algorithm is used to optimize the learning rate, number of hidden layers, and number of iterations in the convolutional neural network-long short-term memory network. The short-term power prediction model is trained with the optimal parameter set until a preset accuracy is reached, and the trained short-term power prediction model is used to perform short-term power prediction on photovoltaic power generation.
2. The short-term power prediction method based on Bayesian optimization hybrid neural network according to claim 1 is characterized in that: The correlation between the environmental index and the photovoltaic output is calculated as follows: Where: R E,k represents the correlation between the kth environmental indicator and the photovoltaic output; P S,j Represents the photovoltaic output sequence P S The photovoltaic output data at the jth time node in , j = 1, 2, ..., T, represents the mean value of T photovoltaic output data samples; Ea k,j represents the environmental data of the jth time node of the kth environmental indicator, Represents the mean value of T data samples of the kth environmental indicator.
3. The short-term power prediction method based on Bayesian optimization hybrid neural network according to claim 2 is characterized in that: According to the correlation R between the kth environmental indicator and photovoltaic output E,k The environmental indicators are optimized in the data interval, which is expressed as follows: Where: R1 represents the first environmental indicator threshold, which is a value greater than 0; R2 represents the second environmental indicator threshold, which is a value less than 0; After optimization, K2 environmental indicators are retained, K2≤K1, and Eb k Represents the kth environmental indicator sequence, k = 1, 2,…, K2.
4. The short-term power prediction method based on Bayesian optimization hybrid neural network according to claim 1 or 3, characterized in that: Decomposition and extraction of features include: for the retained k-th environmental indicator sequence Eb k , which is a time series of T data points. Use a smooth curve to connect T data points, and draw the mean boundary line with the mean of the upper and lower boundary lines, thus obtaining the first characteristic sequence C k,1 , expressed as follows: C k,1,j =Eb k,j -Ec k,j (3) Where: C k,1,j Represents the first characteristic sequence C of the kth environmental indicator k,1 The jth element in , obviously j = 1, 2, ..., T; E k,j Represents the kth environmental indicator sequence Eb k The jth data sample in ; Ec k,j represents the jth data point on the mean boundary line; Take the first characteristic sequence C of the kth environmental indicator k,1 Based on it, continue to extract features and get the second feature sequence C of the kth environmental indicator k,2 It is expressed as the following formula: C k,2,j =C k,1,j -Ec1 k,j (4) Where: C k,2,j Represents the second characteristic sequence C of the kth environmental indicator k,2 The jth element in , obviously j = 1, 2, ..., T; Ec1 k,j Represents the first characteristic sequence C of the kth environmental indicator k,1 The jth data point on the mean boundary line; Repeat the above process N k times, until the kth environmental indicator Nth k Characteristic sequence C k,Nk If the curve is an eigenmode function, or the remaining component is a monotonic function, the decomposition and extraction process is stopped and the kth environmental indicator sequence Eb k It is expressed as the following formula: Where: C k,q,j represents the jth element in the feature sequence obtained by decomposing and extracting the feature sequence for the qth time; CNK j Eb represents the decomposition and extraction of feature sequences k,j Represents the kth environmental indicator sequence Eb k The remaining amount of the j-th data sample in .
5. The short-term power prediction method based on Bayesian optimization hybrid neural network according to claim 4 is characterized in that: The number of times N the feature sequence is decomposed and extracted k Adaptively adjust according to decomposed environmental indicators.
6. The short-term power prediction method based on Bayesian optimization hybrid neural network according to claim 4 is characterized in that: N k The k-th environmental indicator matrix M is constructed by using the characteristic sequence k ; Calculate the k-th environmental indicator matrix M k The correlation coefficient matrix MR k , calculate the correlation coefficient matrix MR k The eigenvectors and eigenvalues of k,i represents the i-th eigenvalue, i=1,2,…N k , with λ k,i The ratio to the sum of all eigenvalues determines the contribution of each feature sequence, which is sorted from large to small. Feature sequences whose cumulative contribution exceeds the set value make substantial contributions to photovoltaic output. These feature sequences are retained and other feature sequences are abandoned.
7. The short-term power prediction method based on Bayesian optimization hybrid neural network according to claim 5 or 6, characterized in that: For the convolutional neural network part, the kth environmental indicator N' k The feature sequence is used as the input of the convolutional neural network part, the output of the convolutional neural network part is used as the input of the long short-term memory network, and the photovoltaic power is used as the output of the long short-term memory network.
8. The short-term power prediction method based on Bayesian optimization hybrid neural network according to claim 1 is characterized in that: The operation of judging the prediction effect by multiple indicators is carried out. By testing the mean square error, root mean square error and determination coefficient indicators of the data set, the evaluation of the future power prediction effect is finally obtained.
9. The short-term power prediction method based on Bayesian optimization hybrid neural network according to claim 1 is characterized in that: The irradiance, relative humidity, ambient temperature and air pressure are retained as the retained environmental indicators to form the multidimensional spatiotemporal variables of environmental factors.
10. A short-term power prediction system based on a Bayesian optimization hybrid neural network, running the short-term power prediction method based on a Bayesian optimization hybrid neural network according to any one of claims 1 to 9, characterized in that: include: Data entry module, data preprocessing module, hybrid neural network module and prediction result output module; The data entry module is used to enter the photovoltaic output data actually measured at the photovoltaic array inverter within a set time period and multiple environmental index data of the space where the photovoltaic array is located at the same time, and form a photovoltaic output sequence and an environmental index sequence; The data preprocessing module is used to perform a first optimization selection on the environmental indicator data to obtain multidimensional spatiotemporal variables of environmental factors, and perform a second optimization selection on the multidimensional spatiotemporal variables of environmental factors to obtain an optimal parameter set; The hybrid neural network module uses a Bayesian optimization algorithm to optimize the learning rate, number of hidden layers, and number of iterations in the convolutional neural network-long short-term memory network to form a short-term power prediction model based on the hybrid neural network, and completes the training with the optimal parameter set; The prediction result output module outputs the short-term power prediction result of photovoltaic power generation.
Citation Information
Patent Citations
Short-term photovoltaic output prediction method based on multi-model fusion
CN114781723A
Short-term wind power prediction method based on improved entropy weight method and SECEEMD
CN116865255A
Photovoltaic power prediction method and system based on Bayesian parameter optimization
CN118630744A