A short-term photovoltaic power generation prediction method and system based on MSGWO-LSTM model

By combining the MSGWO-LSTM model with data preprocessing and various optimization strategies, the problem of uncertainty in photovoltaic power generation output was solved, achieving high-precision short-term photovoltaic power generation prediction and improving grid stability and dispatch efficiency.

CN119962723BActive Publication Date: 2025-10-28CHINA THREE GORGES UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510010720.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-01-03
Publication Date
2025-10-28
Estimated Expiration
2045-01-03

Smart Images

  • Figure CN119962723B_ABST
    Figure CN119962723B_ABST
Patent Text Reader

Abstract

This invention provides a short-term photovoltaic (PV) power generation prediction method based on an improved similar day and MSGWO-LSTM model, relating to the field of new energy power generation technology. By collecting meteorological characteristics of PV power plants and corresponding historical PV output data, the data is preprocessed and saved as a feature dataset. A combination of K-means++ and FCM algorithms is used to perform similar day clustering and construct an MSGWO-LSTM prediction model. In the traditional GWO model, a Tent chaotic mapping equation is introduced to generate the initial population, a differential evolution strategy is used for global optimization, and a dynamic weight strategy is used to update the final position of the wolf pack. Then, the MSGWO algorithm is used to optimize the LSTM to predict short-term PV power generation. This embodiment combines two clustering methods for similar day clustering, multiple optimization strategies, and deep learning techniques, improving the accuracy of similar day clustering, the predictive performance and generalization ability of the model, enhancing the operational safety of the PV power generation system, and improving the accuracy and reliability of short-term PV power generation prediction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of new energy power generation technology, and in particular to a method and system for predicting short-term photovoltaic power generation based on the MSGWO-LSTM model. Background Technology

[0002] Given the continued warming of the global climate and the gradual depletion of fossil fuels, solar energy, as a renewable energy source, has received widespread attention due to its environmental friendliness, abundant resources, and sustainability. In recent years, with the continuous improvement of photovoltaic cell efficiency and the decrease in cost, photovoltaic systems have been widely used in the building sector.

[0003] In recent years, this strategy has gradually become a central policy for countries around the world when adjusting their energy layout. Photovoltaic power generation is an important way to utilize solar energy, and its pollution-free, clean, and efficient nature makes it a major development trend in the future new energy industry. However, the output of photovoltaic power generation is affected by multiple environmental factors such as radiation intensity, temperature, and humidity, which makes its output highly random and uncertain. This uncertainty not only poses a significant challenge to the stability and safe operation of the power grid but also has a considerable impact on the grid's power generation and dispatch plans. Therefore, how to accurately predict photovoltaic power has become a focus of current research in my country. Summary of the Invention

[0004] The main objective of this invention is to provide a short-term photovoltaic power generation prediction method and system based on the MSGWO-LSTM model, which solves the technical problems of output uncertainty caused by external influences and insufficient accuracy of photovoltaic power prediction in the prior art.

[0005] To solve the above-mentioned technical problems, the technical solution adopted by the present invention is: a short-term photovoltaic power generation prediction method based on the MSGWO-LSTM model, comprising the following steps:

[0006] S1: Obtain historical data on meteorological characteristics and corresponding photovoltaic output of photovoltaic power plants within a preset time period, perform data preprocessing and save it as a feature dataset, and construct an MSGWO-LSTM prediction model; where the historical data is in days and includes: time, power generation, horizontal radiation and meteorological characteristic data of the corresponding time period;

[0007] S2: Using the aforementioned feature dataset, similar days are selected using a combination of the K-means++ and FCM algorithms. The selected dataset is then used to train the MSGWO-LSTM prediction model to obtain the optimal prediction model. This model includes the MSGWO model, which incorporates three optimization strategies into the traditional GWO model: generating the initial population using the Tent chaotic mapping equation, performing global optimization using a differential evolution strategy, and updating the final position of the wolf pack using a dynamic weight strategy. An LSTM prediction model is then constructed, and the MSGWO algorithm is used to optimize the LSTM.

[0008] S3: Predict the photovoltaic power generation in the short term based on the optimal prediction model.

[0009] In the preferred embodiment, the data preprocessing in step S1 includes:

[0010] S11: Collect the historical daily power generation of the photovoltaic power station and the corresponding meteorological data for the local time period of the photovoltaic power station. Normalize the collected historical data using the following formula:

[0011] (1);

[0012] in, This represents the normalized value. This represents the value in the original data. These represent the maximum and minimum values ​​of the meteorological characteristic, respectively.

[0013] S12: Perform outlier detection using a box plot method. Replace data identified as outliers using the following formula:

[0014] (2);

[0015] in, This represents the value after linear interpolation. This represents the nearest known normal value above the missing value. This represents the nearest known normal value below the missing value.

[0016] In the preferred scheme, the preprocessed dataset undergoes dimensionality reduction to select meteorological characteristic data that are highly correlated with photovoltaic output, including:

[0017] S13: Dimensionality reduction of the data is performed using the maximum information coefficient method. The mutual information calculation formula is as follows:

[0018] (3);

[0019] in, The joint density distribution function of the parameters. and They are respectively and The marginal density distribution function, and These are meteorological characteristic data and photovoltaic power output data, respectively.

[0020] S14: Based on the principle of maximizing mutual information, mesh generation is then performed, using the following formula:

[0021] (4);

[0022] in, For a finite set of ordered pairs, For one The grid, Medium variables The range is divided into Segment, variable The range is divided into part, Represents an ordered set Using grid Divide; The maximum value is defined as the maximum mutual information value;

[0023] S15: Combining steps S13 and S14, the formula for calculating the maximum mutual information coefficient is as follows:

[0024] (5);

[0025] in, For grid Divided into The upper limit of, generally, is taken as... .

[0026] The preferred embodiment further includes: step S2, which uses the feature dataset to select similar days using a combination of the K-means++ algorithm and the FCM algorithm, including: using the horizontal radiation data of the whole day as the clustering index, using a combination of K-means++ clustering and FCM clustering to cluster similar days, and dividing the historical meteorological dataset into three categories: sunny days, rainy days, and cloudy days.

[0027] A1: Constructing Clustering Indicators: Using the horizontal radiation data of the entire day as the clustering indicator, the formula is as follows:

[0028] (6);

[0029] in, These are the horizontal radiation values ​​at different times.

[0030] A2: Use the K-means++ clustering method to generate initial cluster centers. The formula is:

[0031] (7);

[0032] in, These are samples other than those with selected cluster centers. It is a random sample from the sample set. yes The distance to the nearest cluster center;

[0033] A3: Obtaining Membership Degrees and Cluster Centers Using FCM: FCM transforms the clustering process into a constrained nonlinear programming problem. Through optimization, the fuzzy partitioning of the photovoltaic sequence is obtained, and the membership degrees and cluster centers are calculated. The formula is as follows:

[0034] (8);

[0035] (9);

[0036] Among them, dataset , For fuzzy clustering centers; The number of cluster centers; The number of sample data; For the first The sample belongs to the first Membership degree of a class ; For the sample To the cluster center Euclidean distance, ; It is a weighted parameter that characterizes the degree of blurring. ;

[0037] A4: Initial canonical similarity sets were obtained using K-means++ clustering and FCM clustering methods, respectively. and Then, the intersection is taken to obtain the initial similar day sample set for sunny, cloudy and rainy days. Then, the similar day set is filtered for each weather type according to the preset sample membership degree to determine the final similar day sample set.

[0038] In the preferred scheme, each weather type is screened based on the membership degree of the samples, where the membership degree of the set of similar days with strong sunny days and the set of similar days with strong cloudy days must be greater than 0.8;

[0039] Given that photovoltaic output fluctuates significantly under both cloudy and rainy weather conditions, the samples removed from the cloudy sample set are integrated with the rainy sample set, and historical days with a membership degree greater than 0.35 are taken as the set of similar days for heavy rain.

[0040] In the preferred scheme, step S2 is optimized using three strategies: Tent chaotic mapping strategy, differential evolution strategy, and dynamic weight strategy, specifically as follows:

[0041] S211: The initial population is generated using the Tent chaotic mapping equation to ensure that the initial gray wolf individuals are distributed as widely as possible throughout the search space. The formula is:

[0042] (10);

[0043] in, For the number of mappings, For one A random number, which represents the first... The function value of the second mapping;

[0044] S212: The differential evolution strategy is incorporated into the traditional gray wolf algorithm to improve the algorithm's global optimization ability. The formulas are as follows:

[0045] (11);

[0046] (12);

[0047] (13);

[0048] in, , , Three distinct individuals are randomly selected from the current population, excluding the target individual. ; Represents a random dimension; This is the scaling factor for the variation. Crossover probability factor;

[0049] At the same time, , To perform adaptive adjustment, the formula is:

[0050] (14);

[0051] in, The maximum value of the scaling factor is set to 0.9; The minimum value of the variation scaling factor is set to 0.4; The maximum value of the crossover probability factor is set to 1. To minimize the crossover probability factor, we set it to 0.6; This represents the current iteration number. This represents the maximum number of iterations.

[0052] S213: A dynamic weighting strategy is used to update the final position of the wolf pack, emphasizing the differences among the top three wolves. The formulas are as follows:

[0053] (15);

[0054] (16);

[0055] (17);

[0056] Finally, the formula for updating the gray wolf's position can be expressed as:

[0057] (18);

[0058] In the formula, The weights of the first wolf as a percentage of the top three wolves are: the weight of the second wolf as a percentage of the top three wolves, and the weight of the third wolf as a percentage of the top three wolves.

[0059] In the preferred embodiment, the model training in step S2 includes: using the hyperparameters of the LSTM as variables to be optimized, including the learning rate, dropout rate, number of neuron layers, and number of neurons per layer; optimizing the LSTM network using the MSGWO algorithm, using the mean absolute error of the LSTM as the fitness function, continuously updating the hyperparameter variables, obtaining the optimal fitness of each individual, until the maximum number of iterations is reached, specifically:

[0060] B1: Construct the LSTM prediction model, and its calculation formula is as follows:

[0061] (19);

[0062] in, Forget gate function; To update the gate function; This is the output gate function; For activation functions; This is the output of the previous layer; This is the current input; and Here is the weight matrix for the forget gate; This is the forget gate bias vector; , , , This is the weight matrix of the input gate; , The input gate bias vector; It is the hyperbolic tangent activation function; Candidate values; , To output the weight matrix, This is the output gate bias vector;

[0063] B2: The MSGWO algorithm is used to optimize the LSTM. The mean absolute error of the LSTM is used as the fitness function to continuously update the variables and obtain the optimal fitness of each individual until the maximum number of iterations is reached. The fitness function formula is as follows:

[0064] (20);

[0065] In the formula: This represents the number of test samples; This represents the actual value of photovoltaic power generation. These are the model's predicted values.

[0066] A short-term photovoltaic power generation prediction system based on the MSGWO-LSTM model includes:

[0067] The data acquisition module is used to acquire historical data on meteorological characteristics and corresponding photovoltaic output of photovoltaic power plants within a preset time period. After data preprocessing, the data is saved as a feature dataset and an MSGWO-LSTM prediction model is constructed. The historical data includes: time, power generation, horizontal radiation, and meteorological data for the corresponding time period.

[0068] The model optimization module is used to select similar days using the feature dataset by combining the K-means++ algorithm and the FCM algorithm, and to train the MSGWO-LSTM prediction model to obtain the optimal prediction model. This includes optimizing the MSGWO model by introducing three strategies into the traditional MSGWO model: generating the initial population using the Tent chaotic mapping equation, performing global optimization using the differential evolution strategy, and updating the final position of the wolf pack using the dynamic weight strategy. Then, an LSTM prediction model is constructed, and the MSGWO algorithm is used to optimize the LSTM.

[0069] The model prediction module is used to predict the photovoltaic power generation in the short term based on the optimal prediction model.

[0070] This invention provides a short-term photovoltaic (PV) power generation prediction method based on an improved similar day and MSGWO-LSTM model. It collects meteorological characteristics and historical PV output data from historical PV power generation data, preprocesses the data, and saves it as a feature dataset. Then, it uses a combination of K-means++ and FCM algorithms to perform similar day clustering and construct an MSGWO-LSTM prediction model. In the MSGWO-LSTM model, the Tent chaotic mapping equation is introduced into the traditional GWO model to generate the initial population, a differential evolution strategy is used for global optimization, and a dynamic weight strategy is used to update the final position of the wolf pack. The MSGWO algorithm is then used to optimize the LSTM to obtain the optimal prediction model, which is then used to predict short-term PV power generation, yielding the power prediction result. This embodiment combines two clustering methods for similar day clustering, multiple optimization strategies, and deep learning techniques, improving the accuracy of similar day clustering, the model's predictive performance and generalization ability, enhancing the operational safety of the PV power generation system, and improving the accuracy and reliability of short-term PV power generation prediction. Attached Figure Description

[0071] The present invention will be further described below with reference to the accompanying drawings and embodiments:

[0072] Figure 1 This is the overall prediction flowchart of the present invention;

[0073] Figure 2 This is a flowchart of the short-term photovoltaic power generation prediction method of the present invention;

[0074] Figure 3 These are box plots before and after data correction in this invention;

[0075] Figure 4 This is the improved similarity day selection flowchart used in this invention;

[0076] Figure 5 This is a clustering diagram of irradiance curves under different weather conditions according to the present invention;

[0077] Figure 6 This is a prediction curve graph for different weather conditions according to the present invention. Detailed Implementation

[0078] Example 1

[0079] like Figure 1-6 As shown, a short-term photovoltaic power generation prediction method based on the MSGWO-LSTM model includes the following steps:

[0080] S1: Obtain historical data on meteorological characteristics and corresponding photovoltaic output of photovoltaic power plants within a preset time period, perform data preprocessing and save it as a feature dataset, and construct an MSGWO-LSTM prediction model; where the historical data is in days and includes: time, power generation, horizontal radiation and meteorological data for the corresponding time period;

[0081] S2: Similar days are selected using a combination of K-means++ and FCM algorithms on a feature dataset. The selected dataset is then used to train the MSGWO-LSTM prediction model to obtain the optimal prediction model. The MSGWO model is optimized by introducing three strategies into the traditional GWO model: generating the initial population using the Tent chaotic mapping equation, performing global optimization using a differential evolution strategy, and updating the final position of the wolf pack using a dynamic weight strategy. An LSTM prediction model is then constructed, and the MSGWO algorithm is used to optimize the LSTM.

[0082] S3: Predict short-term photovoltaic power generation based on the optimal prediction model.

[0083] In this embodiment, MSGWO stands for Modified Grey Wolf Optimizer; LSTM stands for Long Short-Term Memory.

[0084] like Figure 2 As shown, in this embodiment, a feature dataset of historical photovoltaic power generation data is collected and an MSGWO-LSTM prediction model is constructed. In the MSGWO-LSTM model, the Tent chaotic mapping equation is introduced into the traditional GWO model to generate the initial population, a differential evolution strategy is used for global optimization, and a dynamic weight strategy is used to update the final position of the wolf pack. Then, the MSGWO algorithm is used to optimize the LSTM to obtain the optimal prediction model, and the prediction model is used to predict the photovoltaic power generation in the short term to obtain the power prediction result. This embodiment combines two clustering methods for similar day clustering and multiple optimization strategies with deep learning technology, which improves the accuracy of similar day clustering, the prediction performance and generalization ability of the model, improves the operational safety of the photovoltaic power generation system, and improves the accuracy and reliability of short-term photovoltaic power generation prediction.

[0085] This embodiment acquires historical data on photovoltaic power generation within a preset time period. The data should be recorded on a daily basis and divided into corresponding time periods to ensure the continuity and integrity of the data. Data features include time, power generation, horizontal radiation, and meteorological data (such as temperature, humidity, wind speed, etc.) for the corresponding time period.

[0086] like Figure 1 The diagram shown is a schematic representation of the overall prediction process in this embodiment. The following scheme is based on... Figure 1 conduct.

[0087] After acquiring historical data, data processing and filtering are performed.

[0088] In the preferred embodiment, step S1 involves acquiring a feature dataset of historical photovoltaic power generation data within a preset time period, including collecting the historical daily power generation of the photovoltaic power station and the local meteorological data for the corresponding time period each day. The collected historical data is then preprocessed.

[0089] Data preprocessing includes: collecting historical daily power generation data of the photovoltaic power station and corresponding meteorological data for the local time period; normalizing the collected historical data and detecting outliers; and replacing data identified as outliers. Specifically:

[0090] S11: First, the collected historical data is normalized using the following formula:

[0091] (1);

[0092] in, This represents the normalized value. This represents the value in the original data. These represent the maximum and minimum values ​​of the meteorological feature, respectively.

[0093] S12: Outlier detection is performed using a box plot method. This method identifies outliers as those exceeding the upper quartile plus 1.5 times the interquartile range, or falling below the lower quartile minus 1.5 times the interquartile range. Outlier handling uses linear interpolation, with the following formula:

[0094] (2);

[0095] in, This represents the value after linear interpolation. This represents the nearest known normal value above the missing value. This represents the nearest known normal value below the missing value.

[0096] In this embodiment, the box plots before and after data correction are as follows: Figure 3As shown in the figure, the content includes outliers and values ​​within the normal range for various meteorological feature data before and after correction. Data within 1.5 IQR are considered normal, while data exceeding 1.5 IQR are considered outliers. The figure shows that before correction, many meteorological features exhibited a large number of outliers. After correction, due to the low rainfall in the selected time period in the photovoltaic power station area, effective daily rainfall data is sparse, and even after outlier processing, the data for this feature is still considered outlier. However, after linear interpolation, all data for other meteorological features fall within the normal range for outlier identification. This fully demonstrates the advantage of box plots in outlier identification and the effectiveness of linear interpolation in outlier handling. These steps improve the accuracy and reliability of the data.

[0097] In the preferred scheme, dimensionality reduction is performed on the preprocessed dataset to select meteorological characteristic data that are highly correlated with photovoltaic output, including:

[0098] S13: Dimensionality reduction of the data is performed using the maximum information coefficient method. The mutual information calculation formula is as follows:

[0099] (3);

[0100] in, The joint density distribution function of the parameters. and They are respectively and The marginal density distribution function, and The meteorological characteristics and photovoltaic power output data are respectively;

[0101] S14: Based on the principle of maximizing mutual information, mesh generation is then performed, using the following formula:

[0102] (4);

[0103] in, For a finite set of ordered pairs, For one The grid, Medium variables The range is divided into Segment, variable The range is divided into part, Represents an ordered set Using grid Divide; The maximum value is defined as the maximum mutual information value.

[0104] S15: Combining steps S13 and S14, the formula for calculating the maximum mutual information coefficient is as follows:

[0105] (5);

[0106] in, For grid Divided into The upper limit of, generally, is taken as... .

[0107] This embodiment reduces the dimensionality of the dataset by using the above steps, retains the meteorological characteristics most relevant to photovoltaic output, and improves the effectiveness of subsequent data input.

[0108] In this example, the correlation coefficients between meteorological characteristics and the MIC of photovoltaic output power are shown in Table 1:

[0109] Table 1. Correlation coefficients between meteorological characteristics and photovoltaic output power (MIC).

[0110]

[0111] As shown in Table 1, horizontal and tilted radiation exhibit a strong correlation with photovoltaic (PV) output, exceeding 0.9; while temperature and humidity show a weak correlation with PV output, around 0.1; and wind direction and daily rainfall show a correlation of less than 0.1 with PV output. Therefore, it is preferable to select horizontal radiation, tilted radiation, temperature, and humidity, which have relatively high correlations, as the input features of the model.

[0112] In this embodiment, in order to further refine the dataset and extract similar daily samples that have an important impact on photovoltaic output, a clustering method based on horizontal radiation data is provided.

[0113] The preferred scheme also includes: Step S2, which uses a combination of K-means++ and FCM algorithms to select similar days based on the feature dataset. This includes: using the meteorological feature data obtained in S1, selecting the horizontal radiation data of the whole day as the clustering index, and using a combination of K-means++ and FCM clustering methods to cluster similar days, dividing the historical meteorological dataset into three categories: sunny days, rainy days, and cloudy days.

[0114] A1: Constructing Clustering Indicators: Using the horizontal radiation data of the entire day as the clustering indicator, the formula is as follows:

[0115] (6);

[0116] in, These are the horizontal radiation values ​​at different times.

[0117] A2: Initial cluster centers are generated using the K-means++ clustering method. K-means++ is an improved version of K-means, randomly generating initial cluster centers to ensure high dissimilarity among the selected centers. Specifically, an arbitrary sample is chosen as the first cluster center, and a subsequent cluster center is selected from the remaining samples. The probability of a sample being selected is proportional to its distance from the nearest existing cluster center, as shown in the formula:

[0118] (7);

[0119] in, These are samples other than those with selected cluster centers. It is a random sample from the sample set. yes The distance to the nearest cluster center;

[0120] A3: Obtaining Membership Degrees and Cluster Centers Using FCM: The FCM algorithm is an extension of the traditional hard clustering algorithm. It primarily assigns a membership degree to the feature vector of each sample data point. The membership degree reflects the degree to which a sample point belongs to different clusters. Based on the magnitude of the membership degree, it can be determined which cluster the sample should be assigned to. The clustering process is transformed into a constrained nonlinear programming problem. Through optimization, the fuzzy partitioning of the photovoltaic sequence is obtained, and the membership degree and cluster centers are calculated. The formula is:

[0121] (8);

[0122] (9);

[0123] Among them, dataset , For fuzzy clustering centers; The number of cluster centers; The number of sample data; For the first The sample belongs to the first Membership degree of a class ; For the sample To the cluster center Euclidean distance, ; It is a weighted parameter that characterizes the degree of blurring. .

[0124] A4: Initial canonical similarity sets were obtained using K-means++ clustering and FCM clustering methods, respectively. and Then, the intersection is taken to obtain the initial similar day sample set for sunny, cloudy and rainy days. Then, the similar day set is filtered for each weather type according to the preset sample membership degree to determine the final similar day sample set.

[0125] This embodiment obtains a set of similar daily samples reflecting different weather types and photovoltaic power output characteristics through the above steps, further improving the accuracy of subsequent predictions.

[0126] In the preferred solution, such as Figure 4 As shown, this embodiment employs an improved method for selecting similar days: initial typical similar day sets are obtained using K-means++ clustering and FCM clustering, respectively. and Then, the intersection is taken to obtain the initial similar day sample sets for sunny, cloudy, and rainy days. Next, each weather type is filtered according to the membership degree of the samples: the membership degree of the similar day sets for strong sunny days and strong cloudy days must be greater than 0.8;

[0127] Given that photovoltaic output fluctuates significantly under both cloudy and rainy weather conditions, the samples removed from the cloudy sample set are integrated with the rainy sample set, and historical days with a membership degree greater than 0.35 are taken as the set of similar days for heavy rain.

[0128] like Figure 4 The diagram shows the flowchart for selecting intersection similar days. The initial set of typical similar days is obtained through K-means++ clustering and FCM clustering, respectively. and Then, the intersection of these intersections yields the initial similar day sample sets for sunny, cloudy, and rainy days. Next, each weather type is filtered based on sample membership, with the membership degree of the strong sunny day similar day set and the strong cloudy day similar day set needing to be greater than 0.8, given the similarity in photovoltaic power output meteorological characteristics between cloudy and rainy weather. Therefore, the samples filtered out from the cloudy sample set are integrated with the rainy day sample set, and historical days with a membership degree greater than 0.35 are selected as the strong rainy day similar day set.

[0129] like Figure 5 The figure shown is a clustering diagram of irradiance curves under different weather conditions in this embodiment.

[0130] This embodiment further filters out a more representative set of similar day samples by setting membership thresholds: different membership thresholds are set to selectively filter similar day samples under different weather types. The final set of similar day samples is used as the dataset for training the prediction model. This not only retains the most representative samples, but also avoids misselection or omission due to weather fluctuations, thereby obtaining more accurate and reliable data and improving the accuracy and practicality of prediction.

[0131] Traditional GWO (Grey Wolf Wolves) methods find the optimal solution by simulating cooperation and competition within a grey wolf pack. The specific formula is as follows:

[0132] S21: The behavioral definition formula for wolves surrounding their prey is as follows:

[0133] ;

[0134] ;

[0135] in, The distance between predator and prey. This indicates the latest change in the predator's location. This represents the number of iterations for the current population. and These are the locations of the prey and the gray wolf, respectively.

[0136] S22: In the process of a wolf pack hunting prey, the pack, led by the first three wolves, continuously approaches the prey until the hunt is successful. The formula is:

[0137] ;

[0138] ;

[0139] ;

[0140] in, , , These represent the distances between other individual wolves in the pack and the top three wolves; , , These represent the current positions of the first three wolves; , and These represent the positions that other individuals in the population need to adjust under the influence of the first three wolves. This represents the final position of the wolf pack after one iteration.

[0141] In this embodiment, in order to further improve its ability to solve optimization problems, three optimization strategies are adopted to optimize each process based on the data characteristics of this application.

[0142] This embodiment introduces three optimization strategies based on the traditional GWO model:

[0143] 1) Generating the initial population using the Tent chaotic mapping equation: This improves the diversity and ergodicity of the population, which helps in finding the global optimum. 2) Using a differential evolution strategy for global optimization: This enhances the algorithm's search capability and convergence speed through differential mutation, crossover, and selection operations. 3) Using a dynamic weight strategy for updating the wolf pack's final position: This dynamically adjusts the weights based on the wolf pack's current and optimal positions, enabling the wolf pack to more accurately approximate the global optimum.

[0144] In the preferred scheme, step S2 is optimized using three strategies: Tent chaotic mapping strategy, differential evolution strategy, and dynamic weight strategy, specifically as follows:

[0145] S211: The initial population is generated using the Tent chaotic mapping equation to ensure that the initial gray wolf individuals are distributed as widely as possible throughout the search space. The formula is:

[0146] (10);

[0147] in, For the number of mappings, For one A random number, which represents the first... The function value of the submapping.

[0148] S212: The differential evolution strategy is incorporated into the traditional gray wolf algorithm to improve the algorithm's global optimization ability. The formulas are as follows:

[0149] (11);

[0150] (12);

[0151] (13);

[0152] in, , and Three distinct individuals are randomly selected from the current population, excluding the target individual. ; Represents a random dimension; This is the scaling factor for the variation. Crossover probability factor;

[0153] At the same time, , To perform adaptive adjustment, the formula is:

[0154] (14);

[0155] in, The maximum value of the scaling factor is set to 0.9; The minimum value of the variation scaling factor is set to 0.4; The maximum value of the crossover probability factor is set to 1. To minimize the crossover probability factor, we set it to 0.6; This represents the current iteration number. This represents the maximum number of iterations.

[0156] S213: A dynamic weighting strategy is used to update the final position of the wolf pack, emphasizing the differences among the top three wolves. The formulas are as follows:

[0157] (15);

[0158] (16);

[0159] (17);

[0160] Finally, the formula for updating the gray wolf's position can be expressed as:

[0161] (18);

[0162] In the formula, The weights of the first wolf as a percentage of the top three wolves are: the weight of the second wolf as a percentage of the top three wolves, and the weight of the third wolf as a percentage of the top three wolves.

[0163] In the preferred scheme, model training in step S2 includes: establishing an MSGWO-LSTM prediction model, using the hyperparameters of the LSTM as variables to be optimized, including the learning rate, dropout rate, number of neuron layers, and number of neurons per layer; optimizing the LSTM network using the MSGWO algorithm, using the mean absolute error of the LSTM as the fitness function, continuously updating the hyperparameter variables, obtaining the optimal fitness of each individual, until the maximum number of iterations is reached, specifically:

[0164] B1: Construct the LSTM prediction model, and its calculation formula is as follows:

[0165] (19);

[0166] in, Forget gate function; To update the gate function; This is the output gate function; For activation functions; This is the output of the previous layer; This is the current input; and Here is the weight matrix for the forget gate; This is the current input value; This is the forget gate bias vector; , , and This is the weight matrix of the input gate; and The input gate bias vector; It is the hyperbolic tangent activation function; Candidate values; and To output the weight matrix, This is the output gate bias vector;

[0167] B2: The MSGWO algorithm is used to optimize the LSTM. The mean absolute error of the LSTM is used as the fitness function to continuously update the variables and obtain the optimal fitness of each individual until the maximum number of iterations is reached. The fitness function formula is as follows:

[0168] (20);

[0169] In the formula: This represents the number of test samples; This represents the actual value of photovoltaic power generation. These are the model's predicted values.

[0170] like Figure 6 The figure shown is a forecast curve for different weather conditions in this embodiment.

[0171] In practice, firstly, this embodiment uses the MIC method to extract meteorological features highly correlated with photovoltaic output; secondly, it combines the K-means++ method and the FCM method to select similar days; and finally, it uses similar days for each type of weather as training data to construct the MSGWO-LSTM model. Figure 6 As shown, by selecting any data point and conducting comparative analysis, it can be seen that under different weather conditions, the prediction model of this embodiment has significantly improved prediction performance compared to other comparative models, and can effectively assist the power sector in formulating real-time dispatch plans.

[0172] Example 2

[0173] To further illustrate with reference to Example 1, a short-term photovoltaic power generation prediction system based on the MSGWO-LSTM model includes:

[0174] The data acquisition module is used to acquire historical data on meteorological characteristics and corresponding photovoltaic output of photovoltaic power plants within a preset time period. After data preprocessing, the data is saved as a feature dataset and an MSGWO-LSTM prediction model is constructed. The historical data is in daily units and includes: time, power generation, horizontal radiation, and meteorological characteristic data for the corresponding time period.

[0175] The similar day selection module is used to select similar days by combining the K-means++ algorithm and the FCM algorithm on the feature dataset.

[0176] The model optimization module is used to train the MSGWO-LSTM prediction model using the dataset selected by the similar day selection module to obtain the optimal prediction model. This includes optimizing the MSGWO model by introducing three strategies into the traditional GWO model: generating the initial population using the Tent chaotic mapping equation, performing global optimization using the differential evolution strategy, and updating the final position of the wolf pack using the dynamic weight strategy. Then, an LSTM prediction model is constructed, and the MSGWO algorithm is used to optimize the LSTM.

[0177] The model prediction module is used to predict short-term photovoltaic power generation based on the optimal prediction model.

[0178] The above embodiments are merely preferred technical solutions of the present invention and should not be considered as limitations on the present invention. The scope of protection of the present invention should be limited to the technical solutions described in the claims, including equivalent substitutions of the technical features described in the claims. That is, equivalent substitutions and improvements within this scope are also within the scope of protection of the present invention.

Claims

1. A short-term photovoltaic power generation prediction method based on the MSGWO-LSTM model, characterized in that, Includes the following steps: S1: Obtain historical data on meteorological characteristics and corresponding photovoltaic output of photovoltaic power plants within a preset time period, perform data preprocessing and save it as a feature dataset, and construct an MSGWO-LSTM prediction model; where the historical data is in days and includes: time, power generation, horizontal radiation and meteorological characteristic data of the corresponding time period; S2: Using the aforementioned feature dataset, similar days are selected using a combination of the K-means++ and FCM algorithms. The selected dataset is then used to train the MSGWO-LSTM prediction model to obtain the optimal prediction model. This model includes the MSGWO model, which incorporates three optimization strategies into the traditional GWO model: generating the initial population using the Tent chaotic mapping equation, performing global optimization using a differential evolution strategy, and updating the final position of the wolf pack using a dynamic weight strategy. An LSTM prediction model is then constructed, and the MSGWO algorithm is used to optimize the LSTM. S3: Predict the photovoltaic power generation in the short term based on the optimal prediction model; In step S2, the feature dataset is used to select similar days using a combination of the K-means++ and FCM algorithms. This includes: using the horizontal radiation data of the entire day as the clustering index, and using a combination of K-means++ and FCM clustering methods to cluster similar days, dividing the historical meteorological dataset into three categories: sunny days, rainy days, and cloudy days. A1: Constructing Clustering Indicators: Using the horizontal radiation data of the entire day as the clustering indicator, the formula is as follows: (6); in, These are the horizontal radiation values ​​at different times. A2: Use the K-means++ clustering method to generate initial cluster centers. The formula is: (7); in, These are samples other than those with selected cluster centers. It is a random sample from the sample set. yes The distance to the nearest cluster center; A3: Obtaining Membership Degrees and Cluster Centers Using FCM: FCM transforms the clustering process into a constrained nonlinear programming problem. Through optimization, the fuzzy partitioning of the photovoltaic sequence is obtained, and the membership degrees and cluster centers are calculated. The formula is as follows: (8); (9); Among them, dataset , For fuzzy clustering centers; The number of cluster centers; The number of sample data; For the first The sample belongs to the first Membership degree of a class ; For the sample To the cluster center Euclidean distance, ; It is a weighted parameter that characterizes the degree of blurring. ; A4: Initial canonical similarity sets were obtained using K-means++ clustering and FCM clustering methods, respectively. and Then, the intersection is taken to obtain the initial similar day sample set for sunny, cloudy and rainy days. Then, the similar day set for each weather type is filtered according to the preset sample membership degree to determine the final similar day sample set. The S2 is optimized using three strategies: Tent chaotic mapping strategy, differential evolution strategy, and dynamic weight strategy. Specifically: S211: The initial population is generated using the Tent chaotic mapping equation to ensure that the initial gray wolf individuals are distributed as widely as possible throughout the search space. The formula is: (10); in, For the number of mappings, For one A random number, which represents the first... The function value of the second mapping; S212: The differential evolution strategy is incorporated into the traditional gray wolf algorithm to improve the algorithm's global optimization ability. The formulas are as follows: (11); (12); (13); in, , and Three distinct individuals are randomly selected from the current population, excluding the target individual. ; Represents a random dimension; This is the scaling factor for the variation. Crossover probability factor; At the same time, , To perform adaptive adjustment, the formula is: (14); in, This represents the maximum value of the scaling factor. The minimum value of the scaling factor is the variation factor. This represents the maximum value of the crossover probability factor. This is the minimum value of the crossover probability factor. This represents the current iteration number. This represents the maximum number of iterations. S213: A dynamic weighting strategy is used to update the final position of the wolf pack, emphasizing the differences among the top three wolves. The formulas are as follows: (15); (16); (17); Finally, the formula for updating the gray wolf's position can be expressed as: (18); In the formula, The weights of the first wolf as a percentage of the top three wolves are: the weight of the second wolf as a percentage of the top three wolves, and the weight of the third wolf as a percentage of the top three wolves.

2. The short-term photovoltaic power generation prediction method based on the MSGWO-LSTM model according to claim 1, characterized in that, The data preprocessing in step S1 includes: S11: Collect the historical daily power generation of the photovoltaic power station and the corresponding meteorological data for the local time period of the photovoltaic power station. Normalize the collected historical data using the following formula: (1); in, This represents the normalized value. This represents the value in the original data. These represent the maximum and minimum values ​​of the meteorological characteristic, respectively. S12: Perform outlier detection using a box plot method. Replace data identified as outliers using the following formula: (2); in, This represents the value after linear interpolation. This represents the nearest known normal value above the missing value. This represents the nearest known normal value below the missing value.

3. The short-term photovoltaic power generation prediction method based on the MSGWO-LSTM model according to claim 2, characterized in that, Dimensionality reduction was performed on the preprocessed dataset to filter out meteorological feature data that are highly correlated with photovoltaic power output, including: S13: Dimensionality reduction of the data is performed using the maximum information coefficient method. The mutual information calculation formula is as follows: (3); in, The joint density distribution function of the parameters. and They are respectively and The marginal density distribution function, and These are meteorological characteristic data and photovoltaic power output data, respectively. S14: Based on the principle of maximizing mutual information, mesh generation is then performed, using the following formula: (4); in, For a finite set of ordered pairs, For one The grid, Medium variables The range is divided into Segment, variable The range is divided into part, Represents an ordered set Using grid Divide; The maximum value is defined as the maximum mutual information value; S15: Combining steps S13 and S14, the formula for calculating the maximum mutual information coefficient is as follows: (5); in, For grid Divided into The upper limit of, generally, is taken as... .

4. The short-term photovoltaic power generation prediction method based on the MSGWO-LSTM model according to claim 1, characterized in that, Each weather type is filtered based on the membership degree of the samples, where the membership degree of the sets of similar days with strong sunny days and the sets of similar days with strong cloudy days must be greater than 0.8; Given that photovoltaic output fluctuates significantly under both cloudy and rainy weather conditions, the samples removed from the cloudy sample set are integrated with the rainy sample set, and historical days with a membership degree greater than 0.35 are taken as the set of similar days for heavy rain.

5. The short-term photovoltaic power generation prediction method based on the MSGWO-LSTM model according to claim 1, characterized in that, The model training described in step S2 includes: using the hyperparameters of the LSTM as variables to be optimized, including the learning rate, dropout rate, number of neuron layers, and number of neurons per layer; optimizing the LSTM network using the MSGWO algorithm, with the mean absolute error of the LSTM as the fitness function, continuously updating the hyperparameter variables to obtain the optimal fitness of each individual network until the maximum number of iterations is reached, specifically: B1: Construct the LSTM prediction model, and its calculation formula is as follows: (19); in, Forget gate function; To update the gate function; This is the output gate function; For activation functions; This is the output of the previous layer; This is the current input; and Here is the weight matrix for the forget gate; This is the forget gate bias vector; , , and This is the weight matrix of the input gate; and The input gate bias vector; It is the hyperbolic tangent activation function; Candidate values; and To output the weight matrix, This is the output gate bias vector; B2: The MSGWO algorithm is used to optimize the LSTM. The mean absolute error of the LSTM is used as the fitness function to continuously update the variables and obtain the optimal fitness of each individual until the maximum number of iterations is reached. The fitness function formula is as follows: (20); In the formula: This represents the number of test samples; This represents the actual value of photovoltaic power generation. These are the model's predicted values.

6. A short-term photovoltaic power generation prediction system based on the MSGWO-LSTM model, which implements the short-term photovoltaic power generation prediction method based on the MSGWO-LSTM model as described in claim 1, characterized in that, include: The data acquisition module is used to acquire historical data on meteorological characteristics and corresponding photovoltaic output of photovoltaic power plants within a preset time period. After data preprocessing, the data is saved as a feature dataset and an MSGWO-LSTM prediction model is constructed. The historical data includes: time, power generation, horizontal radiation, and meteorological data for the corresponding time period. The model optimization module is used to select similar days using the feature dataset by combining the K-means++ algorithm and the FCM algorithm, and to train the MSGWO-LSTM prediction model to obtain the optimal prediction model. This includes optimizing the MSGWO model by introducing three strategies into the traditional MSGWO model: generating the initial population using the Tent chaotic mapping equation, performing global optimization using the differential evolution strategy, and updating the final position of the wolf pack using the dynamic weight strategy. Then, an LSTM prediction model is constructed, and the MSGWO algorithm is used to optimize the LSTM. The model prediction module is used to predict the photovoltaic power generation in the short term based on the optimal prediction model.