Photovoltaic power prediction model training method and system, prediction method and electronic device

By using K-means clustering and dynamic matching with a historical model library, a photovoltaic power prediction model adapted to different weather conditions is generated, which solves the adaptability and accuracy problems of photovoltaic power prediction in existing technologies and achieves model adaptation and efficient updating.

CN123049111APending Publication Date: 2026-11-06NANTONG WOHUIYUN ENERGY TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202611173110.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-04
Publication Date
2026-11-06

AI Technical Summary

Technical Problem

Existing photovoltaic power prediction methods suffer from problems such as strong subjectivity in manually labeling weather types, poor adaptability of single neural network models, improper model updates, and insufficient handling of missing data and anomalies, resulting in low prediction accuracy and insufficient adaptability.

Method used

The K-means clustering algorithm is used to automatically classify weather types, generate typical power generation curve templates, establish a historical model library for dynamic matching and weighted updates, and combine the maximum output power constraint of the inverter to generate a prediction model that adapts to different weather conditions through neural network training.

Benefits of technology

It improves the generalization ability and prediction accuracy of photovoltaic power prediction under complex weather conditions, reduces the computational cost, ensures that the model can smoothly adapt to the long-term changes of photovoltaic power plants, and provides a high-quality data foundation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123049111A_ABST
    Figure CN123049111A_ABST
Patent Text Reader

Abstract

This invention belongs to the field of photovoltaic power prediction technology, and provides a photovoltaic power prediction model training method, system, prediction method, and electronic equipment. First, it obtains the daily power generation curve of the photovoltaic power plant and the corresponding meteorological feature vector. Then, it uses the K-Means clustering algorithm to cluster the meteorological feature vectors, generating typical power generation curve templates for various weather conditions. A historical model library with timestamps is established. Through similarity calculation, a parameter weighted update mechanism is triggered to generate an optimized model. The maximum output power of the inverter is introduced to truncate the prediction sequence and merge historical data. Using a sunny day model as a benchmark, a neural network is trained and a weather influence coefficient is introduced to generate derivative models for other weather types. This invention enables adaptive switching of the photovoltaic power prediction model under different weather conditions, efficient inheritance of historical training results, smooth evolution of model parameters as needed, and continuous improvement of prediction accuracy.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of photovoltaic power prediction technology, specifically relating to a photovoltaic power prediction model training method, system, prediction method, and electronic equipment. Background Technology

[0002] Traditional photovoltaic (PV) power prediction methods are mainly divided into two categories: physical methods and statistical learning methods. Physical methods are based on the irradiance conversion model of PV modules, combined with numerical weather prediction (NWP) data to calculate theoretical power generation. A typical implementation involves establishing an equivalent circuit model of the PV cell, calculating theoretical irradiance using a clear-sky model, and then correcting the predicted power using the inverter efficiency curve. Statistical learning methods are driven by historical data. Common methods include: first, training a single neural network model directly through end-to-end mapping between historical power and meteorological data, without distinguishing between weather types; second, manually labeling historical data into categories such as sunny, cloudy, and rainy based on cloud cover or solar radiation intensity, and then training independent prediction models for each category; third, determining the weather type of the day using meteorological data before prediction, and then calling the corresponding pre-trained model for prediction. In addition, some methods employ a sliding window update strategy, periodically retraining or fine-tuning the model using data from the most recent period.

[0003] Chinese patent application number CN202211610935.2 discloses a method for predicting photovoltaic power output based on K-means clustering and an optimized BP neural network, comprising the following steps: Step 1, collecting historical meteorological data of photovoltaic power plants in the area to be predicted, and the corresponding historical photovoltaic power output data, and preprocessing them using the average interpolation method; Step 2, calculating the correlation coefficient between the historical meteorological data and the historical photovoltaic power output data using the Pearson correlation coefficient, retaining data with a correlation coefficient greater than a threshold, and constructing a training set; Step 3, clustering the historical photovoltaic power output data using K-means clustering and dividing it into similar day datasets; Step 4, optimizing the weights, thresholds, and number of hidden layer nodes of the BP neural network using a genetic algorithm and an ant colony algorithm to construct a photovoltaic power output prediction model for the day. While this scheme combines K-means clustering with an optimized BP neural network to predict photovoltaic (PV) output, it suffers from multiple problems, including coarse data processing, limited clustering logic, and poor model training and reusability. It struggles to adapt to the complex operational scenarios of actual PV power plants. Data preprocessing relies solely on average interpolation to uniformly handle meteorological and output data, failing to design differentiated filling strategies for the continuous variation of PV power data and the periodicity of meteorological data. Furthermore, it lacks outlier identification and removal mechanisms, making it prone to model training bias due to low-quality data. K-means clustering only considers a single dimension of historical PV output data; the similar days obtained from clustering only reflect numerical similarity and cannot match the intrinsic correlation between meteorological conditions and PV output, resulting in insufficient scientific rigor in the selection of similar days.

[0004] Analysis of the existing technologies reveals the following shortcomings in current photovoltaic power prediction methods: First, manual weather type labeling is highly subjective, lacks standardized criteria, and struggles to cover transitional types between cloudy and rainy conditions, resulting in coarse model classification and poor generalization ability. Second, single neural network models attempt to fit power mapping relationships under all weather conditions with a single model. Due to the significant differences in input-output characteristics between sunny, cloudy, and rainy scenarios, model parameters often get trapped in local optima of multi-peak optimization, leading to a significant decrease in prediction accuracy in non-sunny scenarios. Third, traditional methods typically employ either complete retraining or simple sliding window fine-tuning during model updates. The former is computationally expensive and cannot utilize knowledge accumulated from historical models, while the latter is prone to catastrophic forgetting. Both methods lack a quantitative evaluation mechanism for the degree of matching between historical models and current data, resulting in either overly frequent model updates or lags behind actual changes. Fourth, existing methods generally lack systematic hierarchical processing of missing and anomalies in data. Power data and meteorological data are filled with homogeneous data, ignoring the essential difference between the continuous variation characteristics of power signals and the periodic patterns of meteorological elements. In actual operation of photovoltaic power plants, historical power and meteorological data often contain a large number of missing and outlier values ​​due to sensor failures, communication interruptions, equipment maintenance, or severe weather. Directly using this low-quality data for training will severely distort the model's understanding of normal power output patterns. Summary of the Invention

[0005] The purpose of this invention is to overcome the existing defects and provide a photovoltaic power prediction model training method, system, prediction method, and electronic device.

[0006] To solve the above-mentioned technical problems, the present invention provides the following technical solution: The first objective of this invention is to provide a method for training a photovoltaic power prediction model, comprising the following steps: (1) Data acquisition and quality stratification: Collect historical power generation data of photovoltaic power plants, meteorological monitoring data and equipment rated parameters, fill missing values ​​and remove outliers from multi-source data to form a cleaned training dataset; (2) Weather type-driven power generation curve clustering: Based on the cleaned training dataset, the daily power generation curve and corresponding meteorological feature vector are extracted. The K-means clustering algorithm is used to cluster the meteorological feature vector to obtain the cluster center corresponding to each typical weather type and the daily weather type label set, and generate typical power generation curve templates under various weather conditions. (3) Dynamic matching and correction of historical model library: Establish a historical model library that stores historical prediction models and model training timestamps corresponding to various weather types, retrieve and select historical prediction models that match the current training task as the base model, calculate the similarity between the current training data and the training data of the base model, and when the similarity is lower than the set threshold, perform weighted updates on the parameters of the base model based on the current training data to generate an optimized model; (4) Maximum power generation capacity constraint fusion: Read the maximum output power of the inverter as the physical upper limit, truncate the predicted power sequence output by the optimization model, and merge it with the cleaned training dataset obtained in step (1) to form the final training sample set; (5) Hierarchical model training and output: Using the sunny day model as the benchmark model, a power generation prediction model under the sunny day scenario is trained by a neural network algorithm. Based on the benchmark model, the power value is adjusted by introducing the weather influence coefficient to generate derivative models for other weather types. The trained models are stored in the historical model library and the set of currently available photovoltaic power prediction models is output.

[0007] Furthermore, the process of imputing missing values ​​and removing outliers from multi-source data includes: After aligning the multi-source data by timestamp and constructing the initial training dataset, the missing power data segments are filled using linear interpolation between adjacent time points, and the missing meteorological data segments are filled using the historical average of the same meteorological station for the same period. Outliers are identified using the sliding window standard deviation method, and power fluctuation thresholds are set to remove abnormal data points that exceed the actual operating range of the equipment.

[0008] Furthermore, in the process of using the K-means clustering algorithm to cluster meteorological feature vectors, the number of clusters is set to 3 to 5, corresponding to typical weather types such as sunny, cloudy, or rainy.

[0009] Furthermore, the K-means clustering algorithm is expressed as:

[0010] in, Indicates the first Cluster center vectors of meteorological features for weather types =1,2,...,K, where K is the preset total number of weather clusters; Indicates the first A collection of weather cluster tags for the day. =1,2,..., , This represents the total number of complete days in the cleaned training dataset. Indicates the first The sky was divided into the first Weather-like Indicates the first Meteorological feature vectors for the day.

[0011] Furthermore, the generation of typical power generation curve templates under various weather conditions specifically includes: By overlaying and aggregating the power generation curves of all dates within the same cluster along the time dimension, and taking the mean or median of the power values ​​at the same moment, typical power generation curves under various weather conditions are generated.

[0012] Furthermore, the dynamic matching and correction of the historical model library specifically includes: Based on the daily weather type cluster label set, the target weather type corresponding to the current model to be trained is identified to ensure that the weather type of the current model to be trained is consistent with the typical weather type; Establish a historical model library containing historical prediction models corresponding to each typical weather type. Each historical prediction model is accompanied by a unique training timestamp. Based on the target weather type, select all historical prediction models that match the target weather type from the historical model library. Among the selected historical prediction models, the model with the latest training time is selected as the base model for the current training task, based on the training timestamp. The typical power generation curve corresponding to the current target weather type is used as the reference benchmark for this model training. The similarity between the curve and the power generation curve corresponding to the current training data is calculated using the cosine similarity or Pearson correlation coefficient method. When the similarity is greater than or equal to the set threshold, the basic model is used as the prediction model for the current scenario. Otherwise, the parameters of the basic model are updated with weights based on the current training data to generate an optimized model.

[0013] Furthermore, in the process of truncating the predicted power sequence output by the optimization model, the predicted power sequence is compared with the maximum output power of the inverter at time points, and the predicted power values ​​in the predicted power sequence that exceed the maximum output power of the inverter are truncated.

[0014] Another object of the present invention is to provide a photovoltaic power prediction model training system, comprising: The data acquisition and quality stratification processing module is used to collect historical power generation data of photovoltaic power plants, meteorological monitoring data and equipment rated parameters, and to fill missing values ​​and remove outliers from multi-source data to form a cleaned training dataset. The weather type-driven power generation curve clustering module is used to extract daily power generation curves and corresponding meteorological feature vectors based on the cleaned training dataset. The K-means clustering algorithm is used to cluster the meteorological feature vectors to obtain the cluster centers corresponding to each typical weather type and the daily weather type label set, and generate typical power generation curve templates for each type of weather. The historical model library dynamic matching and correction module is used to establish a historical model library that stores historical prediction models and model training timestamps corresponding to various weather types. It retrieves and selects historical prediction models that match the current training task as the base model, calculates the similarity between the current training data and the training data of the base model, and updates the parameters of the base model based on the current training data when the similarity is lower than a set threshold, thereby generating an optimized model. The maximum power generation capacity constraint fusion module is used to read the maximum output power of the inverter as the physical upper limit, truncate the predicted power sequence output by the optimization model, and merge it with the cleaned training dataset to form the final training sample set. The hierarchical model training and output module is used to train a power generation prediction model for sunny weather scenarios using a neural network algorithm, based on the sunny weather model as the baseline model. It also introduces a weather influence coefficient to adjust the power value based on the baseline model, generates derivative models for other weather types, stores the trained models in the historical model library, and outputs a set of currently available photovoltaic power prediction models.

[0015] Another object of the present invention is to provide a photovoltaic power prediction method, comprising: Acquire meteorological data for the time to be predicted, extract corresponding meteorological features, and match them to the target weather type; Retrieve the photovoltaic power prediction model corresponding to the target weather type from the historical model library; The meteorological data for the time to be predicted is input into the photovoltaic power prediction model. After calculation and execution of physical upper limit constraints, the final photovoltaic power prediction result is output. The photovoltaic power prediction model is trained based on the photovoltaic power prediction model training method provided by the present invention.

[0016] Another object of the present invention is to provide an electronic device, including a processor and a memory storing a computer program, wherein the processor executes the computer program to implement the photovoltaic power prediction model training method provided by the present invention, and / or the photovoltaic power prediction method provided by the present invention.

[0017] In combination with the above technical solutions, the beneficial effects of the present invention compared with the prior art are as follows: This invention utilizes the K-means clustering algorithm to perform unsupervised clustering of historical meteorological feature vectors, automatically dividing the training data into 3-5 typical weather types and generating corresponding typical power generation curve templates. This weather type-driven clustering strategy enables the prediction model to adaptively select or adjust its structure based on the current weather type, avoiding systematic biases that can occur when a single model makes predictions across different weather types. For example, under cloudy weather conditions, the rapid power fluctuations caused by changes in cloud cover can be effectively characterized by a dedicated cloudy template, while under overcast and rainy weather conditions, the weak power output characteristics corresponding to low solar radiation intensity can be accurately captured by an overcast and rainy template, thereby significantly improving the model's generalization ability and prediction accuracy under complex meteorological conditions.

[0018] This invention establishes a historical model library, storing historical prediction models and their training timestamps using weather type as an index. It also designs a dynamic matching and weighted update mechanism based on similarity judgment. For the current training task, the system automatically retrieves historical models with the same weather type and the most recent training time as the base model. By calculating the similarity between the current power generation curve and the historical typical template, parameter updates are triggered only when the similarity is below a threshold. This avoids the computational overhead caused by frequent full training and ensures that the model can smoothly adapt to long-term drift phenomena such as photovoltaic power plant aging, component degradation, or local microclimate changes.

[0019] This invention employs a hierarchical quality processing strategy. For missing power data segments, linear interpolation between adjacent time points is used, fully preserving the continuous variation characteristics of the power curve over a short period. For missing meteorological data segments, historical averages from the same meteorological station are used to fill in the gaps, leveraging the periodicity of meteorological elements to ensure the reasonableness of the filled values. Simultaneously, a sliding window standard deviation method is used to dynamically identify power abrupt changes, and dual judgment conditions are set based on the actual operating range of the equipment (maximum output power of the inverter) to eliminate outliers. Compared to simple threshold truncation or mean filling, this hierarchical processing method can more accurately distinguish between real power fluctuations and data acquisition anomalies, providing a high-quality, clean data foundation for subsequent clustering, matching, and model training. Attached Figure Description

[0020] The accompanying drawings are provided to further illustrate the invention and form part of the specification. They are used in conjunction with embodiments of the invention to explain the invention and do not constitute a limitation thereof. In the drawings: Figure 1 This is a flowchart of the photovoltaic power prediction model training method provided in the embodiments of the present invention; Figure 2 This is a flowchart of data acquisition and quality stratification processing provided in an embodiment of the present invention; Figure 3 This is a flowchart of weather type-driven power generation curve clustering provided in an embodiment of the present invention; Figure 4 This is a flowchart of the dynamic matching and correction of the historical model library provided in the embodiments of the present invention; Figure 5 This is a flowchart of the maximum power generation capacity constraint fusion provided in the embodiments of the present invention; Figure 6 This is a schematic diagram of the photovoltaic power prediction model training system provided in an embodiment of the present invention. Detailed Implementation

[0021] The preferred embodiments of the present invention will be described below with reference to the accompanying drawings. It should be understood that the preferred embodiments described herein are for illustration and explanation only and are not intended to limit the present invention.

[0022] Example 1:

[0023] like Figure 1 The image shows an embodiment of the photovoltaic power prediction model training method provided by the present invention, which specifically includes the following steps: S1: Data Acquisition and Quality Layering Processing: Collect historical power generation data of photovoltaic power plants, meteorological monitoring data and equipment rated parameters, fill missing values ​​and remove outliers from multi-source data to form a cleaned training dataset; S2: Weather type-driven power generation curve clustering: Based on the cleaned training dataset, daily power generation curves and corresponding meteorological feature vectors are extracted. The K-means clustering algorithm is used to cluster the meteorological feature vectors to obtain the cluster centers corresponding to each typical weather type and the daily weather type label set, and generate typical power generation curve templates for each type of weather. S3: Dynamic matching and correction of historical model library: Establish a historical model library that stores historical prediction models and model training timestamps corresponding to various weather types, retrieve and select historical prediction models that match the current training task as the base model, calculate the similarity between the current training data and the training data of the base model, and when the similarity is lower than a set threshold, perform weighted updates on the parameters of the base model based on the current training data to generate an optimized model. S4: Maximum power generation capacity constraint fusion: Read the maximum output power of the inverter as the physical upper limit, truncate the predicted power sequence output by the optimization model, and merge it with the cleaned training dataset obtained in step S1 to form the final training sample set. S5: Hierarchical Model Training and Output: Using the sunny day model as the baseline model, a power generation prediction model for sunny day scenarios is trained through a neural network algorithm. Based on the baseline model, a weather influence coefficient is introduced to adjust the power value, generating derivative models for other weather types. The trained models are stored in the historical model library, and the currently available photovoltaic power prediction model set is output.

[0024] Specifically, the photovoltaic power prediction model training method based on K-means clustering and historical model matching provided in this embodiment aims to solve a series of technical problems in traditional photovoltaic power prediction, such as the strong subjectivity of manually labeled weather types, the difficulty of adapting a single model to multiple weather scenarios, the inability to effectively reuse and dynamically update historical model knowledge, the lack of hierarchical processing of missing and abnormal data, the tendency of prediction results to exceed the physical limits of equipment, and the inability of the model to continuously evolve after training. It realizes the adaptive switching of photovoltaic power prediction models under different weather conditions, the efficient inheritance of historical training results, the smooth evolution of model parameters on demand, and the continuous improvement of prediction accuracy.

[0025] Step 1: Data acquisition and quality stratification processing, such as... Figure 2 As shown, historical power generation data, meteorological monitoring data, and equipment rated parameters of the photovoltaic power station were collected. The meteorological data included solar radiation intensity, ambient temperature, and cloud cover, while the equipment parameters included the inverter's maximum output power. After aligning the multi-source data by timestamp and constructing an initial training dataset, the missing power data segments were filled using linear interpolation between adjacent time points, and the missing meteorological data segments were filled using the historical average of the same meteorological station for the same period. Outliers were identified using the sliding window standard deviation method, and power fluctuation thresholds were set to remove abnormal data points that exceeded the actual operating range of the equipment, resulting in a cleaned, high-quality training dataset.

[0026] Let the historical power generation data of the photovoltaic power station be... The solar radiation intensity in the meteorological monitoring data is The ambient temperature is Cloud cover index is The maximum output power of the inverter in the equipment's rated parameters is ,in For discrete time point indexes, ; The initial training dataset after aligning the timestamps is then: The window size in the sliding window standard deviation method is The power fluctuation threshold is .

[0027] The cleaned, high-quality training dataset is then... Missing values ​​have been filled by interpolation or historical mean, and outliers have been removed. Power data missing segment filling: If Missing, and Given valid points, then:

[0028] Meteorological data missing segment filling: missing time The corresponding solar radiation intensity is Its fill value is:

[0029] in, This represents the sample size for the same historical period. A sample of solar radiation intensity representing the same period in history during the same season. Indicates and The same principle applies to specific times within the same season and period. and ; Identification and removal of photovoltaic power outliers: in the window Internal calculation of power mean with standard deviation ,like: or or Then determine Outliers were identified and removed. Final output dataset:

[0030] Of the above parameters, This will be used as the physical upper limit in step four; The data will be used as input for clustering in step two. , , The meteorological feature vectors used in step two will be constructed.

[0031] This embodiment employs a differentiated missing value imputation strategy: missing power data is imputed by linear interpolation between adjacent time points, fully preserving the continuous variation characteristics of the power curve; missing meteorological data is imputed by the historical average of the same meteorological station for the same period, utilizing the periodicity of meteorological elements. Simultaneously, a dedicated data quality tiered processing mechanism is formed by dynamically identifying power fluctuation anomalies and the physical upper limit of equipment using a sliding window standard deviation.

[0032] Step 2: Weather type-driven clustering of power generation curves, such as... Figure 3 As shown, based on the cleaned training dataset, daily power generation curves and corresponding meteorological feature vectors are extracted; K-means clustering algorithm is used to cluster the meteorological feature vectors, with the number of clusters set to 3 to 5, corresponding to typical weather types such as sunny, cloudy, and rainy days; power generation curves within the same cluster are superimposed according to the time dimension to generate typical power generation curve templates for various weather conditions.

[0033] The cleaned, high-quality training dataset output from step one Includes complete data for the set number of days, with daily settings. The nth time point is defined as the nth time point. The daily power generation curve is as follows: Definition of the first The meteorological feature vector for the day is: Each component is The time average of meteorological parameters corresponding to each day:

[0034]

[0035]

[0036] The weather clusters consist of 3-5 categories, corresponding to typical weather types such as sunny, cloudy, and rainy. The K-means algorithm is used to cluster the weather. Perform clustering, This represents a high-quality training dataset after cleaning. In the middle, from day 1 to day 2 The complete sample set consisting of the meteorological feature vectors corresponding to each date of the day is used to obtain the cluster centers corresponding to each typical weather type using the K-means algorithm, and to identify the cluster centers for the first weather type in the dataset. The unique cluster label assigned by Heaven , It is an integer, and its value range is consistent with the preset total number of weather clusters; Define the typical power generation curve corresponding to a certain typical weather type as:

[0037] in, =1,2,..., , The preset total number of weather clusters, 3 ≤ ≤5, =1,2,..., ,and

[0038] in The Middle The first day A discrete time point, It is the first Heavenly Historical power generation of photovoltaic power plants at a given point in time. It is to satisfy All Take the arithmetic mean or median.

[0039] The K-means clustering algorithm is used to cluster meteorological feature vectors. Specifically, the goal of K-means clustering is to divide the meteorological feature vectors of all dates into K categories and determine the cluster centers of each category, such that the sum of the squared Euclidean distances between each sample and the center of its category is minimized. This clustering process can be formalized as an optimization problem with the following objective function:

[0040] in, For the first Cluster center vectors of meteorological features for weather types =1,2,...,K, where K is the preset total number of weather clusters; For the first A collection of weather cluster tags for the day. =1,2,..., , This represents the total number of complete days in the cleaned dataset. Indicates the first The sky was divided into the first Weather-like It is from day 1 to day 2 The summation operation covers all samples in the dataset. It performs a summation operation on categories 1 through K, covering all preset typical weather types. When the condition inside the parentheses When the condition is met, the value is 1; when the condition is not met, the value is 0. Calculation is only performed for the case where "the date matches the weather category". The square operator for Euclidean distance. Indicates the first The meteorological feature vector of the day and the first The vector difference between the cluster center vectors of weather-like clusters is used to calculate the degree of deviation between the sample and the cluster center; After clustering the daily meteorological feature vectors, it is necessary to further generate representative power generation curve templates for each weather type for subsequent historical model matching and similarity calculation. Specifically, for the th For weather types, the power generation curves for all corresponding dates are overlaid and aggregated along the time dimension, that is, at each time point... The average (or median) power values ​​of all curves in this class at the same time are taken to form a smooth, typical curve:

[0041] in ; It is the first Typical power generation curves corresponding to typical weather conditions. It is the first Taking the reciprocal of the sample size for weather-like conditions serves to normalize the summation of all daily power curves for that type, ensuring the final generated value is consistent with the expected value. This is the average power curve for this type of weather, reflecting the overall power generation pattern. For the first The total number of days included under a typical weather pattern, i.e., the sample size belonging to that type of weather, is the sum of the number of daily power curves of the same type. For the conditional summation operator, cluster labels are selected. equal All dates And the daily power generation curves corresponding to these dates Perform a summation operation point by point in time. For the first The daily power generation curve for each day is used to obtain a set of typical power generation curve templates for various weather conditions. By averaging and fusing all daily power curves for the same type of weather, such as sunny, cloudy, and rainy days, and filtering out random fluctuations in daily power, the most representative power generation trend for this type of weather is obtained, providing a standardized benchmark reference curve for historical model matching and similarity calculation in step three. The output of step two includes a set of daily weather type labels. The system consists of a set of power generation curves corresponding to various typical weather conditions and a cluster center for meteorological characteristics of each weather type. The daily weather type label is used to identify the typical weather category of each day. The power generation curve template represents the standard power generation pattern under various weather conditions, and the cluster center represents the typical meteorological characteristics of various weather conditions. Together, these three elements provide category basis, reference benchmark, and feature benchmark for subsequent model retrieval and training.

[0042] This embodiment applies the K-means clustering algorithm to unsupervised clustering of meteorological feature vectors (daily averages of solar radiation intensity, ambient temperature, and cloud cover), automatically classifying historical data into 3-5 typical weather types. It then aggregates and overlays daily power generation curves within the same cluster along the time dimension to generate typical power generation curve templates for various weather conditions. This solves the subjectivity and inconsistency problems of traditional methods that rely on manual weather type labeling, achieving objective and automatic weather type classification and standardized extraction of representative power curves.

[0043] Step 3: Dynamic matching and correction of the historical model library, such as... Figure 4As shown, a historical model library is established to store historical prediction models and model training timestamps corresponding to various weather types. For the current training task, a historical model with the same weather type and the most recent training time is retrieved from the historical model library and used as the base model. The similarity between the current training data and the training data of the historical model is calculated. If the similarity is lower than a set threshold, the parameters of the base model are updated with weights based on the current data to generate an optimized model that adapts to the current scenario.

[0044] Step 3-1: Determine the weather type corresponding to the current training task, based on the daily weather type cluster label set output in Step 2. Determine the target weather type corresponding to the current model to be trained, and ensure that the weather type of the current training is consistent with the typical weather type of the clustering in step two. This provides a clear category basis for subsequent historical model retrieval and avoids the misuse of models across weather types. Step 3-2: Retrieve historical prediction models for the same weather type from the historical model library. Let the historical model library be... Historical model library The database stores historical prediction models corresponding to each typical weather type identified in step 2. Each historical prediction model is accompanied by a unique training timestamp τ, used to distinguish model versions generated in different training batches and at different times. Based on the target weather type determined in step 3-1, the database retrieves models from the historical model library. The process involves selecting all historical prediction models that match the target weather type to complete the initial screening of similar models. This process relies on the clustering results of weather types in step two to ensure the accuracy of the search scope. Step 3-3: Determine the base model for this training. Among the similar historical weather prediction models selected in Step 3-2, the historical prediction model with the latest training time is selected as the base model for the current training task, based on the training timestamp τ. By selecting the latest trained model as the base, we can make full use of the latest historical data training results, avoid the decrease in prediction accuracy caused by using outdated models, and reduce the number of iterations for this training, thereby improving training efficiency. Since the accurate classification of weather types has been completed in Step 2, we can ensure that the selected similar models have practical reference value. Steps 3-4: Determine the benchmark for model training. The power generation curve corresponding to the current training data is obtained using the same extraction method as the typical power generation curve template generated in Step 2, ensuring consistency in data extraction logic. At the same time, the typical power generation curve template output in Step 2, which corresponds to the current target weather type, is called as the benchmark for this model training. This benchmark is used to constrain the training direction of the current model, making the output of the trained model more closely match the actual power generation variation pattern of this type of weather. The typical power generation curve template is one of the core outputs of Step 2 and a key reference for ensuring prediction accuracy in this model training. Let the current weather type label corresponding to the current training task be... The current training dataset is The basic model retrieved from the historical model database is as follows:

[0045]

[0046] This indicates the base model used in this training; Indicates the weather type corresponding to the current training session; Let represent the latest training timestamp in the historical model, and let the power generation curve of the current training data be . Extracted in the same way as in step two, the typical power curve template used during historical model training is... ; Calculate the power generation curve of the current training data Compared to the typical power curve template used during historical model training similarity between The calculation method uses cosine similarity or Pearson correlation coefficient:

[0047] in and These are the mean values ​​of the corresponding curves, and the similarity threshold is... , like Then directly with As a predictive model for the current scenario, no updates are needed; if This indicates a significant difference between the current data distribution and the historical model training data, necessitating parameter updates to the base model; the parameter vector of the base model is... The new parameter vector obtained by fitting the current training data is The optimized model parameters after weighted update are: The update rules are as follows:

[0048] in These are the weighting coefficients for the historical model. Similarity can be taken as the value. itself, that is This ensures that the more similar the current data is to the historical template, the greater the weight retained in the historical model, thus generating an optimized model that adapts to the current scenario. and together with the current timestamp and weather type They are stored together in the historical model library for use in subsequent training tasks.

[0049] Step 4: Maximum power generation capacity constraint fusion, such as Figure 5 As shown, the maximum output power of the inverter in the rated parameters of the equipment is read and used as the upper limit of the physical capability; the predicted power sequence output by the optimized model is compared with the maximum output power of the inverter, and the predicted values ​​exceeding the upper limit are truncated to ensure that the prediction results are consistent with the actual operating capability of the equipment; the truncated prediction sequence is merged with the cleaned high-quality training dataset to form the final training sample set.

[0050] Step four requires reading the high-quality dataset from step one. Based on the weather type classification results generated in step two, the rationality of the predicted power is verified, including the high-quality dataset from step one. This is a core component of the training sample set in step four, and is crucial to ensuring the authenticity of the training samples in step four. Based on this, the specific operations of step four are as follows: Determine the maximum output power of the inverter , Obtain the basic equipment parameters specified in Step 1 from the equipment parameter configuration in Step 1, and combine them with the predicted power sequence output by the optimization model in Step 3. Perform a time-point comparison and identify those exceeding [the specified threshold]. The predicted values ​​are truncated to ensure that the prediction results match the actual operating capacity of the equipment; the constrained and corrected predicted power sequence is then compared with the high-quality dataset from step one. The samples are merged to form a model training sample set. This sample set retains the core characteristics of the high-quality data from step one, and corrects unreasonable predictions through physical constraints of the equipment, thus ensuring the accuracy of model training.

[0051] Step 5: Layered model training and output. A layered training strategy is adopted. The sunny weather model is used as the baseline model. The power generation prediction model under the sunny scenario is trained by a neural network algorithm. For other weather types, the power value is adjusted by introducing a weather influence coefficient based on the sunny model to generate derivative models such as cloudy and rainy. The trained models are stored in the historical model library and the set of currently available photovoltaic power prediction models is output.

[0052] Using the clear-sky model, which boasts the highest data quality and most stable power output patterns, as the baseline model, the power prediction capability under clear-sky conditions is fully trained through neural network algorithms. For non-clear-sky weather types such as cloudy and rainy days, instead of starting from scratch, the model is based on the clear-sky model, with cloud cover attenuation coefficients and temperature correction coefficients introduced to adjust the power values, generating derived models. This architecture significantly reduces the training complexity and sample requirements for non-clear-sky scenarios, while utilizing physically meaningful correction factors to ensure prediction accuracy.

[0053] Example 2:

[0054] like Figure 6 As shown, this embodiment provides a photovoltaic power prediction model training system, including: The data acquisition and quality stratification processing module is used to collect historical power generation data of photovoltaic power plants, meteorological monitoring data and equipment rated parameters, and to fill missing values ​​and remove outliers from multi-source data to form a cleaned training dataset. The weather type-driven power generation curve clustering module is used to extract daily power generation curves and corresponding meteorological feature vectors based on the cleaned training dataset. The K-means clustering algorithm is used to cluster the meteorological feature vectors to obtain the cluster centers corresponding to each typical weather type and the daily weather type label set, and generate typical power generation curve templates for each type of weather. The historical model library dynamic matching and correction module is used to establish a historical model library that stores historical prediction models and model training timestamps corresponding to various weather types. It retrieves and selects historical prediction models that match the current training task as the base model, calculates the similarity between the current training data and the training data of the base model, and updates the parameters of the base model based on the current training data when the similarity is lower than a set threshold, thereby generating an optimized model. The maximum power generation capacity constraint fusion module is used to read the maximum output power of the inverter as the physical upper limit, truncate the predicted power sequence output by the optimization model, and merge it with the cleaned training dataset to form the final training sample set. The hierarchical model training and output module is used to train a power generation prediction model for sunny weather scenarios using a neural network algorithm, based on the sunny weather model as the baseline model. It also introduces a weather influence coefficient to adjust the power value based on the baseline model, generates derivative models for other weather types, stores the trained models in the historical model library, and outputs a set of currently available photovoltaic power prediction models.

[0055] Example 3:

[0056] This embodiment provides a photovoltaic power prediction method, including: Acquire meteorological data for the time to be predicted, extract corresponding meteorological features, and match them to the target weather type; Retrieve the photovoltaic power prediction model corresponding to the target weather type from the historical model library; The meteorological data for the time to be predicted is input into the photovoltaic power prediction model. After calculation and execution of physical upper limit constraints, the final photovoltaic power prediction result is output. The photovoltaic power prediction model is trained based on the photovoltaic power prediction model training method provided in Embodiment 1 of the present invention.

[0057] Example 4:

[0058] This embodiment provides an electronic device, including a processor and a memory storing a computer program. When the processor executes the computer program, it implements the photovoltaic power prediction model training method provided in Embodiment 1 of the present invention, and / or the photovoltaic power prediction method provided in Embodiment 3 of the present invention.

[0059] It should be understood that although the steps in the flowcharts of the various embodiments of the present invention are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated in the present invention, there is no strict order restriction on the execution of these steps, and these steps can be executed in other orders. Moreover, at least some steps in the various embodiments may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least a portion of the sub-steps or stages of other steps.

[0060] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, storage, databases, or other media used in the embodiments provided by this invention can include non-volatile and / or volatile memory. Non-volatile memory can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), dual data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0061] Finally, it should be noted that the above descriptions are merely preferred embodiments of the present invention and are not intended to limit the present invention. Although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art can still modify the technical solutions described in the foregoing embodiments or make equivalent substitutions for some of the technical features. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the protection scope of the present invention.

Claims

1. A method for training a photovoltaic power prediction model, characterized in that, The method includes the following steps: (1) Data acquisition and quality stratification: Collect historical power generation data of photovoltaic power plants, meteorological monitoring data and equipment rated parameters, fill missing values ​​and remove outliers from multi-source data to form a cleaned training dataset; (2) Weather type-driven power generation curve clustering: Based on the cleaned training dataset, the daily power generation curve and corresponding meteorological feature vector are extracted. The K-means clustering algorithm is used to cluster the meteorological feature vector to obtain the cluster center corresponding to each typical weather type and the daily weather type label set, and generate typical power generation curve templates under various weather conditions. (3) Dynamic matching and correction of historical model library: Establish a historical model library that stores historical prediction models and model training timestamps corresponding to various weather types, retrieve and select historical prediction models that match the current training task as the base model, calculate the similarity between the current training data and the training data of the base model, and when the similarity is lower than the set threshold, perform weighted updates on the parameters of the base model based on the current training data to generate an optimized model; (4) Maximum power generation capacity constraint fusion: Read the maximum output power of the inverter as the physical upper limit, truncate the predicted power sequence output by the optimization model, and merge it with the cleaned training dataset obtained in step (1) to form the final training sample set; (5) Hierarchical model training and output: Using the sunny day model as the benchmark model, a power generation prediction model under the sunny day scenario is trained by a neural network algorithm. Based on the benchmark model, the power value is adjusted by introducing the weather influence coefficient to generate derivative models for other weather types. The trained models are stored in the historical model library and the set of currently available photovoltaic power prediction models is output.

2. The photovoltaic power prediction model training method according to claim 1, characterized in that, The process of filling missing values ​​and removing outliers from multi-source data includes: After aligning the multi-source data by timestamp and constructing the initial training dataset, the missing power data segments are filled using linear interpolation between adjacent time points, and the missing meteorological data segments are filled using the historical average of the same meteorological station for the same period. Outliers are identified using the sliding window standard deviation method, and power fluctuation thresholds are set to remove abnormal data points that exceed the actual operating range of the equipment.

3. The photovoltaic power prediction model training method according to claim 1, characterized in that, In the process of using the K-means clustering algorithm to cluster meteorological feature vectors, the number of clusters is set to 3 to 5, which correspond to typical weather types such as sunny, cloudy, or rainy.

4. The photovoltaic power prediction model training method according to claim 3, characterized in that, The K-means clustering algorithm is expressed as follows: in, Indicates the first Cluster center vectors of meteorological features for weather types =1,2,...,K, where K is the preset total number of weather clusters; Indicates the first A collection of weather cluster tags for the day. =1,2,..., , This represents the total number of complete days in the cleaned training dataset. Indicates the first The sky was divided into the first Weather-like Indicates the first Meteorological feature vectors for the day.

5. The photovoltaic power prediction model training method according to claim 1, characterized in that, The generation of typical power generation curve templates under various weather conditions is specifically as follows: By overlaying and aggregating the power generation curves of all dates within the same cluster along the time dimension, and taking the mean or median of the power values ​​at the same moment, typical power generation curves under various weather conditions are generated.

6. The photovoltaic power prediction model training method according to claim 1, characterized in that, The dynamic matching and correction of the historical model library specifically includes: Based on the daily weather type cluster label set, the target weather type corresponding to the current model to be trained is identified to ensure that the weather type of the current model to be trained is consistent with the typical weather type; Establish a historical model library containing historical prediction models corresponding to each typical weather type. Each historical prediction model is accompanied by a unique training timestamp. Based on the target weather type, select all historical prediction models that match the target weather type from the historical model library. Among the selected historical prediction models, the model with the latest training time is selected as the base model for the current training task, based on the training timestamp. The typical power generation curve corresponding to the current target weather type is used as the reference benchmark for this model training. The similarity between the curve and the power generation curve corresponding to the current training data is calculated using the cosine similarity or Pearson correlation coefficient method. When the similarity is greater than or equal to the set threshold, the basic model is used as the prediction model for the current scenario. Otherwise, the parameters of the basic model are updated with weights based on the current training data to generate an optimized model.

7. The photovoltaic power prediction model training method according to claim 1, characterized in that, In the process of truncating the predicted power sequence output by the optimization model, the predicted power sequence is compared with the maximum output power of the inverter at time points, and the predicted power values ​​in the predicted power sequence that exceed the maximum output power of the inverter are truncated.

8. A photovoltaic power prediction model training system, characterized in that, The system includes: The data acquisition and quality stratification processing module is used to collect historical power generation data of photovoltaic power plants, meteorological monitoring data and equipment rated parameters, and to fill missing values ​​and remove outliers from multi-source data to form a cleaned training dataset. The weather type-driven power generation curve clustering module is used to extract daily power generation curves and corresponding meteorological feature vectors based on the cleaned training dataset. The K-means clustering algorithm is used to cluster the meteorological feature vectors to obtain the cluster centers corresponding to each typical weather type and the daily weather type label set, and generate typical power generation curve templates for each type of weather. The historical model library dynamic matching and correction module is used to establish a historical model library that stores historical prediction models and model training timestamps corresponding to various weather types. It retrieves and selects historical prediction models that match the current training task as the base model, calculates the similarity between the current training data and the training data of the base model, and updates the parameters of the base model based on the current training data when the similarity is lower than a set threshold, thereby generating an optimized model. The maximum power generation capacity constraint fusion module is used to read the maximum output power of the inverter as the physical upper limit, truncate the predicted power sequence output by the optimization model, and merge it with the cleaned training dataset to form the final training sample set. The hierarchical model training and output module is used to train a power generation prediction model for sunny weather scenarios using a neural network algorithm, based on the sunny weather model as the baseline model. It also introduces a weather influence coefficient to adjust the power value based on the baseline model, generates derivative models for other weather types, stores the trained models in the historical model library, and outputs a set of currently available photovoltaic power prediction models.

9. A photovoltaic power prediction method, characterized in that, The method includes: Acquire meteorological data for the time to be predicted, extract corresponding meteorological features, and match them to the target weather type; Retrieve the photovoltaic power prediction model corresponding to the target weather type from the historical model library; The meteorological data for the time to be predicted is input into the photovoltaic power prediction model. After calculation and execution of physical upper limit constraints, the final photovoltaic power prediction result is output. The photovoltaic power prediction model is trained based on the photovoltaic power prediction model training method described in any one of claims 1 to 7.

10. An electronic device comprising a processor and a memory storing a computer program, characterized in that, When the processor executes the computer program, it implements the photovoltaic power prediction model training method according to any one of claims 1 to 7, and / or the photovoltaic power prediction method according to claim 9.

Citation Information

Patent Citations

  • Photovoltaic output day-ahead prediction method based on K-means mean clustering and BP neural network optimization

    CN116702937A