Photovoltaic power generation prediction method based on fusion model
By combining the knowledge of the photovoltaic field and fusion model technology, a photovoltaic constraint model is established and the best feature subset is screened, and the photovoltaic power generation prediction is used to predict photovoltaic power generation, which solves the problems of unreasonable physical prediction and high computing resource consumption in the existing technology, and achieves more accurate and efficient photovoltaic power generation prediction.
Patent Information
- Application Number
- CN202411625314.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-14
- Publication Date
- 2025-03-07
- Estimated Expiration
- 2044-11-14
AI Technical Summary
The existing photovoltaic power generation prediction methods are difficult to effectively eliminate physically unreasonable prediction results, and the computing resources and time consumption are large, resulting in limited prediction accuracy.
The photovoltaic power generation prediction method based on the fusion model is used, and the photovoltaic constraint model is initially established in combination with the professional knowledge in the photovoltaic field. The best feature subset is screened through bilateral filtering algorithms and Pearson correlation coefficients, and the model training and prediction are used by the attention mechanism and the LSTM algorithm.
It effectively eliminates physically unreasonable data, improves the interpretability and reliability of the prediction results, saves model learning time, and improves the generalization ability and prediction accuracy of the model.
Smart Images

Figure CN119577565A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the field of photovoltaic energy, and in particular relates to a photovoltaic power generation prediction method based on a fusion model. Background Art
[0002] With the rapid development of renewable energy, solar photovoltaic power generation has been widely used as a clean energy. However, the volatility and uncertainty of photovoltaic power generation pose a challenge to the stability and reliability of the power system. In order to better integrate solar photovoltaic power generation, accurate prediction of photovoltaic power generation becomes crucial.
[0003] At present, photovoltaic prediction is mainly divided into several categories, such as physical methods, statistical methods, and intelligent prediction. Due to cost and hardware issues, mainstream photovoltaic prediction is more inclined to statistical and intelligent prediction methods. The regression analysis method in the statistical method can provide a more intuitive explanation of the prediction model and flexibly establish the linear relationship between photovoltaic power generation and various characteristics. However, due to the large number of nonlinear relationships between photovoltaic characteristics and power generation, as well as outliers and outliers, the prediction accuracy of statistical methods is limited to a certain extent. In contrast, intelligent prediction methods show strong potential for handling complex nonlinear problems and higher fault tolerance. In particular, the long short-term memory (LSTM) network, with its excellent time series processing capabilities, can effectively capture the complex nonlinear relationship between sequence data and target output. However, this method only builds a prediction model through training of a large amount of data, while photovoltaic data has the characteristics of seasonality and uncertainty. Such models lack the constraints of photovoltaic field knowledge and cannot eliminate physically unreasonable predictions, such as midnight power generation, high power generation under low irradiation, and low power generation under high irradiation. At the same time, due to the large amount of data, the model needs to consume a lot of computing resources and time to learn the patterns and dependencies between data during the training process, and constantly adjust network parameters to optimize model performance. Summary of the invention
[0004] The present invention proposes a photovoltaic power generation prediction method based on a fusion model. By combining the professional knowledge in the photovoltaic field, a photovoltaic constraint model is preliminarily established to constrain the data, effectively eliminating physically unreasonable data. In the feature selection stage, the bilateral filtering algorithm and the Pearson correlation coefficient are used as filters to establish a screening model, efficiently extract the functional relationship between each feature and the photovoltaic power generation, and quickly and effectively screen out the best feature subset. This process not only saves the model learning time, but also makes the prediction results more interpretable and reliable. Subsequently, the linear relationship between photovoltaic power generation and irradiance is found and the range is selected through the attention mechanism as the boundary function when training the model and the photovoltaic constraint model is further improved, and the physically unreasonable prediction results are further eliminated. Finally, the LSTM algorithm is used for model training and photovoltaic prediction, thereby improving the generalization ability and prediction accuracy of the model. This method provides an effective solution for photovoltaic power generation prediction, improves the accuracy of prediction, enhances the generalization ability of the model, realizes the accurate prediction of photovoltaic power generation, and has broad application prospects.
[0005] A photovoltaic power generation prediction method based on a fusion model comprises the following steps:
[0006] S1. Obtain original power generation data and related monitoring meteorological data through the information collection system of the photovoltaic power station, and pre-process the incomplete and missing data in the original data;
[0007] S2. Through photovoltaic field knowledge and laws, the irradiation data is screened and processed according to the daily sunrise and sunset times, the average sunrise and sunset times are obtained, a photovoltaic constraint model is initially established, the photovoltaic data is cleaned and filtered, and the corresponding basic data stream is generated;
[0008] S3, through the bilateral filtering algorithm and Pearson correlation coefficient PCC, the basic data stream is smoothed and the correlation analysis is performed to generate the corresponding feature space;
[0009] S4. Through the wrapper method, the feature space to be screened is used to generate feature vectors by permutation and combination, and training is performed to select the best subset of the given feature set;
[0010] S5. The data is input into the model through the photovoltaic model and LSTM algorithm for training, tuning and evaluation. Finally, the obtained photovoltaic model is put into use, and the input data is used to obtain the corresponding photovoltaic power generation prediction results.
[0011] The beneficial effects of the present invention are:
[0012] (1) In view of the phenomena in photovoltaic data that do not conform to the laws of physics, photovoltaic field knowledge is used to screen them. Through the filtering and packaging stages, the functional relationship between each feature and photovoltaic data is found, saving time and resource costs to find the best feature subset.
[0013] (2) By combining photovoltaic domain knowledge with the attention mechanism, the functional relationship between photovoltaic data and irradiation data is fitted to establish a photovoltaic constraint model, thus achieving photovoltaic prediction in a nearly real physical environment.
[0014] (3) Combine the photovoltaic constraint model and LSTM algorithm to perform photovoltaic forecasting, improve the generalization ability of the model, and achieve more accurate photovoltaic forecasting. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] Figure 1 It is a flow chart of a photovoltaic power generation method based on multiple models in an embodiment of the present invention.
[0016] Figure 2 4 is a flowchart of optimal subset screening in an embodiment of the present invention. DETAILED DESCRIPTION
[0017] The technical solution of the present invention is further described in detail below in conjunction with the accompanying drawings of the specification. A photovoltaic power generation method based on multiple models provided by the present invention comprises the following steps:
[0018] S1. Obtain original power generation data and related monitoring meteorological data through the information collection system of the photovoltaic power station, and pre-process the incomplete and missing data in the original data.
[0019] Step S1 is specifically as follows:
[0020] S11. Obtain the required photovoltaic power generation and required meteorological data from the information collection system of the photovoltaic power station, and store them in csv files respectively.
[0021] S12. Complete the data in each csv file by using the K nearest neighbor completion algorithm to select k complete nearest neighbor data of the missing data in the set to complete the missing data.
[0022] S13, use the Euclidean distance method to determine the distance, find the nearest k samples, and calculate the average value to replace the missing value; the formula of the Euclidean distance method in step S13 is:
[0023]
[0024] Xi={x i1 ,x i2 ,...,x im} is the first m-dimensional data of the i-th sample point, Xj={x j1 ,xj2 ,...,x jm} is the first m-dimensional data of the j-th sample point; x ir is the r-th dimension attribute of the i-th sample point, x jr is the r-th dimension attribute of the j-th sample point.
[0025] S14, normalize the sequence to control the sample data within the range of [0,1]; the normalization formula in step S14 is:
[0026]
[0027] Among them, x i is the original photovoltaic power generation data to be normalized, max(x) is the maximum value in the original data, min(x) is the minimum value in the original data, y i is the normalized output value, ranging from [0,1].
[0028] S2. Through the knowledge and laws in the photovoltaic field, the irradiation data is screened and processed according to the daily sunrise and sunset times, the average sunrise and sunset times are obtained, a preliminary photovoltaic constraint model is established, the photovoltaic data is cleaned and filtered, and the corresponding basic data stream is generated.
[0029] Step S2 is specifically as follows:
[0030] S21. Screen the irradiance data and select two marker variables r with positive irradiance according to the sunrise and sunset times of each day. i and i , r i is the sunrise time point when the irradiance is positive, s i is the time of sunset when the irradiance is positive.
[0031] S22. Through the flag variable, the photovoltaic data is output to different time periods. The positive power generation data outside the variable range is reset to zero, and the negative power generation data within the variable range is replaced using the k-nearest neighbor completion algorithm. The average sunrise and sunset time of each season is obtained according to the season, and a photovoltaic constraint model is established.
[0032] S23, normalize the photovoltaic data and control the sample data within the range of [0,1]. The formula is:
[0033]
[0034] Wherein, x” is the value to be normalized in the irradiation data, max(x”) is the maximum value in the irradiation data, min(x”) is the minimum value in the irradiation data, and y” is the normalized output value, ranging from [0,1].
[0035] S3. Through bilateral filtering algorithm and Pearson correlation coefficient PCC, the basic data stream is smoothed and correlation analyzed to generate the corresponding feature space.
[0036] Step S3 is specifically as follows:
[0037] S31, using bilateral filtering algorithm, introduce spatial domain weight function w s ((x',y'),(x,y)) measures the spatial distance between pixels. Pixels farther away from the current pixel (x,y) are given smaller weights, and pixels closer to the current pixel (x,y) are given larger weights.
[0038] S32, using bilateral filtering algorithm, introduce grayscale domain weight function w r (I(x',y'),I(x,y)) measures the grayscale value difference between pixels. Pixels with grayscale values similar to the current pixel (x,y) are given larger weights, and pixels with larger differences are given smaller weights.
[0039] In steps S31 and S32, the bilateral filtering algorithm formula is:
[0040]
[0041] R(x,y) represents the pixel value after bilateral filtering, and I(x',y') represents the original grayscale value w of other pixels in the neighborhood s ((x',y'),(x,y)) is the spatial domain weight function, which measures the spatial distance between the neighboring pixel (x',y') and the target pixel (x,y), w r (I(x',y'),I(x,y)) is the grayscale domain weight function, which measures the grayscale value difference between pixels, W p is the normalization factor to ensure that the sum of weights is 1. Ω = {(x', y') | pixels in the neighborhood}: represents the set of all neighborhood pixels used in the filtering calculation process.
[0042] S33, output the weighted average pixel value of all pixel values in the neighborhood, and the product of the spatial domain weight function and the grayscale domain weight function.
[0043] S34, using the Pearson correlation coefficient to measure the correlation between photovoltaic power generation and each feature, and judging the correlation between photovoltaic power generation and the feature according to the calculated value. When the value is close to 1, there is a positive correlation, close to -1, there is a negative correlation, and close to 0, there is no correlation between the two. In step S34, the Pearson correlation coefficient formula is:
[0044]
[0045] Among them, n is the number of samples, X is the sample value of photovoltaic power generation data, Z is the sample value of characteristic data such as irradiance and temperature, and r is the Pearson correlation coefficient.
[0046] S4. Through the wrapper method, the feature space to be screened is used to generate feature vectors through permutations and combinations, and training is performed to select the best subset of a given feature set.
[0047] Step S4 is specifically as follows:
[0048] S41. Select a feature set with a positive Pearson correlation coefficient as the feature space to be screened, and arrange and combine each feature to generate a feature vector.
[0049] S42. Use the support vector machine regression model, input each feature vector for training, and calculate the root mean square error value through cross-validation. The smaller the RMSE value, the higher the correlation between the feature vector and the photovoltaic power generation.
[0050] Step S42 is specifically as follows:
[0051] S421. Divide the feature vector into a training set and a test set, use 2 / 3 of the data for model training, and use 1 / 3 of the data for testing the performance of the model.
[0052] S422. Use the features and target values in the training set to train the support vector machine regression model, and use the machine learning library scikit-learn to implement the training process.
[0053] S423, using Gaussian kernel function and K-fold cross validation method, the training set model is trained for each fold of data, and the test set uses the root mean square error RMSE value to evaluate the model. The formula is as follows
[0054]
[0055] Where n is the number of samples, t i is the true target value, is the target value predicted by the model.
[0056] S424, repeat the above steps multiple times until each cross-validation is completed, calculate the average value of the RMSE of all fold cross-validations as the final evaluation indicator of the vector machine correlation, and select the vector set with the smallest RMSE value as the final filtered feature vector.
[0057] S5. The data is input into the model through the photovoltaic model and LSTM algorithm for training, tuning and evaluation. Finally, the obtained photovoltaic model is put into use, and the input data is used to obtain the corresponding photovoltaic power generation prediction results.
[0058] Step S5 is specifically as follows:
[0059] S51. Use the attention mechanism to find the linear relationship between photovoltaic power generation and irradiance and select a range as the boundary function when training the model and further improve the photovoltaic constraint model.
[0060] S52. Use the filtered features to construct training set, validation set and test set, with the proportions of 70%, 15% and 15% respectively.
[0061] S53, learning and training are performed through the LSTM algorithm and constrained according to the photovoltaic model, and the predicted data that is not within the model range is penalized.
[0062] S54. Use the validation set data to verify the model and continue to tune it based on the prediction results.
[0063] Comparison table of original data and predicted data
[0064]
[0065]
[0066] Overall error calculation:
[0067] The root mean square error (RMSE) within the 24 hours is calculated according to the error formula:
[0068]
[0069] n: The total number of samples, that is, the number of prediction time points. The model prediction value at the i-th time point, that is, the predicted power generation. i : The actual observed value at the i-th time point, i.e., the actual power generation. The root mean square error between the prediction result of the model and the actual power generation is 0.48 kWh, indicating that the model can accurately predict the power generation.
[0070] The above description is only a preferred embodiment of the present invention, and the protection scope of the present invention is not limited to the above embodiment. Any equivalent modifications or changes made by ordinary technicians in this field based on the contents disclosed by the present invention should be included in the protection scope recorded in the claims.
Claims
1. A photovoltaic power generation prediction method based on a fusion model, characterized by: The method comprises the following steps: S1. Obtain original power generation data and related monitoring meteorological data through the information collection system of the photovoltaic power station, and pre-process the incomplete and missing data in the original data; S2. Through photovoltaic field knowledge and laws, the irradiation data is screened and processed according to the daily sunrise and sunset times, the average sunrise and sunset times are obtained, a photovoltaic constraint model is initially established, the photovoltaic data is cleaned and filtered, and the corresponding basic data stream is generated; S3, through the bilateral filtering algorithm and Pearson correlation coefficient PCC, the basic data stream is smoothed and the correlation analysis is performed to generate the corresponding feature space; S4. Through the wrapper method, the feature space to be screened is used to generate feature vectors by permutation and combination, and training is performed to select the best subset of the given feature set; S5. The data is input into the model through the photovoltaic model and LSTM algorithm for training, tuning and evaluation. Finally, the obtained photovoltaic model is put into use, and the input data is used to obtain the corresponding photovoltaic power generation prediction results.
2. The photovoltaic power generation prediction method based on the fusion model according to claim 1 is characterized by: Step S1 specifically comprises: S11, obtaining the required photovoltaic power generation and required meteorological data from the information collection system of the photovoltaic power station, and storing them in csv files respectively; S12, complete the data in each csv file, use the K nearest neighbor completion algorithm, and select k complete nearest neighbor data of the missing data in the set to complete the missing data; S13, use the Euclidean distance method to determine the distance, find the nearest k samples, and calculate the average value to replace the missing value; the formula of the Euclidean distance method in step S13 is: Xi={x i1 ,x i2 ,...,x im } is the first m-dimensional data of the i-th sample point, Xj={x j1 ,x j2 ,...,x jm } is the first m-dimensional data of the j-th sample point; x ir is the r-th dimension attribute of the i-th sample point, x jr is the r-th dimension attribute of the j-th sample point; S14, normalize the sequence to control the sample data within the range of [0,1]; the normalization formula in step S14 is: Among them, x i is the original photovoltaic power generation data to be normalized, max(x) is the maximum value in the original data, min(x) is the minimum value in the original data, y i is the normalized output value, ranging from [0,1].
3. The photovoltaic power generation prediction method based on the fusion model according to claim 1 is characterized by: Step S2 specifically includes: S21. Screen the irradiance data and select two marker variables r with positive irradiance according to the sunrise and sunset times of each day. i and i , r i is the sunrise time point when the irradiance is positive, s i is the sunset time point when the irradiance is positive; S22, outputting photovoltaic data to different time periods through flag variables, returning positive power generation data outside the variable range to zero, and replacing negative power generation data within the variable range using a k-nearest neighbor completion algorithm, obtaining the average sunrise and sunset time of each season according to the season, and establishing a photovoltaic constraint model; S23, normalize the photovoltaic data and control the sample data within the range of [0,1]. The formula is: Wherein, x” is the value to be normalized in the irradiation data, max(x”) is the maximum value in the irradiation data, min(x”) is the minimum value in the irradiation data, and y” is the normalized output value, ranging from [0,1].
4. The photovoltaic power generation prediction method based on the fusion model according to claim 1 is characterized by: Step S3 specifically comprises: S31, using bilateral filtering algorithm, introduce spatial domain weight function w s ((x',y'),(x,y)) measures the spatial distance between pixels. Pixels farther from the current pixel (x,y) are assigned smaller weights, and pixels closer to the current pixel (x,y) are assigned larger weights. S32, using bilateral filtering algorithm, introduce grayscale domain weight function w r (I(x',y'),I(x,y)) measures the grayscale value difference between pixels. Pixels with similar grayscale values to the current pixel (x,y) are given larger weights, and pixels with larger differences are given smaller weights. S33, outputting the weighted average pixel value of all pixel values in the neighborhood, and the product of the spatial domain weight function and the grayscale domain weight function; S34, using the Pearson correlation coefficient to measure the correlation between photovoltaic power generation and each feature, and judging the correlation between photovoltaic power generation and the feature according to the calculated value. When the value is close to 1, there is a positive correlation, close to -1, there is a negative correlation, and close to 0, there is no correlation between the two. In step S34, the Pearson correlation coefficient formula is: Among them, n is the number of samples, X is the sample value of photovoltaic power generation data, Z is the sample value of characteristic data of irradiance and temperature, and r is the Pearson correlation coefficient.
5. The photovoltaic power generation prediction method based on the fusion model according to claim 4 is characterized by: In steps S31 and S32, the bilateral filtering algorithm formula is: R(x,y) represents the pixel value after bilateral filtering, and I(x',y') represents the original grayscale value w of other pixels in the neighborhood s ((x',y'),(x,y)) is the spatial domain weight function, which is used to measure the spatial distance between the neighboring pixel (x',y') and the target pixel (x,y), w r (I(x',y'),I(x,y)) is the grayscale domain weight function, which measures the grayscale value difference between pixels. p is the normalization factor to ensure that the sum of weights is 1; Ω = {(x', y') | pixels within the neighborhood}, which represents the set of all neighborhood pixels used in the filtering calculation process.
6. The photovoltaic power generation prediction method based on the fusion model according to claim 1 is characterized by: Step S4 specifically includes: S41, selecting a feature set with a positive Pearson correlation coefficient as a feature space to be screened, and arranging and combining each feature to generate a feature vector; S42. Use the support vector machine regression model, input each feature vector for training, and calculate the root mean square error value through cross-validation. The smaller the RMSE value, the higher the correlation between the feature vector and the photovoltaic power generation.
7. The photovoltaic power generation prediction method based on the fusion model according to claim 6 is characterized by: Step S42 specifically includes: S421, dividing the feature vector into a training set and a test set, using 2 / 3 of the data for model training and 1 / 3 of the data for testing the performance of the model; S422. Use the features and target values in the training set to train a support vector machine regression model, and use the machine learning library scikit-learn to implement the training process; S423, using Gaussian kernel function and K-fold cross validation method, the training set model is trained for each fold of data, and the test set uses the root mean square error RMSE value to evaluate the model. The formula is as follows Where n is the number of samples, t i is the true target value, is the target value predicted by the model; S424, repeat the above steps multiple times until each cross-validation is completed, calculate the average value of the RMSE of all fold cross-validations as the final evaluation indicator of the vector machine correlation, and select the vector set with the smallest RMSE value as the final filtered feature vector.
8. The photovoltaic power generation prediction method based on the fusion model according to claim 1 is characterized by: Step S5 specifically includes: S51. Find the linear relationship between photovoltaic power generation and irradiance through the attention mechanism and select the range as the boundary function when training the model and further improve the photovoltaic constraint model; S52, use the filtered features to construct training set, validation set and test set, with the proportions of 70%, 15% and 15% respectively; S53, learning and training are performed through the LSTM algorithm and constrained according to the photovoltaic model, and the predicted data that is not within the model range is penalized; S54. Use the validation set data to verify the model and continue to tune it based on the prediction results.
9. The photovoltaic power generation prediction method based on the fusion model according to claim 8 is characterized by: Step S51 specifically includes: S511. Further preprocess the data, including noise removal and outlier detection; use TensorFlow to build an attention mechanism model and add an attention layer; S512, training the model using the training set, and testing it using the test set; S513. Use photovoltaic power generation and irradiance as horizontal and vertical coordinates respectively, draw data distribution in the form of a scatter plot, observe the image distribution relationship, use a linear regression model to fit the upper and lower limit functions, and improve the photovoltaic constraint model.
10. The photovoltaic power generation prediction method based on the fusion model according to claim 8, characterized in that: Step S53 specifically includes: S531. When the boundary function is violated, a penalty loss term is added to the loss function, and the loss function is: γ(θ)=MSE data +MSE plt Where γ(θ) is the total loss, MSE data is the data loss, MSE plt To punish losses; S532, data loss function is The penalty loss function is where z i is the original value of the input, is the modified linear unit function. When the input value is negative, it returns zero, otherwise it returns the original value of the input. Ndata is the total number of data loss samples, and λ plt is a hyperparameter representing the penalty intensity of the loss function; N plt is the number of samples used to calculate the loss in the penalty term, and i represents the current sample index, which is used to traverse all samples for loss calculation.
Citation Information
Patent Citations
Photovoltaic power prediction method based on LSTM
CN114819382A
Short-term photovoltaic power generation power prediction method based on CNN-ISCA-LSTM model
CN116345555A
Photovoltaic power generation power prediction method based on depth feature fusion under domain knowledge constraint
CN117556379A
Photovoltaic power prediction method based on parameter optimization VMD and combined LSTM-GRU model
CN118074092A
Hybrid deep learning-based photovoltaic power generation prediction method and device, and storage medium
CN118554433A