Photovoltaic generating capacity prediction method and device based on model prediction control, equipment and medium
By matching target user data with pre-divided user clusters and combining model predictive control technology to optimize photovoltaic power generation prediction, the problem of insufficient prediction accuracy under large-scale user groups and complex climatic conditions is solved, and high-precision photovoltaic power generation prediction is achieved.
Patent Information
- Application Number
- CN202511866658.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-10
- Publication Date
- 2026-02-13
AI Technical Summary
Existing photovoltaic power generation forecasting methods are difficult to adapt to large-scale user groups and complex climate and geographical factors, resulting in insufficient forecast accuracy.
By matching target user data with pre-divided user clusters, user clusters are established using similarity based on geographical and climatic features. Combined with model predictive control technology, the initial photovoltaic power generation prediction results are optimized to construct a personalized power generation prediction model.
It improves the model's adaptability and final prediction accuracy under complex and variable weather conditions, realizes the utilization of geographical and climatic correlations among multiple user groups, and overcomes the defect of ignoring synergistic effects.
Smart Images

Figure CN121529544A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of power generation prediction technology, and in particular to a method, apparatus, equipment and medium for predicting photovoltaic power generation based on model predictive control. Background Technology
[0002] Current photovoltaic power generation forecasting methods involve building models for individual users and using these models to predict power generation. This approach has limitations in adapting to large-scale user groups and complex climate and geographical factors.
[0003] Therefore, how to predict power generation under conditions of large-scale user groups and complex climate and geographical factors has become a technical problem that needs to be solved. Summary of the Invention
[0004] In view of this, the purpose of this invention is to provide a method, apparatus, equipment, and medium for predicting photovoltaic power generation based on model predictive control. This method improves the adaptability of the model under complex and variable weather conditions and enhances the final prediction accuracy by matching target user data with pre-divided user clusters. The specific solution is as follows:
[0005] In a first aspect, this application provides a photovoltaic power generation prediction method based on model predictive control, including:
[0006] The initial photovoltaic power generation data of the target user is obtained, and the initial photovoltaic power generation data is preprocessed to obtain the corresponding target photovoltaic power generation data; wherein, the photovoltaic power generation data includes photovoltaic power generation and corresponding climate information;
[0007] The target photovoltaic power generation data is matched with pre-divided user clusters, and the target user cluster corresponding to the target photovoltaic power generation data is determined based on the distance between the target photovoltaic power generation data and the cluster centers corresponding to each user cluster; wherein, the user cluster is a grouping of user data based on the similarity of geographical and climatic characteristics of different users, and the power generation prediction model corresponding to different user clusters is different;
[0008] Photovoltaic power generation is predicted using the target power generation prediction model corresponding to the target user cluster and the target photovoltaic power generation data to obtain the initial photovoltaic power generation prediction result corresponding to the target user. The initial photovoltaic power generation prediction result is then optimized based on model prediction control technology to obtain the corresponding target photovoltaic power generation prediction result.
[0009] Optionally, before obtaining the initial photovoltaic power generation data of the target user, the method further includes:
[0010] Historical photovoltaic power generation data corresponding to several users under different natural conditions is obtained. Outliers are removed from the historical photovoltaic data to obtain the corresponding processed historical power generation data. Missing values are filled into the processed historical power generation data according to the data type and data distribution characteristics of the historical photovoltaic power generation data to obtain the corresponding target historical power generation data.
[0011] Based on the similarity of natural conditions among the historical power generation data of each target, the historical power generation data of each target is divided into several user clusters, and a corresponding power generation prediction model is trained for each user cluster.
[0012] Optionally, dividing the target historical power generation data into several user clusters based on the similarity of natural conditions among the target historical power generation data includes:
[0013] Key data features are selected from the historical power generation data of each target. Based on the elbow rule and the silhouette coefficient evaluation method, error sum of squares curves and silhouette coefficient curves corresponding to different numbers of candidate clusters are constructed respectively. The number of target clusters is determined according to the error sum of squares curves and the silhouette coefficient curves.
[0014] Based on the target clustering algorithm, the key data features, and the number of target clusters, the historical power generation data of each target are divided into several user clusters.
[0015] Optionally, training corresponding power generation prediction models for each of the user clusters includes:
[0016] Different initial climate features in the same user cluster are combined to obtain fused climate features. Target fused features are selected from each of the fused climate features. Based on the correlation between the target fused features in each user cluster and the corresponding photovoltaic power generation, corresponding power generation prediction models are trained for each user cluster.
[0017] Optionally, the photovoltaic power generation prediction method based on model predictive control further includes:
[0018] If the distance between the target photovoltaic power generation data and the cluster center of any user cluster is greater than a preset threshold, a new user cluster corresponding to the target photovoltaic power generation data is created, and a power generation prediction model corresponding to the new user cluster is trained based on the target photovoltaic power generation data.
[0019] Optionally, the optimization of the initial photovoltaic power generation prediction result based on model predictive control technology includes:
[0020] A target physical model is constructed based on the physical characteristics of photovoltaic modules, and the theoretical power generation is calculated using the target physical model; wherein, the target physical model is a model constructed based on the mapping relationship between light intensity, temperature and photovoltaic power generation.
[0021] The initial photovoltaic power generation prediction results are optimized using model predictive control technology and the theoretical power generation.
[0022] Optionally, after optimizing the initial photovoltaic power generation prediction result using model predictive control technology, the method further includes:
[0023] Obtain the actual power generation data corresponding to the target user, calculate the error value between the actual power generation data and the target photovoltaic power generation prediction result, and adjust the parameters of the target power generation prediction model according to the error value.
[0024] Secondly, this application provides a photovoltaic power generation prediction device based on model predictive control, comprising:
[0025] The data preprocessing module is used to acquire the initial photovoltaic power generation data of the target user and preprocess the initial photovoltaic power generation data to obtain the corresponding target photovoltaic power generation data; wherein, the photovoltaic power generation data includes photovoltaic power generation and corresponding climate information;
[0026] The user cluster determination module is used to match the target photovoltaic power generation data with pre-divided user clusters, and determine the target user cluster corresponding to the target photovoltaic power generation data based on the distance between the target photovoltaic power generation data and the cluster centers corresponding to each user cluster; wherein, the user cluster is a grouping of user data based on the similarity of geographical and climatic characteristics of different users, and the power generation prediction model corresponding to different user clusters is different;
[0027] The power generation prediction module is used to predict photovoltaic power generation using the target power generation prediction model corresponding to the target user cluster and the target photovoltaic power generation data, so as to obtain the initial photovoltaic power generation prediction result corresponding to the target user, and optimize the initial photovoltaic power generation prediction result based on model prediction control technology to obtain the corresponding target photovoltaic power generation prediction result.
[0028] Thirdly, this application provides an electronic device, comprising:
[0029] Memory, used to store computer programs;
[0030] A processor is used to execute the computer program to implement the aforementioned photovoltaic power generation prediction method based on model predictive control.
[0031] Fourthly, this application provides a computer-readable storage medium for storing a computer program, which, when executed by a processor, implements the aforementioned photovoltaic power generation prediction method based on model predictive control.
[0032] This application first obtains initial photovoltaic power generation data of the target user and preprocesses the initial photovoltaic power generation data to obtain corresponding target photovoltaic power generation data. The photovoltaic power generation data includes photovoltaic power generation and corresponding climate information. Then, the target photovoltaic power generation data is matched with pre-divided user clusters. Based on the distance between the target photovoltaic power generation data and the cluster centers corresponding to each user cluster, the target user cluster corresponding to the target photovoltaic power generation data is determined. The user cluster is a group of user data established based on the similarity of geographical and climatic characteristics of different users. Different user clusters correspond to different power generation prediction models. Finally, the target power generation prediction model corresponding to the target user cluster and the target photovoltaic power generation data are used to predict photovoltaic power generation to obtain the initial photovoltaic power generation prediction result corresponding to the target user. The initial photovoltaic power generation prediction result is then optimized based on model predictive control technology to obtain the corresponding target photovoltaic power generation prediction result. Therefore, this application achieves the utilization of geographical and climatic correlations among multiple user groups by matching target user data with pre-divided user clusters, overcoming the shortcomings of treating each user as an independent individual and ignoring synergistic effects; by calling the dedicated prediction model corresponding to the user cluster for preliminary prediction and combining the model prediction control technology to dynamically optimize the results, it achieves real-time correction and adjustment of the initial prediction results, effectively improving the model's adaptability and final prediction accuracy under complex and variable weather conditions. Attached Figure Description
[0033] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on the provided drawings without creative effort.
[0034] Figure 1 This is a flowchart of a photovoltaic power generation prediction method based on model predictive control disclosed in this application;
[0035] Figure 2 This is a schematic diagram of a photovoltaic power generation prediction process disclosed in this application;
[0036] Figure 3 This application discloses a user cluster partitioning flowchart;
[0037] Figure 4This is a schematic diagram of a power generation prediction result disclosed in this application;
[0038] Figure 5 This is a flowchart of a model training method disclosed in this application;
[0039] Figure 6 This is a flowchart of a power generation prediction method disclosed in this application;
[0040] Figure 7 This is a schematic diagram of a photovoltaic power generation prediction device based on model predictive control disclosed in this application.
[0041] Figure 8 This is a structural diagram of an electronic device disclosed in this application. Detailed Implementation
[0042] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0043] Current photovoltaic (PV) power generation forecasting methods suffer from limitations in adapting to large-scale user groups and complex climate and geographical factors. To address this, this application provides a model-based predictive control method for PV power generation forecasting. By matching target user data with pre-defined user clusters, the method improves the model's adaptability and final prediction accuracy under complex and variable weather conditions.
[0044] See Figure 1 As shown in the figure, an embodiment of the present invention discloses a photovoltaic power generation prediction method based on model predictive control, comprising:
[0045] Step S11: Obtain the initial photovoltaic power generation data of the target user, and preprocess the initial photovoltaic power generation data to obtain the corresponding target photovoltaic power generation data; wherein, the photovoltaic power generation data includes photovoltaic power generation and corresponding climate information.
[0046] The overall process for photovoltaic power generation prediction in this embodiment is as follows: Figure 2 As shown, the data acquisition module collects real-time meteorological data, geographic information, local climate data, equipment operation data, power generation attenuation rate, and historical power generation data from multi-user photovoltaic power stations and transmits them to the processing and storage module. The collected data is then cleaned and preprocessed, with a focus on integrating and storing regional user power generation average data relevant to the geographic environment.
[0047] The prediction model module utilizes the aforementioned data, incorporating average user data in the geographical environment as a correction term. Through Model Predictive Control (MPC) optimization and considering inter-user correlations, it uncovers the correlation between user geographic location and power generation characteristics. A prediction model is constructed and trained, and a dynamically adaptive joint prediction algorithm adjusts the model's parameters and structure based on real-time data changes and environmental conditions for different users. The feedback correction module compares daily actual power generation with predicted values, using error correction to adjust the prediction results, allowing the prediction model to continuously optimize its prediction strategy based on real-time feedback. The entire system iterates continuously, optimizing predictions based on new data, thereby improving the accuracy and control effect of photovoltaic power generation predictions, contributing to the efficient operation of photovoltaic power plants and the stable dispatch of the power system.
[0048] In this embodiment, before obtaining the initial photovoltaic power generation data of the target user, the method further includes: obtaining historical photovoltaic power generation data corresponding to several users under different natural conditions; removing outliers from the historical photovoltaic data to obtain the corresponding processed historical power generation data; filling missing values in the processed historical power generation data according to the data type and data distribution characteristics of the historical photovoltaic power generation data to obtain the corresponding target historical power generation data; dividing each target historical power generation data into several user clusters according to the similarity of natural conditions between each target historical power generation data, and training corresponding power generation prediction models for each user cluster.
[0049] The data collection and preprocessing process described above is as follows: Comprehensive data on photovoltaic power generation (i.e., initial photovoltaic power generation data) is collected from user terminals across numerous geographical regions and climatic conditions. This includes, but is not limited to, detailed historical power generation time-series data and corresponding local real-time climate data, such as weather, temperature, precipitation, and solar radiation intensity. Simultaneously, accurate local geographic information data, such as latitude and longitude coordinates and altitude, is integrated. Intelligent data integrity checking algorithms and outlier identification technology are used to preprocess the collected data. Missing data is filled based on data type and distribution characteristics. For data with obvious time-series characteristics (such as power generation and sunshine duration), advanced time-series prediction models, such as LSTM (Long Short-Term Memory) neural network models, are used to predict and fill in missing values to maximize the restoration of data integrity and continuity. For outliers, a multi-dimensional data feature space is established, and reasonable thresholds are set based on data distribution patterns, physical constraints, and historical data statistical ranges. Outlier detection algorithms from data mining techniques are used to accurately identify outliers. Corrective values are then applied based on local trends and overall distribution characteristics, and smoothing of adjacent data is employed to effectively correct them, ensuring data quality and reliability. The cleaned data undergoes standardization to unify data with different characteristics to a similar scale range, eliminating calculation biases caused by differences in data magnitude. Furthermore, to eliminate data incomparability due to differences in photovoltaic system installed capacity, component specifications, and installation angles among different users, this embodiment standardizes the original power generation data: First, the installed capacity and component power of each user are uniformly converted into the equivalent number of standard components; second, based on the physical correlation model between photovoltaic component azimuth angle, tilt angle, and power generation efficiency, the actual power generation capacity under different installation configurations is mapped to a unified standard operating condition; ultimately, the power generation performance of all users is normalized to the same evaluation benchmark, providing a consistent and comparable data foundation for subsequent analysis and modeling.
[0050] To improve the accuracy of photovoltaic power generation prediction, this embodiment uses cluster analysis to provide MPC with highly discriminative input features and model adaptation basis. Then, based on the clustering results, a basic prediction model is selected or trained to improve the prediction accuracy of MPC. Finally, MPC integrates these clustered models and dynamically adjusts the basic prediction model called. By building a photovoltaic power generation prediction system that integrates Model Predictive Control (MPC) and multiple models, the accuracy and real-time performance of photovoltaic power generation prediction are improved, overcoming the shortcomings of existing prediction methods in dealing with complex and ever-changing environments.
[0051] Accordingly, the process of dividing the historical power generation data of each target into several user clusters based on the similarity of natural conditions among the historical power generation data of each target includes: selecting key data features from the historical power generation data of each target; constructing error sum of squares curves and silhouette coefficient curves corresponding to different numbers of candidate clusters based on the elbow rule and the silhouette coefficient evaluation method; determining the number of target clusters based on the error sum of squares curves and the silhouette coefficient curves; and dividing the historical power generation data of each target into several user clusters based on the target clustering algorithm, key data features, and the number of target clusters.
[0052] In this embodiment, cluster analysis is used to process photovoltaic (PV) power generation related data. For the PV power generation related data, which includes traditional factors such as light intensity, temperature, time, and geographical location, this embodiment also adds user region characteristics. Cluster analysis is first used to divide the data according to the user's geographical location and administrative region. Based on this regional division, the data is further grouped according to the similarity of data within the same region, ensuring that data within the same group has high regional similarity, while data in different groups has significant differences. This allows for the identification of data clusters with different characteristics for the MPC (Multi-Center for Computational Processing), serving as the basis for subsequent model input and adaptation. The cluster analysis process is as follows: Figure 3 As shown. Key features that can determine clustering are selected from the preprocessed data, and the optimal number of clusters is determined using an algorithm. Then, the K-means clustering algorithm is used to divide users into different clusters. The user data within each cluster is analyzed, and different prediction models are selected. Specifically:
[0053] (1) By combining data mining technology with domain expert knowledge, key data dimensions (i.e. key data features) that are closely related to photovoltaic power generation and can distinguish the characteristics of different user groups are selected from the preprocessed data as clustering features. For example, climate features such as sunshine duration and average temperature that have a decisive impact, as well as geographical features such as latitude and longitude that can reflect geographical differences, and historical power generation data.
[0054] (2) Determine the optimal number of clusters. Using the elbow rule combined with the silhouette coefficient evaluation method, plot the sum of squared errors (SSE) curve and the silhouette coefficient curve under different values. Analyze the inflection point of the curve and the optimal value of the silhouette coefficient, and select the value that both point to as the optimal number of clusters (i.e., the target number of clusters) to ensure that the clustering results can reflect the inherent structural differences of the data to the greatest extent, while maintaining good cluster compactness and separability.
[0055] (3) K-means clustering method process. Divide the given dataset X into K clusters C such that the sum of the distances from each data point to the centroid of its cluster is minimized. Then randomly select K data points as initial centroids, or use other specific initialization methods, such as K-means++. Iterate through the data point allocation and centroid update until the centroids no longer change significantly or the maximum number of iterations is reached.
[0056] It should be noted that the user cluster in this embodiment is constructed based on a large number of real user photovoltaic systems, which have accumulated massive power generation data from more than ten years of long-term stable operation.
[0057] The above steps complete the clustering of different users, dividing users in the same region into different clusters, analyzing the characteristics of user data within each cluster, extracting useful information, and customizing personalized prediction models for different cluster categories. It should be noted that clustering is only a one-time preprocessing step in the MPC initialization phase; subsequent re-clustering is only triggered when the data distribution changes significantly.
[0058] The foregoing describes the process of training corresponding power generation prediction models for each user cluster, including: combining different initial climate features in the same user cluster to obtain fused climate features, selecting target fused features from each fused climate feature, and training corresponding power generation prediction models for each user cluster based on the correlation between the target fused features and the corresponding photovoltaic power generation.
[0059] Step S12: Match the target photovoltaic power generation data with the pre-divided user clusters, and determine the target user clusters corresponding to the target photovoltaic power generation data based on the distance between the target photovoltaic power generation data and the cluster centers corresponding to each user cluster; wherein, the user clusters are user data groups established based on the similarity of geographical and climatic characteristics of different users, and the power generation prediction models corresponding to different user clusters are different.
[0060] In this embodiment, when a new user requires power generation forecasting, climate data and historical power generation data for the user's location are collected. Based on historical similar weather pattern matching, a similarity algorithm is used to compare future forecast weather sequences with historical weather patterns, selecting the best-matching historical time periods. Historical dates with high weather condition similarity are assigned higher weights, ensuring the predicted values more closely match the power generation patterns of these high-weighted historical dates. The data is then cleaned and standardized according to the aforementioned rigorous data preprocessing methods to ensure consistency and comparability between the new and existing data. The same efficient distance calculation method used in the clustering stage is employed to calculate the distance between the new user's data and each cluster center. A precise category assignment strategy is used to assign the new user to the category of the nearest cluster center. The feature data of the new user's location is input into the prediction model of the corresponding cluster category to obtain the photovoltaic power generation prediction results output by the prediction model.
[0061] It should be noted that if the distance between the target photovoltaic power generation data and the cluster center of any user cluster is greater than a preset threshold, a new user cluster corresponding to the target photovoltaic power generation data is created, and a power generation prediction model corresponding to the new user cluster is trained based on the target photovoltaic power generation data.
[0062] In other words, if a new user does not belong to any of the clusters, the new user is treated as a new category and saved in the clustering results. For this new category of data, the GRU (Gated Recurrent Unit) model is retrained to obtain the power generation data prediction results.
[0063] Step S13: Utilize the target power generation prediction model corresponding to the target user cluster and the target photovoltaic power generation data to predict photovoltaic power generation, thereby obtaining the initial photovoltaic power generation prediction result corresponding to the target user, and optimize the initial photovoltaic power generation prediction result based on model prediction control technology to obtain the corresponding target photovoltaic power generation prediction result.
[0064] In this embodiment, clustering analysis and prediction models are used as the pre-processing data optimization and dynamic model adaptation tools for MPC. By clustering users / power plants into groups, differentiated prediction model inputs are provided for MPC. Based on the clustering results, specific prediction models are selected or trained to improve the prediction accuracy of MPC. The real-time optimization results of MPC guide the updating of clustering features, forming a closed-loop system.
[0065] The process of optimizing the initial photovoltaic power generation prediction results based on model predictive control technology includes: constructing a target physical model based on the physical characteristics of the photovoltaic module, and calculating the theoretical power generation using the target physical model; wherein, the target physical model is a model constructed based on the mapping relationship between light intensity, temperature and photovoltaic power generation; and optimizing the initial photovoltaic power generation prediction results using model predictive control technology and theoretical power generation.
[0066] Specifically, the system first integrates the basic prediction models, incorporating the various cluster prediction sub-models into the MPC framework as prediction models. Based on the cluster to which the current data belongs, the system calls the corresponding sub-model to predict photovoltaic power generation over a future period. The system quickly matches the corresponding cluster model by monitoring data characteristics in real time, ensuring the relevance and accuracy of the predictions.
[0067] Next, an MPC physical model (i.e., the target physical model) is constructed. This model, based on the physical characteristics of photovoltaic modules and the relationship between factors such as light intensity and temperature, theoretically describes the photovoltaic power generation process. This model considers the impact of various factors, including light intensity, temperature, and power generation degradation rate, on photovoltaic power generation. The model can be expressed as:
[0068] ;
[0069] in, The predicted photovoltaic power generation at time k+1 The actual value of photovoltaic power generation at time k. The light intensity at time k, The temperature at time k, These are the model parameters.
[0070] Using the photovoltaic power generation system model established above, Model Predictive Control (MPC) is employed for optimization. The core objective of MPC is to minimize the error between the predicted power generation and the target power generation within the prediction time domain. Its objective function can be expressed as:
[0071] ;
[0072] The state transition equation is incorporated as a constraint into the optimization problem of MPC. When solving the objective function, it is ensured that the predicted power generation conforms to the physical laws and actual operating characteristics of the photovoltaic power generation system. By optimizing the control variable u(k), the predicted power generation is made as close as possible to the target power generation while satisfying the state transition equation. The state transition equation is:
[0073] ;
[0074] in, The photovoltaic power generation reference value at time k+i This represents the photovoltaic power generation value predicted at time k+i based on information from time k. In other words, it's the power generation estimate for the next i time steps from time k. u(k) represents control variables, such as the inverter's operating voltage and current. N represents the prediction time domain, which determines the time span over which the model predicts future power generation. For example, N=24 means the model will predict for 24 future time steps. The cost weighting coefficient is used to balance the predicted power generation. and These are the lower and upper limits of the control variable, respectively.
[0075] MPC combines the predictions from the base model with the calculations from the physical model, taking into account various factors to further optimize prediction and control decisions, correct prediction results, and improve the accuracy and reliability of predictions.
[0076] Furthermore, this embodiment also utilizes dynamic optimization of time-domain parameters. The prediction time domain N determines the time span for the model's prediction of future power generation, while the control time domain M determines the time range of the control variables' effects in each optimization calculation. This refers to the number of future time steps required to determine the control action in the model's predictive control algorithm, starting from the current moment. This invention achieves dynamic adjustment of the prediction and control time domains and is deeply integrated with clustering results. After clustering analysis, different user clusters are adapted to different prediction and control time domains. For medium-term power generation prediction, N=24 hours and M=6 hours are used. In addition, the system dynamically adjusts the values of N and M based on different seasonal characteristics, weather changes, and the operating status of photovoltaic power plants. For example, during periods of drastic weather changes, the prediction time domain is appropriately shortened to improve the model's response to short-term changes. During stable operation, the prediction time domain is extended to improve the accuracy of medium- and long-term predictions. That is, the power generation prediction method in this embodiment is for medium-term time period (e.g., power generation within one week to one month). By adjusting the prediction time domain and controlling the time domain, this embodiment can also make short-term (e.g., 1 hour) or long-term (e.g., 3 months) power generation predictions.
[0077] In addition, in this embodiment, after optimizing the initial photovoltaic power generation prediction result based on model predictive control technology, the method further includes: obtaining the actual power generation data corresponding to the target user, calculating the error value between the actual power generation data and the target photovoltaic power generation prediction result, and adjusting the parameters of the target power generation prediction model according to the error value.
[0078] Specifically, this implementation uses rolling optimization to address multiple scenarios. At each sampling moment, the system collects the latest weather data, equipment operation data, power generation attenuation rate, etc., in real time as input parameters to update the prediction model and optimization problem. It obtains the control variables at the current moment and the predicted photovoltaic power generation for a future period. The MPC measures the actual output of the system in real time and compares it with the model's predicted value to determine the prediction error. This error is then used to correct the model's predicted value, improving control accuracy. Feedback correction is then performed. To prevent deviations from the ideal state caused by model mismatch or interference, at a new sampling moment, the actual output of power generation data is first detected, and this real-time information is used to correct the model's prediction results before further optimization. In special circumstances such as sudden weather changes or equipment failures, the MCP control input parameters are added to the model as additional input variables. The system quickly adjusts the prediction model, recalculates, and obtains new control variables and predicted photovoltaic power generation values. This process is repeated continuously to achieve real-time prediction of photovoltaic power generation. In this implementation, the predicted power generation for a future period is as follows: Figure 4 As shown.
[0079] Therefore, this application achieves the utilization of geographical and climatic correlations among multiple user groups by matching target user data with pre-divided user clusters, overcoming the shortcomings of treating each user as an independent individual and ignoring synergistic effects; by calling the dedicated prediction model corresponding to the user cluster for preliminary prediction and combining the model prediction control technology to dynamically optimize the results, it achieves real-time correction and adjustment of the initial prediction results, effectively improving the model's adaptability and final prediction accuracy under complex and variable weather conditions.
[0080] As can be seen from the foregoing embodiments, this application describes the overall process of photovoltaic power generation prediction. To make the technical solution in this application more complete, the following section will elaborate on how to perform model training. See [link to relevant documentation]. Figure 5 As shown, an embodiment of the present invention discloses a model training method, including:
[0081] Step S21: Combine different initial climate features in the same user cluster to obtain fused climate features, and select target fused features from each of the fused climate features.
[0082] In this embodiment, it is necessary to select or train specific prediction models based on the different data clusters obtained from clustering. Because different clusters have different data characteristics, selecting or training a suitable prediction model for each cluster allows for a better fit to the patterns of that cluster's data, thereby improving the prediction accuracy of MPC. The basic prediction model process is as follows: Figure 6As shown, the collected geographic location information, local historical weather data, and historical operational data are used as the raw input data. Next, data preprocessing such as outlier detection and missing value imputation is performed on these data to obtain the dataset for the prediction model. Feature processing and analysis are then performed on the dataset to extract time features, user features, etc., and the final power generation and power consumption data prediction results are obtained through neural network training.
[0083] After preprocessing the data, the Pearson correlation coefficient between climate data and power generation data is calculated to intuitively understand the strength of the linear or nonlinear correlation between various climate factors and power generation data. Different climate features and historical power generation characteristics are combined to construct new features (i.e., fused climate features). For example, multiplying light intensity and temperature yields a new feature representing the combined impact of light and temperature. After constructing a large number of features, redundant and irrelevant features need to be filtered to reduce model complexity and computational cost, and improve the model's generalization ability. Cross-validation is used to validate the filtered features, ensuring their stability and effectiveness. During different dataset partitioning and model training processes, the impact of features on model performance is observed, and features are adjusted and optimized in a timely manner.
[0084] Step S22: Based on the correlation between the target fusion features and the corresponding photovoltaic power generation in each user cluster, train the corresponding power generation prediction model for each user cluster.
[0085] Extracted features, such as geographic location information, weather data, long-term operational data, and short-term operational data, are trained using a gated recurrent unit (GRU) network. The GRU can capture long-term dependencies in sequential data. By learning the correlation between historical meteorological change patterns and power generation data—for example, the impact of weather conditions over the past few days or even weeks on current power generation—better power generation forecasts can be made. Considering the differentiated impact of weather conditions at different times in weather forecasts on photovoltaic power generation, this invention introduces a time-period weighted gating mechanism during the forecast process. This allows the impact of the same weather event on power generation at different times to exhibit non-linear response characteristics. Based on the specific time of occurrence of weather events such as rain or snow in the weather forecast (e.g., night or day), combined with the power generation characteristics of the photovoltaic system at different times, the forecast model is adjusted accordingly. This allows for a more accurate reflection of the impact of weather conditions on photovoltaic power generation at different times, achieving photovoltaic power generation forecasts that better reflect reality.
[0086] During GRU model training, the loss function is optimized using a sample-weighted loss function. This involves assigning different weights to different samples to adjust the model's focus on those samples. In traditional model training, each sample contributes equally to the loss function. For example, the traditional mean squared error (MSE) loss function is:
[0087] ;
[0088] Where n is the number of samples, For the true value, These are predicted values.
[0089] The modified mean squared error loss function is:
[0090] ;
[0091] in, The modified loss function is used to train the model, assigning weights to the i-th sample. During training, the model updates its parameters based on the weighted loss, thus paying more attention to samples with larger weights, i.e., samples from later dates. For power generation data, when more weights are assigned to data from later dates, the loss of these samples will account for a larger proportion of the total loss when calculating the loss function, forcing the model to focus more on learning the characteristics of these recent data. Furthermore, it should be noted that during model training, this embodiment can also use the average power generation of users in the same geographical area or under the same climatic conditions as a correction term, and use this correction term to constrain the training process of the corresponding power generation prediction model. This avoids the problem of excessive discrepancies between the model's prediction results and the actual power generation data of users in the same area or under the same climatic conditions, improving the reliability of the model's prediction results.
[0092] Based on the unique characteristics and inherent patterns of data in different cluster categories, various machine learning or deep learning algorithms can be flexibly selected to construct photovoltaic power generation prediction models. Prediction models can be customized for user groups with different characteristics. The amount of data in one category is significantly reduced compared to the total amount of data for all users, which significantly shortens the model training time and effectively reduces computational costs and energy consumption.
[0093] By fusing existing features to form new features, the generalization ability of the model is improved, ensuring the accuracy of the model's prediction results.
[0094] See Figure 7 As shown, this embodiment of the invention discloses a photovoltaic power generation prediction device based on model predictive control, comprising:
[0095] The data preprocessing module 11 is used to acquire the initial photovoltaic power generation data of the target user and preprocess the initial photovoltaic power generation data to obtain the corresponding target photovoltaic power generation data; wherein, the photovoltaic power generation data includes photovoltaic power generation and corresponding climate information;
[0096] User cluster determination module 12 is used to match the target photovoltaic power generation data with pre-divided user clusters, and determine the target user cluster corresponding to the target photovoltaic power generation data based on the distance between the target photovoltaic power generation data and the cluster centers corresponding to each user cluster; wherein, the user cluster is a grouping of user data based on the similarity of geographical and climatic characteristics of different users, and the power generation prediction model corresponding to different user clusters is different;
[0097] The power generation prediction module 13 is used to predict photovoltaic power generation using the target power generation prediction model corresponding to the target user cluster and the target photovoltaic power generation data, so as to obtain the initial photovoltaic power generation prediction result corresponding to the target user, and optimize the initial photovoltaic power generation prediction result based on model prediction control technology to obtain the corresponding target photovoltaic power generation prediction result.
[0098] In some specific embodiments, the data preprocessing module 11 further includes:
[0099] The missing value filling unit is used to obtain historical photovoltaic power generation data corresponding to several users under different natural conditions, remove outliers from the historical photovoltaic data to obtain corresponding processed historical power generation data, and fill missing values in the processed historical power generation data according to the data type and data distribution characteristics of the historical photovoltaic power generation data to obtain corresponding target historical power generation data.
[0100] The model training submodule is used to divide the historical power generation data of each target into several user clusters based on the similarity of natural conditions among the historical power generation data of each target, and to train a corresponding power generation prediction model for each user cluster.
[0101] In some specific embodiments, the model training submodule may specifically include:
[0102] The clustering number determination unit is used to filter out key data features from the historical power generation data of each target, construct error sum of squares curves and profile coefficient curves corresponding to different candidate clustering numbers based on the elbow rule and the profile coefficient evaluation method, and determine the target clustering number according to the error sum of squares curves and the profile coefficient curves.
[0103] The user cluster partitioning unit is used to partition each target historical power generation data into several user clusters based on the target clustering algorithm, the key data features, and the target clustering number.
[0104] In some specific embodiments, the model training submodule may specifically include:
[0105] The model training unit is used to combine different initial climate features in the same user cluster to obtain fused climate features, select target fused features from each fused climate feature, and train corresponding power generation prediction models for each user cluster based on the correlation between the target fused features and the corresponding photovoltaic power generation in each user cluster.
[0106] In some specific embodiments, the photovoltaic power generation prediction device based on model predictive control further includes:
[0107] The user cluster creation unit is used to create a new user cluster corresponding to the target photovoltaic power generation data if the distance between the target photovoltaic power generation data and the cluster center of any user cluster is greater than a preset threshold, and to train the power generation prediction model corresponding to the new user cluster based on the target photovoltaic power generation data.
[0108] In some specific embodiments, the power generation prediction module 13 may specifically include:
[0109] The physical model construction unit is used to construct a target physical model based on the physical characteristics of the photovoltaic module, and to calculate the theoretical power generation using the target physical model; wherein, the target physical model is a model constructed based on the mapping relationship between light intensity, temperature and photovoltaic power generation.
[0110] The prediction result optimization unit is used to optimize the initial photovoltaic power generation prediction result using model prediction control technology and the theoretical power generation.
[0111] In some specific embodiments, the power generation prediction module 13 further includes:
[0112] The parameter adjustment unit is used to acquire the actual power generation data corresponding to the target user, calculate the error value between the actual power generation data and the target photovoltaic power generation prediction result, and adjust the parameters of the target power generation prediction model according to the error value.
[0113] Furthermore, embodiments of this application also disclose an electronic device, Figure 8 This is a structural diagram of an electronic device 20 according to an exemplary embodiment. The content of the diagram should not be construed as limiting the scope of this application.
[0114] Figure 8This is a schematic diagram of the structure of an electronic device 20 provided in an embodiment of this application. Specifically, the electronic device 20 may include: at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25, and a communication bus 26. The memory 22 stores a computer program, which is loaded and executed by the processor 21 to implement the relevant steps in the photovoltaic power generation prediction method based on model predictive control disclosed in any of the foregoing embodiments. Alternatively, the electronic device 20 in this embodiment may specifically be an electronic computer.
[0115] In this embodiment, the power supply 23 is used to provide operating voltage for each hardware device on the electronic device 20; the communication interface 24 can create a data transmission channel between the electronic device 20 and external devices, and the communication protocol it follows can be any communication protocol applicable to the technical solution of this application, and is not specifically limited here; the input / output interface 25 is used to acquire external input data or output data to the outside world, and its specific interface type can be selected according to specific application needs, and is not specifically limited here.
[0116] In addition, the memory 22, as a carrier for resource storage, can be a read-only memory, random access memory, disk or optical disk, etc. The resources stored thereon can include operating system 221, computer program 222, etc., and the storage method can be temporary storage or permanent storage.
[0117] The operating system 221 is used to manage and control the various hardware devices on the electronic device 20 and the computer program 222, which may be Windows Server, Netware, Unix, Linux, etc. In addition to including a computer program capable of performing the model predictive control-based photovoltaic power generation prediction method executed by the electronic device 20 as disclosed in any of the foregoing embodiments, the computer program 222 may further include computer programs capable of performing other specific tasks.
[0118] Furthermore, this application also discloses a computer-readable storage medium for storing a computer program; wherein, when the computer program is executed by a processor, it implements the aforementioned photovoltaic power generation prediction method based on model predictive control. Specific steps of this method can be found in the corresponding content disclosed in the foregoing embodiments, and will not be repeated here.
[0119] The various embodiments in this specification are described in a progressive manner, with each embodiment focusing on its differences from other embodiments. Similar or identical parts between embodiments can be referred to interchangeably. For the apparatus disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple; relevant parts can be referred to in the method section.
[0120] Those skilled in the art will further recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0121] The steps of the methods or algorithms described in conjunction with the embodiments disclosed herein can be implemented directly by hardware, a software module executed by a processor, or a combination of both. The software module can be located in random access memory (RAM), main memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or any other form of storage medium known in the art.
[0122] Finally, it should be noted that in this document, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0123] The technical solutions provided in this application have been described in detail above. Specific examples have been used to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the methods and core ideas of this application. At the same time, for those skilled in the art, there will be changes in the specific implementation methods and application scope based on the ideas of this application. Therefore, the content of this specification should not be construed as a limitation of this application.
Claims
1. A photovoltaic power generation amount prediction method based on model predictive control, characterized by, The method comprises the following steps: obtaining initial photovoltaic power generation data of a target user, and preprocessing the initial photovoltaic power generation data to obtain corresponding target photovoltaic power generation data; wherein the photovoltaic power generation data comprises photovoltaic power generation capacity and corresponding climate information; matching the target photovoltaic power generation data with pre-divided user clusters, and determining a target user cluster corresponding to the target photovoltaic power generation data based on the distance between the target photovoltaic power generation data and the clustering centers corresponding to each of the user clusters; wherein the user cluster is a user data grouping established based on the similarity of geographical features and climate features of different users, and the power generation capacity prediction models corresponding to different user clusters are different; using the target power generation capacity prediction model corresponding to the target user cluster and the target photovoltaic power generation data to predict the photovoltaic power generation capacity, to obtain an initial photovoltaic power generation capacity prediction result corresponding to the target user, and optimizing the initial photovoltaic power generation capacity prediction result based on model predictive control technology to obtain a corresponding target photovoltaic power generation capacity prediction result.
2. The model predictive control based photovoltaic power generation prediction method according to claim 1, characterized in that, Before the step of obtaining the initial photovoltaic power generation data of the target user, the method further comprises the following steps: obtaining historical photovoltaic power generation data corresponding to a plurality of users under different natural conditions, removing outliers from the historical photovoltaic data to obtain corresponding processed historical power generation data, and filling in missing values in the processed historical power generation data according to the data type and data distribution characteristics of the historical photovoltaic power generation data to obtain corresponding target historical power generation data; dividing each of the target historical power generation data into a plurality of user clusters according to the similarity of natural conditions between the target historical power generation data, and training a corresponding power generation capacity prediction model for each of the user clusters.
3. The model predictive control based photovoltaic power generation prediction method according to claim 2, characterized in that, The step of dividing each of the target historical power generation data into a plurality of user clusters according to the similarity of natural conditions between the target historical power generation data comprises the following steps: screening key data features from each of the target historical power generation data, constructing error sum of squares curves and contour coefficient curves corresponding to different candidate cluster numbers based on elbow rule and contour coefficient evaluation method, and determining a target cluster number according to the error sum of squares curves and the contour coefficient curves; dividing each of the target historical power generation data into a plurality of user clusters according to a target clustering algorithm, the key data features and the target cluster number.
4. The model predictive control based photovoltaic power generation prediction method according to claim 2, characterized in that, The step of training a corresponding power generation capacity prediction model for each of the user clusters comprises the following steps: combining different initial climate features in the same user cluster to obtain fused climate features, screening target fused features from each of the fused climate features, and training a corresponding power generation capacity prediction model for each of the user clusters based on the association between the target fused features in each of the user clusters and the corresponding photovoltaic power generation capacity.
5. The model predictive control based photovoltaic power generation prediction method according to claim 1, characterized in that, The method further comprises the following steps: if the distance between the target photovoltaic power generation data and the clustering center of any user cluster is greater than a preset threshold, creating a new user cluster corresponding to the target photovoltaic power generation data, and training a power generation capacity prediction model corresponding to the new user cluster based on the target photovoltaic power generation data.
6. The model predictive control based photovoltaic power generation prediction method according to claim 1, characterized in that, The step of optimizing the initial photovoltaic power generation capacity prediction result based on model predictive control technology comprises the following steps: A target physical model is constructed based on the physical characteristics of photovoltaic modules, and the theoretical power generation is calculated using the target physical model; wherein, the target physical model is a model constructed based on the mapping relationship between light intensity, temperature and photovoltaic power generation. The initial photovoltaic power generation prediction results are optimized using model predictive control technology and the theoretical power generation.
7. The model predictive control based photovoltaic power generation prediction method according to claim 1, characterized in that, After optimizing the initial photovoltaic power generation prediction results using model predictive control technology, the method further includes: Obtain the actual power generation data corresponding to the target user, calculate the error value between the actual power generation data and the target photovoltaic power generation prediction result, and adjust the parameters of the target power generation prediction model according to the error value.
8. A photovoltaic power generation amount prediction device based on model predictive control, characterized by, include: The data preprocessing module is used to acquire the initial photovoltaic power generation data of the target user and preprocess the initial photovoltaic power generation data to obtain the corresponding target photovoltaic power generation data; wherein, the photovoltaic power generation data includes photovoltaic power generation and corresponding climate information; The user cluster determination module is used to match the target photovoltaic power generation data with pre-divided user clusters, and determine the target user cluster corresponding to the target photovoltaic power generation data based on the distance between the target photovoltaic power generation data and the cluster centers corresponding to each user cluster; wherein, the user cluster is a grouping of user data based on the similarity of geographical and climatic characteristics of different users, and the power generation prediction model corresponding to different user clusters is different; The power generation prediction module is used to predict photovoltaic power generation using the target power generation prediction model corresponding to the target user cluster and the target photovoltaic power generation data, so as to obtain the initial photovoltaic power generation prediction result corresponding to the target user, and optimize the initial photovoltaic power generation prediction result based on model prediction control technology to obtain the corresponding target photovoltaic power generation prediction result.
9. An electronic device, comprising: include: Memory, used to store computer programs; A processor for executing the computer program to implement the photovoltaic power generation prediction method based on model predictive control as described in any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, Used to store a computer program, which, when executed by a processor, implements the photovoltaic power generation prediction method based on model predictive control as described in any one of claims 1 to 7.
Citation Information
Cited By
Space-time fusion photovoltaic power generation prediction method, system, equipment and medium
CN122026338A