Distributed photovoltaic power forecasting method based on adaptive ant colony tuning long short-term memory network
By using an adaptive ant colony-tuned LSTM network in photovoltaic power prediction, the model parameters are optimized to adapt to the changes in the photovoltaic system, and the existing photovoltaic power prediction methods are solved in terms of accuracy and stability, achieving more efficient and stable prediction effects.
Patent Information
- Application Number
- CN202311177463.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-09-13
- Publication Date
- 2025-04-01
- Estimated Expiration
- 2043-09-13
AI Technical Summary
The existing photovoltaic power prediction methods are insufficient in terms of accuracy and stability, and cannot effectively adapt to the real-time changes of the photovoltaic system, resulting in a lack of stability in the prediction results.
Distributed photovoltaic power prediction is adopted based on adaptive ant colony adjustment, and the parameters of the LSTM network are optimized through the adaptive ant colony algorithm to enhance the adaptability and generalization capabilities of the model.
It significantly improves the accuracy and stability of the photovoltaic power prediction model, enhances the prediction ability under different environmental conditions, and improves the effectiveness and universality of the prediction method.
Smart Images

Figure CN117390951B_ABST
Abstract
Description
[Technical field]
[0001] The present invention relates to the field of photovoltaic power prediction, and in particular to a distributed photovoltaic power prediction method based on an adaptive ant colony setting long short-term memory network. [Background technology]
[0002] With the proposal of the goal of "carbon peak and carbon neutrality", vigorously developing new energy has become one of the important development directions of the power system. Photovoltaic power generation, as an environmentally friendly and sustainable form of energy, is receiving increasing attention and promotion. However, the special nature of photovoltaic power generation systems brings a series of challenges, one of the most important of which is the problem of photovoltaic power prediction. Since photovoltaic power generation is affected by many factors such as sunshine intensity, weather changes, seasonal differences, and geographical location, its power output is highly nonlinear and time-varying. Therefore, accurate prediction of photovoltaic power has become the key to realizing smart grids, optimizing energy scheduling, and market transactions.
[0003] At present, traditional power prediction methods are mainly based on statistics or mathematical models. For example, Chinese patents CN110598896A and CN112085260A have proposed photovoltaic power prediction methods, which can select similar days to the predicted day based on the basic principle of similar days to predict the photovoltaic power generation power at each base point of the predicted day. However, due to the complexity and nonlinearity of the photovoltaic power generation system, the accuracy and stability of these methods are poor and cannot meet the needs of practical applications.
[0004] In order to improve the prediction accuracy, deep learning technology has been gradually introduced into photovoltaic power prediction. Among them, the long short-term memory network (LSTM), as an excellent variant of the recurrent neural network (RNN), can effectively capture the long-term dependencies of time series data, providing a new idea for photovoltaic power prediction. Chinese patent CN116029442A proposes a photovoltaic power prediction method, system, device and storage medium based on the LSTM combined prediction framework. The pre-processed meteorological data is input into the optimized LSTMs prediction model to obtain the photovoltaic power prediction value under the model. The integrated LSTMs model is optimized by the optimization algorithm through the combination of ARIMA and SVR, which further improves the accuracy of the prediction. However, the traditional LSTM network needs to determine its parameters through offline training, which makes it difficult for the network parameters to adapt to the real-time changes of the photovoltaic system and the prediction results lack stability.
[0005] Therefore, it is necessary to fully consider the complexity and nonlinear characteristics of the distributed photovoltaic power prediction process, design a reasonable distributed photovoltaic power prediction method, use artificial intelligence algorithms to optimize the distributed photovoltaic power prediction model, improve the generalization ability of the prediction model, enhance the prediction accuracy and stability of the prediction model under different environmental conditions, improve the effectiveness and universality of the prediction method, improve the performance and efficiency of the photovoltaic power prediction model, and provide strong support for the intelligent management and optimized operation of photovoltaic power generation systems. [Summary of the invention]
[0006] The purpose of the present invention is to solve the problems in the prior art and provide a distributed photovoltaic power prediction method based on an adaptive ant colony tuning long short-term memory network, which can enhance the prediction accuracy and stability of the prediction model under different environmental conditions, improve the effectiveness and universality of the prediction method, thereby improving the performance and efficiency of the photovoltaic power prediction model, and providing strong support for the intelligent management and optimized operation of photovoltaic power generation systems.
[0007] To achieve the above object, the present invention proposes a distributed photovoltaic power prediction method based on an adaptive ant colony tuning long short-term memory network, comprising the following steps:
[0008] Step 1: Establish a multi-dimensional feature data vector set for predicting distributed photovoltaic power;
[0009] Step 2: For the multi-dimensional feature data vector set for predicting distributed photovoltaic power established in step 1, a long short-term memory network for predicting distributed photovoltaic power is established;
[0010] Step 3: For the long short-term memory network established in step 2, an adaptive ant colony algorithm model for optimizing the parameters of the long short-term memory network is established.
[0011] Preferably, the feature data in the multi-dimensional feature data vector set used to predict distributed photovoltaic power in step 1 includes irradiance data, temperature data, humidity data, air pressure data, distributed photovoltaic power generation data and load power consumption data.
[0012] Preferably, the distributed photovoltaic power generation data is used as the output vector, and the irradiance data, temperature data, humidity data, air pressure data and load power consumption data are used as the input vector; based on the LightGBM feature selection algorithm, the characteristic values of the input vectors such as irradiance data, temperature data, humidity data, air pressure data, distributed photovoltaic power generation data and load power consumption data are converted into a histogram, and then the contribution of each dimension of the multi-dimensional feature data vector set is sorted, and the features with a contribution less than 5% are eliminated to form an optimized distributed photovoltaic power prediction multi-dimensional feature data vector set.
[0013] Preferably, in step 2, the long short-term memory network includes a plurality of input variables and a plurality of LSTM units, and the input variables are sequentially trained through the LSTM units in the hidden layer of the long short-term memory network.
[0014] Preferably, an update gate function that can retain key timing association information of input variables is introduced into the LSTM unit, and the LSTM network can selectively update the state of each moment through the update gate function; a reset gate function that can remove unnecessary timing association information of input variables is introduced into the LSTM unit, and the LSTM network can selectively discard unnecessary information through the reset gate function.
[0015] Preferably, the step 2 comprises:
[0016] S201: using the optimized distributed photovoltaic power prediction multi-dimensional feature data vector set obtained in step 1 as an input variable x of a distributed photovoltaic power prediction model;
[0017] S202: Based on the input variable x described in step S201, a distributed photovoltaic power LSTM prediction model is constructed; the distributed photovoltaic power LSTM prediction model includes an input layer, a hidden layer and an output layer; the input layer receives the optimized distributed photovoltaic power prediction multi-dimensional feature data as input, the hidden layer includes a number of LSTM units for learning the long-term dependencies of time series, and the output layer is used to predict the distributed photovoltaic power; each LSTM unit includes an update gate, a forget gate and an output gate at time t; the update gate is used to memorize the distributed photovoltaic power prediction multi-dimensional feature information at the current time t, and the forget gate is used to select non-essential feature information in the distributed photovoltaic power prediction multi-dimensional features; the output gate is used to output the result of the current hidden layer to the next LSTM unit.
[0018] Preferably, the update gate and forget gate in S202 operate based on the input variables at the same time; the update gate determines the importance of each input feature through a Sigmoid activation function to control the input of appropriate information into the memory unit; the update gate selectively transmits relevant information to the memory unit according to the input data at the current moment and the hidden state at the previous moment to update the current state; the forget gate also determines whether the information in each memory unit needs to be retained through a Sigmoid activation function; the forget gate determines the information that should be forgotten through continuous iteration based on the past state and the current input;
[0019] Update the output L of the gate t It can be expressed as:
[0020] L t =f t L t-1 +j t Ct
[0021] j t =g(W j x t +V j h t-1 +b j )
[0022] C t =tanh(W i x t +V i h t-1 +b i )
[0023] Where, L t is the output of the update gate, f t is the output of the forget gate; x t is the input vector at time t; h t-1 is the output of the hidden layer at time t-1, that is, the output result of the output gate; g is the Sigmoid activation function; j t is the output of the Sigmoid activation function; W j 、V j From x t With h t-1 Mapped to the update gate activation function output j t The weight matrix of b, the elements in the matrix are random real numbers with initial values. j is the bias vector output by the update gate activation function, and the vector elements are real numbers with random initial values; C t is the output of the tanh function; W i 、V i From x t With h t-1 Mapped to the update gate tanh function output C t The weight matrix of b, the elements in the matrix are random real numbers with initial values. i To update the bias vector output by the gate tanh function, the vector elements are real numbers with random initial values;
[0024] The output f of the forget gate t Determined by the following formula:
[0025] f t =g(W f x t +V f h t-1 +b f )
[0026] Where W f 、V f From xt With h t-1 Mapped to the forget gate activation function output f t The weight matrix of b, the elements in the matrix are random real numbers with initial values. f is the bias vector output by the forget gate activation function, and the vector elements are real numbers with random initial values;
[0027] The output o of the output gate t Determined by the following formula:
[0028] o t =g(W o x t +V o h t-1 +b o )
[0029] Where W o 、V o From x t With h t-1 Mapped to the forget gate activation function output o t The weight matrix of b, the elements in the matrix are random real numbers with initial values. o From x t With h t-1 Mapped to the output bias vector of the forget gate activation function, the vector elements are real numbers with random initial values;
[0030] The output gate obtains the output of the current hidden layer based on the output of the update gate and the output of the forget gate. The output of the hidden layer at time t is h t It can be expressed as:
[0031] h t =o t ·tanhL t
[0032] After iterations of multiple layers of LSTM units, the output of a distributed photovoltaic power prediction model based on a long short-term memory network is finally formed.
[0033] Preferably, the step 3 comprises:
[0034] S301: Initialize the parameters of the adaptive ant colony algorithm;
[0035] S302: Calculating the pheromone content function of the food location of the adaptive ant colony algorithm;
[0036] S303: Using the adaptive ant colony algorithm neighborhood search equation with an adaptive coefficient to perform neighborhood search to find a new food location;
[0037] S304: designing a probability selection formula to determine whether the ant searches for food at a location with a higher pheromone content function value;
[0038] S305: Determine whether the number of searches has reached the maximum number of iterations; if so, output the optimal solution of the current round of the adaptive ant colony algorithm; if not, perform the next round of food location search and return to S302.
[0039] Preferably, the step 3 comprises:
[0040] S301: Initialize the parameters of the adaptive ant colony algorithm; the adaptive ant colony algorithm includes the number of ants n in the adaptive ant colony algorithm, the maximum number of food searches is I max and food location x m ; where food position x m The multi-dimensional information stored in the long short-term memory network model includes W j , V j , b j , W f , V f , b f , W o , V o , b o The parameters to be optimized;
[0041] S302: Calculate the pheromone content function F of the food location of the adaptive ant colony algorithm to quantify the quality of the parameters to be optimized in the current long short-term memory network; the pheromone content function F of the food location of the adaptive ant colony algorithm can be expressed as:
[0042]
[0043] In the formula, e m is the average prediction error of the distributed photovoltaic power prediction model based on long short-term memory network; e r is the prediction root mean square error of the distributed photovoltaic power prediction model based on long short-term memory network; N p The total number of time points for distributed photovoltaic power prediction; are the true value and predicted value of the i-th point respectively;
[0044] S303: Adopting the adaptive ant colony algorithm neighborhood search equation with an adaptive coefficient to perform neighborhood search, specifically:
[0045]
[0046] In the formula, is the location of the food in the neighborhood; u(t) is the adaptive function of the adaptive ant colony algorithm; k and j are food locations different from i; is the adaptive coefficient; Vi g is the optimal solution in the current cycle;
[0047] S304: Establish a roulette probability formula to select the food location obtained by the ant search, which can be specifically expressed as:
[0048]
[0049] In the formula, f i F is the probability of ant i choosing a food location; i is the pheromone content function value of the food location of ant i;
[0050] S305: Determine whether the number of calculations of the adaptive ant colony algorithm has reached the maximum number of explorations I max If the maximum number of explorations is reached, the LSTM parameters currently calculated by the adaptive ant colony algorithm are the optimal parameters. If the maximum number of explorations is not reached, the adaptive ant colony algorithm is continued to be used to optimize the LSTM parameters, and the process returns to step 302.
[0051] Preferably, the following method is used to design the adaptive function in S303: at the beginning of the loop, the value of the adaptive function should be a real number less than 1 and greater than 0.5; as the number of loops increases, the value of the adaptive function should decrease monotonically until it approaches 0.
[0052] Beneficial effects of the present invention:
[0053] 1. A distributed photovoltaic power intelligent prediction method considering the temporal correlation and generalization of multi-dimensional prediction influencing factors is proposed. By making full use of the update gate in the long short-term memory network, the potential temporal correlation between photovoltaic output power and natural environmental information is explored. At the same time, the forget gate in the long short-term memory network is used to eliminate the non-universal influence on photovoltaic output power and natural environmental information, thereby significantly improving the generalization ability of the prediction model, enhancing the prediction accuracy and stability of the prediction model under different environmental conditions, and thus improving the effectiveness and universality of the prediction method.
[0054] 2. A distributed photovoltaic power prediction network parameter optimization method based on an adaptive ant colony algorithm is designed. The adaptive ant colony algorithm can significantly improve the accuracy of distributed photovoltaic power prediction by optimizing the parameters of the prediction network. This optimization method can automatically adjust the parameters of the prediction network to adapt to the complex correlation between the multi-dimensional features of distributed photovoltaic power prediction, so as to better capture the characteristics of photovoltaic power generation systems. Through the parameter optimization of the adaptive ant colony algorithm, the performance and efficiency of the photovoltaic power prediction model can be further improved, providing strong support for the intelligent management and optimized operation of photovoltaic power generation systems.
[0055] The features and advantages of the present invention will be described in detail through embodiments in conjunction with the accompanying drawings.
Brief Description of the Drawings
[0056] Figure 1 It is a schematic diagram of a distributed photovoltaic power prediction method based on an adaptive ant colony tuning long short-term memory network according to the present invention;
[0057] Figure 2 The present invention is a flow chart of the intelligent prediction algorithm in the distributed photovoltaic power prediction method based on the adaptive ant colony tuning long short-term memory network. [Specific implementation method]
[0058] In order to make the above-mentioned purposes, features and advantages of the present invention more obvious and easy to understand, the specific implementation methods of the present invention are described in detail below in conjunction with the drawings of the specification. Obviously, the described embodiments are part of the embodiments of the present invention, but not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary persons in the art without creative work should fall within the scope of protection of the present invention.
[0059] In the following description, many specific details are set forth to facilitate a full understanding of the present invention, but the present invention may also be implemented in other ways different from those described herein, and those skilled in the art may make similar generalizations without violating the connotation of the present invention. Therefore, the present invention is not limited to the specific embodiments disclosed below.
[0060] Secondly, the term "one embodiment" or "embodiment" as used herein refers to a specific feature, structure, or characteristic that may be included in at least one implementation of the present invention. The term "in one embodiment" that appears in different places in this specification does not necessarily refer to the same embodiment, nor does it refer to a separate or selective embodiment that is mutually exclusive with other embodiments.
[0061] See also Figure 1 , 2 , a distributed photovoltaic power prediction method based on adaptive ant colony tuning long short-term memory network includes the following steps:
[0062] Step 1: Establish a multi-dimensional feature data vector set for predicting distributed photovoltaic power.
[0063] The multi-dimensional feature data vector set used to predict distributed photovoltaic power includes the feature data related to distributed photovoltaic power prediction within 30 days. The sampling period of the data vector set is 30 seconds.
[0064] The feature data in the multi-dimensional feature data vector set used to predict distributed photovoltaic power includes irradiance data, temperature data, humidity data, air pressure data, distributed photovoltaic power generation data, and load power consumption data.
[0065] Feature selection is performed on the features related to distributed photovoltaic power prediction. Specifically, the distributed photovoltaic power generation data is used as the output vector, and the irradiance data, temperature data, humidity data, air pressure data, and load power consumption data are used as input vectors; based on the LightGBM feature selection algorithm, the eigenvalues of the input vectors such as irradiance data, temperature data, humidity data, air pressure data, distributed photovoltaic power generation data, and load power consumption data are converted into histograms, and then the contribution of each dimension of the multi-dimensional feature data vector set is sorted, and the features with a contribution of less than 5% are eliminated to form an optimized distributed photovoltaic power prediction multi-dimensional feature data vector set.
[0066] Step 2: Based on the multi-dimensional feature data vector set for predicting distributed photovoltaic power established in step 1, a long short-term memory network for predicting distributed photovoltaic power is established.
[0067] Step 2 includes the following steps:
[0068] S201: using the optimized distributed photovoltaic power prediction multi-dimensional feature data vector set obtained in step 1 as an input variable x of a distributed photovoltaic power prediction model;
[0069] S202: Based on the input variable x described in step S202, a distributed photovoltaic power LSTM prediction model is constructed. The model is composed of an LSTM network, which includes an input layer, a hidden layer, and an output layer. The input layer receives the optimized distributed photovoltaic power prediction multi-dimensional feature data as input, the hidden layer contains several LSTM units for learning the long-term dependency of the time series, and the output layer is used to predict the distributed photovoltaic power. Among them, each LSTM unit includes an update gate, a forget gate, and an output gate at time t;
[0070] Among them, the update gate is used to memorize the multi-dimensional feature information of distributed photovoltaic power prediction at the current time t, the forget gate is used to select non-essential feature information in the multi-dimensional features of distributed photovoltaic power prediction; the output gate is used to output the result of the current hidden layer to the next LSTM unit.
[0071] In the LSTM unit, the update gate and the forget gate operate based on the input variables at the same time, and they each undertake the task of memorizing and forgetting the necessary or unnecessary feature information of the input variables. This gating mechanism allows the network to flexibly decide whether the information should be retained or forgotten based on the input and past states, thereby effectively processing long-term dependencies in time series. Specifically, the update gate determines the importance of each input feature through a Sigmoid activation function to control the input of appropriate information into the memory unit. It selectively passes relevant information to the memory unit to update the current state based on the input data at the current moment and the hidden state at the previous moment. The forget gate also uses a Sigmoid activation function to decide whether the information in each memory unit needs to be retained. It determines the information that should be forgotten through continuous iteration based on the past state and current input, thereby ensuring that the memory unit is not disturbed by irrelevant information.
[0072] Among them, the output L of the update gate t It can be expressed as
[0073] L t =f t L t-1 +j t C t
[0074] j t =g(W j x t +V j h t-1 +b j )
[0075] C t =tanh(W i x t +V i h t-1 +b i )
[0076] Where, L t is the output of the update gate, f t is the output of the forget gate; x t is the input vector at time t; h t-1 is the output of the hidden layer at time t-1, that is, the output result of the output gate; g is the Sigmoid activation function; j t is the output of the Sigmoid activation function; W j 、V j From x t With h t-1 Mapped to the update gate activation function output j t The weight matrix of b, the elements in the matrix are random real numbers with initial values.j is the bias vector output by the update gate activation function, and the vector elements are real numbers with random initial values; C t is the output of the tanh function; W i 、V i From x t With h t-1 Mapped to the update gate tanh function output C t The weight matrix of b, the elements in the matrix are random real numbers with initial values. i To update the bias vector output by the gate tanh function, the vector elements are real numbers with random initial values.
[0077] Among them, the output f of the forget gate t Determined by the following formula
[0078] f t =g(W f x t +V f h t-1 +b f )
[0079] Where W f 、V f From x t With h t-1 Mapped to the forget gate activation function output f t The weight matrix of b, the elements in the matrix are random real numbers with initial values. f It is the bias vector output by the forget gate activation function, and the vector elements are real numbers with random initial values.
[0080] Among them, the output o of the output gate t Determined by the following formula
[0081] o t =g(W o x t +V o h t-1 +b o )
[0082] Where W o 、V o From x t With h t-1 Mapped to the forget gate activation function output o t The weight matrix of b, the elements in the matrix are random real numbers with initial values. o From x t With h t-1 Mapped to the forget gate activation function output bias vector, the vector elements are real numbers with random initial values.
[0083] The output gate obtains the output of the current hidden layer based on the output of the update gate and the output of the forget gate. The output of the hidden layer at time t is h t It can be expressed as
[0084] h t =o t ·tanhL t
[0085] After iterations of multiple layers of LSTM units, the output of a distributed photovoltaic power prediction model based on a long short-term memory network is finally formed.
[0086] Furthermore, for W in the long short-term memory network model in step 2 j , V j , b j , W f , V f , b f , W o , V o , b o The parameters to be optimized are determined by using the adaptive ant colony algorithm to optimize the parameters of the distributed photovoltaic power prediction model.
[0087] See also Figure 2 , Step 3: For the long short-term memory network established in step 2, an adaptive ant colony algorithm model is established to optimize the parameters of the long short-term memory network.
[0088] The step 3 comprises:
[0089] S301: Initialize the parameters of the adaptive ant colony algorithm; the adaptive ant colony algorithm includes the number of ants n in the adaptive ant colony algorithm, the maximum number of food searches is I max and food location x m ; where food position x m The multi-dimensional information stored in the long short-term memory network model includes W j , V j , b j , W f , V f , b f , W o , V o , b o The parameters to be optimized;
[0090] S302: Calculate the pheromone content function F of the food location of the adaptive ant colony algorithm to quantify the quality of the parameters to be optimized in the current long short-term memory network; the pheromone content function F of the food location of the adaptive ant colony algorithm can be expressed as:
[0091]
[0092] In the formula, e m is the average prediction error of the distributed photovoltaic power prediction model based on long short-term memory network; e r is the prediction root mean square error of the distributed photovoltaic power prediction model based on long short-term memory network; N p The total number of time points for distributed photovoltaic power prediction; are the true value and predicted value of the i-th point respectively;
[0093] S303: Adopting the adaptive ant colony algorithm neighborhood search equation with an adaptive coefficient to perform neighborhood search, specifically:
[0094]
[0095] In the formula, is the location of the food in the neighborhood; u(t) is the adaptive function of the adaptive ant colony algorithm; k and j are food locations different from i; is the adaptive coefficient; V i g is the optimal solution in the current cycle;
[0096] Furthermore, in order to make the algorithm have a higher ability in global search at the beginning of the loop and improve the development ability of local areas as the number of loops increases, the following method is used to design the adaptive function u(t): at the beginning of the loop, the adaptive function u(t) should approach 1; as the number of loops increases, the adaptive function u(t) should gradually approach 0.
[0097] S304: Establish a roulette probability formula to select the food location obtained by the ant search, which can be specifically expressed as:
[0098]
[0099] In the formula, f i F is the probability of ant i choosing a food location; i is the pheromone content function value of the food location of ant i;
[0100] S305: Determine whether the number of calculations of the adaptive ant colony algorithm has reached the maximum number of explorations I max If the maximum number of explorations is reached, the LSTM parameters currently calculated by the adaptive ant colony algorithm are the optimal parameters. If the maximum number of explorations is not reached, the adaptive ant colony algorithm is continued to be used to optimize the LSTM parameters, and the process returns to step 302.
[0101] The distributed photovoltaic data of a certain regional power grid was selected for case analysis.
[0102] The distributed photovoltaic system in the region includes 1,089 photovoltaic panels, each with a rated output power of 260W. The raw data obtained include irradiance data, temperature data, humidity data, air pressure data, distributed photovoltaic power generation data, and load power consumption data with a sampling interval of 30 seconds from January 2021 to January 2022. For these data, we considered 4 different photovoltaic power prediction methods for comparison.
[0103] First, our patent proposes a distributed photovoltaic power prediction method based on adaptive ant colony algorithm to adjust the long short-term memory network. By using the adaptive ant colony algorithm to optimize the parameters in the long short-term memory network, our method can better exert the prediction performance of the LSTM network. Table 1 shows that the method designed in this patent has the lowest prediction average percentage error and prediction root mean square error, which shows that our method performs well in photovoltaic power prediction.
[0104] Secondly, we compared the other three prediction methods. Method 2 is a prediction method based on simulated annealing algorithm, method 3 is a prediction method based on gated recurrent unit, and method 4 is a prediction method based on ordinary long short-term memory network. As can be seen from Table 1, the method of this patent is significantly better than the other three methods in terms of prediction error, especially in terms of prediction average percentage error and prediction root mean square error, which show the lowest error level.
[0105] This superiority is mainly attributed to the introduction of the adaptive ant colony algorithm in this patented method, which can intelligently optimize the parameters of the long short-term memory network to better adapt to the complexity and variability of the photovoltaic system. By optimizing the parameters, our method can better capture the temporal correlation in the photovoltaic system and eliminate information that is not universal to the prediction results, thereby significantly improving the generalization ability of the model.
[0106] In summary, the distributed photovoltaic power prediction method based on the adaptive ant colony algorithm to adjust the long short-term memory network in this patent performs well in practical applications, with low prediction error and high prediction accuracy. The superiority of this method is due to the intelligent optimization of parameters, which enables it to show excellent prediction performance in distributed photovoltaic systems. This will provide strong technical support for the intelligent management and optimized operation of photovoltaic power generation systems, and will also play a positive role in promoting the development of the renewable energy field.
[0107] Table 1 Comparison of distributed photovoltaic power prediction effects based on different algorithms
[0108]
[0109]
[0110] It should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit the present invention. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solutions of the present invention may be modified or replaced by equivalents without departing from the spirit and scope of the technical solutions of the present invention, which should all be included in the scope of the claims of the present invention.
Claims
1. A distributed photovoltaic power prediction method based on adaptive ant colony tuning long short-term memory network, characterized in that: The following steps are involved: Step 1: Establish a multi-dimensional feature data vector set for predicting distributed photovoltaic power; Step 2: For the multi-dimensional feature data vector set for predicting distributed photovoltaic power established in step 1, a long short-term memory network for predicting distributed photovoltaic power is established; Step 3: For the long short-term memory network established in step 2, an adaptive ant colony algorithm model for optimizing the parameters of the long short-term memory network is established; In step 2, the long short-term memory network includes a plurality of input variables and a plurality of LSTM units, and the input variables are sequentially trained through the LSTM units in the hidden layer of the long short-term memory network; An update gate function that can retain key timing association information of input variables is introduced into the LSTM unit, and the LSTM network can selectively update the state of each moment through the update gate function; a reset gate function that can remove unnecessary timing association information of input variables is introduced into the LSTM unit, and the LSTM network can selectively discard unnecessary information through the reset gate function; The step 2 comprises: S201: using the optimized distributed photovoltaic power prediction multi-dimensional feature data vector set obtained in step 1 as an input variable x of a distributed photovoltaic power prediction model; S202: Based on the input variables described in step S201 x , construct a distributed photovoltaic power LSTM prediction model; the distributed photovoltaic power LSTM prediction model includes an input layer, a hidden layer and an output layer; the input layer receives the optimized distributed photovoltaic power prediction multi-dimensional feature data as input, the hidden layer contains several LSTM units for learning the long-term dependency of time series, and the output layer is used to predict distributed photovoltaic power; each LSTM unit includes an update gate, a reset gate and an output gate at time t; the update gate is used to memorize the distributed photovoltaic power prediction multi-dimensional feature information at the current time t, and the reset gate is used to select non-essential feature information in the distributed photovoltaic power prediction multi-dimensional features; the output gate is used to output the result of the current hidden layer to the next LSTM unit; The update gate and reset gate in S202 operate based on the input variables at the same time; the update gate determines the importance of each input feature through a Sigmoid activation function to control the information input into the memory unit; the update gate selectively passes the relevant information to the memory unit according to the input data at the current moment and the hidden state at the previous moment to update the current state; the reset gate also determines whether the information in each memory unit needs to be retained through a Sigmoid activation function; the reset gate determines the information that should be forgotten through continuous iteration based on the past state and the current input; Update the output L of the gate t It is expressed as: L t =f t L t-1 +j t C t j t =g(W j x t +V j h t-1 +b j ) C t =tanh(W i x t +V i h t-1 +b i ) Where, L t is the output of the update gate, f t is the output of the reset gate; x t is the input vector at time t; h t-1 is the output of the hidden layer at time t-1, that is, the input result of the output gate; g is the Sigmoid activation function; j t is the output of the Sigmoid activation function; W j 、V j From x t With h t-1 Mapped to the update gate activation function output j t The weight matrix, the elements in the matrix are random real numbers with initial values; b j is the bias vector output by the update gate activation function, and the vector elements are real numbers with random initial values; C t is the output of the tanh function; W i 、V i From x t With h t-1 Mapped to the update gate tanh function output C t The weight matrix, the elements in the matrix are random real numbers with initial values; b i To update the bias vector output by the gate tanh function, the vector elements are real numbers with random initial values; Reset the gate output f t Determined by the following formula: f t =g(W f x t +V f h t-1 +b f ) Where W f 、V f From x t With h t-1 Mapped to the reset gate activation function output f t The weight matrix, the elements in the matrix are random real numbers with initial values; b f To reset the bias vector output by the gate activation function, the vector elements are real numbers with random initial values; The output o of the output gate t Determined by the following formula: o t =g(W o x t +V o h t-1 +b o ) Where W o 、V o From x t With h t-1 Mapped to the reset gate activation function output o t The weight matrix, the elements in the matrix are random real numbers with initial values; b o From x t With h t-1 Mapped to the reset gate activation function output bias vector, the vector elements are real numbers with random initial values; The output gate obtains the output of the current hidden layer based on the output of the update gate and the output of the reset gate; the output of the hidden layer at time t is h t It is expressed as: h t =o t ·tanhL t After iterations of multiple layers of LSTM units, the output of a distributed photovoltaic power prediction model based on a long short-term memory network is finally formed; The step 3 comprises: S301: Initialize the parameters of the adaptive ant colony algorithm; S302: Calculating the pheromone content function of the food location of the adaptive ant colony algorithm; S303: Using the adaptive ant colony algorithm neighborhood search equation with an adaptive coefficient to perform neighborhood search to find a new food location; S304: designing a probability selection formula to determine whether the ant searches for food at a location with a higher pheromone content function value; S305: Determine whether the number of searches has reached the maximum number of iterations; if so, output the optimal solution of the current round of the adaptive ant colony algorithm; if not, perform the next round of food location search and return to S302; The step 3 comprises: S301: Initialize the parameters of the adaptive ant colony algorithm; the adaptive ant colony algorithm includes the number of ants n in the adaptive ant colony algorithm, the maximum number of food searches is I max and food location x m ; where food position x m The multi-dimensional information stored in the long short-term memory network model includes W j , V j , b j , W f , V f , b f , W o , V o , b o The parameters to be optimized; S302: Calculate the pheromone content function F of the food location of the adaptive ant colony algorithm to quantify the quality of the parameters to be optimized in the current long short-term memory network; the pheromone content function F of the food location of the adaptive ant colony algorithm is expressed as: In the formula, e m is the average prediction error of the distributed photovoltaic power prediction model based on long short-term memory network; e r is the prediction root mean square error of the distributed photovoltaic power prediction model based on long short-term memory network; N p The total number of time points for distributed photovoltaic power prediction; are the true value and predicted value of the i-th point respectively; S303: Adopting the adaptive ant colony algorithm neighborhood search equation with an adaptive coefficient to perform neighborhood search, specifically: In the formula, is the location of the food in the neighborhood; u(t) is the adaptive function of the adaptive ant colony algorithm; k and j are food locations different from i; is the adaptive coefficient; V i g is the optimal solution in the current cycle; S304: Establish a roulette probability formula to select the food location obtained by the ants’ search, which is specifically expressed as: In the formula, f i F is the probability of ant i choosing a food location; i is the pheromone content function value of the food location of ant i; S305: Determine whether the number of calculations of the adaptive ant colony algorithm has reached the maximum number of explorations I max ; If the maximum number of explorations is reached, the LSTM parameters currently calculated by the adaptive ant colony algorithm are the optimal parameters; if the maximum number of explorations has not been reached, the adaptive ant colony algorithm is continued to be used to optimize the LSTM parameters, and the process returns to step 302; The feature data in the multi-dimensional feature data vector set used to predict distributed photovoltaic power in step 1 includes irradiance data, temperature data, humidity data, air pressure data, distributed photovoltaic power generation data and load power consumption data.
2. The distributed photovoltaic power prediction method based on adaptive ant colony tuning long short-term memory network according to claim 1 is characterized in that: Distributed photovoltaic power generation data is used as the output vector, and irradiance data, temperature data, humidity data, air pressure data and load power consumption data are used as input vectors; based on the LightGBM feature selection algorithm, the eigenvalues of the irradiance data, temperature data, humidity data, air pressure data, distributed photovoltaic power generation data and load power consumption data input vectors are converted into histograms, and then the contribution of each dimensional feature of the multi-dimensional feature data vector set is sorted, and the features with a contribution of less than 5% are eliminated to form an optimized distributed photovoltaic power prediction multi-dimensional feature data vector set.
3. The distributed photovoltaic power prediction method based on adaptive ant colony tuning long short-term memory network according to claim 1 is characterized in that: The following method is used to design the adaptive function in S303: at the beginning of the loop, the value of the adaptive function should be a real number less than 1 and greater than 0.5; as the number of loops increases, the value of the adaptive function should decrease monotonically until it approaches 0.
Citation Information
Patent Citations
Photovoltaic power prediction method based on prediction error correction
CN110598896A
Photovoltaic power ultra-short-term prediction method based on cloud atlas prediction
CN112085260A
Photovoltaic power prediction method, system and device based on LSTM combined prediction framework, and storage medium
CN116029442A
Feature extraction method and system for energy consumption prediction
CN112329813A