Medium-term photovoltaic power generation power prediction method, electronic equipment and medium

By combining the CNN-BiLSTM-Attention model with the improved IAOA algorithm, the problems of insufficient local feature extraction and model generalization ability in medium-term photovoltaic power generation prediction are solved, and high-precision medium-term photovoltaic power generation prediction is achieved.

CN120601384APending Publication Date: 2025-09-05ACREL CO LTD +2
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510536091.9
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-27
Publication Date
2025-09-05

AI Technical Summary

Technical Problem

Existing technologies have difficulty in achieving high-precision prediction of medium-term photovoltaic power generation, especially due to problems such as insufficient local feature extraction, weak model generalization ability and improper hyperparameter optimization.

Method used

The CNN-BiLSTM-Attention model is combined with the improved IAOA algorithm. The convolutional neural network is used to extract the local features of the time series of photovoltaic power generation. BiLSTM deeply extracts time features in the forward and reverse directions, and uses the Attention mechanism to weight the importance. The IAOA algorithm optimizes the hyperparameters to build a medium-term photovoltaic power prediction model.

Benefits of technology

The accuracy and stability of medium-term photovoltaic power generation forecasting are improved, resource waste is reduced, premature convergence problems are avoided, and the global and local search performance of the model are improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120601384A_ABST
    Figure CN120601384A_ABST
Patent Text Reader

Abstract

The invention relates to a medium-term photovoltaic power generation power prediction method, electronic equipment and a medium, and the method comprises the steps: obtaining a data set in a period of time, the data set comprising influence factor data and photovoltaic power generation power data, and dividing the data set into a training set and a test set; inputting the training set to construct a CNN-BiLSTM-Attention model for training, wherein the CNN model performs feature extraction and dimension reduction on the data; feature information extracted by the CNN model is input into the BiLSTM to extract deep time features of photovoltaic power, an Attention mechanism performs importance degree distinguishing on time information extracted by a hidden layer of the BiLSTM in a weighting mode, and deep time sequence features of response data are mined; an optimal hyper-parameter of the CNN-BiLSTM-Attention model is selected by using an IAOA algorithm, and an IAOA-CNN-BiLSTM-Attention model is constructed by using the optimal hyper-parameter to serve as a mid-term photovoltaic power prediction model; and inputting the test set into the mid-term photovoltaic power prediction model, and outputting a mid-term photovoltaic power prediction result. Compared with the prior art, the method has the advantages of realizing accurate prediction of the photovoltaic power generation power in the middle stage and the like.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of power dispatching and energy management, and in particular to a method, electronic equipment and medium for predicting mid-term photovoltaic power generation. Background Art

[0002] As global challenges such as energy shortages, climate change, and environmental pollution continue to intensify, the importance of renewable energy is becoming increasingly prominent. Against this backdrop, photovoltaic power generation technology and its commercial applications have rapidly developed. Accurately predicting photovoltaic output power is a core component of photovoltaic power generation technology, essential for both the rational distribution of power loads within power systems and the efficient utilization of power resources.

[0003] Currently, photovoltaic power prediction methods fall into two main categories. One relies on meteorological data and actual photovoltaic power generation data, taking into account the specific location of the photovoltaic power station to establish a prediction model. The other directly uses historical photovoltaic output data and employs artificial intelligence algorithms to establish a functional relationship between input and output variables. This method requires high-quality historical data. Key methods include BP neural networks, extreme learning machines, and support vector machines, but all of these models suffer from low prediction accuracy.

[0004] After searching, I found that Chinese invention patent application publication number CN117892197A proposes a photovoltaic power prediction model using a COA-optimized LSTM. However, this model is relatively weak in extracting local features. Furthermore, the LSTM model is unidirectional and can only capture past information, making less comprehensive use of temporal information than the BilSTM. This existing patent application is only suitable for short-term photovoltaic power prediction, not for medium-term prediction.

[0005] After searching, Chinese invention patent application publication number CN119401402A discloses an ISSA-BilSTM-Attention photovoltaic prediction model. This model predicts photovoltaic power generation by capturing the temporal characteristics and historical information of input data. It also calculates the mean squared error between the predicted and true values ​​to continuously fit the predicted values. Through model self-learning, the accuracy of the model's short-term photovoltaic power predictions is further improved. However, this existing patent application suffers from an inability to extract nonlinear local features and a weak model generalization capability, making it unsuitable for medium-term photovoltaic power forecasting.

[0006] How to achieve high-precision prediction of medium-term photovoltaic power generation has become a technical problem that needs to be solved. Summary of the Invention

[0007] The purpose of the present invention is to overcome the defects of the above-mentioned prior art and provide a method, electronic equipment and medium for predicting medium-term photovoltaic power generation.

[0008] The purpose of the present invention can be achieved by the following technical solutions:

[0009] According to one aspect of the present invention, a method for predicting mid-term photovoltaic power generation is provided.

[0010] A method for predicting mid-term photovoltaic power generation, characterized in that the method comprises:

[0011] Acquire a data set within a period of time, the data set including influencing factor data and photovoltaic power generation data, and divide the data set into a training set and a test set;

[0012] The training set is input into a CNN-BiLSTM-Attention model for training. The CNN model extracts features and reduces the dimensionality of the data. The feature information extracted by the CNN model is input into the BiLSTM, which extracts deep temporal features of photovoltaic power in both forward and reverse directions. The Attention mechanism is used to distinguish the importance of the time information extracted by the BiLSTM hidden layer in a weighted manner, thereby mining the deep temporal features of the response data.

[0013] The IAOA algorithm was used to select the optimal hyperparameters of the CNN-BiLSTM-Attention model, and the IAOA-CNN-BiLSTM-Attention model was constructed using the optimal hyperparameters as a medium-term photovoltaic power prediction model.

[0014] The test set data is input into the medium-term photovoltaic power prediction model, and the medium-term photovoltaic power prediction results are output.

[0015] Preferably, the process of the CNN model performing feature extraction and dimensionality reduction on the data includes: the training set data enters the convolution layer of the CNN model, the convolution layer extracts features from the data and processes the data with a nonlinear activation function, and then passes it to the pooling layer, the pooling layer reduces the dimensionality of the feature data extracted for the first time, and finally the fully connected layer integrates the features extracted by the convolution layer and the pooling layer and outputs them.

[0016] Preferably, the Attention mechanism uses the influence of different features of the influencing factor data on the photovoltaic power generation prediction results as the basis for assigning weights to the hidden units of the neural network, and optimizes the weights of the BiLSTM hidden layer, specifically:

[0017] e i =tanh(W·h i +b)

[0018]

[0019]

[0020] Where W and b are weight and threshold respectively; h i The hidden layer unit state value output by CNN is used to obtain the score e of each hidden unit state value. i , and then normalize the score, and finally e i and h i Perform weighted summation to obtain the hidden layer state value c t , T is the length of the input sequence.

[0021] Preferably, the IAOA algorithm is an algorithm that improves the AOA algorithm by using a Sin chaos reverse learning strategy and an adaptive t distribution.

[0022] More preferably, the Sin chaos reverse learning strategy includes:

[0023] Firstly, the Sin chaotic map is used to form a diverse initial solution population;

[0024] Secondly, a reverse learning strategy is used on the initial solution population to form a new reverse solution population;

[0025] Finally, the fitness values ​​of the initial solution population and the reverse solution population are calculated, and the best ones are retained as the new population.

[0026] More preferably, the position of the individual in the AOA algorithm is updated using the adaptive t distribution, as follows:

[0027]

[0028] in, is the position of the i-th individual after updating using the adaptive t distribution; t(k) is the adaptive t distribution function; x i is the position of the i-th individual.

[0029] Preferably, the optimal hyperparameters of the CNN-BiLSTM-Attention model include the number of convolution kernels, the number of BiLSTM hidden layer neurons, the number of fully connected hidden layer neurons, the dropout layer, the batch size and the learning rate.

[0030] Preferably, the initialization parameters of the IAOA algorithm include search interval, number of iterations and population size;

[0031] The fitness function of the IAOA algorithm selects the mean square error between the predicted value and the true value of the training set.

[0032] According to another aspect of the present invention, an electronic device is provided, comprising a memory and a processor, wherein a computer program is stored in the memory, and the method described above is implemented when the processor executes the program.

[0033] According to a third aspect of the present invention, a computer-readable storage medium is provided, on which a computer program is stored, and when the program is executed by a processor, the method described above is implemented.

[0034] Compared with the prior art, the present invention has the following beneficial effects:

[0035] 1) The present invention uses a CNN model to extract features and reduce the dimensionality of the acquired influencing factor data and photovoltaic power generation data; the feature information extracted by the CNN model is input into BiLSTM, and the deep temporal features of the photovoltaic power are deeply extracted in both positive and negative directions. The Attention mechanism distinguishes the importance of the time information extracted by the BiLSTM hidden layer in a weighted manner. Finally, the IAOA algorithm is used to select the optimal hyperparameters of CNN and BiLSTM, and the IAOA-CNN-BiLSTM-Attention model is constructed using the optimal hyperparameters as a medium-term photovoltaic power prediction model to achieve medium-term photovoltaic power prediction.

[0036] 2) The present invention uses Attention to take the influence of different features of influencing factor data on the photovoltaic power generation prediction results as the basis for assigning weights to the hidden units of the neural network, so that factors that have a prominent impact on the prediction results receive higher attention, which can help improve the prediction accuracy of the model and provide a basis for subsequent data processing, greatly reducing the waste of resources.

[0037] 3) The present invention integrates the Sin chaos reverse learning strategy and the adaptive t-distribution into the AOA algorithm to form the IAOA algorithm, which compensates for the premature convergence problem of the AOA that may be caused by the rapid convergence of buoyancy. The addition of the t-distribution is essentially to add a disturbance after the AOA position update, avoiding falling into the local optimum, and significantly improving the global search performance and local search performance. The resulting optimal hyperparameters help improve prediction accuracy and efficiency. BRIEF DESCRIPTION OF THE DRAWINGS

[0038] Figure 1 Schematic diagram of the prediction method of the present invention;

[0039] Figure 2 This is a comparison chart of LSTM prediction results and actual values ​​in an embodiment of the present invention;

[0040] Figure 3 This is a comparison chart of the BiLSTM prediction results and actual values ​​in an embodiment of the present invention;

[0041] Figure 4 This is a comparison chart of the CNN-BiLSTM prediction results and actual values ​​in an embodiment of the present invention;

[0042] Figure 5 This is a comparison chart of the CNN-BiLSTM-Attention prediction results and actual values ​​in an embodiment of the present invention;

[0043] Figure 6 This is a comparison chart of the AOA-CNN-BiLSTM-Attention prediction results and actual values ​​in an embodiment of the present invention;

[0044] Figure 7 This is a comparison chart of the IAOA-CNN-BiLSTM-Attention prediction results and actual values ​​in an embodiment of the present invention;

[0045] Figure 8 This is a structural diagram of the CNN-BiLSTM-Attention model in the present invention. DETAILED DESCRIPTION

[0046] The following will clearly and completely describe the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present invention, not all of them. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative efforts should fall within the scope of protection of the present invention.

[0047] To address the impact of nonlinearity, randomness, instability, and complex spatiotemporal characteristics on photovoltaic power time series, a prediction model based on IAOA-CNN-BiLSTM-Attention was proposed. The convolutional neural network (CNN) effectively extracts local features of photovoltaic power time series, while the BiLSTM simultaneously extracts deep temporal features of photovoltaic power data in both forward and reverse directions. Attention weights the temporal information extracted by the BiLSTM hidden layer to prioritize its importance. The IAOA (Improved Archimedean Algorithm) optimization algorithm ensures optimal hyperparameters for both the CNN and BiLSTM.

[0048] Example 1

[0049] This embodiment relates to a method for predicting mid-term photovoltaic power generation. The method is based on the IAOA-CNN-BiLSTM-Attention prediction model. In view of the fact that there are many factors affecting mid-term photovoltaic power generation, the IAOA-CNN-BilSTM-Attention prediction model is constructed. Figure 8This model uses CNN to extract and reduce data dimensionality, integrating the extracted local information to lay the foundation for further extracting deep temporal features using BiLSTM. To address the problem of BiLSTM's output layer data being prone to generalization, an attention mechanism is introduced in the BiLSTM's hidden layer to further learn the temporal variation patterns of photovoltaic power generation. To address the hyperparameter blindness of the CNN-BiLSTM-Attention model, an improved IAOA algorithm is used to optimize the hyperparameters of the CNN-BiLSTM-Attention model and establish an optimal medium-term photovoltaic power generation prediction model. The constructed IAOA-CNN-BiLSTM-Attention model exhibits excellent stability and improves prediction accuracy.

[0050] A method for predicting mid-term photovoltaic power generation, such as Figure 1 , including the following steps:

[0051] S1, obtains a data set within a period of time, including influencing factor data (i.e., meteorological data) and photovoltaic power generation data, and normalizes them uniformly to avoid unnecessary errors and increase the running speed of the model.

[0052] S2 initializes model parameters, divides the dataset into training and test sets, and uses the training sample data as the target variable (model output) and covariate (model input). Machine learning then performs feature changes. The BiLSTM model parameters are: 2 layers, dropout = 0.5, hidden-size = 400, and input size = 64. For the CNN model, the hidden layer nodes are: channels = 3, stride = 1, padding = 1, and the activation function is ReLU.

[0053] In step S3, the CNN model extracts features and reduces the dimensionality of the data. The partitioned dataset is fed into the convolutional neural network and then into its convolutional layer. The neurons in the convolutional layer extract features from the data. The data extracted by the convolutional layer is processed through an activation function and passed to the pooling layer. The neurons in the pooling layer extract local features from the initially extracted feature data, simplify the data, and use sampling from each neuron to perform hierarchical extraction of the input data. Finally, the extracted local information is integrated.

[0054] S4 introduces the Attention mechanism. The information extracted by CNN is passed into BiLSTM as a new input variable. Then, through the forward and backpropagation of deep learning, the Attention mechanism is used to calculate the weights of the BiLSTM hidden layer. The time information extracted by the BiLSTM hidden layer is distinguished by importance in a weighted manner to mine the deep temporal characteristics of the response data.

[0055] S5, build the CNN-BiLSTM-Attention model, use the IAOA algorithm to initialize the IAOA parameters, set the search interval, number of iterations, population size and other parameters of the IAOA algorithm, and select the mean square error between the predicted value and the true value of the training set as the fitness function.

[0056] S6, the IAOA (Improved Archimedes) algorithm is used to select the optimal parameters of CNN-BiLSTM-Attention for medium-term photovoltaic power prediction, which are the number of convolution kernels, the number of BiLSTM hidden layer neurons, the number of fully connected hidden layer neurons, the dropout layer, the batch size, and the learning rate.

[0057] S7, select IOA to complete the maximum number of iterations, obtain the optimal parameters of CNN-BiLSTM-Attention, and build the medium-term photovoltaic power prediction model of IOA-CNN-BiLSTM-Attention, as shown in Figure 8 , including input layer, CNN layer, BiLSTM layer, Attention layer and output layer.

[0058] S8, input the test set data into the medium-term photovoltaic power prediction model, output the prediction result, and perform denormalization processing to obtain the power prediction value.

[0059] S9, with the help of evaluation indicators RMSE, MAE and R 2 Performance of the model.

[0060]

[0061] Where, is the predicted value; Y is the actual value; s is the number of test samples.

[0062] In S3, CNN convolutional neural network is a deep learning neural network model that has the ability to automatically extract layers when processing large amounts of data information. By reducing the parameters of the neural network through the convolution kernel, it can effectively prevent the model from overfitting and improve the calculation speed of the network model.

[0063] The convolution operation is similar to a two-dimensional weighted array. The input data is sliced ​​and diced using the same step length, then multiplied and summed. This is then nonlinearly combined using a nonlinear activation function and used as the input for the pooling layer. The pooling layer then reduces the dimensionality of the features, retrieving the input data according to a specific pooling window size, extracting important features and reducing network parameters. The fully connected layer is primarily responsible for integrating the features derived from the convolutional and pooling layers and connecting them to the output layer. By stacking and adding nonlinear activation functions to multiple neurons in the fully connected layer, the nonlinear fitting capabilities of convolutional neural networks can be improved.

[0064] In S4, the Long-Short Term Memory (LSTM) network is a special feedback neural network. Its neurons are based on special hidden layer units with accumulation functions and gating mechanisms. In the next moment, they generate a weight based on the information transmitted in the previous step and connect it to themselves to replicate the true value of their own state and accumulate external input signals. It is suitable for processing deep learning problems related to large amounts of time series data.

[0065] LSTM consists of an input layer, a hidden layer, and an output layer. It uses a gating mechanism to selectively control information, more realistically representing and simulating internal characteristic patterns. It combines required long-term and short-term memory information to form new neural units, controlling the transmission of network information. The gating mechanism consists of a forget gate, an input gate, and an output gate, corresponding to the forgetting, selective memory, and output processes, respectively.

[0066] The forget gate discards unnecessary information from the previous unit, the input gate controls the storage of long-term and short-term information, and the output gate controls the final output of the input gate information. The specific formula is:

[0067] f t =σ(W f ·[h t-1 ,x t ]+b f )

[0068] c′ t-1 =f t c t-1

[0069] Where x t is the input value at time t (the time series feature sequence extracted by CNN, representing the dynamic changes of historical meteorological and photovoltaic data); h t-1 is the hidden state that stores short-term information at time t-1; σ is the sigmoid function; W f is the weight; f t c t-1 The forgetting coefficient, f t = 0, completely forget c t-1 Information, ft = 1, the cell state c at the previous moment is completely retained t-1 Information; c' t-1 The unit state that retains information at the previous moment; b f is the threshold.

[0070] i t =σ(W i ·[h t-1 ,x t ]+b i )

[0071]

[0072]

[0073] Where i t is x t and h t-1 Update c t The degree coefficient of For the selected update content; c t is the superposition information processed by the forget gate and the input gate; W i and W c are weights; b i and b c Both are thresholds.

[0074] o t =σ(W o ·[h t-1 ,x t ]+b o )

[0075] h t =o t tanh(c t )

[0076] y=σ(W y ·h t +b y )

[0077] In the formula, o t is x t and h t-1 For h t The influence coefficient of h t is the output of the hidden layer unit; y is the predicted output value, that is, the implicit state sequence, which encodes the bidirectional temporal dependency relationship between historical meteorological data and photovoltaic power generation data; W o is the weight; b o is the threshold.

[0078] In S5 and S6, the attention mechanism originates from the signal processing mechanism of human vision. When humans focus the majority of their attention on key image regions, they automatically block out other visible information. Based on the principles of the attention mechanism, numerous researchers have applied it to various industries. The attention mechanism uses the influence of different meteorological data features on photovoltaic power generation forecasts as the basis for assigning weights to hidden units in the neural network. This gives greater attention to factors that have a significant impact on the forecast, providing a basis for subsequent data processing, significantly reducing resource waste, and helping to improve the model's forecast accuracy.

[0079] e i =tanh(W·h i +b)

[0080]

[0081] Where W and b are weight and threshold respectively; h i The hidden layer unit state value output by CNN is used to obtain the score e of each hidden unit state value. i , and then normalize the score of the attention mechanism, and finally e i and h i Perform weighted summation to obtain the hidden layer state value c t , T is the length of the input sequence. The hidden layer state value c t This context vector, or context vector, weights and integrates information from key time steps, guiding the model to focus on time periods that have a significant impact on the predicted target (mid-term power generation). For example, if the model detects a sudden increase in sunlight and moderate temperature on a particular day, the attention weight will amplify the impact of that time step, thereby correcting the predicted value.

[0082] In S6-S7, the Improved Archimedean Algorithm (IAOA) is an optimization algorithm inspired by Archimedes' theorem. Its core principle is that when an object is fully or partially immersed in a fluid, the buoyancy exerted by the fluid on the object is proportional to the mass (volume) of the displaced liquid: if the buoyancy on the object is equal to the mass of the displaced liquid, the object is in equilibrium. The specific principle is expressed as follows. Suppose that many objects are immersed in the same fluid. Each object attempts to reach equilibrium. The immersed objects have completely different densities p and volumes v, and therefore have different accelerations a.

[0083]

[0084] Where: b is the fluid; o represents the individual object; p b 、v b and a b are the density, volume and acceleration of the fluid respectively; po 、v o and a o are the density, volume and acceleration of the object respectively. b W is the buoyancy exerted by the fluid on the object; o The mass of the discharged liquid.

[0085] According to the above formula, the acceleration a0 of the object can be calculated as shown below:

[0086]

[0087] If object o collides with another object r at a closer distance, causing its own equilibrium state to be affected by r, then the equilibrium state of object o is:

[0088]

[0089] Among them, W b 、W o , and W r are the mass of the discharged liquid, object o and object r respectively; p o 、v o and a o are the density, volume and acceleration of object o respectively; p r 、v r and a r are the density, volume and acceleration of object r respectively; p b 、v b and a b are the density, volume and acceleration of the fluid respectively.

[0090] Similar to other heuristic algorithms, AOA initially randomly initializes the density, volume, and acceleration of objects. After calculating the fitness of each individual in the initial population, AOA iteratively updates their positions until a predetermined number of iterations are met. In each iteration, AOA selects a position update method based on whether the individual has collided with other individuals and updates its own attributes. These updated attributes determine the new positions of the next generation of individuals.

[0091] During the initialization phase, AOA will randomly initialize the volume (vol), density (den), and acceleration (acc) of each object. During this process, AOA will evaluate the initial population and select the current optimal individual (x best ), the density of the optimal individual (den best ), volume (vol best ), acceleration (acc best ) is used to update the density, volume, and acceleration of other individuals. The formula for updating the density and volume of individuals is as follows:

[0092]

[0093] Where: and is the density of the i-th individual in generation t and generation t+1; and is the volume of the i-th individual in generation t and generation t+1; rand is a random number between (0,1).

[0094] Depending on whether an individual has collided, AOA will perform different search phases: global search phase and local search phase. If no collision occurs, AOA performs a global search; otherwise, it performs a local search. The decision of which search phase to enter depends on the value of the transfer factor (TF). The calculation formula of TF is as follows:

[0095] TF=exp((tt max ) / t max )

[0096] Where: t is the current iteration number; t max is the maximum number of iterations.

[0097] When TF≤0.5, AOA enters global search mode, and the update formula of individual acceleration is as follows:

[0098]

[0099] Where: are the acceleration, density and volume of the i-th individual in the t+1 iteration; acc mr 、den mr and vol mr are the acceleration, density, and volume of a randomly selected individual in the current iteration.

[0100] When TF>0.5, AOA enters local search mode. The individual acceleration calculation formula is as follows:

[0101]

[0102] In order to make the individual position update step size more standardized, AOA needs to normalize the individual acceleration. The specific normalization formula is shown below:

[0103]

[0104] Where: is the normalization operation of the acceleration of the i-th individual in the t+1-th iteration; u and l are the ranges used to adjust the normalization value; min(acc) and max(acc) are the minimum and maximum acceleration values, respectively.

[0105] In the global search phase, the individual position update formula is as follows:

[0106]

[0107] Where: and is the position of the i-th individual in generation t+1 and generation t; x rand is the individual position randomly selected in the current iteration; rand is a random number between (0, 1); C1 is a constant, d is the density factor, and the update formula of d in the t+1 generation is shown in formula (21):

[0108] d t+1 =exp[((t max -t) / t max )-(t / t max )]

[0109] Among them, t max is the maximum number of iterations, and t is the current number of iterations.

[0110] During the local search phase, the AOA individual position is updated according to the following formula:

[0111]

[0112] Where: C2 is a constant; F is a parameter that determines the direction of the iterative position update. The specific expression of F is:

[0113]

[0114] Where: P = 2rand-C4, C4 is a constant; T = C3×TF, and T∈[0.3C3, 1], C3 is a constant, and TF is the value of the migration operator.

[0115] The Sin chaos reverse learning strategy and adaptive t distribution are used to improve the AOA algorithm to form the IAOA algorithm, as follows:

[0116] (1) Sin Chaos Reverse Learning Strategy

[0117] The specific Sin chaos reverse learning strategy is: the diversity of population initialization prevents some particles from gathering in a certain local range, which expands the contraction range of the algorithm to a certain extent. The sequence generated by the Sin chaos map can traverse various values ​​within the interval range and is easy to implement. The reverse learning strategy is the most common improvement strategy in the field of swarm intelligence. Its idea is to generate a reverse solution based on the current solution, compare the fitness values ​​of the current solution and the reverse solution, and select the best one to enter the next generation. The two strategies are simultaneously integrated into the Archimedean algorithm. First, the Sin chaos map is used to form an initial solution with better population diversity; secondly, the reverse learning strategy is used on the initial solution population to form a new reverse solution population; finally, the fitness value of the initial solution population and the fitness value of the reverse solution population are calculated, and the best one is retained as the new population. The expression of the Sin chaos one-dimensional mapping is as follows:

[0118]

[0119] Map the Sin chaotic sequence to the solution space and obtain the population X={X i ,i=1,2,…,N},X j ={X j ,j=1,2,…,dim}, the individuals in the population are represented as follows:

[0120] X i+1,j =sin(2 / X i,j )

[0121] Where, X i+1,j is the position of the i+1th individual in the jth dimension.

[0122] Calculate the reverse population of the initial solution population based on the reverse learning strategy Reverse population individuals It is expressed as follows:

[0123]

[0124] In the formula, [X minj , X maxj ] are the upper and lower bounds of the search space. The population X generated by the Sin chaotic map and the reverse population X* form a new population {X∪X *}, sort the fitness values ​​of individuals in the new population, and select the top N individuals with better fitness to form a new population.

[0125] The Sin Chaos Reverse Learning strategy, incorporated into the AOA algorithm, avoids the locality inherent in traditional random initialization. It introduces chaotic perturbations during iterations, enhancing the ability to escape local optima. This mitigates the premature convergence issue often associated with rapid buoyancy convergence in the AOA algorithm. The reverse learning strategy enhances local development efficiency and balances global and local search. Therefore, integrating the Sin Chaos Reverse Learning strategy into the AOA algorithm significantly improves search efficiency and the global optimality of the solution.

[0126] (2) Adaptive t distribution

[0127] The t distribution is short for Student distribution. The shape of the curve is determined by the value of the parameter freedom n. The probability density function is as follows:

[0128]

[0129] Where, is the Euler integral of the second kind.

[0130] When the degrees of freedom n decrease, the curve becomes flatter, with the center of the curve flatter. When the degrees of freedom n = 1, the t-distribution is a Cauchy distribution, i.e., t(n=1)→C(0,1). When the degrees of freedom n increase, the curve becomes taller, similar to the standard normal distribution. When the degrees of freedom n is infinite, the t-distribution is a Gaussian distribution, i.e., t(n=∞)→N(0,1).

[0131] The position of the AOA individual is updated using the adaptive t distribution as shown below:

[0132]

[0133] in, is the position of the i-th individual after updating using the adaptive t distribution; t(k) is the adaptive t distribution function; x i is the position of the i-th individual.

[0134] Adding a t-distribution to the AOA algorithm essentially adds a perturbation to the AOA position update. Because the t-distribution has a thicker tail than the normal distribution, it can more stably adjust the search step size in small sample sizes or high-noise scenarios, allowing individuals to escape local extremes and avoid being trapped in local optima. Furthermore, the t-distribution's similarities to the Cauchy and Gaussian distributions improve the algorithm's global and local search performance.

[0135] Sin chaos is used to initialize the characteristics of historical meteorological and power generation data, combined with reverse learning to generate symmetric meteorological scenarios, and the parameter update step of the prediction model is adjusted through t distribution to improve the robustness of medium-term photovoltaic power generation forecast; in the optimization of complex multi-peak functions (such as photovoltaic power station layout design), the IAOA algorithm can quickly converge to the global optimal solution while avoiding falling into the engineering trap of local optimality.

[0136] The prediction accuracy of the CNN-BiLSTM-Attention model is determined by hyperparameters such as the number of convolution kernels, the number of BiLSTM hidden layer neurons, the number of fully connected hidden layer neurons, the number of dropout layers, the batch size, and the learning rate. Therefore, parameter optimization is particularly important. We use an improved Archimedean algorithm to optimize these parameters to achieve optimal prediction results.

[0137] Example 2

[0138] This embodiment relates to a method for predicting medium-term photovoltaic power generation. The data set selects photovoltaic power generation data from September 24, 2024 to April 18, 2025 (total installed capacity is 300kW), with a data accuracy of 1 minute. The training data selects data from September 24, 2024 to April 11, 2025, and the test data selects data from the last seven days. The data set contains influencing factor data and photovoltaic power generation data. The data set is divided into training data and test data. The test data selects the data from the best seven days, and the rest is training data. The influencing factor data (i.e., model input) uses meteorological data collected by a small weather station, namely temperature X1, humidity X2, wind speed X3, wind force X4, wind direction X5, wind direction degree X6, atmospheric pressure X7, and irradiance X8. The model output is the predicted data of photovoltaic power generation.

[0139] To verify the effectiveness of the IAOA-CNN-BiLSTM-Attention model proposed in the present invention, BiLSTM, CNN-BiLSTM, CNN-BiLSTM-Attention, and AOA-CNN-BiLSTM-Attention were used as comparison models. The parameter settings of the CNN and BiLSTM models were consistent with the parameters set in the initialization of the IAOA-CNN-BiLSTM-Attention model of the present invention. The upper boundary of the hyperparameter settings was (128, 600, 300, 0.5, 128, 0.001), the lower boundary was (32, 100, 100, 0.1, 16, 0.0001), pop = 5, MaxLter = 50, dim = 6, where the data in the boundary respectively represent the number of convolution kernels, the number of BiLSTM hidden layer neurons, the number of fully connected hidden layer neurons, the dropout layer, the batch size, and the learning rate.

[0140] The results of the six models for medium-term (generally 3 to 15 days) photovoltaic power generation prediction are shown in the figure below: Figures 2 to 7 The evaluation index values ​​of the prediction results are shown in the following table.

[0141] Table 1 Evaluation index values ​​of prediction results of different models

[0142]

[0143]

[0144] It can be seen from the evaluation index values ​​in Table 1 that the root mean square error (RMSE), mean absolute error (MAE) and goodness of fit (R 2 ) are all reduced to a certain extent compared with the LSTM model, BiLSTM model, CNN-BiLSTM model, CNN-BiLSTM-Attention model and AOA-CNN-BiLSTM-Attention model. The smaller the error index, the better the prediction effect. And the goodness of fit (R 2 ) is the highest, where a higher degree of fit indicates a more accurate prediction result. In summary, the method of the present invention can effectively remove the randomness of the prediction, reduce the error of the predicted value, and greatly improve the accuracy of the prediction. This further proves that the IAOA-CNN-BiLSTM-Attention model has certain advantages in the field of medium-term photovoltaic power generation forecasting.

[0145] The prediction model IAOA-CNN-BiLSTM-Attention was applied to actual cases, and the prediction results and errors were compared with those of other models. The results showed that the prediction model proposed in this paper has higher accuracy and stronger stability, and can provide certain data support for power generation optimization scheduling, load management and medium- and long-term power trading.

[0146] Example 3

[0147] The electronic device of the present invention includes a central processing unit (CPU), which can perform various appropriate actions and processes according to computer program instructions stored in a read-only memory (ROM) or loaded from a storage unit into a random access memory (RAM). In the RAM, various programs and data required for device operation can also be stored. The CPU, ROM, and RAM are connected to each other via a bus. An input / output (I / O) interface is also connected to the bus.

[0148] Many components in a device are connected to the I / O interface, including: input units, such as a keyboard and mouse; output units, such as various types of displays and speakers; storage units, such as magnetic disks and optical disks; and communication units, such as network cards, modems, and wireless communication transceivers. The communication unit allows the device to exchange information / data with other devices via computer networks such as the Internet and / or various telecommunication networks.

[0149] The processing unit performs the various methods and processes described above. For example, in some embodiments, the method can be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit. In some embodiments, part or all of the computer program can be loaded and / or installed on the device via a ROM and / or a communication unit. When the computer program is loaded into RAM and executed by the CPU, one or more steps of the method described above can be performed. Alternatively, in other embodiments, the CPU can be configured to execute the method in any other appropriate manner (e.g., by means of firmware).

[0150] The functions described above herein may be performed, at least in part, by one or more hardware logic components. For example, and without limitation, exemplary types of hardware logic components that may be used include: field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chip (SOCs), complex programmable logic devices (CPLDs), and the like.

[0151] The program code for implementing the method of the present invention can be written in any combination of one or more programming languages. Such program code can be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device so that when the program code is executed by the processor or controller, the functions / operations specified in the flow chart and / or block diagram are implemented. The program code can be executed entirely on the machine, partially on the machine, as a stand-alone software package, partially on the machine and partially on a remote machine, or entirely on a remote machine or server.

[0152] In the context of the present invention, machine-readable medium can be a tangible medium that can contain or store a program for use with an instruction execution system, device or equipment or used in combination with an instruction execution system, device or equipment. Machine-readable medium can be a machine-readable signal medium or a machine-readable storage medium. Machine-readable medium can include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared or semiconductor systems, devices or equipment, or any suitable combination of the foregoing. More specific examples of machine-readable storage media can include electrical connections based on one or more lines, portable computer disks, hard disks, random access memories (RAM), read-only memories (ROM), erasable programmable read-only memories (EPROM or flash memory), optical fibers, portable compact disk read-only memories (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination of the foregoing.

[0153] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in the present invention, and such modifications or substitutions are intended to be within the scope of protection of the present invention. Therefore, the scope of protection of the present invention shall be subject to the scope of protection of the claims.

Claims

1. A method for predicting mid-term photovoltaic power generation, characterized in that: The method includes: Acquire a data set within a period of time, the data set including influencing factor data and photovoltaic power generation data, and divide the data set into a training set and a test set; The training set is input into a CNN-BiLSTM-Attention model for training. The CNN model extracts features and reduces the dimensionality of the data. The feature information extracted by the CNN model is input into the BiLSTM, which extracts deep temporal features of photovoltaic power in both positive and negative directions. The Attention mechanism uses a weighted approach to distinguish the importance of the time information extracted by the BiLSTM hidden layer, thereby mining the deep temporal features of the response data. The IAOA algorithm was used to select the optimal hyperparameters of the CNN-BiLSTM-Attention model, and the IAOA-CNN-BiLSTM-Attention model was constructed using the optimal hyperparameters as a medium-term photovoltaic power prediction model. The test set data is input into the medium-term photovoltaic power prediction model, and the medium-term photovoltaic power prediction results are output.

2. The method for predicting mid-term photovoltaic power generation according to claim 1, characterized in that: The process of feature extraction and dimensionality reduction of data by the CNN model includes: the training set data enters the convolution layer of the CNN model, the convolution layer extracts features from the data and processes the data with a nonlinear activation function before passing it to the pooling layer, the pooling layer reduces the dimensionality of the feature data extracted for the first time, and finally the fully connected layer integrates the features extracted by the convolution layer and the pooling layer and outputs them.

3. The method for predicting mid-term photovoltaic power generation according to claim 1, characterized in that: The attention mechanism uses the different features of the influencing factor data on the photovoltaic power generation prediction results as the time information extracted by the hidden unit of the neural network to distinguish the importance in a weighted manner, and mines the deep temporal characteristics of the response data. Specifically: e i =tanh(W·h i +b) Where W and b are weight and threshold respectively; h i The hidden layer unit state value output by CNN is used to obtain the score e of each hidden unit state value. i , and then normalize the score, and finally e i and h i Perform weighted summation to obtain the hidden layer state value c t , T is the length of the input sequence.

4. The method for predicting mid-term photovoltaic power generation according to claim 1, characterized in that: The IAOA algorithm is an algorithm that improves the AOA algorithm by using a Sin chaos reverse learning strategy and an adaptive t distribution.

5. The method for predicting mid-term photovoltaic power generation according to claim 4, characterized in that: The Sin chaos reverse learning strategy includes: Firstly, the Sin chaotic map is used to form a diverse initial solution population; Secondly, a reverse learning strategy is used on the initial solution population to form a new reverse solution population; Finally, the fitness values ​​of the initial solution population and the reverse solution population are calculated, and the best ones are retained as the new population.

6. The method for predicting mid-term photovoltaic power generation according to claim 4, characterized in that: The position of the individual in the AOA algorithm is updated using the adaptive t distribution as follows: in, is the position of the i-th individual after updating using the adaptive t distribution; t(k) is the adaptive t distribution function; x i is the position of the i-th individual.

7. The method for predicting mid-term photovoltaic power generation according to claim 1, characterized in that: The optimal hyperparameters of the CNN-BiLSTM-Attention model include the number of convolution kernels, the number of BiLSTM hidden layer neurons, the number of fully connected hidden layer neurons, the dropout layer, the batch size, and the learning rate.

8. The method for predicting mid-term photovoltaic power generation according to claim 1, characterized in that: The initialization parameters of the IAOA algorithm include search interval, number of iterations and population size; The fitness function of the IAOA algorithm selects the mean square error between the predicted value and the true value of the training set.

9. An electronic device comprising a memory and a processor, wherein a computer program is stored in the memory, wherein: When the processor executes the program, the method according to any one of claims 1 to 8 is implemented.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 8 is implemented.

Citation Information

Patent Citations

  • Photovoltaic power generation power prediction method

    CN117892197A

  • Short-term photovoltaic power generation power prediction method adapting to weather change

    CN119401402A