A photovoltaic power prediction method based on dual integrated model
By adopting a dual-integrated model method in the photovoltaic power prediction model, combining the remarking method and projection method for cluster integration, and using the Stacking integrated learning framework, the existing photovoltaic power prediction model has been solved, and higher prediction accuracy and stability have been achieved.
Patent Information
- Application Number
- CN202210543973.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-05-18
- Publication Date
- 2025-03-21
- Estimated Expiration
- 2042-05-18
AI Technical Summary
The existing photovoltaic power prediction model ignores the inherent uncertainty of the algorithm and the influence of anomalies during the clustering process, resulting in low robustness and atypical classification, making it difficult to achieve high-precision photovoltaic power prediction.
The photovoltaic power prediction method based on the dual-integration model is adopted, and the integrated clustering model is constructed by selecting Kmeans, GMM, AGNES and BIRCH as the base clusterers, and combining the remarking method and projection method to integrate the clustering results. At the same time, using Stacking integrated learning framework, integrating primary learners and secondary learners to improve prediction accuracy.
By broadening the classification perspective and avoiding random factors, the average performance and stability of the clustering algorithm are improved, the robustness and prediction accuracy of the model are enhanced, and the problem of fine data division that is difficult to achieve in a single cluster is solved.
Smart Images

Figure CN114936694B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of application of artificial intelligence algorithms in power systems, and in particular to a photovoltaic power prediction method based on a dual integrated model. Background Art
[0002] As the demand for clean energy grows in countries around the world, photovoltaic power generation is gaining importance in the power industry. However, photovoltaic power generation is highly volatile, and a high proportion of access to the power grid will bring shocks and safety hazards to the system operation. Photovoltaic power prediction can assist in adjusting the dispatching strategy and reduce the negative impact of grid fluctuations. Therefore, improving the accuracy of photovoltaic power prediction is of great significance to maintaining the stable operation of the power system and improving the economic benefits of power stations.
[0003] Photovoltaic forecasting is mainly divided into two parts: data processing and algorithm prediction. Data processing is often used to improve abnormal features or amplify effective features. In order to adapt to the current situation that photovoltaic power generation is affected by weather, domestic and foreign scholars often use the similar day theory based on meteorological factors to cluster data samples. Weather clustering can amplify the detailed features of similar data and improve the adaptability of the prediction model to data. However, existing models usually only use a single clustering algorithm, ignoring the inherent ambiguity of the algorithm, and do not consider the impact of abnormal samples on clustering, resulting in low robustness and atypical classification. Summary of the invention
[0004] The purpose of the present invention is to provide a photovoltaic power prediction method based on a dual integrated model, comprising the following steps:
[0005] 1) Obtain weather forecast data;
[0006] 2) Establish a meteorological classification model based on ensemble clustering
[0007] The steps of establishing an ensemble clustering-based meteorological classification model include:
[0008] 2.1) Selecting a base clusterer and clustering the historical meteorological data using the base clusterer to obtain several clustering results; the base clusterer includes a Kmeans clusterer, a GMM clusterer, an AGNES clusterer and a BIRCH clusterer;
[0009] The basic function formula of the Kmeans clusterer is as follows:
[0010] H ji =||x j -μ i ||2 (1)
[0011] In the formula, H ji is the sample point x j The distance from the cluster center; μ iis the cluster C i The mean vector of ;
[0012] The basic function formula of the GMM clusterer is as follows:
[0013]
[0014] Where μ is the mean vector, Σ is the covariance matrix, x represents a random vector in the n-dimensional target data set; q(x) is the probability density function that obeys the Gaussian distribution.
[0015] The basic function formulas of the AGNES clusterer are as follows:
[0016]
[0017] In the formula, C i and C j is the cluster, dist is the distance calculation function between samples; H min , H max , H avg are the minimum distance, maximum distance, and average distance; e and f represent cluster C respectively. i and cluster C j point.
[0018] The BIRCH clusterer is a split clusterer; the BIRCH clusterer constructs a clustering feature tree using highly compressed ternary features, and outputs a number of tree nodes representing each cluster.
[0019] 2) Use the re-labeling method and projection method to update the clustering results of the base clusterer and obtain the preliminary integrated clusters η'1, η'2, ..., η' N ;
[0020] The steps of updating the clustering results of the base clusterer using the re-labeling method and the projection method include:
[0021] 2.2.1) Let the independent base clusterers be ψ1, ψ2, ..., ψ γ ; i = 1, 2, ..., γ; γ is the number of base clusterers;
[0022] 2.2.2) Use the base clusterer to cluster the target data set and obtain the clustering result S i ={α (i)1, β (i)2, ...,λ (i)N}; where α (i)1, β (i)2, ...,λ (i)N is the cluster;
[0023] 2.2.3) Randomly select a clustering result S of a base clustereri As a fixed reference quantity, a group of unlabeled quantities are randomly selected from the remaining base clusterers without repetition, and the number of shared samples between the fixed reference quantity and the unlabeled quantity is calculated to determine whether the unlabeled quantity needs to be relabeled. The process is repeated until all unlabeled quantities are covered, and the relabeled clustering results S'1, S'2, ..., S' are obtained. γ ;
[0024] Among them, the calculation matrix ο of cluster shared samples is as follows:
[0025]
[0026] In the formula, u represents the reference quantity, v represents the quantity to be marked, c and d represent the marking tasks selected in the cluster; is the clustering result;
[0027] 2.2.4) Cluster the results S'1, S'2, ..., S' γ The N similar clusters in the set are integrated into a set η r ;Similar clusters refer to clusters whose number of shared samples is greater than the preset threshold;
[0028] Set η r As shown below:
[0029]
[0030] In the formula, is the cluster after integration;
[0031] The re-labeling formula is as follows:
[0032] (u′,v′)=argmax (u,v)∈I ο(u,v) (8)
[0033] Wherein, the set I = {(u,v)|1≤u,v≤N}; (u′,v′) is the matrix parameter after relabeling.
[0034] 2.2.5) Using the projection method to r Reorganize to ensure that the initial integrated clusters η'1, η'2, ..., η' are obtained N .
[0035] Using the projection method, the set η r The method of performing the reorganization includes: performing the reorganization in the form of taking the majority, if there are repeated samples, only retaining one sample and deleting the redundant repeated samples.
[0036] 2.3) Preliminary integrated clustering based on sliding time window η'1, η'2, ..., η' N Perform outlier screening and delete outlier days.
[0037] The outlier day is a sample whose window standard deviation value is greater than the threshold ω;
[0038] The window standard deviation value τ is as follows:
[0039]
[0040] In the formula, is the sample mean; x i is the sample; n is the number of samples.
[0041] 3) Establish a Stacking ensemble learning photovoltaic power prediction model;
[0042] The stacking integrated learning photovoltaic power prediction model includes a primary learner and a secondary learner;
[0043] The primary learner is used to extract data features and construct a new data set that is strongly related to the input data;
[0044] The secondary learner is used to integrate new data sets or perform weight distribution to achieve integration of learners.
[0045] The stacking ensemble learning photovoltaic power prediction model is trained by the target data set;
[0046] The target data set includes photovoltaic characteristics related to power generation;
[0047] The target data set has been cleaned and normalized, and daily samples with a number of missing power values greater than a threshold have been deleted.
[0048] The steps to establish the Stacking ensemble learning photovoltaic power prediction model include:
[0049] 3.1) Input target data set K = {(a1,b1),(a2,b2),…,(a n ,b n )}, define primary learners H1, H2, …, H t , secondary learner H0; where a1, a2, …, a n are features, b1, b2, …, b n For labels;
[0050] 3.2) Randomly divide the target data set into k subsets with the same number of samples, denoted as K1, K2, …, K k ; Each time, select one of the subsets K without repetition i Used as a test set, generate k sets of data sets containing different test sets; i = 1, 2, ..., k;
[0051] 3.3) Following the k-fold cross-validation method, k sets of data are sequentially put into the given t primary learners to obtain the training result z mt ; Among them, z mt =H (i)t (a m );a m For subset K i Samples in H ( t i) For the t-th primary learner, use the subset K i The result of the test set;
[0052] 3.4) Combine the training results of t groups of learners and construct a new dataset K′={(z m ,y m )};z m ,y m Represents the training results of the learner.
[0053] 3.5) Input the new data set K′ into the secondary learner to obtain the training results.
[0054] 4) Input the meteorological data into the meteorological classification model based on integrated clustering to obtain the meteorological classification results, and combine the power station climate to establish meteorological models under different meteorological classifications;
[0055] 5) Determine the weather category of the forecast day based on the weather forecast data, and input the photovoltaic data of the forecast day into the Stacking model under the corresponding meteorological model to obtain the photovoltaic power prediction result.
[0056] The technical effect of the present invention is unquestionable. The present invention selects partition-based Kmeans clustering, model-based Gaussian mixture clustering GMM, and hierarchical AGNES and BIRCH clustering as base clustering, and combines the re-labeling method and projection method for fusion integration to construct a weather clustering model based on integration thinking. This broadens the classification perspective, avoids random factors, improves the average performance and stability of the clustering algorithm, and solves the problem of fine data division that is difficult to achieve with a single cluster. And the consideration of abnormal samples is added to the model, making it more robust and more typical in classification.
[0057] In the prediction stage, the present invention uses the Stacking integration framework to improve the algorithm's ability to explore data periodicity and nonlinear relationships between features, obtain higher prediction accuracy under different weather conditions, and obtain a better prediction model. Compared with a single model, the Stacking ensemble learning model can summarize the different characteristics of the difference model to achieve a more ideal effect. It solves the problem of traditional algorithm selection limitations and gives full play to the advantage of "brainstorming" advocated by the hybrid model. BRIEF DESCRIPTION OF THE DRAWINGS
[0058] Figure 1 It is an integrated process based on re-labeling and projection methods;
[0059] Figure 2 It is an outlier day screening method based on sliding time window;
[0060] Figure 3 It is the primary learner training process based on k-fold cross validation;
[0061] Figure 4 It is the line graph of Kmeans and GMM silhouette coefficient under different cluster numbers;
[0062] Figure 5 Hierarchical clustering tree for AGNES clustering;
[0063] Figure 6 This is the correlation coefficient heat map of Birch clustering;
[0064] Figure 7 The typical power generation curves under three types of meteorological models;
[0065] Figure 8 This is a comparison chart of the forecast based on the clear sky model;
[0066] Fig. 9 This is a comparison chart of predictions based on a multi-cloud model;
[0067] Fig.10 This is a comparison chart of predictions based on the rainy day model. DETAILED DESCRIPTION
[0068] The present invention is further described below in conjunction with the embodiments, but it should not be understood that the above subject matter of the present invention is limited to the following embodiments. Without departing from the above technical ideas of the present invention, various substitutions and changes are made according to the common technical knowledge and customary means in the art, which should all be included in the protection scope of the present invention.
[0069] Embodiment 1:
[0070] See also Figures 1 to 10 , a photovoltaic power prediction method based on a dual integrated model, comprising the following steps:
[0071] 1) Obtain weather forecast data;
[0072] 2) Establish a meteorological classification model based on ensemble clustering
[0073] The steps of establishing an ensemble clustering-based meteorological classification model include:
[0074] 2.1) selecting a base clusterer and clustering the historical meteorological data using the base clusterer to obtain several clustering results; the base clusterer includes a Kmeans (K-means) clusterer, a GMM (Gaussian Mixture Model) clusterer, an AGNES (agglomerative nesting) clusterer and a BIRCH (balanced iterative reducing and clustering using hierarchies) clusterer;
[0075] The basic function formula of the Kmeans clusterer is as follows:
[0076] H ji =||x j -μ i ||2 (1)
[0077] In the formula, H ji is the sample point x j The distance from the cluster center; μ i is the cluster C i The mean vector of ;
[0078] The basic function formula of the GMM clusterer is as follows:
[0079]
[0080] Where μ is the mean vector, Σ is the covariance matrix, x represents a random vector in the n-dimensional target data set; q(x) is the probability density function that obeys the Gaussian distribution.
[0081] The basic function formulas of the AGNES clusterer are as follows:
[0082]
[0083]
[0084] In the formula, C i and C j is the cluster, dist is the distance calculation function between samples; H min , H max , H avg are the minimum distance, maximum distance, and average distance; e and f represent cluster C respectively. i and cluster C j point.
[0085] The BIRCH clusterer is a split clusterer; the BIRCH clusterer constructs a clustering feature tree using highly compressed ternary features, and outputs a number of tree nodes representing each cluster.
[0086] 2) Use the re-labeling method and projection method to update the clustering results of the base clusterer and obtain the preliminary integrated clusters η'1, η'2, ..., η' N ;
[0087] The steps of updating the clustering results of the base clusterer using the re-labeling method and the projection method include:
[0088] 2.2.1) Let the independent base clusterers be ψ1, ψ2, ..., ψ γ ; i = 1, 2, ..., γ; γ is the number of base clusterers;
[0089] 2.2.2) Use the base clusterer to cluster the target data set and obtain the clustering result S i ={α (i)1 ,β (i)2 ,...,λ (i)N}; where α (i)1 ,β (i)2 ,...,λ (i)N is the cluster;
[0090] 2.2.3) Randomly select a clustering result S of a base clusterer i As a fixed reference quantity, a group of unlabeled quantities are randomly selected from the remaining base clusterers without repetition, and the number of shared samples between the fixed reference quantity and the unlabeled quantity is calculated to determine whether the unlabeled quantity needs to be relabeled. The process is repeated until all unlabeled quantities are covered, and the relabeled clustering results S'1, S'2, ..., S' are obtained. γ ;
[0091] Among them, the calculation matrix ο of cluster shared samples is as follows:
[0092]
[0093] In the formula, u represents the reference quantity, v represents the quantity to be marked, c and d represent the marking tasks selected in the cluster; is the clustering result;
[0094] 2.2.4) Cluster the results S'1, S'2, ..., S' γ The N similar clusters in the set are integrated into a set η r ;Similar clusters refer to clusters whose number of shared samples is greater than the preset threshold;
[0095] Set η r As shown below:
[0096]
[0097] In the formula, is the cluster after integration;
[0098] The re-labeling formula is as follows:
[0099] (u′,v′)=argmax (u,v)∈I ο(u,v) (8)
[0100] Wherein, the set I = {(u,v)|1≤u,v≤N}; (u′,v′) is the matrix parameter after relabeling.
[0101] 2.2.5) Using the projection method to r Reorganize to ensure that the initial integrated clusters η'1, η'2, ..., η' are obtained N .
[0102] Using the projection method, the set η r The method of performing the reorganization includes: performing the reorganization in the form of taking the majority, if there are repeated samples, only retaining one sample and deleting the redundant repeated samples.
[0103] 2.3) Preliminary integrated clustering based on sliding time window η'1, η'2, ..., η' N Perform outlier screening and delete outlier days.
[0104] The outlier day is a sample whose window standard deviation value is greater than the threshold ω;
[0105] The window standard deviation value τ is as follows:
[0106]
[0107] In the formula, is the sample mean; x i is the sample; n is the number of samples.
[0108] 3) Establish a Stacking ensemble learning photovoltaic power prediction model;
[0109] The stacking integrated learning photovoltaic power prediction model includes a primary learner and a secondary learner;
[0110] The primary learner is used to extract data features and construct a new data set that is strongly related to the input data;
[0111] The secondary learner is used to integrate new data sets or perform weight distribution to achieve integration of learners.
[0112] The stacking ensemble learning photovoltaic power prediction model is trained by the target data set;
[0113] The target data set includes photovoltaic characteristics related to power generation;
[0114] The target data set has been cleaned and normalized, and daily samples with a number of missing power values greater than a threshold have been deleted.
[0115] The steps to establish the Stacking ensemble learning photovoltaic power prediction model include:
[0116] 3.1) Input target data set K = {(a1,b1),(a2,b2),…,(a n ,b n )}, define primary learners H1, H2, …, H t , secondary learner H0; where a1, a2, …, a n are features, b1, b2, …, b n For labels;
[0117] 3.2) Randomly divide the target data set into k subsets with the same number of samples, denoted as K1, K2, …, K k ; Each time, select one of the subsets K without repetition i Used as a test set, generate k sets of data sets containing different test sets; i = 1, 2, ..., k;
[0118] 3.3) Following the k-fold cross-validation method, k sets of data are sequentially put into the given t primary learners to obtain the training result z mt ; Among them, z mt =H (i)t (a m );a m For subset K i Samples in For the t-th primary learner, use the subset K i The result of the test set;
[0119] 3.4) Combine the training results of t groups of learners and construct a new dataset Kˊ={(z m ,y m )} nm=1 ; z m ,y m Represents the training results of the learner.
[0120] 3.5) Input the new data set Kˊ into the secondary learner to obtain the training results.
[0121] 4) Input the meteorological data into the meteorological classification model based on integrated clustering to obtain the meteorological classification results, and combine the power station climate to establish meteorological models under different meteorological classifications;
[0122] 5) Determine the weather category of the forecast day based on the weather forecast data, and input the photovoltaic data of the forecast day into the Stacking model under the corresponding meteorological model to obtain the photovoltaic power prediction result.
[0123] Embodiment 2:
[0124] A photovoltaic power prediction method based on a dual integrated model, which realizes refined meteorological classification and improves the accuracy of power prediction. First, based on the re-labeling method and projection method, a Kmeans-GMM-AGNES-BIRCH integrated clustering framework integrating four heterogeneous algorithms is constructed, and outlier days are screened according to the sliding time window to establish a typical meteorological model; secondly, based on the Stacking integrated learning framework, a GRU-RF-XGBoost-LightGBM integrated prediction model is constructed on the basis of using the k-fold cross-validation method to avoid overfitting, and the potential laws of photovoltaic data are deeply mined to achieve accurate prediction. The specific steps are summarized as follows:
[0125] 1) Import the target dataset
[0126] The Pearson correlation coefficient is used to select photovoltaic features that have a strong correlation with power generation and construct the target data set. Then, data cleaning and normalization are performed, samples are constructed in units of days, and daily samples with a large number of missing power values are deleted as a whole to retain the time series characteristics within the daily samples.
[0127] 2) Establish an integrated clustering model based on the preprocessed data set
[0128] Four heterogeneous clustering algorithms are used to classify weather, and the algorithms are integrated through relabeling and projection methods to generate initial weather types. Then, the classification differences of heterogeneous algorithms are used to extract controversial samples based on typicality, and the sliding window screening method is combined to eliminate outlier days that affect the forecast, and finally N types of meteorological models are generated.
[0129] 3) Photovoltaic forecast based on weather classification
[0130] Refer to the numerical weather forecast to determine the weather category of the day to be predicted. Build a GRU-RF-XGBoost-LightGBM integrated prediction model, input the day to be predicted into the corresponding Stacking prediction model, and complete the power prediction.
[0131] Embodiment 3:
[0132] A photovoltaic power prediction method based on a dual integrated model, comprising the following steps:
[0133] 1) Import the target data set and perform data preprocessing
[0134] The Pearson correlation coefficient is used to select photovoltaic features that have a strong correlation with power generation and construct the target data set. Then the data is cleaned and normalized, and samples are constructed in units of days. Daily samples with a large number of missing power values are deleted as a whole, and the time series characteristics within the daily samples are retained. Finally, the final data set for input clustering is obtained.
[0135] 2) Construction of integrated clustering model
[0136] Single clustering is difficult to achieve fine division of data, and multi-algorithm integration can broaden the classification perspective, avoid random factors, and improve the average performance and stability of the algorithm. The present invention selects Kmeans clustering based on division, Gaussian mixture clustering GMM based on model, and AGNES and BIRCH clustering based on hierarchy as base clustering to construct an integrated model. Then, the collection is performed through the re-labeling method and the projection method to achieve refined meteorological classification.
[0137] 2-1) Base clusterer selection
[0138] Kmeans continuously adjusts the sample categories by updating the cluster center to calculate the sample point x j The distance H from the cluster center ji Clustering is achieved by using the distance formula (1), where μ i is the cluster C i The mean vector of .
[0139] H ji =||x j -μ i ||2 (1)
[0140] GMM uses a probability density function that obeys a Gaussian distribution to describe the cluster center and has a flexible partitioning effect. The basic function formula is shown in formula (2), where μ is the mean vector, Σ is the covariance matrix, and x represents a random vector in an n-dimensional sample.
[0141]
[0142] AGNES is a "bottom-up" merging clustering algorithm, that is, clustering is achieved by merging the clusters with the closest distance, which can take into account the hierarchical relationship in the category. Its distance calculation uses the minimum distance H min , maximum distance H max and the average distance H avg , refer to formula (3)-(5), where C i and C j is the clustering cluster, and dist is the distance calculation function between samples.
[0143]
[0144] BIRCH and AGNES both belong to hierarchical clustering. However, BIRCH is a "top-down" split clustering that can identify noise points and preprocess the data set. The algorithm uses highly compressed ternary features to construct a clustering feature tree, and the final output is a number of tree nodes representing each cluster.
[0145] 2-2) Clustering ensemble method based on re-labeling and projection
[0146] Since the ensemble method used in this model requires the base clusterers to have the same number of clusters, before clustering calculations, it is necessary to use the silhouette coefficient, hierarchical clustering tree, and heat map to judge the clustering quality under different numbers of clusters according to the algorithm properties of the above four clustering methods, and determine the number of clusters N of the base clusterer. Then, the relabeling method is used to give the clusters with large overlap the same label to achieve label correction of similar clusters; then the projection method is used to merge the clusters with the same label to obtain the initial set category; and the outlier screening method is introduced to classify controversial samples and delete meaningless marginalized samples, and finally three typical meteorological types are obtained.
[0147] The steps of the relabeling method are as follows. Define the independent base clusterers as ψ1, ψ2, …, ψ γ , are clustered according to N clusters, and the result is S i ={α (i)1, β (i)2, ...,λ (i)N},i=1,2,…,γ, where α1,β2,…,λ N is a clustering cluster, representing the clustering result under the base clusterer. However, since the clustering algorithm belongs to unsupervised learning, the clusters generated by different algorithms cannot be directly compared. For example, α1 (1) With α1 (2) The relabeling method can make similar clusters under the γ-based clustering obtain the same label, such as (1) Similar clusters are relabeled as α1 (2) ,α1 (3) ,…,α1 (γ) The operation method is to randomly select the clustering result S of a base clusterer i As a fixed reference quantity, a group of quantities to be labeled is randomly selected from the remaining base clusterers without repetition. Then the number of shared samples between the fixed reference quantity and the quantity to be labeled is calculated to determine whether the quantity to be labeled needs to be relabeled (corresponding to Figure 1The goal of relabeling is that similar clusters have similar colors. Therefore, clusters with similar data but different colors in the initial state need to be relabeled), and iterate continuously until all the quantities to be labeled are covered. The calculation matrix ο of cluster shared samples is as shown in formula (6). Among them, u represents the reference quantity, v represents the quantity to be labeled, and c and d represent the selected labeling tasks in the cluster. The formula for determining whether to relabel is as shown in formula (7), I={(u,v)|1≤u,v≤N}, and the final clustering results after relabeling are S'1,S'2,…,S' γ .
[0148]
[0149] Next, S'1, S'2, ..., S' γ The N similar clusters in the set are integrated into a set η r , as shown in formula (8), and then the projection method is used to process it. This method separates similar clusters η1,η2,…,η N The samples in the are reorganized in the form of "taking more", and only one of the repeated samples is retained to ensure that the samples in similar clusters are unique. This method is similar to stacking the visualized cluster point graphs, projecting vertically from top to bottom, and taking all the projected points as the final result, thereby obtaining the preliminary integrated clusters η'1, η'2, ..., η' N Among them, the cluster η' r (r=1,2,…,N), there are identical samples. This method of temporarily classifying controversial samples into multiple clusters makes it possible for controversial samples to be considered multiple times, thereby improving sample utilization.
[0150] 2-3) Outlier day screening method based on sliding time window
[0151] After the initial integration, the cluster η' is processed r Among the controversial samples in (r=1,2,…,N), filter and delete the outlier days. Outlier days refer to controversial samples with abnormal fluctuations or marginalization, which need to be located according to typicality. The classification differences of heterogeneous clustering algorithms can reflect the typicality of samples. The value of sample typicality is the initial integrated cluster η'1,η'2,…,η' N The number of times each sample appears in the cluster. First, define the sample typicality as σ and traverse the cluster η' r (r=1,2,…,N), and get the typicality of each sample. According to the number of clusters in this study, the maximum value of σ is 4. If σ>2, the sample is typical, and the rest are outliers. At this time, the clustering result S i (i=1,2,…,γ) can also be expressed as S i ={A i ,B i},i=1,2,…,γ,A iand B i They are the typical day set and the outlier day set respectively.
[0152] In order to further enhance the rigor of outlier selection and reduce the additional consequences of heterogeneous algorithm diversity, the present invention uses a sliding time window method to analyze the data and further select outlier days. The sampling period of photovoltaic day samples is short and the data volume is large, so data compression should be performed first. In probability statistics, the standard deviation can measure the degree of dispersion between data and reflect data fluctuations. Sample x i The standard deviation τ is calculated as follows.
[0153]
[0154] However, the standard deviation cannot describe the details of fluctuations, so the standard deviation operation sliding time window is introduced to quantify the fluctuations of adjacent samples. The method is as follows Figure 2 . The sliding time window method starts from daily sample 1, sets 3 adjacent days as a window, slides from front to back, and continuously constructs new windows until sample n. Then the standard deviations of the above n-2 windows are calculated one by one for subsequent screening. The new standard deviation represents the fluctuation of adjacent samples, expands the relative perspective of the observed data, improves the screening criteria, and is conducive to enhancing the rigor of selecting outlier days. After the calculation is completed, the threshold ω is set to measure the window standard deviation value, and the sample curve is drawn. Combined with the image, the samples with the threshold ω>0.1 are judged as abnormal samples, and then the outlier day set Ω is locked and deleted.
[0155] 3) Establishing a Stacking ensemble learning photovoltaic power prediction model
[0156] Stacking is a fusion model, which is generally divided into two layers. The first layer is the primary learner, which usually uses heterogeneous algorithms to extract data features and construct new data sets that are strongly related to the input data. The second layer is the secondary learner, which has 1 and is used to integrate new data sets or perform weight distribution to achieve learner integration. Therefore, the secondary learner needs to have strong generalization ability.
[0157] In a simple integrated architecture, the test set will cause data waste. However, the primary learner in Stacking uses the k-fold cross-validation method to divide the data, which can ensure that each operation is carried out around a different data set, thereby improving data utilization. The specific process of Stacking is as follows.
[0158] (a) Input data set K = {(a1,b1),(a2,b2),…,(a n ,b n )}, define primary learners H1, H2, …, H t , secondary learner H0. Among them, a1, a2, …, a n are features, b1, b2, …, bn For label.
[0159] (b) Randomly divide the target data set into k subsets K1, K2, …, K with the same (or similar) number of samples. k . Each time, select one of the K i (i=1,2,…,k) is used as a test set to generate k sets of data sets containing different test sets. K i Corresponding training set, then K = K i
[0160] (c) Following the k-fold cross-validation method, k sets of data are sequentially placed into the given t primary learners, then H (i)t Corresponding to the tth primary learner with K i The result of the test set is as follows: Figure 3 shown.
[0161] (d) for K i Sample a in m , let z mt =H (i)t (a m ), then a m All samples z generated m =(z m1 ; z m2 ;…;z mt ). Combine the training results of t groups of learners to construct a new data set K′={(z m ,y m )} nm=1 ;
[0162] (e) Input K′ into the secondary learner to obtain the training result.
[0163] Ensemble learning is composed of existing algorithms, and the combination of algorithms determines the quality of prediction. In principle, the learner should not only ensure the accuracy of the algorithm itself, but also take into account the differences with other learners to achieve complementary advantages and disadvantages. The short-term memory function of the gated recurrent unit GRU is suitable for time series data processing. The update gate and reset gate can identify and retain important information and determine the current information call. At the same time, the GRU model is simple and suitable for building large networks. The basic unit of RF is the CART tree, which can achieve regression using a simple average method under the premise of random sampling. It has few hyperparameters, a robust model, is good at processing high-dimensional data, and can ignore messy data to a certain extent. XGBoost is a parallel optimization algorithm that focuses on improving accuracy. Based on the principle of the GBDT algorithm, XGBoost adds the quadratic Taylor expansion term of the objective function and the model complexity regularization term to reduce the difference with the actual data. LightGBM uses the HistoGram algorithm and the leaf-wise strategy with depth restriction. The calculation speed is 10 times faster than the original algorithm, and the memory is reduced to 1 / 8 of the original, which will not cause memory burden to ensemble learning. The above algorithms are heterogeneous, have strong learning capabilities, and run at a considerable speed. They are suitable for photovoltaic time series data sets and are the best choice for primary learners. The secondary learner contains new features extracted by the primary learner, and the probability of overfitting is greater, so algorithms with all-round optimization capabilities are often selected. Commonly used algorithms include: linear regression, which processes data quickly and directly, and RF, which is good at processing high-dimensional data. In view of the long training time of the primary learner, in order to ensure efficiency, the secondary learner in this article is selected as linear regression.
[0164] Embodiment 4:
[0165] An experiment on photovoltaic power prediction method based on dual integrated model is as follows:
[0166] The technical route of the present invention can be divided into two major steps, among which the integrated clustering model is applied to meteorological classification, and the integrated prediction model is committed to improving accuracy. At the data optimization level, the integrated clustering model synchronizes the similar categories obtained by the base clustering algorithm using the re-labeling method, and realizes the preliminary combination through the projection method; secondly, the sliding time window is introduced to screen out the outlier days that affect the training, thereby improving the quality and robustness of clustering and realizing weather classification. At the algorithm innovation level, the integrated prediction model uses the Stacking integrated learning framework to fuse four heterogeneous artificial intelligence algorithms adapted to photovoltaic time series data through a secondary learner, and uses the k-fold cross-validation method for data processing before inputting the model, avoiding the overfitting problem, and finally realizing the multi-angle analysis of photovoltaic data. Later, it was proved by experiments that the prediction accuracy of the dual integrated model is significantly improved compared with the traditional model. Combined with the specific implementation plan, it is further explained as follows.
[0167] 1) Basic data preparation
[0168] The technical facility data of the present invention comes from a 1.8MW solar power station in central Australia. The data set collection cycle is 5 minutes, covering the characteristics of electricity, meteorology and equipment parameters, but different characteristics have different degrees of influence on photovoltaic output. Therefore, the simulation uses the Pearson coefficient to calculate the correlation between photovoltaic power and other characteristics. The formula is as follows:
[0169]
[0170] The features with a Pearson coefficient greater than 0.5 in Table 1 were selected as input data. A total of 157 normalized numerical points from 6:00 to 19:00 every day from January 2019 to September 2021 were selected as the training set, and October 2021 was used as the test set.
[0171] Table 1 Pearson correlation coefficient between photovoltaic characteristics and power generation
[0172]
[0173] In order to comprehensively evaluate the prediction performance, this study determined three evaluation indicators from the perspectives of error, model and fitting. RMSE Describes the error between the predicted value and the true value; mean absolute percentage error y MAPE Represents the quality of the model, 0% means the model is perfect; determination coefficient
[0174] y R2 Indicates the quality of the fit, 1 means a perfect fit. The predicted value is The true value is y, then the indicator formula is as follows.
[0175]
[0176] 2) Establish a weather classification model based on ensemble clustering
[0177] Ensemble clustering requires four algorithms to operate on the same set of data. If the number of clusters is different, the results cannot be merged. Moreover, the diversification of heterogeneous algorithms requires researchers to study and evaluate the selection of the number of clusters. Among the four clustering methods in this paper, Kmeans and GMM clustering belong to K-means clustering, and the silhouette coefficient can be used to judge the effect under different numbers of clusters; AGNES and Birch belong to hierarchical clustering, and the hierarchical clustering tree is an effective way to view the clustering situation.
[0178] Silhouette coefficient is one of the classic clustering evaluation indicators, which can verify the effectiveness of the results. It measures the similarity between a point and its category, with a value range of -1 to 1. The larger the value, the better the effect. In Python simulation software, the silhouette_score function can be used to determine the mean silhouette score of clustering results under different clusters, and finally the silhouette coefficients of Kmeans and GMM are obtained as follows: Figure 4 . Combined with Figure 5 and Figure 6 Finally, the number of clusters is determined to be 3. After completing the integrated clustering according to the three-category division, on the basis of eliminating outlier days, three types of typical meteorological day curves are obtained as follows: Figure 7 .
[0179] analyze Figure 7 . Due to the strong solar radiation in the location of the dataset, there is still considerable power generation even in the presence of clouds, so the photovoltaic output curves of the sunny and cloudy models are relatively close. The power curves of the three models are peak-shaped as a whole, corresponding to the characteristics that photovoltaic power generation is closely related to solar radiation. In addition, since Australia has a continental climate and rainfall is scarce, from the perspective of the proportion in the dataset, the number of samples of the rainy day model only accounts for 7% of the dataset, while the sunny and cloudy models account for a high proportion, 47% and 46% respectively.
[0180] 3) Stacking ensemble learning model for predicting photovoltaic power generation
[0181] Based on meteorological classification, a comparative experiment between the Stacking integrated algorithm and the traditional algorithm was conducted, and the prediction results are shown in Table 2. Figure 8-Figure 10 From the curves, we can see that the Stacking integrated algorithm can accurately predict power fluctuations, and the predicted power curves of the three types of meteorological models are highly consistent with the actual power curves. The specific analysis is as follows.
[0182] Table 2 Comparison of prediction effects between traditional algorithm and Stacking algorithm
[0183]
[0184] Figure 8 This is the daily prediction curve under the sunny model. The curve conforms to the smooth peak pattern with high power at noon and low power at sunrise and sunset. There are few power mutations and the random fluctuation amplitude is not large. It is a relatively stable weather model. Compared with other algorithms, the prediction curve under the Stacking model can best approximate the actual power value with the smallest error. Compared with LSTM, CNN-LSTM, SVR and BP algorithms, Stacking's y RMSE The indicators decreased by 1.458, 1.120, 10.719 and 13.847 respectively, MAPEThey decreased by 2.102, 1.969, 4.668 and 4.902 respectively.
[0185] Fig. 9 This is the daily prediction curve under the cloudy model. The power prediction curve under the cloudy model also shows certain peaks and valleys. However, due to the great influence of cloud movement and unstable solar radiation, the curve has jagged characteristics in some periods compared with the sunny model. Compared with other algorithms, the prediction value of the Stacking model is more superior, and the three indicators are still the best. Combined with the sunny model, it can be seen that the SVR and BP algorithms are less compatible with the photovoltaic power prediction, and the prediction results are seriously deviated from the actual power generation.
[0186] Fig.10 This is the daily prediction curve under the rainy day model. The power generation curve on rainy days is relatively close to the trend of high in the middle and low on both sides, but the random volatility of power generation is large, and the amplitude is significantly lower than that of the sunny day model and the cloudy model. Compared with the other four algorithms, the Stacking algorithm has the highest prediction accuracy, and the prediction curves of the SVR and BP algorithms are the least consistent with the model curve. RMSE The indicators differed by 1.458, 1.120, 10.719 and 13.847 respectively. MAPE They decreased by 2.102, 1.969, 4.668 and 4.902 respectively.
[0187] Faced with the abnormal values, atypical values, and substandard power prediction effects in the original photovoltaic data, the present invention specifically proposes a dual-integrated photovoltaic power prediction model. Compared with traditional methods, this model uses the integrated idea of re-labeling and projection to obtain a more comprehensive meteorological clustering, and refines the controversial samples based on the sliding time window to obtain a better meteorological model. Secondly, through the Stacking integrated learning framework, combined with the correct choice of learners, better prediction results are achieved than a single learner, and the prediction accuracy is improved.
Claims
1. A photovoltaic power prediction method based on a dual integration model, characterized in that: The following steps are involved: 1) Obtain weather forecast data; 2) Establish a meteorological classification model based on ensemble clustering and a stacking ensemble learning photovoltaic power prediction model respectively; 3) Input the meteorological data into the meteorological classification model based on integrated clustering to obtain the meteorological classification results, and combine the power station climate to establish meteorological models under different meteorological classifications; 4) Determine the weather category of the forecast day based on the weather forecast data, and input the photovoltaic data of the forecast day into the Stacking model under the corresponding meteorological model to obtain the photovoltaic power prediction result; The steps of establishing an ensemble clustering-based meteorological classification model include: a1) selecting a base clusterer, and using the base clusterer to cluster the historical meteorological data to obtain several clustering results; a2) Use the re-labeling method and projection method to update the clustering results of the base clusterer to obtain the preliminary integrated clusters η'1, η'2, ..., η' N ; a3) Preliminary integrated clustering of clusters η'1, η'2, ..., η' based on sliding time window N Filter outlier days and delete them; The base clusterers include Kmeans clusterer, GMM clusterer, AGNES clusterer and BIRCH clusterer; The basic function formula of the Kmeans clusterer is as follows: H ji =||x j -m i ||2 (1) In the formula, H ji is the sample point x j The distance from the cluster center; μ i is the cluster C i The mean vector of ; The basic function formula of the GMM clusterer is as follows: Where μ is the mean vector, Σ is the covariance matrix, x represents a random vector in the n-dimensional target data set; q(x) is the probability density function that obeys the Gaussian distribution; The basic function formulas of the AGNES clusterer are as follows: In the formula, C i and C j is the cluster, dist is the distance calculation function between samples; H min , H max , H avg are the minimum distance, maximum distance, and average distance; e and f represent cluster C respectively. i and cluster C j point; The BIRCH clusterer is a split clusterer; the BIRCH clusterer constructs a clustering feature tree using highly compressed ternary features and outputs a number of tree nodes representing each cluster; The steps of updating the clustering results of the base clusterer using the re-labeling method and the projection method include: b1) Let the independent base clusterers be ψ1, ψ2, ..., ψ γ ; i = 1, 2, ..., γ; γ is the number of base clusterers; b2) Use the base clusterer to cluster the target data set and obtain the clustering result S i ={α (i)1 ,β (i)2 ,...,λ (i)N }; where α (i)1 ,β (i)2 ,...,λ (i)N is the cluster; b3) Randomly select a clustering result S of a base clusterer i As a fixed reference quantity, a group of unlabeled quantities are randomly selected from the remaining base clusterers without repetition, and the number of shared samples between the fixed reference quantity and the unlabeled quantity is calculated to determine whether the unlabeled quantity needs to be relabeled. The process is repeated until all unlabeled quantities are covered, and the relabeled clustering results S'1, S'2, ..., S' are obtained. γ ; The calculation matrix of cluster shared samples is as follows: In the formula, u represents the reference quantity, v represents the quantity to be marked, c and d represent the marking tasks selected in the cluster; is the clustering result; b4) Cluster the results S'1, S'2, ..., S' γ The N similar clusters in the set are integrated into a set η r ;Similar clusters refer to clusters whose number of shared samples is greater than the preset threshold; Set η r As shown below: In the formula, is the cluster after integration; b5) Use the projection method to r Reorganize to ensure that the initial integrated clusters η'1, η'2, ..., η' are obtained N ; The re-labeling formula is as follows: (u′,v′)=argmax (u,v)∈I ο(u,v) (8) Where, the set I = {(u,v)|1≤u,v≤N}; (u′,v′) is the relabeled matrix parameter; Using the projection method, the set η r The method of performing the reorganization includes: reorganizing in the form of taking the majority, if there are repeated samples, only one sample is retained and the redundant repeated samples are deleted; The outlier day is a sample whose window standard deviation value is greater than the threshold ω; The window standard deviation value τ is as follows: In the formula, is the sample mean; x i is the sample; n is the number of samples; The stacking integrated learning photovoltaic power prediction model includes a primary learner and a secondary learner; The primary learner is used to extract data features and construct a new data set that is strongly related to the input data; The secondary learner is used to integrate new data sets or perform weight distribution to achieve integration of learners; The stacking ensemble learning photovoltaic power prediction model is trained by the target data set; The target data set includes photovoltaic characteristics related to power generation; The target data set has been cleaned and normalized, and daily samples with a number of missing power values greater than a threshold have been deleted; The steps to establish the Stacking ensemble learning photovoltaic power prediction model include: c1) Input the target data set K = {(a1,b1),(a2,b2),…,(a n ,b n )}, define primary learners H1, H2, …, H t , secondary learner H0; where a1, a2, …, a n are features, b1, b2, …, b n For labels; c2) Randomly divide the target data set into k subsets with the same number of samples, denoted as K1, K2, …, K k ; Each time, select one of the subsets K without repetition i Used as a test set, generate k sets of data sets containing different test sets; i = 1, 2, ..., k; c3) Following the k-fold cross-validation method, k sets of data sets are sequentially put into the given t primary learners to obtain the training result z mt ; Among them, z mt =H (i)t (a m );a m For subset K i Samples in For the tth primary learner, use the subset K i The result of the test set; c4) Combine the training results of t groups of learners to construct a new data set K′={(z m ,y m )};z m ,y m Represents the training results of the learner; c5) Input the new data set K′ into the secondary learner to obtain the training result.
Citation Information
Patent Citations
Short-term photovoltaic power generation power prediction method
CN111369045A
Short-term photovoltaic power generation power prediction method and system
CN112561139A