Distributed Photovoltaic Power Prediction Method and System Based on AP Clustering and Transfer Learning

The station clusters of distributed photovoltaic power stations are divided through AP clustering and feature transfer is used to transfer, which solves the problem of low power prediction accuracy of distributed photovoltaic power stations and achieves higher prediction accuracy and applicability.

CN118316021BActive Publication Date: 2025-06-27SHANDONG UNIV +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410385305.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-04-01
Publication Date
2025-06-27
Estimated Expiration
2044-04-01

AI Technical Summary

Technical Problem

Due to the lack of special meteorological monitoring devices and historical data, it is difficult to establish high-precision power prediction models for distributed photovoltaic power plants, resulting in low photovoltaic power prediction accuracy, affecting the safe and economical operation of the power system.

Method used

Using the method based on AP clustering and transfer learning, distributed photovoltaic power stations are divided into station groups with similar meteorological-power characteristics, and the feature transfer of the source domain to the target domain is realized through transfer learning, and a power prediction model is constructed.

Benefits of technology

It improves the accuracy and applicability of distributed photovoltaic power prediction, simplifies the prediction modeling of each single station, and reduces the prediction difficulty.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118316021B_ABST
    Figure CN118316021B_ABST
Patent Text Reader

Abstract

The present invention proposes a distributed photovoltaic power prediction method and system based on AP clustering and transfer learning, which relates to the technical field of short-term distributed photovoltaic power prediction. The specific solution is as follows: collect the historical power generation data of each distributed photovoltaic power station in the area to be predicted; based on the historical power generation data, use AP clustering to divide multiple distributed photovoltaic power stations in the area to be predicted into station groups; take the most relevant clustering center power station in each station group as the source domain and other power stations as the target domain, and transfer the features from the source domain to the target domain through transfer learning to obtain a power prediction model; use the power prediction model to predict the photovoltaic power of the distributed photovoltaic power stations in the target domain; the present invention uses the AP clustering algorithm to cluster the photovoltaic power of each photovoltaic power station, divides the photovoltaic power stations with similar "meteorology-power" characteristics into the same station group, and realizes the feature transfer from the source domain to the target domain in the same station group through transfer learning, so as to accurately predict the photovoltaic power of the target domain.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of distributed photovoltaic short-term power prediction, and particularly relates to a distributed photovoltaic power prediction method and system based on AP clustering and transfer learning. Background Art

[0002] The statements in this part only provide background technical information related to the present invention and do not necessarily constitute prior art.

[0003] With the continuous development of science and technology, photovoltaic power generation has rapidly become the third largest renewable energy after hydropower and wind power. Different from conventional power sources, the output of photovoltaic power generation is affected by meteorological factors such as irradiance, temperature, wind speed, and humidity, with large intermittency, randomness, and volatility. Being able to accurately predict photovoltaic power is of utmost importance for the development of photovoltaic power generation technology.

[0004] Distributed photovoltaic units have a small single capacity and a large number. Due to cost issues, there is a lack of dedicated meteorological monitoring devices and measurement equipment, and a large number of newly built photovoltaic power stations each year lack sufficient historical data. When performing photovoltaic power prediction, the weather type is a key influencing factor because changes in different irradiance intensities and meteorological conditions directly affect the power generation performance of the photovoltaic system and the total amount of solar radiation obtained by the photovoltaic panels. Incomplete information collection also causes certain difficulties in distributed photovoltaic power prediction, making it difficult to establish a high-precision prediction model, resulting in distributed photovoltaics being in the "blind zone" of new energy regulation for a long time, bringing many challenges to the safe and economic operation and optimal dispatching management of the power system.

[0005] The methods for centralized photovoltaic power prediction are mainly applicable to photovoltaic power stations with a complete meteorological acquisition system and power information. For distributed photovoltaic power prediction, the method of cluster prediction can be used. Currently, there are relatively few related studies on the cluster power prediction of distributed photovoltaic power stations. There are mainly three ways of cluster power prediction: the summation method, the extrapolation method, and the statistical upscaling method. The summation method does not consider the correlation between different power stations and cannot effectively handle the non-linear changes in the power of cluster power stations. When using the extrapolation method to predict the power of cluster power stations, the selection of weights will greatly affect the quality of the final cluster power prediction results. Due to the smoothing effect of the photovoltaic power plant cluster, the prediction of the statistical upscaling method will be higher than the prediction accuracy of a single power station. When using the statistical upscaling method for prediction, only the relevant data of the reference power station need to be known to predict the power value of the entire region, and at the same time, the prediction accuracy can be effectively improved and the applicability can be enhanced. However, how to make the reference power station better represent other power stations in the region is the key factor determining the prediction accuracy of this method. Summary of the Invention

[0006] To overcome the deficiencies of the above-mentioned existing technologies, the present invention provides a distributed photovoltaic power prediction method and system based on AP clustering and transfer learning. The affinity propagation (AP) clustering algorithm is used to cluster the photovoltaic power of each photovoltaic power station, and the photovoltaic power stations with similar "meteorology-power" characteristics are divided into the same group of stations. Through transfer learning, the feature transfer from the source domain to the target domain in the same group of stations is realized, so as to accurately predict the photovoltaic power of the target domain.

[0007] To achieve the above object, one or more embodiments of the present invention provide the following technical solutions:

[0008] The first aspect of the present invention provides a distributed photovoltaic power prediction method based on AP clustering and transfer learning.

[0009] The distributed photovoltaic power prediction method based on AP clustering and transfer learning includes:

[0010] Collect the historical power generation data of each distributed photovoltaic power station in the area to be predicted, including photovoltaic power and corresponding meteorological data;

[0011] Based on the historical power generation data, use the affinity propagation AP clustering to divide multiple distributed photovoltaic power stations in the area to be predicted into groups of stations, so that the power stations in each group of stations have similar meteorology-power characteristics;

[0012] Taking the most relevant clustering center power station in each group of stations as the source domain and other power stations as the target domain, transfer learning the feature transfer from the source domain to the target domain to obtain a power prediction model;

[0013] Use the power prediction model to predict the photovoltaic power of the distributed photovoltaic power stations in the target domain; wherein, the use of AP clustering to divide multiple distributed photovoltaic power stations in the area to be predicted into groups of stations is to calculate the similarity between the power samples of the distributed photovoltaic power stations according to the output curve, obtain a similarity matrix, and based on the similarity matrix, perform iterative calculations of the attractiveness matrix and the belongingness matrix until the conditions for stopping the iteration are met.

[0014] Further, it also includes preprocessing the collected historical power generation data, and the preprocessing includes outlier identification and data cleaning work.

[0015] Further, the specific steps of using AP clustering to divide multiple distributed photovoltaic power stations in the area to be predicted into groups of stations are as follows:

[0016] (1) Calculate the similarity between the power samples of the distributed photovoltaic power stations to obtain a similarity matrix;

[0017] (2) Calculate the attractiveness matrix and the belongingness matrix;

[0018] (3) Update the attraction matrix and the membership matrix;

[0019] (4) If the iteration stop condition is satisfied, go to the next step; otherwise, repeat steps (2) and (3);

[0020] (5) Calculate the silhouette coefficient according to the clustering results, and determine the clustering centers and various clusters of photovoltaic power stations;

[0021] (6) Analyze the silhouette coefficients under different numbers of clusters, select the best clustering result, and complete the division of the photovoltaic power station groups.

[0022] Furthermore, the similarity between the power samples of the distributed photovoltaic power stations is characterized by the similarity between the photovoltaic output curves, and the DTW distance is used to measure the similarity between the photovoltaic output curves.

[0023] Furthermore, the DTW distance is obtained by searching for the similar parts between two output curves and continuously adjusting the corresponding relationship between the different data points of the two output curves to obtain the best path between the two curves, and taking the cumulative distance of the best path as the DTW distance.

[0024] Furthermore, the power prediction model is constructed based on the long short-term memory (LSTM) network, with the meteorological data and historical power generation data at the time to be predicted as inputs, and outputs the predicted value of the photovoltaic power.

[0025] Furthermore, the power prediction model is pre-trained in the source domain to learn the common features in similar scenarios, and the pre-trained power prediction model is fine-tuned in the target domain to transfer the common features in the source domain to the target domain with similar features.

[0026] The second aspect of the present invention provides a distributed photovoltaic power prediction system based on AP clustering and transfer learning.

[0027] The distributed photovoltaic power prediction system based on AP clustering and transfer learning includes a data collection module, a station group division module, a model construction module, and a power prediction module:

[0028] The data collection module is configured to collect the historical power generation data of each distributed photovoltaic power station in the area to be predicted, including the photovoltaic power and the corresponding meteorological data;

[0029] The station group division module is configured to divide multiple distributed photovoltaic power stations in the area to be predicted into station groups based on the historical power generation data by using AP clustering, so that the power stations in each station group have similar meteorological-power characteristics;

[0030] A model construction module, configured to: use the most relevant clustering center power station in each station group as the source domain and other power stations as the target domain, transfer the features from the source domain to the target domain through transfer learning, and obtain a power prediction model;

[0031] A power prediction module, configured to: use the power prediction model to predict the photovoltaic power of distributed photovoltaic power stations in the target domain;

[0032] Among them, the step of dividing multiple distributed photovoltaic power stations in the area to be predicted into station groups by using AP clustering is to calculate the similarity between the power samples of distributed photovoltaic power stations according to the output curves, obtain a similarity matrix, and based on the similarity matrix, perform iterative calculations of the attraction matrix and the membership matrix until the conditions for stopping the iteration are met.

[0033] Further, the step of dividing multiple distributed photovoltaic power stations in the area to be predicted into station groups by using AP clustering is specifically as follows:

[0034] (1) Calculate the similarity between the power samples of distributed photovoltaic power stations to obtain a similarity matrix;

[0035] (2) Calculate the attraction matrix and the membership matrix;

[0036] (3) Update the attraction matrix and the membership matrix;

[0037] (4) If the conditions for stopping the iteration are met, proceed to the next step; otherwise, repeat steps (2) and (3);

[0038] (5) Calculate the silhouette coefficient according to the clustering results, determine the clustering center and each cluster of photovoltaic power station groups;

[0039] (6) Analyze the silhouette coefficients under different numbers of clusters, select the best clustering result, and complete the division of photovoltaic power station groups.

[0040] Further, the similarity between the power samples of distributed photovoltaic power stations is characterized by the similarity between photovoltaic output curves, and the DTW distance is used to measure the similarity between photovoltaic output curves.

[0041] Further, the DTW distance is obtained by searching for the similar parts between two output curves and continuously adjusting the corresponding relationship between different data points of the two output curves to obtain the best path between the two curves, and taking the cumulative distance of the best path as the DTW distance.

[0042] The third aspect of the present invention provides a computer-readable storage medium, on which a program is stored, and when the program is executed by a processor, it implements the steps in the distributed photovoltaic power prediction method based on AP clustering and transfer learning as described in the first aspect of the present invention.

[0043] A fourth aspect of the present invention provides an electronic device, including a memory, a processor, and a program stored on the memory and executable on the processor. When the processor executes the program, the steps in the distributed photovoltaic power prediction method based on AP clustering and transfer learning as described in the first aspect of the present invention are implemented.

[0044] The above one or more technical solutions have the following beneficial effects:

[0045] The present invention uses AP clustering to divide multiple distributed photovoltaic power stations in a region into small station groups, so that the power stations within each station group have similar "weather-power" characteristics, thereby ensuring the prediction accuracy.

[0046] In the present invention, the most relevant clustering center in each category is selected as the source domain, and the remaining power stations are the target domains. The meteorological data of the source domain is used as the overall meteorological data of this category. Based on the refined numerical weather prediction products developed by the PSEO team of Shandong University, each station group has its own meteorological data, thereby achieving full-region station group coverage of key meteorological data.

[0047] The present invention trains models for different weather types respectively. During prediction, classification is performed according to the meteorological conditions of the day to be predicted, and the data is input into the prediction models for different weathers, reducing the degree of data pollution and improving the overall prediction accuracy.

[0048] The present invention uses transfer learning to build a power prediction model. The characteristics of the power prediction model under similar meteorological resources are extracted from the source domain photovoltaic power stations with high data quality, and then a rough "portrait" and parameter fine-tuning are performed on the prediction model of the target domain photovoltaic power stations, thereby realizing the feature transfer from the source domain to the target domain. It can quickly learn the common features of the prediction model in similar scenarios, simplify the cumbersome modeling for predicting each single station, and reduce the prediction difficulty.

[0049] The advantages of the additional aspects of the present invention will be partially given in the following description, partially will become obvious from the following description, or will be understood through the practice of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS

[0050] The specification drawings constituting a part of the present invention are used to provide a further understanding of the present invention. The schematic embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute an improper limitation to the present invention.

[0051] Figure 1 It is a flowchart of the method for the first embodiment.

[0052] Figure 2 It is a clustering effect diagram under the AP clustering algorithm adopted in the first embodiment.

[0053] Figure 3For the first embodiment, the information transfer mode of the AP clustering algorithm is adopted.

[0054] Figure 4 For the first embodiment, it is the dynamic time warping optimal path diagram of two photovoltaic power curves.

[0055] Figure 5 For the first embodiment, the structure diagram of the LSTM neural network is adopted.

[0056] Figure 6 For the first embodiment, it is the step diagram of the model fine-tuning idea adopted. Specific implementation mode

[0057] It should be noted that the following detailed description is illustrative and is intended to provide further explanation of the present application. Unless otherwise specified, all technical and scientific terms used in the present invention have the same meaning as commonly understood by those of ordinary skill in the technical field to which this application belongs.

[0058] It should be noted that the terms used herein are only for describing specific implementation modes and are not intended to limit the exemplary implementation modes according to the present application. As used herein, unless the context clearly indicates otherwise, the singular form is also intended to include the plural form. In addition, it should be understood that when the terms "comprising" and / or "including" are used in this specification, they indicate the presence of features, steps, operations, devices, components, and / or combinations thereof.

[0059] Embodiment 1

[0060] In an embodiment of the present disclosure, a distributed photovoltaic power prediction method based on AP clustering and transfer learning is provided. As Figure 1 shown, it includes the following steps:

[0061] Step S1: Collect the historical power generation data of each distributed photovoltaic power station in the area to be predicted, including photovoltaic power and corresponding meteorological data.

[0062] First, after collecting the historical power generation power data and historical meteorological data information of each distributed photovoltaic power station in the area, the work of identifying outliers and cleaning relevant data is completed.

[0063] For the processing of outliers, since the original photovoltaic power and meteorological data may contain missing values and outliers and cannot be directly used for prediction, it is necessary to clean the data to remove outliers and missing values; and in order to eliminate the influence of different dimensions on the prediction accuracy and accelerate the convergence speed of the model, it is also necessary to normalize the data. The formula is as follows:

[0064]

[0065] Among them, X is the sequence after normalization; X i is the original photovoltaic sequence or meteorological sequence sample; X max and X min are the minimum and maximum values of the sample data respectively. After normalization, the values of the data are all within [0, 1].

[0066] Step S2: Based on historical power generation data, use AP clustering to divide multiple distributed photovoltaic power stations in the area to be predicted into station groups, so that the power stations within each station group have similar meteorological-power characteristics.

[0067] The power output of photovoltaic power stations is significantly affected by geographical terrain and climate conditions. Under different meteorological conditions, such as changes in wind speed, irradiance, cloud cover, etc., photovoltaic power stations in the same area may show obvious output differences. Therefore, it is necessary to further divide these power stations into sub-clusters, which can more fully explore the correlation between distributed photovoltaic power stations; when clustering photovoltaic power stations, considering factors such as geographical location, climate conditions, and topography between different power stations, it should be ensured to the greatest extent that the photovoltaic power stations within the same cluster have similar output characteristics, which helps to improve the synergy effect between the power stations within the cluster and then optimize the allocation of power resources.

[0068] In this embodiment, the AP algorithm is used to cluster distributed photovoltaic power stations. AP is an unsupervised clustering algorithm based on information transfer for cluster division. This algorithm is not sensitive to outliers and anomalies, and the clustering results are more stable. Figure 2 is an effect diagram under the AP clustering algorithm. It can be seen that data points with high similarity are grouped into one category, and at the same time, the clustering centers are also shown. By dividing power stations with the same fluctuation trend into the same station group, the correlation between distributed photovoltaic power stations can be more fully explored.

[0069] Specifically, initially all distributed photovoltaic power stations are regarded as potential clustering centers in this algorithm, and then based on "information mutual transfer" among power stations, they iteratively compete for clustering centers. There are two information exchange mechanisms, the attraction information r(i,k) and the membership information a(i,k), between power station data points. Among them, the attraction information r(i,k) represents the degree to which power station k is suitable as the clustering center of candidate central power station i, and is sent from point i to candidate clustering center point k; the membership information a(i,k) represents the degree of suitability for power station i to select power station k as the clustering center, and is sent from candidate clustering center point k to point i. The specific steps are as Figure 3 shown:[[]]

[0070] (1) Calculate the similarity s(i,k) between power samples of distributed photovoltaic power stations to obtain the similarity matrix S.

[0071] After data collection and preprocessing, the similarity s(i, k) between power samples of distributed photovoltaic power stations is calculated to obtain the similarity matrix S, and the diagonal element s(k, k) is the sample x of power station k k The criterion for judging whether it can become the clustering center of the station group is called the reference value. The larger this value is, the greater the possibility of being the clustering center.

[0072] The similarity between any two photovoltaic output curves can be measured by the distance between them. The smaller the distance between them, the more similar the output curves of the two photovoltaics are. Currently, the Euclidean distance and the DTW distance are usually used to measure the similarity between two time series. However, the traditional Euclidean distance only measures the geometric average distance of two output curves and is greatly affected by noise or outliers, and cannot well reflect the morphological characteristics of the output curves, so there are certain limitations. Therefore, in this embodiment, the DTW distance is selected as the index to measure the similarity between two photovoltaics.

[0073] The DTW algorithm is the application of the dynamic programming method to the time warping problem. It searches for the similar parts between two output curves and continuously adjusts the corresponding relationship between different data points of the two output curves to obtain the best path between the two curves, so as to obtain the maximum possible similarity.

[0074] First, given the output curves X = {x1, x2,..., x n} and Y = {y1, y2,..., y n} of two photovoltaics, a distance matrix D n×n is constructed:

[0075]

[0076]

[0077] Among them, x i and y j are the active power values of the two output curves respectively; n in the subscript is the length of the photovoltaic output curve; d ij is the Euclidean distance between the data points x i and y j between the two output curves.

[0078] Then, select the elements in the distance matrix D n×n that simultaneously satisfy the boundary conditions, continuity, and monotonicity constraint conditions to form the set of bending paths P = {p1, p2,..., ps,..., pl}, where p s is the position coordinate of the s-th point on the dynamic bending path, and l is the number of elements contained in the dynamic bending path.

[0079] Finally, the cumulative distance of the dynamic bending path that meets the above constraints is calculated through a recursive algorithm, and the minimum value is taken as the DTW distance between the two output curves.

[0080] In this embodiment, this is used as an index to measure the similarity between any two photovoltaic output curves. Figure 4 This is the optimal path diagram of dynamic time warping for the two photovoltaic power curves in this embodiment. The smaller the DTW distance, the higher the similarity between the two photovoltaic output curves.

[0081] (2) Calculate the element r(i,k) of the attraction matrix r and the element a(i,k) of the membership matrix a.

[0082] At the beginning of the algorithm, the attraction matrix and the membership matrix need to be initialized as zero matrices, and the calculation formulas are as follows:

[0083] r(i,k)←s(i,k)-max k′≠k {a(i,k′)+s(i,k′)} (4)

[0084]

[0085] a(k,k)←Σmax i′≠k {0,r(i′,k)} (6)

[0086] Among them, the self-membership a(k,k) is equal to the sum of the positive attractions obtained from other points.

[0087] (3) Update r(i,k) and a(i,k), and further introduce a damping coefficient λ to adjust the convergence speed and iteration stability. It is expressed by the formula:

[0088]

[0089] Among them, d represents the number of iterations.

[0090] (4) If the preset number of iterations is exceeded or the clustering division no longer changes, go to the next step. Otherwise, after changing the reference value, repeat the previous two steps to continue the calculation, and continuously update the attraction matrix and the membership matrix alternately.

[0091] (5) Calculate the silhouette coefficient according to the clustering result under the current reference value, determine the clustering center and each cluster of photovoltaic power stations, change the reference value, and recalculate.

[0092] If the preset number of iterations is exceeded or the clustering division no longer changes, then calculate the silhouette coefficient according to the clustering result under the current reference value, determine the clustering center and each cluster of photovoltaic power stations, and select the k that makes r(i,k)+a(i,k) the largest as the clustering center of i.

[0093] (6) Analyze the silhouette coefficients under different numbers of clusters, select the best clustering result, and complete the division of the photovoltaic power station group.

[0094] Finally, analyze the silhouette coefficients under different numbers of clusters until the best clustering result is selected to complete the division of the photovoltaic power station group. The station groups divided according to this method basically belong to the same geographical area, that is, the power stations in a certain area can be equivalent to a small-scale photovoltaic power station group with meteorological consistency.

[0095] As an unsupervised algorithm, AP clustering itself cannot directly evaluate the quality of the clustering effect. To obtain accurate and stable clustering results, in this embodiment, the silhouette coefficient is selected to evaluate the clustering results, and its formula is as follows:

[0096]

[0097] Among them, h(i) is the silhouette coefficient of power station i; m(i) is the average distance between sample x of power station i i and other samples in the same cluster, which is called the cohesion; n(i) is the average distance between x i and all samples in other clusters, which is called the separation; the average silhouette coefficient is the average value of the silhouette coefficients of all samples, and its value range is [-1, 1]. The larger the value, the smaller the intra-cluster distance, the larger the inter-cluster distance, and the better the clustering effect.

[0098] Step S3: Take the most relevant clustering center power station in each station group as the source domain and other power stations as the target domain, and transfer the features from the source domain to the target domain through transfer learning to obtain a power prediction model.

[0099] Step S4: Use the power prediction model to predict the photovoltaic power of distributed photovoltaic power stations in the target domain.

[0100] The processes of Step S3 and S4 can be summarized as:

[0101] (1) Cluster distributed photovoltaic power stations with similar "meteorology-power" mapping relationships;

[0102] (2) Select the most relevant clustering center power station in each type of photovoltaic power station group as the source domain, divide other power stations into the target domain, and use the meteorological data of the source domain as the overall meteorological data of this area;

[0103] (3) Divide the training set for different prediction scenarios;

[0104] (4) Use the Pearson correlation coefficient to screen out the main factors affecting the photovoltaic output power;

[0105] (5) Use LSTM to establish and train the power prediction model of the source domain respectively;

[0106] (6) Based on the 3 km × 3 km refined numerical weather prediction products developed by the PSEO team of Shandong University, combined with the transfer learning theory, input the target domain data, and fine-tune the model parameters of the target domain to obtain the final prediction results of each photovoltaic power station in the target domain.

[0107] The above process will be described in detail below:

[0108] Since there are a large number of distributed photovoltaic power stations with wide distribution, building a prediction model for each photovoltaic power station will greatly reduce the prediction efficiency; moreover, some distributed photovoltaic power stations have the problems of short construction time and insufficient data, and it is difficult to guarantee the power prediction accuracy, which will affect the subsequent dispatching and consumption of clean electricity; in this embodiment, the transfer learning theory is introduced to perform power prediction on distributed photovoltaic power stations.

[0109] Transfer learning is a machine learning idea that allows fine-tuning of existing models for application to new domains or new functions; the transfer learning algorithm transfers the pre-trained model of distributed photovoltaics with sufficient data to the remaining distributed photovoltaics with similar characteristics, which can not only avoid the problem of data shortage, improve the prediction accuracy, but also significantly improve the training speed of the model, and is very suitable for the application scenario of distributed photovoltaic prediction; in transfer learning, the data domain is divided into the source domain and the target domain. Usually, the model is pre-trained in the source domain with sufficient data, and the pre-trained model is fine-tuned in the target domain with less data to make full use of the source domain data to improve its performance on the target data.

[0110] The basic idea of transfer learning is:

[0111] The data spaces of the source domain and the target domain are expressed by the formula:

[0112] H s ={X s ,T s}(9)

[0113] H t ={X t ,T t}(10)

[0114] Among them, H s and H t respectively represent the data spaces of the source domain and the target domain, X s and X t respectively represent the features of the data spaces of the source domain and the target domain, and T s and T t respectively represent the corresponding labels.

[0115] The tasks of the source domain and the target domain are in the appropriate mapping functions f s and f tFind the optimal source domain parameter w of the corresponding mapping function s and the optimal target domain w t , so that the predicted values P s and P t are as close as possible to the label T s and T t ; Transfer learning is to fine-tune based on the optimal source domain parameter w s so that the target domain parameter is as close as possible to the optimal target domain parameter w t , as follows:

[0116] P s = f s (X s , w s ) (11)

[0117] P t = f t (X t , w t ) (12)

[0118] In this embodiment, first, distributed photovoltaic power stations with similar "weather-power" mapping relationships are clustered according to historical data such as photovoltaic power data, considering ensuring that photovoltaic power stations within the same cluster have similar output characteristics as much as possible; the clustering center power station with the highest correlation of the output characteristics of each type of photovoltaic power station group is selected as the source domain, and other power stations are divided into the target domain, and the meteorological data of the source domain is used as the overall meteorological data of this area.

[0119] Furthermore, photovoltaic output is closely related to solar radiation intensity. Under different day types, photovoltaic output varies greatly, mainly because the total amount of solar radiation intensity obtained by photovoltaic panels is significantly different under different day types; in contrast, photovoltaic output on sunny days is significantly higher than that on cloudy days, overcast days, and rainy days, and the photovoltaic output on sunny days basically shows an obvious "rise-remain-fall" trend; therefore, in order to avoid data pollution, it is necessary to divide the training set for different prediction scenarios.

[0120] In order to achieve scientific classification prediction, this embodiment follows the following three basic principles:

[0121] First, while maintaining accuracy, the modeling difficulty and complexity need to be considered, that is, the total number of classifications should neither be too many nor too few; too many classifications will lead to an increase in modeling complexity and workload, while too few classifications will make the description of weather conditions not detailed enough, thus unable to improve prediction accuracy.

[0122] Second, the classification types of different weather conditions should be typical and representative, and have clear physical meanings to ensure the rationality of classification modeling.

[0123] Third, to ensure the feasibility and accuracy of modeling, when using existing historical records for modeling, it is necessary to make the sample data as evenly distributed as possible among different types.

[0124] Taking into account the above principles comprehensively, Table 1 shows a classification method for this embodiment. Taking 4 typical weather categories as representatives, it should be noted that there are differences in the distribution of various meteorological professional weather types in the historical data accumulated by different photovoltaic power stations, and there are also differences in the distribution of the same meteorological professional weather type in the historical data of photovoltaic power stations in different regions. Therefore, when defining weather categories, a unified and unchanging fixed standard should not be set. Instead, on the basis of comprehensively considering the above three basic principles, combined with the meteorological characteristics of different regions, with the numerical values of the correlation coefficient and irradiance as references, and then by calculating the Euclidean distance, the transition weather is integrated into the major weather categories to achieve coverage of various weather conditions.

[0125] Furthermore, the Pearson correlation coefficient R(X,Y) is used to measure the degree of correlation between the photovoltaic output power and various influencing factors, and the main factors affecting the photovoltaic output power are screened out. The calculation formula of the Pearson correlation coefficient is as follows:

[0126]

[0127] where X c and Y c are respectively the output power of the photovoltaic power station sample c and the meteorological factor sample point after standardization; X and Y are respectively the matrices composed of X c and Y c ; and are respectively the averages of X c and Y c ; C is the number of samples; the value range of the correlation coefficient is [-1, 1], and the greater the absolute value, the stronger the correlation.

[0128] Furthermore, the LSTM algorithm is used to establish the corresponding power prediction model for the source-domain photovoltaic power station and train it; LSTM is a neural network model based on the recurrent neural network. Compared with the RNN, LSTM can judge the addition or deletion of information through different "gate units", so that the neural network can learn long-term dependence problems more accurately and improve the accuracy of neural network prediction; LSTM has 1 memory unit and 3 gate units. The memory unit can store the most critical information throughout the training process. The three gate units include the forget gate f t , the input gate i t and the output gate o t .

[0129] The forget gate is used to determine which information should be discarded in the memory cell, the input gate is used to update the storage cell, and the output gate is used to determine the output of the LSTM hidden layer cell in this training step. The formulas for these gates are as follows:

[0130] f t = σ(W f · [h t-1 , x t + b f ) (14)

[0131] i t = σ(W i · [h t-1 , x t + b i ) (15)

[0132] O t = σ(W o · [h t-1 , x t + b o ) (16)

[0133] where the subscript character t indicates that the variable is in the current training step t, and the subscript character t - 1 indicates that the variable is in the previous training step t - 1; W f , W i , W o represent the weight matrices of the gates, b f , b i , b o represent the biases of the gates, h t-1 represents the previous output of the hidden unit, x t represents the input of the hidden unit, and σ represents the sigmoid activation function.

[0134] The memory cell requires an update function to normalize the input. This function will be multiplied by i t to obtain g t which is used to update the memory cell. The formula is:

[0135] g t = tanh(W g · [h t-1 , x t + b g) (17)

[0136] where W g represents the weight matrix of the update function, b g represents the bias, and tanh is an activation function.

[0137] The update of the memory cell is the most important part of the LSTM. The memory cell c tIt is formed by splicing the historical state and the current state. The historical state is that after the historical data is trained by the neural network of the gods, the key information is extracted into the memory cell c of the previous training t-1 , and multiplied by the output f of the forget gate t , which constitutes the historical state of the memory cell; the current state refers to the output of the input gate, which represents the importance of the current input layer data in the neural network, and determines which input layer data needs to be updated into the memory cell. These data to be updated constitute the current state; based on the above formula, the memory cell will be updated to:

[0138] c t = f t * c t-1 + i t * g t (18)

[0139] Among them, the new memory cell c t contains both the information c retained by the previous storage cell t-1 , and the information g updated by the current input t ; using the new memory cell c t , the output of the hidden layer can be expressed as:

[0140] h t = o t * tanh(c t ) (19)

[0141] The structure diagram of LSTM is as shown in Figure 5 . In the three gate structures of LSTM, the activation function is not only used to improve the non-linear characteristics of the neural network. Different activation functions have different functions and cannot be replaced or changed; the tanh activation function expands the input to the range of [-1, 1], which plays a role in normalizing the output in LSTM and avoids the phenomenon of gradient explosion during training; while the σ activation function limits the output between [0, 1]. After multiplying the input by the weight matrix and adding a certain random bias, the output is obtained as the weight coefficient of each unit. Its result determines whether the data is retained or not during training. 1 means complete retention, and 0 means complete abandonment; this also ensures that the information retained in the memory cell is the most critical information in the entire training process, rather than just using the information at the most recent moment. This enables LSTM to not only increase the weight of recent input data but also take into account extracting key historical information, storing it in the memory cell, avoiding the attenuation of historical information over time, and keeping updated during each training; their function formulas can be written as:

[0142]

[0143]

[0144] To improve the sensitivity of photovoltaic power prediction to time and date, the daily cycle label D and the annual cycle label Y are added to the input features, and the formula is as follows:

[0145]

[0146]

[0147] The daily cycle label is the highest at 12:00, corresponding to the moment with the largest noon irradiance; the annual cycle label has an offset of 8 days, making the value of the annual cycle label the highest at the summer solstice and the lowest at the winter solstice.

[0148] Finally, the root mean square error RMSE, the mean absolute percentage error MAPE, and the model training time are used as indicators to measure the prediction accuracy and efficiency. Among them, the calculations of RMSE and MAPE are shown in formulas (24) and (25). When the prediction accuracy meets the requirements, the model is migrated to the remaining target domain power stations within the same classification. In this embodiment, the idea of model fine-tuning is adopted, and its implementation steps are as Figure 6 , the data division results of the source domain and the target domain are the same. The parameters of the target domain prediction model are adjusted according to the source domain parameter settings. Since the information features extracted by the higher layers of the neural network are more obvious, and the information of the first few layers is more general, the parameters of the first few LSTM layers are migrated and only slightly adjusted, while the parameters of the fully connected layer are retrained; based on the 3 km × 3 km refined numerical weather forecast products developed by the PSEO team of Shandong University, the meteorological data of the source domain is used as the overall meteorological data of the region to predict the final results of each photovoltaic power station in the target domain.

[0149]

[0150]

[0151] Among them, y i and are the actual power value and the predicted power value of the i-th sampling point in the test set respectively; N is the number of predicted data in the test set; the smaller the RMSE and MAPE, the higher the prediction accuracy.

[0152] Embodiment 2

[0153] In an embodiment of the present disclosure, a distributed photovoltaic power prediction system based on AP clustering and transfer learning is provided, including a data collection module, a station group division module, a model construction module, and a power prediction module:

[0154] The data collection module is configured to: collect the historical power generation data of each distributed photovoltaic power station in the area to be predicted, including photovoltaic power and corresponding meteorological data;

[0155] The station group division module is configured to: based on historical power generation data, use AP clustering to divide multiple distributed photovoltaic power stations in the area to be predicted into station groups, so that the power stations within each station group have similar meteorological-power characteristics;

[0156] The model construction module is configured to: take the most relevant clustering center power station within each station group as the source domain and other power stations as the target domain, transfer the features from the source domain to the target domain through transfer learning, and obtain a power prediction model;

[0157] The power prediction module is configured to: use the power prediction model to predict the photovoltaic power of the distributed photovoltaic power stations in the target domain;

[0158] Among them, the use of AP clustering to divide multiple distributed photovoltaic power stations in the area to be predicted into station groups is to calculate the similarity between the power samples of the distributed photovoltaic power stations according to the output curves, obtain a similarity matrix, and based on the similarity matrix, perform iterative calculations of the attraction matrix and the membership matrix until the conditions for stopping the iteration are met.

[0159] Further, the steps of using AP clustering to divide multiple distributed photovoltaic power stations in the area to be predicted into station groups are as follows:

[0160] (1) Calculate the similarity between the power samples of the distributed photovoltaic power stations to obtain a similarity matrix;

[0161] (2) Calculate the attraction matrix and the membership matrix;

[0162] (3) Update the attraction matrix and the membership matrix;

[0163] (4) If the conditions for stopping the iteration are met, proceed to the next step; otherwise, repeat steps (2) and (3);

[0164] (5) Calculate the silhouette coefficient according to the clustering results, determine the clustering center and each cluster of photovoltaic power station clusters;

[0165] (6) Analyze the silhouette coefficients under different numbers of clusters, select the best clustering result, and complete the division of the photovoltaic power station groups.

[0166] Further, the similarity between the power samples of the distributed photovoltaic power stations is characterized by the similarity between the photovoltaic output curves, and the DTW distance is used to measure the similarity between the photovoltaic output curves.

[0167] Further, the DTW distance is obtained by searching for the similar parts between two output curves and continuously adjusting the corresponding relationship between the different data points of the two output curves to obtain the best path between the two curves, and taking the cumulative distance of the best path as the DTW distance.

[0168] Embodiment III

[0169] The purpose of this embodiment is to provide a computer-readable storage medium.

[0170] A computer-readable storage medium, on which a computer program is stored, and when the program is executed by a processor, it implements the steps in the distributed photovoltaic power prediction method based on AP clustering and transfer learning as described in Embodiment 1 of the present disclosure.

[0171] Embodiment 4

[0172] The purpose of this embodiment is to provide an electronic device.

[0173] An electronic device, including a memory, a processor, and a program stored on the memory and executable on the processor, and when the processor executes the program, it implements the steps in the distributed photovoltaic power prediction method based on AP clustering and transfer learning as described in Embodiment 1 of the present disclosure.

[0174] The above are only the preferred embodiments of the present invention and are not used to limit the present invention. For those skilled in the art, the present invention can have various changes and modifications. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included within the protection scope of the present invention.

Claims

1. A distributed photovoltaic power prediction method based on AP clustering and transfer learning, characterized in that: include: Step S1: Collect historical power generation data of each distributed photovoltaic power station in the area to be predicted, including photovoltaic power and corresponding meteorological data; Step S2: Based on historical power generation data, the multiple distributed photovoltaic power stations in the area to be predicted are divided into station groups using the nearest neighbor propagation AP clustering, so that the power stations in each station group have similar meteorological-power characteristics; The method of using AP clustering to divide multiple distributed photovoltaic power stations in the area to be predicted into station groups is to calculate the similarity between the power samples of the distributed photovoltaic power stations according to the output curve, obtain the similarity matrix, and iterate the calculation of the attraction matrix and the attribution matrix based on the similarity matrix until the condition for stopping the iteration is met; Step S3: Taking the most relevant cluster center power station in each station group as the source domain and other power stations as the target domain, the source domain is used to build and pre-train the power prediction model, the common features in similar scenarios are learned, the pre-trained power prediction model is fine-tuned in the target domain, and the common features of the source domain are transferred to the target domain with similar features to obtain the power prediction model of the target domain; Step S4: using the power prediction model to predict the photovoltaic power of the distributed photovoltaic power station in the target domain; The power prediction model is constructed based on a long short-term memory (LSTM) network, which takes the meteorological data and historical power generation data of the time to be predicted as input and outputs the predicted value of photovoltaic power; Among them, the meteorological data of the time to be predicted is to use the meteorological data of the source domain as the overall meteorological data of the distributed photovoltaic power station in the target domain, and add the daily cycle label D and the annual cycle label Y to the input features of the long short-term memory LSTM network. The formula is as follows: Among them, the daily cycle label is highest at 12 o'clock, corresponding to the time when the noon radiation is the largest; the annual cycle label adds an offset of 8 days, making the value of the annual cycle label highest at the summer solstice and lowest at the winter solstice.

2. The distributed photovoltaic power prediction method based on AP clustering and transfer learning according to claim 1, characterized in that: It also includes preprocessing the collected historical power generation data, and the preprocessing includes outlier identification and data cleaning.

3. The distributed photovoltaic power prediction method based on AP clustering and transfer learning according to claim 1, characterized in that: The AP clustering is used to divide multiple distributed photovoltaic power stations in the area to be predicted into station groups, and the specific steps are as follows: (1) Calculate the similarity between the power samples of distributed photovoltaic power stations and obtain the similarity matrix; (2) Calculate the attraction matrix and the belonging matrix; (3) Update the attraction matrix and the belonging matrix; (4) If the conditions for stopping the iteration are met, go to the next step, otherwise repeat steps (2) and (3); (5) Calculate the silhouette coefficient based on the clustering results to determine the cluster center and various types of photovoltaic power station clusters; (6) Analyze the silhouette coefficients under different cluster numbers, select the best clustering result, and complete the division of the photovoltaic power station group.

4. The distributed photovoltaic power prediction method based on AP clustering and transfer learning as claimed in claim 3, characterized in that: The similarity between the power samples of the distributed photovoltaic power station is characterized by the similarity between the photovoltaic output curves, and the DTW distance is used to measure the similarity between the photovoltaic output curves.

5. The distributed photovoltaic power prediction method based on AP clustering and transfer learning as claimed in claim 4, characterized in that: The DTW distance is obtained by searching for similar parts between two output curves and continuously adjusting the corresponding relationship between different data points of the two output curves to obtain the best path between the two curves, and the accumulated distance of the best path is used as the DTW distance.

6. The distributed photovoltaic power prediction method based on AP clustering and transfer learning according to claim 1, characterized in that: The power prediction model of the target domain is obtained as follows: Use the LSTM algorithm to model the power prediction of the source domain, obtain the power prediction model of the source domain, pre-train the power prediction model until the prediction accuracy of the model meets the requirements, and perform transfer learning from the source domain to the target domain; By using the idea of ​​model fine-tuning, the parameters of the first few LSTM layers of the power prediction model are migrated, and the parameters of the fully connected layer are retrained in the target domain. The minimum RMSE and MAPE are taken as the optimization goals to obtain the power prediction model of the target domain.

7. A distributed photovoltaic power prediction system based on AP clustering and transfer learning, characterized in that: Including data collection module, station group division module, model building module and power prediction module: The data collection module is configured to: collect historical power generation data of each distributed photovoltaic power station in the area to be predicted, including photovoltaic power and corresponding meteorological data; The station group division module is configured to: divide multiple distributed photovoltaic power stations in the area to be predicted into station groups by using AP clustering based on historical power generation data, so that the power stations in each station group have similar meteorological-power characteristics; The method of using AP clustering to divide multiple distributed photovoltaic power stations in the area to be predicted into station groups is to calculate the similarity between the power samples of the distributed photovoltaic power stations according to the output curve, obtain the similarity matrix, and iterate the calculation of the attraction matrix and the attribution matrix based on the similarity matrix until the condition for stopping the iteration is met; The model building module is configured to: take the most relevant cluster center power station in each power station group as the source domain and other power stations as the target domain, transfer learning the features from the source domain to the target domain, and obtain the power prediction model; The power prediction module is configured to: predict the photovoltaic power of the distributed photovoltaic power station in the target domain by using the power prediction model; The power prediction model is constructed based on a long short-term memory (LSTM) network, which takes the meteorological data and historical power generation data of the time to be predicted as input and outputs the predicted value of photovoltaic power; Among them, the meteorological data of the time to be predicted is to use the meteorological data of the source domain as the overall meteorological data of the distributed photovoltaic power station in the target domain, and add the daily cycle label D and the annual cycle label Y to the input features of the long short-term memory LSTM network. The formula is as follows: Among them, the daily cycle label is highest at 12 o'clock, corresponding to the time when the noon radiation is the largest; the annual cycle label adds an offset of 8 days, making the value of the annual cycle label highest at the summer solstice and lowest at the winter solstice.

8. The distributed photovoltaic power prediction system based on AP clustering and transfer learning as claimed in claim 7, characterized in that: The AP clustering is used to divide multiple distributed photovoltaic power stations in the area to be predicted into station groups, and the specific steps are as follows: (1) Calculate the similarity between the power samples of distributed photovoltaic power stations and obtain the similarity matrix; (2) Calculate the attraction matrix and the belonging matrix; (3) Update the attraction matrix and the belonging matrix; (4) If the conditions for stopping the iteration are met, go to the next step, otherwise repeat steps (2) and (3); (5) Calculate the silhouette coefficient based on the clustering results to determine the cluster center and various types of photovoltaic power station clusters; (6) Analyze the silhouette coefficients under different cluster numbers, select the best clustering result, and complete the division of the photovoltaic power station group.

9. The distributed photovoltaic power prediction system based on AP clustering and transfer learning as claimed in claim 8, characterized in that: The similarity between the power samples of the distributed photovoltaic power station is characterized by the similarity between the photovoltaic output curves, and the DTW distance is used to measure the similarity between the photovoltaic output curves.

10. The distributed photovoltaic power prediction system according to claim 9, characterized in that: The DTW distance is obtained by searching for similar parts between two output curves and continuously adjusting the corresponding relationship between different data points of the two output curves to obtain the best path between the two curves, and the accumulated distance of the best path is used as the DTW distance.

11. An electronic device, comprising: a memory for non-transitory storage of computer readable instructions; as well as a processor for executing the computer readable instructions, Wherein, when the computer-readable instructions are executed by the processor, the method described in any one of claims 1 to 6 is executed.

12. A storage medium, characterized in that: The computer-readable instructions are non-transitory stored, wherein when the non-transitory computer-readable instructions are executed by a computer, the method of any one of claims 1 to 6 is performed.