A photovoltaic power generation prediction method based on a fusion model

By combining photovoltaic knowledge with the LSTM algorithm, and using bilateral filtering and Pearson correlation coefficient to screen features, a photovoltaic constraint model was established, which solved the unreasonable phenomena and resource consumption problems in photovoltaic power generation prediction, and achieved efficient and accurate photovoltaic power generation prediction.

CN119577565BActive Publication Date: 2026-04-17南京鼎研电力科技有限公司 +1
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
南京鼎研电力科技有限公司
Filing Date
2024-11-14
Publication Date
2026-04-17

AI Technical Summary

Technical Problem

Existing photovoltaic power generation prediction methods exhibit phenomena that do not conform to the laws of physics when processing photovoltaic data, and consume excessive computational resources and time, resulting in insufficient prediction accuracy and interpretability.

Method used

Combining knowledge from the photovoltaic field, feature selection is performed using a bilateral filtering algorithm and Pearson correlation coefficient. A photovoltaic constrained model is established using an attention mechanism and LSTM algorithm to select the optimal feature subset and eliminate unreasonable predictions, thereby improving the model's generalization ability.

Benefits of technology

It improves the accuracy and interpretability of photovoltaic power generation prediction, saves computing resources and time, and enhances the model's generalization ability.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119577565B_ABST
    Figure CN119577565B_ABST
Patent Text Reader

Abstract

This invention presents a photovoltaic (PV) power generation prediction method based on a fusion model, belonging to the field of photovoltaic energy. Traditional PV prediction methods rely solely on large amounts of data for model training, often resulting in predictions that contradict PV laws. Furthermore, the selection of feature subsets typically employs a single method, but PV data exhibits seasonality and uncertainty, making it difficult for a single method to accurately describe the relationship between various features and power generation. This invention integrates PV knowledge and laws with traditional prediction methods to establish a PV constraint model; it employs a combination of filtering and wrapping algorithms to build a feature subset selection model; and finally, it integrates an LSTM algorithm model for PV prediction. Therefore, this invention can efficiently select more representative and better-correlated feature subsets and impose physical constraints on the PV prediction results, thereby improving the model's performance and generalization ability, and achieving accurate PV power generation prediction.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of photovoltaic energy, specifically relating to a photovoltaic power generation prediction method based on a fusion model. Background Technology

[0002] With the rapid development of renewable energy, solar photovoltaic (PV) power generation has been widely used as a clean energy source. However, the volatility and uncertainty of PV power generation pose challenges to the stability and reliability of power systems. Therefore, accurate prediction of PV power output is crucial for better integration of solar PV power generation.

[0003] Currently, photovoltaic (PV) forecasting is mainly categorized into physical methods, statistical methods, and intelligent forecasting. Due to cost and hardware limitations, mainstream PV forecasting leans towards statistical and intelligent methods. Regression analysis within statistical methods provides a more intuitive explanation of the forecasting model and flexibly establishes linear relationships between PV power generation and various characteristics. However, due to the numerous nonlinear relationships between PV characteristics and power generation, as well as outliers and anomalies, the accuracy of statistical methods is somewhat limited. In contrast, intelligent forecasting methods demonstrate strong potential for handling complex nonlinear problems and higher fault tolerance. In particular, Long Short-Term Memory (LSTM) networks, with their superior time-series processing capabilities, can effectively capture the complex nonlinear relationships between sequence data and target output. However, this method relies solely on training with large amounts of data to build the forecasting model. PV data exhibits seasonality and uncertainty, and such models lack the constraints of PV domain knowledge, failing to eliminate physically unreasonable predictions, such as midnight power generation, high power generation under low irradiance, and low power generation under high irradiance. Furthermore, due to the massive amount of data, the model requires significant computational resources and time to learn patterns and dependencies between data during training, and continuously adjusts network parameters to optimize model performance. Summary of the Invention

[0004] This invention proposes a photovoltaic (PV) power generation prediction method based on a fusion model. By combining expertise in the PV field, a preliminary PV constraint model is established to constrain the data and effectively eliminate physically unreasonable data. In the feature selection stage, a bilateral filtering algorithm and Pearson correlation coefficient are used as filters to establish a screening model, efficiently extracting the functional relationship between each feature and PV power generation, and quickly and effectively selecting the optimal feature subset. This process not only saves model learning time but also makes the prediction results more interpretable and reliable. Subsequently, an attention mechanism is used to find the linear relationship between PV power generation and irradiance and select a range as the boundary function for training the model, further refining the PV constraint model and eliminating physically unreasonable prediction results. Finally, the LSTM algorithm is used for model training and PV prediction, thereby improving the model's generalization ability and prediction accuracy. This method provides an effective solution for PV power generation prediction, improving prediction accuracy, enhancing model generalization ability, and achieving accurate PV power generation prediction, with broad application prospects.

[0005] A photovoltaic power generation prediction method based on a fusion model includes the following steps:

[0006] S1. Obtain raw power generation data and related meteorological monitoring data through the photovoltaic power station's information acquisition system, and preprocess incomplete or missing data in the raw data;

[0007] S2. Using knowledge and laws in the photovoltaic field, the irradiance data is filtered and processed according to the daily sunrise and sunset times to obtain the average sunrise and sunset times. A preliminary photovoltaic constraint model is established, and the photovoltaic data is cleaned and filtered to generate the corresponding basic data stream.

[0008] S3. The basic data stream is smoothed and correlation analyzed using a bilateral filtering algorithm and Pearson correlation coefficient (PCC) to generate the corresponding feature space.

[0009] S4. Using the wrapper method, feature vectors are generated by permutation and combination of the feature space to be screened, and then trained to select the best subset of the given feature set.

[0010] S5. Through the photovoltaic model and LSTM algorithm, the data is input into the model for training, optimization and evaluation. Finally, the obtained photovoltaic model is put into use, and the corresponding photovoltaic power generation prediction results are obtained by inputting the data.

[0011] The beneficial effects of this invention are:

[0012] (1) For phenomena in photovoltaic data that do not conform to the laws of physics, we use photovoltaic knowledge to screen them. Through the filtering and packaging stages, we find the functional relationship between each feature and photovoltaic data, saving time and resource costs to find the best feature subset.

[0013] (2) By combining photovoltaic knowledge with attention mechanism, a photovoltaic constraint model is established by fitting the functional relationship between photovoltaic data and irradiation data, so as to realize photovoltaic prediction under a near-real physical environment.

[0014] (3) Combining photovoltaic constraint model and LSTM algorithm for photovoltaic prediction improves the generalization ability of the model and achieves more accurate photovoltaic prediction. Attached Figure Description

[0015] Figure 1 This is a flowchart of a photovoltaic power generation method based on multiple models according to an embodiment of the present invention.

[0016] Figure 2 This is a flowchart of the optimal subset selection in an embodiment of the present invention. Detailed Implementation

[0017] The technical solution of the present invention will be further described in detail below with reference to the accompanying drawings. The present invention provides a photovoltaic power generation method based on a multi-model approach, comprising the following steps:

[0018] S1. Obtain raw power generation data and related meteorological monitoring data through the photovoltaic power station's information acquisition system, and preprocess incomplete or missing data in the raw data.

[0019] Step S1 is as follows:

[0020] S11. Obtain the required photovoltaic power generation and meteorological data from the photovoltaic power station's information acquisition system, and store them as CSV files respectively.

[0021] S12. Complete the data in each CSV file by using the K-nearest neighbor completion algorithm to select the k nearest neighbors of the missing data in the set to fill in the gaps.

[0022] S13. Use the Euclidean distance method to determine proximity, find the k nearest neighbors, and calculate the average to replace the missing values; the formula for the Euclidean distance method in step S13 is:

[0023]

[0024] Xi = {x i1 ,x i2 ,...,x im Let} represent the first m dimensions of the i-th sample point, and Xj = {x j1 ,xj2 ,...,x jm} represents the first m dimensions of the j-th sample point; x ir Let x be the r-th dimension attribute of the i-th sample point. jr Let be the r-th dimension attribute of the j-th sample point.

[0025] S14. Normalize the sequence to control the sample data within the range [0,1]; the normalization formula for step S14 is:

[0026]

[0027] Where, x i Here, y represents 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, and y represents the maximum value in the original data. i This is the normalized output value, ranging from [0,1].

[0028] S2. Using knowledge and laws in the photovoltaic field, the irradiance data is filtered and processed according to the daily sunrise and sunset times to obtain the average sunrise and sunset times. A preliminary photovoltaic constraint model is established, and the photovoltaic data is cleaned and filtered to generate the corresponding basic data stream.

[0029] Step S2 is as follows:

[0030] S21. Filter and process the irradiance data, selecting two positive irradiance variables r based on the sunrise and sunset times of each day. i and s i r i For sunrise times when irradiance is positive, s i The time of sunset when the irradiance is positive.

[0031] S22. By using a flag variable, the photovoltaic data is output to different time periods. Positive power generation data outside the variable range is reset to zero, while negative power generation data within the variable range is replaced using the k-nearest neighbor completion algorithm. The average sunrise and sunset times for each season are calculated based on the season to establish a photovoltaic constraint model.

[0032] S23. Normalize the photovoltaic data, controlling the sample data within the range of [0,1]. The formula is as follows:

[0033]

[0034] Where 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. Using a bilateral filtering algorithm and Pearson correlation coefficient (PCC), the basic data stream is smoothed and correlation analysis is performed to generate the corresponding feature space.

[0036] Step S3 is as follows:

[0037] S31. Using a bilateral filtering algorithm, a spatial domain weight function w is introduced. s ((x',y'),(x,y)) measures the spatial distance between pixels. Pixels that are farther away from the current pixel (x,y) are given a smaller weight, and pixels that are closer to the current pixel are given a larger weight.

[0038] S32. Using a bilateral filtering algorithm, introduce a grayscale weight function w. r (I(x',y'),I(x,y)) measures the difference in gray values ​​between pixels. Pixels with similar gray values ​​to the current pixel (x,y) are given a larger weight, while pixels with larger differences are given a smaller weight.

[0039] In steps S31 and S32, the formula for the bilateral filtering algorithm is as follows:

[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 neighboring pixels (x',y') and the target pixel (x,y). r The grayscale weighting function (I(x',y'),I(x,y)) measures the difference in grayscale values ​​between pixels. p This is a normalization factor to ensure that the sum of the weights is 1. Ω = {(x',y') | pixels within the neighborhood}: represents the set of all neighborhood pixels used in the filtering calculation.

[0042] S33. Output the weighted average pixel value of all pixel values ​​in the neighborhood, as well as the product of the spatial domain weight function and the grayscale domain weight function.

[0043] S34. Use the Pearson correlation coefficient to measure the correlation between photovoltaic power generation and various characteristics. Based on the calculated values, determine the correlation between photovoltaic power generation and the characteristics. A value close to 1 indicates a positive correlation, close to -1 indicates a negative correlation, and close to 0 indicates no correlation. The formula for the Pearson correlation coefficient in step S34 is:

[0044]

[0045] Where 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. Using the wrapper method, feature vectors are generated by permutation and combination of the feature space to be screened, and then trained to select the best subset of the given feature set.

[0047] Step S4 is as follows:

[0048] S41. Select the feature set with a positive Pearson correlation coefficient as the feature space to be screened, and arrange and combine the features to generate feature vectors.

[0049] S42. Use a support vector machine regression model, input each feature vector for training, and calculate the root mean square error (RMSE) through cross-validation. The smaller the RMSE value, the higher the correlation between the feature vector and photovoltaic power generation.

[0050] Step S42 is as follows:

[0051] S421. Divide the feature vectors into training and testing sets, use 2 / 3 of the data for model training, and use 1 / 3 of the data for testing the model's performance.

[0052] S422. Use the features and target values ​​on 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 the Gaussian kernel function and K-fold cross-validation, the model is trained on a training set for each fold of data. The root mean square error (RMSE) is used to evaluate the model on the test set, as shown in the following formula.

[0054]

[0055] Where n is the number of samples, t i It is the actual target value. It 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 RMSE of all folded cross-validations as the final evaluation index of the vector machine correlation. Select the vector set with the smallest RMSE value as the final selected feature vector.

[0057] S5. Through the photovoltaic model and LSTM algorithm, the data is input into the model for training, optimization and evaluation. Finally, the obtained photovoltaic model is put into use, and the corresponding photovoltaic power generation prediction results are obtained by inputting the data.

[0058] Step S5 is as follows:

[0059] S51. Find the linear relationship between photovoltaic power generation and irradiance through the attention mechanism and select a range as the boundary function when training the model, and further improve the photovoltaic constraint model.

[0060] S52. Construct training, validation, and test sets using the selected features, with proportions of 70%, 15%, and 15%, respectively.

[0061] S53. The LSTM algorithm is used for learning and training, and constraints are applied according to the photovoltaic model. Predictions that are outside the model's range are penalized.

[0062] S54. Use the validation set data to validate the model and continue to fine-tune it based on the prediction results.

[0063] Comparison table of raw data and predicted data

[0064]

[0065]

[0066] Overall error calculation:

[0067] The root mean square error (RMSE) for that 24-hour period is calculated using the error formula:

[0068]

[0069] n: The total number of samples, i.e. the number of prediction time points. The model prediction at time point i, i.e., the predicted power generation. i The actual observed value at time point i represents the actual power generation. The root mean square error between the model's prediction and the actual power generation is 0.48 kWh, indicating that the model can accurately predict power generation.

[0070] The above description is only a preferred embodiment of the present invention. The scope of protection of the present invention is not limited to the above embodiments. Any equivalent modifications or changes made by those skilled in the art based on the content disclosed in the present invention should be included within the scope of protection set forth in the claims.

Claims

1. A photovoltaic power generation prediction method based on a fusion model, characterized in that: The method includes the following steps: S1. Obtain raw power generation data and related meteorological monitoring data through the photovoltaic power station's information acquisition system, and preprocess incomplete or missing data in the raw data; S2. Using knowledge and laws in the photovoltaic field, the irradiance data is filtered and processed according to the daily sunrise and sunset times to obtain the average sunrise and sunset times. A preliminary photovoltaic constraint model is established, and the photovoltaic data is cleaned and filtered to generate the corresponding basic data stream. S3. The basic data stream is smoothed and correlation analyzed using a bilateral filtering algorithm and Pearson correlation coefficient (PCC) to generate the corresponding feature space. Step S3 specifically involves: S31. Use a bilateral filtering algorithm and introduce a spatial domain weighting function. Measure the spatial distance between pixels, the distance from the current pixel Pixels that are farther away are assigned a smaller weight, while pixels that are closer are assigned a larger weight. S32. Use a bilateral filtering algorithm and introduce a grayscale weighting function. The difference in grayscale values ​​between pixels is measured relative to the current pixel. Pixels with similar gray values ​​are given greater weight, while pixels with large differences are given less weight. 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; S34. Use the Pearson correlation coefficient to measure the correlation between photovoltaic power generation and various characteristics. Based on the calculated values, determine the correlation between photovoltaic power generation and the characteristics. A value close to 1 indicates a positive correlation, close to -1 indicates a negative correlation, and close to 0 indicates no correlation. The formula for the Pearson correlation coefficient in step S34 is: in, For the sample size, These are sample values ​​of photovoltaic power generation data. These are sample values ​​of characteristic data for irradiance and temperature. The Pearson correlation coefficient; S4. Using the wrapper method, feature vectors are generated by permutation and combination of the feature space to be screened, and then trained to select the best subset of the given feature set. Step S4 specifically involves, S41. Select the feature set with a positive Pearson correlation coefficient as the feature space to be screened, and arrange and combine the features to generate feature vectors; S42. Use a support vector machine regression model, input each feature vector for training, and calculate the root mean square error (RMSE) through cross-validation. The smaller the RMSE value, the higher the correlation between the feature vector and photovoltaic power generation. S5. Through the photovoltaic model and LSTM algorithm, the data is input into the model for training, optimization and evaluation. Finally, the obtained photovoltaic model is put into use, and the corresponding photovoltaic power generation prediction results are obtained by inputting the data.

2. The photovoltaic power generation prediction method based on a fusion model according to claim 1, characterized in that: Step S1 specifically involves: S11. Obtain the required photovoltaic power generation and meteorological data from the photovoltaic power station's information acquisition system, and store them as CSV files respectively; S12. Complete the data in each CSV file by using the K nearest neighbor completion algorithm to select the k nearest neighbors of the missing data in the set to fill in the gaps. S13. Use the Euclidean distance method to determine proximity, find the k nearest neighbors, and calculate the average to replace the missing values; the formula for the Euclidean distance method in step S13 is: For the first m dimensions of the i-th sample point, This represents the first m dimensions of the j-th sample point; Let r be the r-th dimension attribute of the i-th sample point. Let r be the r-th dimension attribute of the j-th sample point; S14. Normalize the sequence to control the sample data within the range [0,1]; the normalization formula for step S14 is: in, The raw photovoltaic power generation data to be normalized The maximum value in the original data. The minimum value in the original data. This is the normalized output value, ranging from [0,1].

3. The photovoltaic power generation prediction method based on a fusion model according to claim 1, characterized in that: Step S2 specifically involves: S21. Filter the irradiance data and select two positive irradiance variables based on the sunrise and sunset times of each day. and , The sunrise time when the irradiance is positive. The sunset time when the irradiance is positive; S22. By using a flag variable, the photovoltaic data is output to different time periods. Positive power generation data outside the variable range is reset to zero, while negative power generation data within the variable range is replaced using the k-nearest neighbor completion algorithm. The average sunrise and sunset times for each season are calculated based on the season to establish a photovoltaic constraint model. S23. Normalize the photovoltaic data, controlling the sample data within the range of [0,1]. The formula is as follows: in, The value to be normalized in the irradiation data. The maximum value in the irradiation data. This is the minimum value in the irradiation data. This is the normalized output value, ranging from [0,1].

4. The photovoltaic power generation prediction method based on a fusion model according to claim 1, characterized in that: In steps S31 and S32, the formula for the bilateral filtering algorithm is as follows: This represents the pixel value after bilateral filtering. Represents the original grayscale value of other pixels in the neighborhood. This is a spatial domain weighting function used to measure the weights of neighboring pixels. With target pixel Spatial distance between It is a grayscale weighting function that measures the difference in grayscale values ​​between pixels. As a normalization factor, it ensures that the sum of weights is 1; ={ The set of all neighboring pixels used in the filtering calculation process is represented by the set of pixels within the neighborhood range.

5. The photovoltaic power generation prediction method based on a fusion model according to claim 1, characterized in that: Step S42 specifically involves, S421. Divide the feature vectors into training and testing sets, use 2 / 3 of the data for model training, and 1 / 3 of the data for testing the model's performance. S422. Use the features and target values ​​on the training set to train the support vector machine regression model, and use the machine learning library scikit-learn to implement the training process. S423. Using the Gaussian kernel function and K-fold cross-validation, the model is trained on a training set for each fold of data. The root mean square error (RMSE) is used to evaluate the model on the test set, as shown in the following formula. in, It is the sample size. It is the actual target value. It is the target value predicted by the model; S424. Repeat the above steps multiple times until each cross-validation is completed. Calculate the average RMSE of all folded cross-validations as the final evaluation index of the vector machine correlation. Select the vector set with the smallest RMSE value as the final selected feature vector.

6. The photovoltaic power generation prediction method based on a fusion model according to claim 1, characterized in that: Step S5 specifically involves: S51. Find the linear relationship between photovoltaic power generation and irradiance through the attention mechanism and select a range as the boundary function when training the model, and further improve the photovoltaic constraint model. S52. Construct training, validation, and test sets using the selected features, with proportions of 70%, 15%, and 15%, respectively. S53. The LSTM algorithm is used for learning and training, and the photovoltaic model is constrained. Predictions that are outside the model range are penalized. S54. Use the validation set data to validate the model and continue to fine-tune it based on the prediction results.

7. The photovoltaic power generation prediction method based on a fusion model according to claim 6, characterized in that: Step S51 specifically involves: S511. Perform further preprocessing on the data, including noise removal and outlier detection; build an attention mechanism model using TensorFlow and add an attention layer; S512. Train the model using the training set and test it using the test set; S513. Using photovoltaic power generation and irradiance as the horizontal and vertical axes respectively, plot the data distribution in the form of a scatter plot, observe the distribution relationship of the images, use a linear regression model to fit the upper and lower limit functions, and improve the photovoltaic constraint model.

8. The photovoltaic power generation prediction method based on a fusion model according to claim 6, characterized in that: Step S53 specifically involves, S531. When the boundary function is violated, a penalty loss term is added to the loss function, and the loss function is: in For the total loss, For data loss, To punish the loss; S532, the data loss function is: The penalty loss function is in The original input value, To correct the linear unit function, return zero if the input value is negative, otherwise return the original input value. The total number of data loss samples, Let be a hyperparameter representing the strength of the penalty applied to the loss function; The number of samples used to calculate the loss in the penalty item. This represents the index of the current sample, used to iterate through all samples for loss calculation.

Citation Information

Patent Citations

  • Short-term photovoltaic power generation power prediction method based on CNN-ISCA-LSTM model

    CN116345555A

  • Photovoltaic output prediction method based on MODWT and improved BiLSTM

    CN118611018A