A hybrid model photovoltaic power prediction method based on spatiotemporal synergy
By using a spatio-temporal collaborative hybrid model in photovoltaic power generation forecasting, combined with CNN and LSTM multi-head attention mechanisms, parallel training and an improved dung beetle optimization algorithm, the limitations and information integration problems of existing photovoltaic power generation forecasting methods are solved, and the efficiency is improved Forecast accuracy and efficiency help grid operators optimize energy supply.
Patent Information
- Application Number
- CN202311711047.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-13
- Publication Date
- 2024-09-24
- Estimated Expiration
- 2043-12-13
AI Technical Summary
Existing photovoltaic power generation power prediction methods have limitations in dealing with diversity issues, insufficient generalization capabilities, and a single model cannot effectively integrate spatiotemporal information during the training process, resulting in low prediction accuracy and cumbersome and high-cost hyperparameter settings.
A hybrid model photovoltaic power generation prediction method based on spatio-temporal collaboration is used, combined with the CNN multi-head attention mechanism and the LSTM multi-head attention mechanism, to train the model in parallel, and find the global optimal hyperparameters through the improved dung beetle optimization algorithm, and through the multi-head attention mechanism Fusion of spatiotemporal information.
It improves the accuracy and efficiency of photovoltaic power generation prediction, enhances the representation ability of the model, reduces training time, improves the ability to capture spatiotemporal correlation information of photovoltaic power generation sequences, and helps grid operators rationally dispatch and optimize energy supply.
Smart Images

Figure CN117689167B
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of photovoltaic prediction of renewable energy power generation, and specifically relates to a hybrid model photovoltaic power generation prediction method based on time-space coordination. Background Art
[0002] As the world's most populous country, China has always been faced with growing energy demand and environmental challenges. The development and utilization of new energy has become one of China's key strategies for achieving sustainable development, and in order to respond to climate change and reduce greenhouse gas emissions, it has set the important goal of carbon peak and carbon neutrality. Photovoltaic power generation, as a clean and renewable form of energy, plays a key role in achieving the carbon peak and carbon neutrality goals.
[0003] However, the output of photovoltaic power generation is affected by factors such as solar radiation, weather conditions and seasonal changes, and has a certain degree of volatility. Therefore, accurately predicting the power output of photovoltaic power generation is crucial for the planning and management of energy systems. Accurate prediction of photovoltaic power generation can help grid operators and energy planners to rationally dispatch and optimize energy supply and ensure the stable operation of the power system. By predicting the supply of photovoltaic power generation, other energy resources can be better integrated and coordinated, the supply and demand relationship can be balanced, and energy utilization efficiency can be improved, thereby promoting the realization of carbon neutrality and carbon peak goals.
[0004] At present, photovoltaic power generation prediction mainly adopts physical method, statistical method, machine learning method and deep learning method. Physical method is sensitive to meteorological data. When the weather changes drastically, the prediction accuracy drops significantly. Statistical methods are mostly linear predictions and require a large amount of data, making it difficult to achieve accurate predictions. Machine learning and deep learning are mainstream methods, but many hyperparameters need to be set in the prediction process. Trial and error or empirical methods are usually used to set hyperparameters, but this may result in prediction results being limited to local optimality and high time cost. At the same time, a single model will have limitations, insufficient generalization ability, and inability to handle diversity issues during training, which will affect the prediction accuracy; while by combining models for serial training, information can only flow in the order of modules and cannot be directly transmitted to other parts of the entire network. This may limit information transmission and interaction in the network, making it difficult to achieve global information integration and optimization. Summary of the invention
[0005] The purpose of the present invention is to provide a hybrid model photovoltaic power prediction method based on time-space coordination.
[0006] In a first aspect, the present invention provides a hybrid model photovoltaic power generation prediction method based on time-space coordination, which comprises the following steps:
[0007] Step 1: Construct a data set. The data set contains multiple influencing factors of photovoltaic power stations and their corresponding time series data of power generation.
[0008] Step 2: Construct a power prediction model.
[0009] The power prediction model includes a CNN multi-head attention mechanism module, an LSTM multi-head attention mechanism module, a combination module and a fully connected layer. The LSTM multi-head attention mechanism module includes a long short-term memory network and a first multi-head attention mechanism layer. The CNN multi-head attention mechanism module includes a convolutional neural network and a second multi-head attention mechanism layer. The first multi-head attention mechanism layer, the second multi-head attention mechanism layer and the combination module all adopt a multi-head attention mechanism structure.
[0010] The features output by the long short-term memory network are transmitted as input to the first multi-head attention mechanism layer. The features output by the convolutional neural network are transmitted as input to the second multi-head attention mechanism layer. The output vector C1 of the first multi-head attention mechanism layer and the output vector C2 of the second multi-head attention mechanism layer are input to the combination module for fusion; the resulting fusion vector is input to the fully connected layer. The fully connected layer outputs the prediction result.
[0011] Step 3: Set the hyperparameters of the long short-term memory network and the convolutional neural network.
[0012] Step 4: Build a training set based on the data set, and use the training set to train the CNN multi-head attention mechanism model and the LSTM multi-head attention mechanism model in parallel.
[0013] Step 5: Use the trained power prediction model to predict the power generation of the photovoltaic power station.
[0014] Preferably, in step 3, the global optimal hyperparameters of the long short-term memory network and the convolutional neural network are respectively found by the dung beetle optimization algorithm (DBO), and the obtained global optimal hyperparameters of the long short-term memory network and the convolutional neural network are respectively assigned to the long short-term memory network and the convolutional neural network;
[0015] Preferably, the initial position of the population in the dung beetle optimization algorithm is determined by a Logistic chaos mapping method.
[0016] Preferably, the mean square error is used as the fitness function in the dung beetle optimization algorithm.
[0017] Preferably, the influencing factors are selected from rainfall, wind direction, diffuse horizontal irradiance, global horizontal irradiance, humidity, temperature, wind speed and current. The selection process is: the Pearson correlation coefficient method selects data with high correlation with the generated power as the influencing factors.
[0018] Preferably, the data constructed in step 1 is processed by missing value filling, outlier replacement and normalization.
[0019] As a preferred method, multiple sets of parameter matrices W are defined in the multi-head attention mechanism structure i Q , W i K , W i V , where the parameter matrix of each group is different, and the input features are multiplied by the parameter matrix to obtain multiple groups of query vectors Q i , key vector K i , value vector V i ; Based on the query vector Q i , key vector K i , value vector V i Calculate multiple attention outputs; perform weighted summation of each attention output to obtain the output of the multi-head attention mechanism structure.
[0020] Preferably, in the convolutional neural network, the convolution kernel is applied to each position on the input sequence. The sliding window starts from the beginning of the input sequence and moves step by step, each time moving a step size. At each position of the sliding window, the convolution kernel is element-by-element multiplied with the corresponding element in the input sequence, and then the product results are summed. This summation result is the value of the corresponding position of the output sequence of the convolution operation. Continue sliding the window until the sliding window traverses the entire input sequence.
[0021] In a second aspect, the present invention provides a computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the memory stores the computer program; and the processor executes the aforementioned hybrid model photovoltaic power generation prediction method based on spatiotemporal coordination.
[0022] In a third aspect, the present invention provides a readable storage medium storing a computer program; when the computer program is executed by a processor, it is used to implement the aforementioned hybrid model photovoltaic power generation prediction method based on time-space coordination.
[0023] The beneficial effects of the present invention are:
[0024] 1. The present invention adopts an improved dung beetle optimization algorithm, which can find the global optimal hyperparameters of the model, thereby effectively reducing the time required for model training. In the algorithm, the initial position of the individuals in the population is crucial to the optimization effect of the swarm intelligence algorithm. By using the Logistic chaotic map to initialize the population, the present invention can make the population distribution more balanced, thereby improving the convergence and optimization accuracy of the algorithm.
[0025] 2. The present invention introduces a CNN multi-head attention mechanism in the design of the model. This mechanism enables the model to learn the spatial dependencies in the input sequence and capture local structural features. At the same time, through the multi-head attention mechanism, the present invention can enhance the spatial dependencies learned by the model. In addition, the present invention also adopts an LSTM multi-head attention mechanism model. The model can automatically learn and focus on important factors related to power generation in the input sequence. LSTM can capture short-term dependencies in the sequence through its memory units, while the multi-head attention mechanism helps to capture long-term dependencies in the sequence.
[0026] 3. During the training process, the present invention trains the CNN and LSTM models in parallel and combines them through the Multi-Head-Attention mechanism. Based on this, the model can simultaneously learn the spatial and temporal structure knowledge of the input sequence. CNN extracts spatial features to assist LSTM learning, while LSTM learning temporal relationships can make up for the shortcomings of CNN. By fusing the outputs of the two through the attention mechanism, the present invention can better capture the associated information learned by CNN and LSTM. The comprehensive use of temporal and spatial information capabilities helps to improve the model's ability to represent photovoltaic power generation sequences, thereby improving the accuracy of predictions. This is very important for power grid operators and energy planners, and can help them rationally dispatch and optimize energy supply to ensure the stable operation of the power system. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] Figure 1 is a flow chart of the present invention;
[0028] Figure 4 It is a structural diagram of the power prediction model in the present invention;
[0029] Figure 2 It is a structural model diagram of the long short-term memory network in the present invention;
[0030] Figure 3 This is a model diagram of the multi-head attention mechanism structure in the present invention;
[0031] Figure 5 This is a comparison chart between the predicted results and the true values of the CNN multi-head attention mechanism model under the DBO algorithm and the Logistic-DBO algorithm;
[0032] Figure 6 This is a comparison chart between the prediction results and the true values of the LSTM multi-head attention mechanism model under the DBO algorithm and the Logistic-DBO algorithm;
[0033] Figure 7 This is a comparison chart of the prediction results and true values of the serial and parallel CNN-LSTM-multi-head attention mechanism models under the Logistic-DBO algorithm; DETAILED DESCRIPTION
[0034] The present invention is further described below in conjunction with the accompanying drawings.
[0035] A photovoltaic power generation prediction method based on a hybrid model of time-space synergy is proposed. Firstly, the improved dung beetle optimization algorithm is used to optimize the hyperparameters of the model to find the global optimal solution. Secondly, two groups of models are trained in parallel to achieve the time-space synergy effect. Finally, the two results are merged and outputted through a multi-head attention mechanism to achieve deep fusion of time and space information.
[0036] The specific process of the photovoltaic power generation prediction method is as follows:
[0037] Step 1: Screen suitable influencing factors.
[0038] A historical data set of the measured area (in this embodiment, the Alice Springs photovoltaic power station in central Australia) is obtained, and the data set contains the power generation power at different time points in history and multiple influencing factors; the influencing factors include the received active power, current, wind speed, temperature, humidity, global horizontal irradiance, diffuse horizontal irradiance, wind direction, rainfall, and active power.
[0039] The correlation between each influencing factor and the power generation is not the same, so the Pearson correlation coefficient method is used to select the strongly correlated influencing factors. The Pearson correlation coefficient formula is as follows:
[0040]
[0041] Where X represents the power under normal conditions, Y represents the power under environmental influences, n represents the number of samples, and i represents the sequence number of the samples.
[0042] Clean the strongly correlated data, including filling in missing values and filling in reasonably according to the data change trend.
[0043] After the data is filled, a threshold is set. If the value is greater than or less than the threshold, it is defined as an outlier and its value is replaced to ensure the availability of the data.
[0044] Normalizing normal data effectively reduces the scope of the original data, thereby better extracting data information and enhancing the correlation between features. The normalization formula is as follows:
[0045]
[0046] In the formula, X is the original data, X max is the maximum value in the original data, X min is the minimum value in the original data.
[0047] After screening, the retained influencing factors include: wind speed, temperature, humidity, global horizontal irradiance, diffuse horizontal irradiance, wind direction, rainfall and active power.
[0048] Step 2: Build a power prediction model (Lojistic-DBO-CNN-LSTM-Multi-Head-Attention (parallel)).
[0049] The power prediction model includes a CNN multi-head attention mechanism module, an LSTM multi-head attention mechanism module, a combination module and a fully connected layer. The LSTM multi-head attention mechanism module includes a long short-term memory network (LSTM) and the first multi-head attention mechanism layer. The CNN multi-head attention mechanism module includes a convolutional neural network (CNN) and a second multi-head attention mechanism layer. The first multi-head attention mechanism layer, the second multi-head attention mechanism layer and the combination module all adopt a multi-head attention mechanism structure (Multi-Head-Attention). The data are input into the convolutional neural network and the long short-term memory network respectively.
[0050] In the LSTM multi-head attention mechanism module, the features output by the long short-term memory network are transmitted as input to the first multi-head attention mechanism layer.
[0051] In the first multi-head attention mechanism layer, we first define multiple sets of parameter matrices W i Q , W i K , W i V , where each set of parameter matrices is different, and the input features are multiplied by the parameter matrix to obtain multiple sets of query vectors Q i , key vector K i , value vector V i ; where the vector Q (query, Query) is the reference point in the mechanism, used to compare keys and determine the vectors associated with values; the vector K (key, Key) is a set of vectors used to represent the characteristics of each element in the input sequence, and each key vector K i With the query vector V i The comparison is performed to calculate the relevance score to the query; the value vector V(value, Value) is a vector associated with each key, and its weight is adjusted according to the relevance score so that the values are weighted summed.
[0052]
[0053] Z=Concat(Z1,···Z h )
[0054] Where i = 1, 2, ..., h; Z i is the attention output of the ith head, and Z is the sum of the attention outputs of h heads; d k is the dimension of the key; Softmax is to normalize the score; Q i is the i-th query vector; K i is the i-th key vector; V i is the i-th lookup vector; Concat merges all outputs.
[0055] In the CNN multi-head attention mechanism module, the features output by the convolutional neural network are transmitted as input to the second multi-head attention mechanism layer. The working process of the second multi-head attention mechanism layer is the same as that of the first multi-head attention mechanism layer, and it can output vector C2.
[0056] The output vector C1 and the output vector C2 are combined through the combination module and input into the fully connected layer; the fully connected layer outputs the prediction result.
[0057] The above-mentioned long short-term memory network is a variant of a recurrent neural network (RNN) that has been improved to solve the gradient vanishing and gradient exploding problems in long sequence data processing. The long short-term memory network includes an input gate i, a forget gate f, an output gate o, and an internal memory unit c.
[0058] In the LSTM network, data is input to the input gate, which uses the following formula to control how much data is currently input and can be saved to the memory unit c t :
[0059] i t =σ(W xi x t +W hi h t-1 +b i )
[0060] In the formula, x t is the input of the current time; h t-1 is the hidden state at the previous time; W xi Enter x for the current time t and the weight of the input gate; W hi is the weight of the previous hidden state and the input gate; b i is the bias of the input gate.
[0061] At the same time, the forget gate uses the following formula to determine which parts of the historical information will be discarded. t-1 The information in the current memory unit ct Impact:
[0062] f t =σ(W xf x t +W hf h t-1 +b f )
[0063] c t =f t ×c t-1 +i t ×tanh(W xc x t +W hc h t-1 +b c )
[0064] Where W xf Enter x for the current time t and the weight of the forget gate; W hf is the weight of the previous hidden state and the input forget gate; W xc Enter x for the current time t The weight updated with the memory unit; W hc is the weight of the previous hidden state and memory unit update.
[0065] Finally, the output gate controls the memory cell c through the following formula t For the current output value h t The impact of , that is, which part of the memory unit will be output at time t:
[0066] o t =σ(W xo x t +W ho h t-1 +b o )
[0067] h t =o t ×tanh(c t )
[0068] Where W xo Enter x for the current time t And the weight of the output gate; W ho is the weight of the previous hidden state and the output gate.
[0069] The above-mentioned Convolutional Neural Network (CNN) is inspired by the working principle of the biological visual cortex. It extracts and learns features in images through components such as convolutional layers, pooling layers, and fully connected layers.
[0070] In a convolutional neural network, a convolution kernel is applied to each position on the input sequence. The sliding window starts at the beginning of the input sequence and moves step by step, one step at a time. At each position in the sliding window, the convolution kernel is element-wise multiplied with the corresponding element in the input sequence, and then the product results are summed. This summed result is the value of the corresponding position in the output sequence of the convolution operation. Continue sliding the window until the sliding window traverses the entire input sequence.
[0071] Step 3: Use the improved dung beetle optimization algorithm to find the global optimal hyperparameters of the long short-term memory network and the convolutional neural network, and assign the obtained global optimal hyperparameters of the long short-term memory network and the convolutional neural network to the long short-term memory network and the convolutional neural network, respectively; the initial position of the population in the dung beetle optimization algorithm is determined by the Logistic chaos mapping method.
[0072] The improved dung beetle optimization algorithm is used to optimize the hyperparameters of the model.
[0073] The main steps of the present invention to improve the dung beetle optimization algorithm are as follows:
[0074] ① Initialize the number of rolling dung beetles, egg-laying dung beetles, foraging dung beetles, and stealing dung beetles in a ratio of 2:4:2:2, and set the maximum number of iterations to MaxIter, the upper and lower bounds of the search area to Ub and Lb, and the number of parameters to be optimized to dim;
[0075] ②Use the Logistic chaotic mapping method to initialize the initial position of the population.
[0076] ③ Taking the mean-square error as the fitness function, the fitness value of each individual in the four populations is calculated and defined as fitness;
[0077] ④ The next position of the rolling dung beetle, egg-laying dung beetle, foraging dung beetle, and stealing dung beetle is obtained by calculation. If the fitness value of the new position is better than the previous position, the position is updated;
[0078] ⑤Continuously iterate step ③, continuously update the latest position of each dung beetle, and when the maximum number of iterations MaxIter is reached, stop the iteration and return the global optimal fitness value and the position of the optimal solution.
[0079] Dung Beetle Optimizer (DBO) is a new swarm intelligence optimization algorithm inspired by the dung beetle's rolling, dancing, egg-laying, foraging, and reproduction behaviors. The model is based on these five behaviors. The following are the five behavior rules:
[0080] (1) During the ball rolling process, the dung beetle will follow the celestial clues to keep the dung ball rolling in the same straight line. Therefore, in order to simulate the ball rolling behavior, the dung beetle needs to move in a given direction in the entire search space.
[0081] (2) When a dung beetle encounters an obstacle and cannot move forward, it needs to reposition itself through dancing to find a new route.
[0082] (3) In nature, dung balls are rolled to a safe place and hidden by dung beetles. In order to provide a safe environment for their spring, choosing the right oviposition site is crucial for dung beetles, so a boundary selection strategy was used to simulate the area where female dung beetles lay their eggs.
[0083] (4) When some dung beetles have grown into adults and come out from the ground to look for food, an optimal foraging area is established to guide the foraging dung beetles to simulate the foraging process.
[0084] (5) There is still a common phenomenon in nature, that is, stealing. Some dung beetles will steal dung balls from other dung beetles. The specific process of initializing the initial position of the population using the Logistic chaos mapping method in step ② is as follows:
[0085] y(k+1)=μy(k)(1-y(k))
[0086] In the formula: y(k+1) is the state value at the next moment, y(k) is the state value at the current moment, and μ is the control parameter. The y(k) value is randomly generated. When 3.57<μ≤4, it is in a completely chaotic state. In this interval, the motion trajectory shows chaotic characteristics. When selecting parameters, let μ=4.
[0087] When the ball-rolling dung beetle performs the ball-rolling behavior, it will determine whether to perform the ball-rolling behavior or the dancing behavior based on the random value r, which is defined as follows:
[0088]
[0089] Where: When r < 0.9, the rolling ball behavior is selected, x i (t+1), x i (t), x i (t-1) is the position of the i-th dung beetle at iterations t+1, t, and t-1; k∈(0,0.2] represents the deflection coefficient; b∈(0,1) is a natural coefficient; Δx represents the degree of change in light intensity; X w is the global worst position; α is set to 1 or -1, when α = 1 it means that the natural environment does not affect the original moving direction of the dung beetle, and α = -1 means that the dung beetle deviates from the original direction.
[0090] If r ≥ 0.9, it means that the dung beetle has encountered an obstacle and cannot move forward. At this time, the dung beetle will use dancing behavior to locate itself, reselect the direction of advance, obtain a new route, and use the sine function to obtain a new rolling direction, the deflection angle When θ is equal to 0, π, or 2π, the dung beetle does not change its position.
[0091] When the dung ball is rolled back home, it is crucial for dung beetles to choose a suitable oviposition area in order to provide a safe environment for their offspring. A boundary selection strategy is used to simulate the area where female dung beetles lay eggs, which is defined as follows:
[0092]
[0093] Where: Lb * , Ub * are the lower and upper limits of the spawning area respectively; Lb, Ub are the lower and upper limits of the search space respectively, X * represents the current local optimal position; R is the inertia weight, and its expression is T max The maximum number of iterations of the algorithm. Through continuous iterations, the scope of the spawning area is constantly changing to avoid the algorithm falling into a local optimal position.
[0094] Once the egg-laying area is determined, the female dung beetle will lay eggs in the area. Each female dung beetle lays one egg per iteration, and the position of the dung ball for hatching eggs is dynamic during the iteration process and is defined as follows:
[0095] B i (t+1)=X * +b1×(B i (t)-Lb * )+b2×(B i (t)-Ub * )
[0096] Where b1 and b2 represent two independent random vectors of size 1*D, D represents the dimension of the optimization problem, and the position of the incubation fecal ball is strictly limited to the egg-laying area.
[0097] When the baby dung beetles hatch successfully, they will run out to forage for food, so establish the best foraging area, which is defined as follows:
[0098]
[0099] Where: X b represents the global best position; Lb b , Ub b It represents the lower and upper limits of the optimal foraging area. Therefore, the dung beetle forages in this area, which is defined as follows:
[0100] xi (t+1)=x i (t)+C1×(x i (t)-Lb b )+C2×(x i (t)-Ub b )
[0101] Where: x i (t+1) is the position of the i-th dung beetle at the tth iteration; C1 represents a random number that obeys a normal distribution; C2 represents a random vector belonging to (0, 1).
[0102] There are also thieves in the dung beetle population; thieves steal dung balls from other dung beetles for their own use, and are defined as follows:
[0103] x i (t+1)=X b +S×g×(|x i (t)-X * |+|x i (t)-X b |)
[0104] Where: x i (t+1) is the position of the i-th thieving dung beetle at the t+1 iteration; g is a random vector of size 1×D that follows a normal distribution; S represents a constant and is assigned a value of 0.5 in the code.
[0105] Step 4: Divide the normalized data obtained in step 1 into time series, and then divide the training set and test set into a ratio of 9:1. Input the data into the power prediction model in small batches, and perform parallel training of the CNN multi-head attention mechanism model and the LSTM multi-head attention mechanism model.
[0106] Step 5: Real-time prediction of power generation for a preset time period in the future.
[0107] The screened real-time influencing factors are input into the power prediction model. The power prediction model outputs the predicted power generation. The power dispatching system can dispatch the working status of other power generation equipment in real time according to the predicted power generation to achieve stable power supply.
[0108] This embodiment uses an improved dung beetle optimization algorithm to implement parallel training of the CNN multi-head attention mechanism model and the LSTM multi-head attention mechanism model. Specifically, the present invention runs the CNN and LSTM branches in parallel during the training process, and effectively integrates the feature representations learned by the two by combining the multi-head attention mechanism. This realizes the mutual improvement of CNN and LSTM in the expression level: CNN is good at extracting spatial features, and LSTM is good at capturing the laws of time evolution; through parallel training, the two can influence each other in the direction of learning optimization, and give full play to the advantages of their respective network structures in spatiotemporal information extraction. At the same time, the improved dung beetle optimization algorithm can automatically search for the global optimal solution of the hidden layer hyperparameters during the training process, greatly improving the model parameter adjustment efficiency. Combining the above technologies, the present invention not only successfully combines the advantages of CNN and LSTM in spatiotemporal learning, but also improves the robustness and accuracy of the model. Compared with a single sequence model, this parallel structure model better captures the deep spatiotemporal correlation laws in the input sequence. Through this improvement, the model of the present invention has been significantly improved in both learning expression ability and learning efficiency, providing a better solution for related applications.
[0109] Comparative Example 1
[0110] A photovoltaic power generation prediction method, the difference between this comparative example and Example 1 is that: the power prediction model adopts DBO-CNN-Multi-Head-Attention. The structure of DBO-CNN-Multi-Head-Attention is: the optimal hyperparameters such as hidden units, regularization, and minimum training batches of the CNN model are found through the DBO algorithm, and the parameters of the model initialization with the most optimal hyperparameters are combined with the multi-head attention mechanism for training and prediction results.
[0111] Comparative Example 2
[0112] A photovoltaic power generation prediction method, the difference between this comparative example and Example 1 is that: the power prediction model adopts Lojistic-DBO-CNN-Multi-Head-Attention. The structure of Lojistic-DBO-CNN-Multi-Head-Attention is: through Lojistic chaotic mapping, the population generation distribution of the DBO algorithm is more uniform during the population initialization process, which is more conducive to the later search for the global optimal hyperparameters; find the optimal hyperparameters such as CNN model hidden units, regularization, minimum training batches, etc., and replace the parameters of the model initialization with the most hyperparameters with multi-head attention mechanism for training and prediction results.
[0113] Comparative Example 3
[0114] A photovoltaic power generation prediction method, the difference between this comparative example and Example 1 is that: the power prediction model adopts DBO-LSTM-Multi-Head-Attention. The structure of DBO-LSTM-Multi-Head-Attention is: the optimal hyperparameters such as LSTM model hidden units, regularization, and minimum training batch are found through the DBO algorithm, and the parameters of the model initialization with the most optimal hyperparameters are combined with the multi-head attention mechanism for training and prediction results
[0115] Comparative Example 4
[0116] A photovoltaic power generation prediction method, the difference between this comparative example and Example 1 is that: the power prediction model adopts Lojistic-DBO-LSTM-Multi-Head-Attention. The structure of Lojistic-DBO-LSTM-Multi-Head-Attention is: through Lojistic chaotic mapping, the population generation distribution of the DBO algorithm is more uniform during the population initialization process, which is more conducive to the later search for the global optimal hyperparameters; find the optimal hyperparameters such as LSTM model hidden units, regularization, minimum training batches, etc., and replace the parameters of the model initialization with the most hyperparameters with multi-head attention mechanism for training and prediction results.
[0117] Comparative Example 5
[0118] A photovoltaic power generation prediction method, the difference between this comparative example and embodiment 1 is that: the power prediction model adopts Lojistic-DBO-CNN-LSTM-Multi-Head-Attention (serial). The structure of Lojistic-DBO-CNN-LSTM-Multi-Head-Attention (serial) is: through Lojistic chaotic mapping, the population generation distribution of the DBO algorithm is more uniform during the population initialization process, which is more conducive to the later search for the global optimal hyperparameter; find the optimal hyperparameters such as LSTM, CNN model hidden units, regularization, minimum training batch, etc., and replace the parameters of model initialization with the most optimal hyperparameters; during the training process, the data is first input into the CNN model for training, and then after the CNN model is trained, the output of the CNN is used as the input of the LSTM, and the training is continued in the LSTM, and the output of the LSTM is used as the input of the multi-head attention mechanism, and weighted summation is performed in the multi-head attention mechanism; finally, the output of the multi-head attention mechanism is used as the input of the fully connected layer for the final training and output of the prediction result.
[0119] The comparison between the prediction results of the DBO algorithm and the DBO algorithm optimized by Lojistic chaotic mapping in the basic models CNN-Multi-Head-Attention and LSTM-Multi-Head-Attention and the true values is shown in the figure below. Figure 5 , Figure 6 shown; from Figure 5 , Figure 6 It can be seen that in the two basic models, the prediction result curve obtained by the DBO algorithm using the Lojistic chaotic map to initialize the population has a higher degree of fit with the true value curve, which proves that the DBO algorithm optimized by the Lojistic chaotic map initialization population improves the prediction accuracy of the model.
[0120] The above comparative experiments show that the Lojistic chaotic mapping optimization DBO algorithm is effective. This paper will use the optimization algorithm as the basic algorithm to conduct a comparative experiment on the serial training and parallel training of the CNN and LSTM models. Figure 7 In the figure, we can see intuitively that both training methods can predict the changing trend of photovoltaic power generation, but the prediction result curve obtained by training the CNN and LSTM models in parallel has a higher degree of fit with the true value curve, which proves that the parallel training method improves the prediction accuracy of the model compared with the serial training of the two models.
[0121] The comparison of model evaluation parameters between Example 1 and Comparative Examples 1-5 is shown in Table 1 below.
[0122]
[0123]
[0124] As can be seen from Table 1, the Lojistic chaotic map initialization population optimization DBO algorithm has a certain improvement in the CNN-Multi-Head-Attention and LSTM-Multi-Head-Attention basic models, with an increase of 1 percentage point and nearly 2 percentage points in the R2 index respectively. The R2 of the parallel training mode is 0.9737, which is significantly improved compared with the other models. The larger the R2 value, the better, and the smaller the MSE, MAE and RMSE values, the better.
Claims
1. A photovoltaic power generation prediction method based on a hybrid model of time-space coordination, characterized by: The following steps are involved: Step 1: Construct a data set; the data set contains multiple influencing factors of photovoltaic power stations and their corresponding time series data of power generation; the influencing factors are selected from rainfall, wind direction, diffuse horizontal irradiance, global horizontal irradiance, humidity, temperature, wind speed and current; the selection process is: the Pearson correlation coefficient method is used to select data with high correlation with power generation as influencing factors; Step 2: Construct a power prediction model; The power prediction model includes a CNN multi-head attention mechanism module, an LSTM multi-head attention mechanism module, a combination module and a fully connected layer; the LSTM multi-head attention mechanism module includes a long short-term memory network and a first multi-head attention mechanism layer; the CNN multi-head attention mechanism module includes a convolutional neural network and a second multi-head attention mechanism layer; the first multi-head attention mechanism layer, the second multi-head attention mechanism layer and the combination module all adopt a multi-head attention mechanism structure; The features output by the long short-term memory network are transmitted as input to the first multi-head attention mechanism layer; the features output by the convolutional neural network are transmitted as input to the second multi-head attention mechanism layer; the output vector C1 of the first multi-head attention mechanism layer and the output vector C2 of the second multi-head attention mechanism layer are jointly input into the combination module for fusion; The resulting fusion vector is input to the fully connected layer; the fully connected layer outputs the prediction result; Step 3: Set the hyperparameters of the long short-term memory network and the convolutional neural network; use the dung beetle optimization algorithm to find the global optimal hyperparameters of the long short-term memory network and the convolutional neural network, and assign the obtained global optimal hyperparameters of the long short-term memory network and the convolutional neural network to the long short-term memory network and the convolutional neural network respectively; the initial position of the population in the dung beetle optimization algorithm is determined by the Logistic chaos mapping method; the mean square error is used as the fitness function in the dung beetle optimization algorithm; Step 4: Build a training set based on the data set, and use the training set to train the CNN multi-head attention mechanism model and the LSTM multi-head attention mechanism model in parallel; Step 5: Use the trained power prediction model to predict the power generation of the photovoltaic power station.
2. The photovoltaic power generation prediction method based on a hybrid model of time-space coordination according to claim 1 is characterized by: The data constructed in step 1 are processed by missing value filling, outlier replacement and normalization.
3. The photovoltaic power generation prediction method based on a hybrid model of time-space coordination according to claim 1 is characterized by: Multiple sets of parameter matrices W are defined in the multi-head attention mechanism structure i Q , W i K , W i V , where the parameter matrix of each group is different, and the input features are multiplied by the parameter matrix to obtain multiple groups of query vectors Q i , key vector K i , value vector V i ; Based on the query vector Q i , key vector K i , value vector V i Calculate multiple attention outputs; perform weighted summation of each attention output to obtain the output of the multi-head attention mechanism structure.
4. The photovoltaic power generation prediction method based on a hybrid model of time-space coordination according to claim 1 is characterized by: In the convolutional neural network, a convolution kernel is applied to each position on an input sequence; a sliding window starts from the beginning of the input sequence and moves step by step, each time with a step size; at each position of the sliding window, the convolution kernel is element-by-element multiplied with the corresponding element in the input sequence, and then the product results are summed; this summation result is the value of the corresponding position of the output sequence of the convolution operation; the sliding window continues until the sliding window traverses the entire input sequence.
5. A computer device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the memory stores the computer program; characterized in that: The processor executes the photovoltaic power generation prediction method based on a hybrid model of time-space coordination as described in any one of claims 1-4.
6. A readable storage medium storing a computer program; characterized in that: When the computer program is executed by a processor, it is used to implement the photovoltaic power generation power prediction method based on a hybrid model of time-space coordination as described in any one of claims 1 to 4.
