Weather classification method and system, electronic equipment, storage medium and program product
By acquiring and processing the radiation intensity data of photovoltaic power stations, calculating standard scores, and optimizing the classification threshold using genetic algorithms, more accurate weather classification is achieved, solving the problem of inaccurate weather classification in the existing technology, and improving the accuracy of photovoltaic output prediction.
Patent Information
- Application Number
- CN202510047756.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-13
- Publication Date
- 2025-05-09
AI Technical Summary
The existing technology cannot accurately classify weather, resulting in inaccurate prediction of photovoltaic output and affecting the safety of power grid operation.
By obtaining the cumulative radiation intensity within each time interval, the standard score is calculated, and weather classification is performed based on the classification threshold optimized by the genetic algorithm.
It improves the accuracy and reliability of weather classification, reduces the dependence on human experience, and significantly improves the utilization rate of radiation historical data.
Smart Images

Figure CN119961756A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of photovoltaic power generation, and in particular to a weather classification method, system, electronic device, storage medium and program product. Background Art
[0002] Photovoltaic energy has become one of the main energy sources as a green and clean energy. However, photovoltaic energy is intermittent, has obvious uncertainty and depends on weather conditions, which brings huge challenges to the operation and management of photovoltaic power stations. In particular, photovoltaic output prediction is crucial to the efficient operation of power stations and the stability of the power grid, and its accuracy affects the safety and economic operation of the power system. Photovoltaic output characteristics are greatly affected by weather, with strong randomness and volatility. When the proportion of new energy grid connection increases, this uncertainty threatens the safety of grid operation. Photovoltaic output is affected by key factors such as total radiation, direct radiation and scattered radiation. Therefore, weather classification helps to improve power prediction accuracy, improve grid connection efficiency and ensure stable operation of the power system. The current weather classification method based on comprehensive weather data fails to make full use of high-frequency sampled radiation intensity data, resulting in some classification results that cannot match the actual photovoltaic output. Summary of the invention
[0003] The technical problem to be solved by the present disclosure is to overcome the defect that the prior art cannot accurately classify the weather, and to provide a weather classification method, system, electronic device, storage medium and program product.
[0004] The present invention solves the above technical problems through the following technical solutions:
[0005] The present disclosure provides a weather classification method, the weather classification method comprising:
[0006] Obtaining a first cumulative radiation intensity corresponding to each date included in each first time interval;
[0007] Determine a first standard score corresponding to each date according to the first cumulative radiation intensity in each of the first time intervals;
[0008] Based on the preset classification threshold corresponding to each of the first time intervals, the first standard score corresponding to each date in each of the first time intervals is divided respectively, so as to determine the first weather classification corresponding to each date according to the division result; wherein the preset classification threshold is obtained after optimizing the initial classification threshold based on a genetic algorithm.
[0009] Optionally, the step of obtaining the first cumulative radiation intensity corresponding to each date included in each first time interval includes:
[0010] Acquiring first radiation intensity data within a first preset time interval;
[0011] A change point in the first radiation intensity data is determined according to a change point detection algorithm, and the first radiation intensity data is divided into a plurality of first time intervals according to the change point.
[0012] Optionally, the weather classification method further includes:
[0013] The preset classification threshold is iteratively optimized based on a genetic algorithm.
[0014] Optionally, the iterative optimization of the preset classification threshold based on a genetic algorithm includes:
[0015] Determine a first Pearson correlation coefficient between the first cumulative radiation intensity and the first weather classification corresponding to each date, and update the preset classification threshold with the goal of the first Pearson correlation coefficient satisfying a first preset condition.
[0016] Optionally, the step of setting the preset classification thresholds corresponding to the first time intervals includes:
[0017] The initial classification threshold is iteratively optimized based on a genetic algorithm.
[0018] Optionally, the iterative optimization of the initial classification threshold based on a genetic algorithm includes:
[0019] Obtaining the second cumulative radiation intensity corresponding to each date included in each second time interval;
[0020] Determine a second standard score corresponding to each date according to the second accumulated radiation intensity in each of the second time intervals;
[0021] Based on the initial classification threshold corresponding to each of the second time intervals, the second standard score corresponding to each date in each of the second time intervals is divided respectively, so as to determine the second weather classification corresponding to each date according to the division result;
[0022] Determine a second Pearson correlation coefficient between the second cumulative radiation intensity and the second weather classification corresponding to each date, and update the initial classification threshold with the second Pearson correlation coefficient satisfying a second preset condition as a goal.
[0023] The present disclosure also provides a weather classification system, the weather classification system comprising:
[0024] A first acquisition module is used to acquire a first cumulative radiation intensity corresponding to each date included in each first time interval;
[0025] a determination module, configured to determine a first standard score corresponding to each date according to the first accumulated radiation intensity in each of the first time intervals;
[0026] A classification module is used to divide the first standard scores corresponding to each date in each of the first time intervals based on the preset classification thresholds corresponding to each of the first time intervals, so as to determine the first weather classification corresponding to each date according to the division results; wherein the preset classification threshold is obtained by optimizing the initial classification threshold based on a genetic algorithm.
[0027] Optionally, the weather classification system further includes:
[0028] A second acquisition module, used to acquire first radiation intensity data within a first preset time interval;
[0029] A data division module is used to determine a change point in the first radiation intensity data according to a change point detection algorithm, and divide the first radiation intensity data into a plurality of first time intervals according to the change point.
[0030] Optionally, the weather classification system further includes:
[0031] The first algorithm module is used to iteratively optimize the preset classification threshold based on a genetic algorithm.
[0032] Optionally, the first algorithm module is specifically used to:
[0033] Determine a first Pearson correlation coefficient between the first cumulative radiation intensity and the first weather classification corresponding to each date, and update the preset classification threshold with the goal of the first Pearson correlation coefficient satisfying a first preset condition.
[0034] Optionally, the weather classification system further includes:
[0035] The second algorithm module is used to iteratively optimize the initial classification threshold based on a genetic algorithm.
[0036] Optionally, the second algorithm module is specifically used to:
[0037] Obtaining the second cumulative radiation intensity corresponding to each date included in each second time interval;
[0038] Determine a second standard score corresponding to each date according to the second accumulated radiation intensity in each of the second time intervals;
[0039] Based on the initial classification threshold corresponding to each of the second time intervals, the second standard score corresponding to each date in each of the second time intervals is divided respectively, so as to determine the second weather classification corresponding to each date according to the division result;
[0040] Determine a second Pearson correlation coefficient between the second cumulative radiation intensity and the second weather classification corresponding to each date, and update the initial classification threshold with the second Pearson correlation coefficient satisfying a second preset condition as a goal.
[0041] The present disclosure also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and used to run on the processor, wherein the processor implements any of the above-mentioned weather classification methods when executing the computer program.
[0042] The present disclosure also provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the weather classification method described in any one of the above is implemented.
[0043] The present disclosure also provides a computer program product, including a computer program, which implements any of the above-mentioned weather classification methods when executed by a processor.
[0044] On the basis of being in accordance with the common sense in the art, the above-mentioned preferred conditions can be arbitrarily combined to obtain the preferred embodiments of the present disclosure.
[0045] The positive and progressive effect of the present disclosure is that: by using the preset classification thresholds corresponding to each first time interval, the first standard scores corresponding to each date in each first time interval are divided respectively, so as to determine the first weather classification corresponding to each date according to the division results; wherein, the preset classification threshold is obtained after optimizing the initial classification threshold based on the genetic algorithm. The degree of dependence of traditional weather classification on human experience is reduced, making the classification process more objective and scientific. At the same time, it significantly improves the utilization rate of radiation historical data, and can more fully mine the useful information in the data, thereby providing a more reliable data basis for subsequent analysis and application. BRIEF DESCRIPTION OF THE DRAWINGS
[0046] Figure 1 A flow chart of a weather classification method provided for an exemplary embodiment of the present disclosure;
[0047] Figure 2 A flow chart of another weather classification method provided for an exemplary embodiment of the present disclosure;
[0048] Figure 3 A flow chart of another weather classification method provided for an exemplary embodiment of the present disclosure;
[0049] Figure 4 A flow chart of another weather classification method provided for an exemplary embodiment of the present disclosure;
[0050] Figure 5 A flowchart of step 107 provided for an exemplary embodiment of the present disclosure;
[0051] Figure 6 A schematic diagram of segmented processing of radiation intensity data provided by an exemplary embodiment of the present disclosure;
[0052] Figure 7 A schematic diagram of a weather classification result provided by an exemplary embodiment of the present disclosure;
[0053] Figure 8 A module schematic diagram of a weather classification system provided by an exemplary embodiment of the present disclosure;
[0054] Fig. 9 A module diagram of another weather classification system provided for an exemplary embodiment of the present disclosure;
[0055] Fig.10 A module diagram of another weather classification system provided for an exemplary embodiment of the present disclosure;
[0056] Fig.11 A module diagram of another weather classification system provided for an exemplary embodiment of the present disclosure;
[0057] Fig.12 The present invention provides a schematic structural diagram of an electronic device according to an exemplary embodiment of the present invention. DETAILED DESCRIPTION
[0058] The present disclosure is further described below by way of examples, but the present disclosure is not limited to the scope of the examples.
[0059] Prefixes such as "first" and "second" are used in the embodiments of the present disclosure only to distinguish different description objects, and have no limiting effect on the position, order, priority, quantity or content of the described objects. The use of prefixes such as ordinal numbers to distinguish description objects in the embodiments of the present disclosure does not constitute a limitation on the described objects. For the statement of the described objects, please refer to the description in the context of the embodiments, and no unnecessary limitation should be constituted due to the use of such prefixes. In addition, in the description of the present embodiment, unless otherwise specified, the meaning of "plurality" is two or more.
[0060] In the embodiments of the present disclosure, the collection, storage, use, processing, transmission, provision and disclosure of user personal information involved are in compliance with the provisions of relevant laws and regulations and do not violate public order and good morals.
[0061] Example 1
[0062] Figure 1 This is a flow chart of a weather classification method provided by an exemplary embodiment of the present disclosure. As can be seen from the figure, the weather classification method includes:
[0063] Step 101: Obtain a first cumulative radiation intensity corresponding to each date included in each first time interval.
[0064] In step 101, the data processing performed within a specific time interval is emphasized. The setting of this first time interval may be based on a variety of factors, such as the periodicity of weather changes or the characteristics of data collection. For example, 24 hours a day can be divided into small time intervals of several hours, or a year can be divided into different time intervals according to seasons. This partitioning helps to analyze the changing law of radiation intensity more carefully, because the weather conditions in different time intervals may be quite different, thus affecting the radiation intensity. Among them, the first cumulative radiation intensity involves cumulative radiation intensity, which can better reflect the energy accumulation over a period of time than the instantaneous radiation intensity. For photovoltaic output forecasting, the cumulative radiation intensity has a more direct relationship with the power generation of photovoltaic cells within a certain period of time. Calculating the cumulative radiation intensity can smooth out some short-term fluctuations and better reflect the overall impact of weather on radiation intensity.
[0065] This step is the basis for subsequent weather classification. Only by obtaining accurate cumulative radiation intensity can we further calculate standard scores and determine weather classification.
[0066] Based on step 101, a specific example is listed here:
[0067] 1. About data collection
[0068] Suppose you want to classify the weather in a certain area for a month (30 days), and divide this month into 6 first time intervals with each interval being 5 days. Get the radiation intensity data at each time of the day from the weather station or photovoltaic power station monitoring equipment. For example, the radiation intensity of each hour from 0:00 to 24:00 on the first day is R 1,1 , R 1,2 , …, R 1,24 , where R i,j represents the radiation intensity at the jth hour on the i-th day.
[0069] 2. About calculating the cumulative radiation intensity
[0070] For the first day of the first 5-day period, the cumulative radiation intensity S 1,1 It is the sum of the radiation intensity of the 24 hours of the day.
[0071] Similarly, the cumulative radiation intensity of other dates in this time interval and the cumulative radiation intensity of each date in other subsequent time intervals can be calculated.
[0072] In this way, the cumulative radiation intensity of each date in each first time interval is obtained, providing basic data for the subsequent weather classification process.
[0073] It should be understood that there can be more data on radiation intensity. For example, the example can be replaced with a situation where 365 days a year are divided into four seasons: Dividing a year into four seasons as time intervals is a common way of division, because seasonal changes have a significant impact on weather conditions and radiation intensity. Each season has different climatic characteristics, such as plenty of sunshine and long sunshine in summer, relatively short sunshine in winter and possible cloudy and snowy weather, which will cause the radiation intensity to vary greatly in different seasons. This division helps to grasp the changing law of radiation intensity from a macro perspective, and can better reflect the impact of seasonal factors on photovoltaic output in subsequent weather classification. In the larger time scale of seasons, the cumulative radiation intensity can still reflect the energy accumulation over a long period of time in each season. For photovoltaic power stations, the difference in cumulative radiation intensity in different seasons will affect the estimation of its total power generation and power generation efficiency throughout the year. Calculating the cumulative radiation intensity of each day in each season helps to more accurately analyze the impact of seasonal weather changes on radiation intensity, and provides an important basis for accurate weather classification.
[0074] Based on step 101, a specific example is given here:
[0075] Suppose we want to classify the weather in a certain area in a year, and divide the year into four seasons: spring, summer, autumn and winter. Each season is about 90-92 days (here we assume that spring has 90 days, summer has 92 days, autumn has 91 days, and winter has 92 days).
[0076] 1. About data collection
[0077] Get the radiation intensity data at each time of the day from the weather station or photovoltaic power station monitoring equipment. For example, on the first day of spring, the radiation intensity at 0:00-24:00 is R a,1,1 , R a,1,2 , …, R a,1,24 , where R a,i,j represents the radiation intensity at the jth hour of the i-th day of season a. Here a includes 1, 2, 3 and 4, representing spring, summer, autumn and winter respectively. For example, R 1,i,j represents the radiation intensity at the jth hour on the i-th day in spring, R 2,i,j represents the radiation intensity at the jth hour of the i-th day in summer, R 3,i,jrepresents the radiation intensity at the jth hour on the i-th day in autumn, R 4,i,j It represents the radiation intensity at the jth hour of the i-th day in winter and will not be repeated here.
[0078] 2. About calculating the cumulative radiation intensity
[0079] For the first day of spring, the cumulative radiation intensity S 1,1 It is the sum of the radiation intensity of the 24 hours of the day, that is, Using the same method, the cumulative radiation intensity of other dates in spring, as well as the cumulative radiation intensity of each date in summer, autumn and winter can be calculated.
[0080] In addition, it should be noted that when the amount of radiation intensity data is large and discrete, it is impossible to directly integrate the function to get the cumulative value. Approximate calculation can be performed for a given set of radiation intensity data points X = {x1, x2, ..., xn}, the cumulative radiation intensity can be approximated as:
[0081]
[0082] Where F(X) is the cumulative radiation intensity within the time period, PDF(t) is the approximate curve of the radiation intensity, Δx i For the time interval.
[0083] In this way, the cumulative radiation intensity of each date in each season (time interval) is obtained, which provides basic data for the subsequent weather classification process based on these data.
[0084] Step 102: Determine a first standard score corresponding to each date according to the first accumulated radiation intensity in each first time interval.
[0085] In the process of weather classification, step 102 is to convert the cumulative radiation intensity into a more comparable numerical form. In this step, the first standard score is used, which involves the calculation of the standard score. Since the radiation intensity in different time intervals may have different magnitude ranges, directly using the cumulative radiation intensity for weather classification may be affected by the size of the value, and the standard score can standardize the data so that data from different dates can be compared on the same scale. The standard score can reflect the overall distribution of the cumulative radiation intensity of each date relative to the radiation intensity in the time interval, such as whether it is higher or lower than the average level, and the degree of deviation, which helps to classify the weather more accurately.
[0086] The formula for calculating the standard score (usually called z-score) is z = (xu) / s, where x is the first cumulative radiation intensity of a certain date, u is the average of the first cumulative radiation intensity of all dates in the first time interval, and s is the standard deviation of the first cumulative radiation intensity of all dates in the time interval. Through such calculation, the radiation intensity of each date is converted into a value under the standard normal distribution with 0 as the mean and 1 as the standard deviation.
[0087] After determining the standard score for each date, when subsequently classifying the weather based on the preset classification threshold, the weather type for each date can be determined more scientifically based on the score range, rather than simply based on the absolute value of the radiation intensity.
[0088] Based on step 102, specific examples are listed here:
[0089] Assume that a year is divided into four seasons: spring, summer, autumn and winter, taking spring as an example (90 days).
[0090] 1. Calculate the mean and standard deviation
[0091] First, calculate the average value u and standard deviation s of the first cumulative radiation intensity of each day in the 90 days of spring. Assume that u=500 (unit: megajoule / square meter) and s=50 (unit: megajoule / square meter) are obtained through calculation.
[0092] 2. Calculate standard scores
[0093] For a certain day in spring, the first cumulative radiation intensity is x=600 (unit: megajoules / square meter), then the first standard score corresponding to this day is z=(600-500) / 50=2.
[0094] For another example, the first cumulative radiation intensity of another day is x=400 (unit: megajoule / square meter), then its standard score z=(400-500) / 50=-2.
[0095] Through such calculations, each date is given a standard score that reflects its relative position in radiation intensity within the season. These standard scores will serve as an important basis for subsequent weather classification.
[0096] Step 103: Based on the preset classification threshold corresponding to each first time interval, the first standard score corresponding to each date in each first time interval is divided respectively, so as to determine the first weather classification corresponding to each date according to the division result; wherein the preset classification threshold is obtained by optimizing the initial classification threshold based on a genetic algorithm.
[0097] Step 103 is the core link of weather classification. In the previous steps 101 to 102, the first standard score corresponding to each date has been obtained, and the preset classification threshold here is the boundary for dividing the standard score into different weather types. Through this division, dates with similar radiation intensity characteristics (measured by the standard score) can be classified into the same weather type.
[0098] It is worth mentioning that the preset classification threshold is obtained by optimizing the initial classification threshold based on the genetic algorithm, which reflects the scientificity and accuracy of the method. The genetic algorithm can continuously adjust the threshold so that the classification results can better reflect the relationship between the actual weather conditions and the radiation intensity, and improve the accuracy of weather classification.
[0099] Different weather types (such as sunny, cloudy, overcast, rainy and snowy days, etc.) may correspond to different standard score ranges in different time intervals. For example, in a certain season, sunny days may correspond to a higher standard score range because the radiation intensity on sunny days is usually higher; while overcast or rainy and snowy days may correspond to a lower standard score range.
[0100] Accurate weather classification is crucial for PV output forecasting. By classifying dates according to their radiation intensity characteristics, we can better understand the power generation characteristics of PV power stations under different weather conditions, thus providing a more reliable basis for PV output forecasting.
[0101] Based on step 103, specific examples are listed here:
[0102] Assume that summer (92 days) is taken as a first time interval, and the following preset classification thresholds are obtained after genetic algorithm optimization: [-1.5, -0.5, 0.5].
[0103] 1. About classification rule setting
[0104] Set the dates with standard scores less than -1.5 as rainy and snowy day types, the dates with standard scores between -1.5 and -0.5 as cloudy day types, the dates with standard scores between -0.5 and 0.5 as overcast day types, and the dates with standard scores greater than 0.5 as sunny day types.
[0105] 2. About specific date classification examples
[0106] Assume that the first standard score calculated on a certain day is z=-2. Since -2<-1.5, this day is classified as a rainy and snowy day.
[0107] For another example, the standard score of another day is z=1, because 1>0.5, so this day is classified as a sunny day type.
[0108] If the standard score for a day is z = 0, since -0.5<0<0.5, the day is classified as cloudy.
[0109] In this way, the first standard score of each date is divided according to the preset classification threshold, so as to determine the first weather classification corresponding to each date.
[0110] Alternatively, see Figure 2 It can be seen that the steps before step 101 include:
[0111] Step 104: Acquire first radiation intensity data within a first preset time interval.
[0112] Step 105: determine a change point in the first radiation intensity data according to a change point detection algorithm, and divide the first radiation intensity data into a plurality of first time intervals according to the change point.
[0113] Steps 104 and 105 are preparatory work before obtaining the cumulative radiation intensity corresponding to the date in each first time interval. The purpose is to divide the time interval more reasonably so that the subsequent weather classification based on these time intervals is more accurate. By determining the change point through the change point detection algorithm to divide the time interval, the structural changes in the radiation intensity data can be better captured. This change may be related to factors such as the transformation of the weather system and the change of seasons, which helps to analyze the characteristics of the radiation intensity in different time periods in more detail.
[0114] The first time interval divided in step 105 will serve as the processing basis for the subsequent steps 101 to 103. For example, in each divided first time interval, the cumulative radiation intensity is obtained, the standard score is calculated, and the weather classification is performed.
[0115] Based on step 104 and step 105, specific examples are listed here:
[0116] Suppose you want to study the radiation intensity data of a certain area for half a year.
[0117] 1. About data sources
[0118] The hourly radiation intensity data of the area for the past six months (about 180 days) is obtained from the weather station. These data constitute the first radiation intensity data within the first preset time interval (six months). For example, the daily radiation intensity data is an array containing 24 values (one value per hour), and the data for the entire six months is a very large array, containing 180 such arrays (one per day).
[0119] Suppose a simple change-point detection algorithm based on statistical methods is used, such as calculating the differences between adjacent data points. A threshold is set. For example, if the difference in the average values of radiation intensity data for two adjacent days exceeds this threshold, it is considered that there may be a change point. After calculation, it is found that there is a change point around the 60th day because there are obvious differences in the average values of radiation intensity data before and after this point. It may be because the season changes from spring to summer, the weather becomes clearer, and the overall radiation intensity increases. Similarly, a change point is found around the 120th day, probably due to the transition from summer to autumn, the weather gradually becomes cloudy, and the radiation intensity decreases. In this way, according to these two change points, the data for half a year is divided into three first-time intervals: the 1st to the 60th day is one interval, the 61st to the 120th day is one interval, and the 121st to the 180th day is one interval.
[0120] Among them, the purpose of step 105 is to segment the time series of light intensity with seasonal variations through a change-point detection algorithm (also known as an inflection-point detection algorithm) in dynamic programming, so that the weather classification after segmentation is more in line with the actual weather conditions.
[0121] The formula is: dp[i][j] = min k<j (dp[k][i] + cost(i, j)), where the specific meanings are as follows:
[0122] It is necessary to find a k (k < j) such that the value of dp[k][i] + cost(i, j) is the smallest. Here, dp[k][i] represents the minimum cost when the last change point among the first k points is the i-th point, and cost(i, j) represents the cost from the i-th point to the j-th point. This recurrence relation is the basis of dynamic programming, and the optimal solution of a larger problem is constructed by gradually calculating the optimal solutions of sub-problems.
[0123] In addition, the formula for the cost function cost(i, j) is: Here, the Euclidean distance is adopted as the cost function.
[0124] S t represents the value of the t-th data point in the time series, is the average value from the (i + 1)-th point to the j-th point.
[0125] Cost(i,j) calculates the sum of squares of the deviations between the data points from the i-th point to the j-th point and the average value of this interval. This calculation method is based on the concept of Euclidean distance. By minimizing this cost function, we can find the relatively "smooth" or "natural" segmentation position (i.e., change point) in the data sequence. The significance of this formula is to measure the degree of dispersion of the data from the i-th point to the j-th point. If this segment of data is relatively concentrated around the average value, If the data is close to each other, the value of cost(i,j) will be smaller; conversely, if the data is more scattered, the value of cost(i,j) will be larger.
[0126] Through the operations of steps 104 and 105, a good foundation is laid for subsequent weather classification related work in each reasonably divided time interval.
[0127] Alternatively, see Figure 3 It can be seen that the weather classification method also includes:
[0128] Step 106: Iteratively optimize the preset classification threshold based on the genetic algorithm.
[0129] Optionally, step 106 specifically includes: determining a first Pearson correlation coefficient between the first cumulative radiation intensity and the first weather classification corresponding to each date, and updating a preset classification threshold with the goal of the first Pearson correlation coefficient satisfying a first preset condition.
[0130] Step 106 is a further improvement of the weather classification based on the preset classification threshold. Since the preset classification threshold initially set may not be optimal in actual situations, the accuracy of weather classification can be improved by iteratively optimizing it through a genetic algorithm. The first Pearson correlation coefficient plays a key evaluation role here, which involves the calculation of the Pearson correlation coefficient. The Pearson correlation coefficient can quantify the linear relationship between the first cumulative radiation intensity and the first weather classification of each date. If the Pearson correlation coefficient between the two is high, it means that the current classification threshold can better reflect the relationship between radiation intensity and weather type; otherwise, the classification threshold needs to be adjusted.
[0131] The threshold is updated with the goal of the first Pearson correlation coefficient satisfying the first preset condition. Its purpose is to make the weather classification results more consistent with the actual law of radiation intensity changes, so as to better serve photovoltaic output prediction and other services.
[0132] Genetic algorithm is a global search optimization algorithm that can find a better solution in a complex search space. In this process, through continuous iteration, it simulates the selection, crossover and mutation operations in the biological evolution process, and gradually adjusts the classification threshold until the optimal or approximately optimal solution that meets the conditions is found.
[0133] Based on step 106, specific examples are listed here:
[0134] Assume that the weather data for a certain area for one year has been classified according to the previous steps, and the initial preset classification threshold has been obtained.
[0135] 1. About calculating the Pearson correlation coefficient
[0136] For example, four weather types are set: sunny, cloudy, overcast, and rainy and snowy, and the corresponding preset classification thresholds are [-1.5, -0.5, 0.5].
[0137] The Pearson correlation coefficient between the first cumulative radiation intensity of each date and its corresponding first weather category is calculated. Assume that after calculation, the initial Pearson correlation coefficient obtained is r=0.6.
[0138] In this step, the Pearson correlation coefficient between the first weather classification column X and the first cumulative radiation intensity Y is calculated, which can be referred to the following formula:
[0139]
[0140] Wherein Cov(X,Y) is the covariance of the first weather classification column (in the present disclosure, various weathers can be marked, for example, sunny weather is marked as 1, cloudy weather is marked as 0, overcast weather is marked as -0.5, and rainy and snowy weather is marked as -1, and the mark value can be adjusted according to actual needs) and the first cumulative radiation intensity, u(X) and u(Y) represent the average values of the first weather classification column and the first cumulative radiation intensity, s(X) and s(Y) represent the standard deviations of the first weather classification column and the first cumulative radiation intensity, respectively, and n is the total amount of data.
[0141] 2. Determining whether the preset conditions are met
[0142] The first preset condition may be that r is greater than or equal to 0.8 (this value can be adjusted according to actual conditions). Since 0.6<0.8, the preset condition is not met and the threshold needs to be updated.
[0143] 3. About the iterative optimization process of genetic algorithm
[0144] In the iterative process of the genetic algorithm, the preset classification threshold is first encoded into a chromosome form. For example, [-1.5, -0.5, 0.5] can be encoded into a specific string of numbers. Then a selection operation is performed to select those with higher fitness (here the fitness function can be a function related to the Pearson correlation coefficient, such as 1-|rr target |, r target is the target correlation coefficient) of individuals (i.e., threshold combination). Then, a crossover operation is performed to exchange some genes (threshold part) of the two selected individuals to generate new individuals. Then a mutation operation is performed to change some genes (threshold value) in the individuals with a certain probability. After many such iterations, assuming that the final new classification threshold is [-1.2, -0.3, 0.4], the Pearson correlation coefficient is recalculated at this time. Assuming that r = 0.85 is obtained, which meets the preset condition of 0.8, then the iteration is stopped and the new classification threshold is used for weather classification.
[0145] Through the operation of step 106, the accuracy and reliability of the weather classification method can be continuously improved.
[0146] Optionally, before step 103, the following steps are included:
[0147] Step 107: Iteratively optimize the initial classification threshold based on a genetic algorithm.
[0148] Step 107 is a pre-optimization step before formally classifying the weather based on the preset classification threshold (optimized by the genetic algorithm) (step 103). Its purpose is to adjust the initial classification threshold at an earlier stage, and optimize the classification threshold by using more data or different time interval division methods, so that the subsequent classification is more accurate. This step is similar to step 106, both of which optimize the classification threshold based on the genetic algorithm, but step 107 focuses more on the exploratory optimization of the initial threshold in the preliminary stage.
[0149] Optionally, step 107 specifically includes:
[0150] Step 1071: Obtain the second cumulative radiation intensity corresponding to each date included in each second time interval.
[0151] Step 1072: Determine the second standard score corresponding to each date according to the second accumulated radiation intensity in each second time interval.
[0152] Step 1073: Based on the initial classification threshold corresponding to each second time interval, the second standard score corresponding to each date in each second time interval is divided respectively, so as to determine the second weather classification corresponding to each date according to the division result.
[0153] Step 1074: determine the second Pearson correlation coefficient between the second cumulative radiation intensity corresponding to each date and the second weather classification, and update the initial classification threshold with the second Pearson correlation coefficient satisfying the second preset condition as the goal.
[0154] Steps 1071 to 1073 are similar to the aforementioned operations of obtaining cumulative radiation intensity, calculating standard scores, and preliminary classification, but here the operations are performed in the second time interval. This helps to examine the rationality of the classification threshold from different angles or a wider range of data. Of course, according to actual conditions, the second time interval here can select a data set that is consistent with the first time interval.
[0155] Step 1074 evaluates the classification effect under the current initial classification threshold by calculating the Pearson correlation coefficient. If the preset conditions are not met, an update is performed. This is the key basis for optimizing the classification threshold.
[0156] Through such a pre-optimization step, the quality of the initial classification threshold can be improved, thereby improving the accuracy of the final weather classification, which is of great significance for accurately analyzing the impact of weather on PV output.
[0157] Based on steps 1071 to 1074, specific examples are listed here:
[0158] Suppose you want to conduct a weather classification study on two years of data for a certain area.
[0159] 1. Specific example of step 1071
[0160] The two years are divided into 12 second time intervals (each interval is about 30 days) according to the month. For the second time interval of the first month, the second cumulative radiation intensity corresponding to each day is obtained. For example, the cumulative radiation intensity from the first day to the thirtieth day is R 1,1 , R 1,2 , …, R 1,30 .
[0161] 2. Specific example of step 1072
[0162] Calculate the second standard score for each day of each month. Assume that the average radiation intensity u1 of the first month is 400 (unit: megajoules / square meter) and the standard deviation s1 is 50 (unit: megajoules / square meter). For the first day, if its cumulative radiation intensity R 1,1 =450, then its second standard score z1=(450-400) / 50=1.
[0163] 3. Specific example of step 1073
[0164] Set the initial classification threshold, for example [-1.2, -0.4, 0.4]. According to this threshold, classify the standard scores of each day in the first month. If the standard score z = 1 on a certain day, it may be classified as sunny; if z = -0.8, it may be classified as cloudy, etc., thus determining the second weather classification corresponding to each date.
[0165] 4. Specific example of step 1074
[0166] Calculate the second Pearson correlation coefficient between the second cumulative radiation intensity and the second weather classification for each date of each month. Assume that after calculation, the Pearson correlation coefficient r of the first month 1= 0.7.
[0167] If the second preset condition is that r is greater than or equal to 0.8, since 0.7<0.8, the initial classification threshold needs to be updated. Through the operation of the genetic algorithm (encoding, selection, crossover, mutation, etc.), the classification threshold is adjusted until the preset condition is met.
[0168] Through the operation of step 107, the classification threshold can be optimized at an early stage, laying a foundation for subsequent more accurate weather classification.
[0169] Based on the above steps 101 to 107, the historical weather data collected by a photovoltaic power plant for one year is applied to perform weather classification. Here is a specific example, and the specific implementation process is as follows:
[0170] (1) The continuous historical radiation intensity data were processed to find the deviation and negative values of the data and replace them with Nan. The deviation was determined with the help of a box plot, and all negative values were found. Among them, there were 312 large deviations and 183 days of negative data.
[0171] (2) For all the deviation values and negative values replaced in the previous step and the missing values in the original data, Lagrange interpolation is used to fill in and replace them to ensure the accuracy and completeness of the data.
[0172] (3) Calculate the daily radiation accumulation value according to the formula, a total of 365 values.
[0173] (4) Dynamic programming algorithm is used to segment the data so that the segmented data is more consistent with the characteristics of the four seasons. The segmentation results are as follows: Figure 6 shown.
[0174] (5) Calculate the mean and standard deviation of all radiation accumulation values in each segment, and then calculate the z-score of the radiation accumulation value based on the mean and standard deviation.
[0175] (6) The geographical location of this example is in Xinjiang, where the weather characteristics are mostly sunny all year round and there are few types of weather. Based on domain knowledge, this example is set to four weather types.
[0176] (7) Set three z-score initial thresholds as starting points, which are set to -1.5, -0.5 and 0.5 respectively, so that each threshold represents a deviation several times the standard deviation. According to the z-score values of all days, they are divided into four weather types: those above 0.5 are "clear", those between -0.5 and 0.5 are "cloudy", those between -0.5 and -1.5 are "overcast", and those below -1.5 are "rain and snow".
[0177] (8) Add labels to various weather conditions, with sunny weather marked as 1, cloudy weather marked as 0, overcast weather marked as -0.5, and rainy and snowy weather marked as -1. Table 1 is an example of the weather classification for the first ten days of the year.
[0178] Table 1 Example of weather classification for the previous ten days
[0179] date Radiation accumulation value Weather Type January 1 774.0752 0.5 January 2 926.9992 1 January 3 936.0412 1 January 4 537.1889 0 January 5 914.3828 1 January 6 911.2792 1 January 7 1061.388 1 January 8 966.739 1 January 9 529.1814 0 January 10 853.4294 0.5
[0180] (9) Expand the weather type to the size of the original light intensity column. Calculate the Pearson correlation coefficient between the weather type column and the original historical light intensity column to evaluate the correlation between the weather type classification and the light intensity data. The Pearson correlation coefficient is directly related to the accuracy of weather classification, which is measured based on the correlation between various weather labels and actual observed weather data under the current threshold setting. The closer the correlation coefficient is to 1, the more accurately the threshold setting can reflect the actual weather conditions and the higher the adaptability.
[0181] (10) Taking the Pearson correlation coefficient as the objective function, the genetic algorithm is used to optimize the z-score threshold of each weather segment. The optimal thresholds obtained for the four weather segments are [-1.21309873, -0.56549365, 0.38074291], [-1.1564027, -0.1216414, 0.4941296], [-1.1837732, -0.121641, 0.108610], and [-1.583773, -0.223741, 0.223091], respectively. Figure 7 This is a schematic diagram of some optimized classification results.
[0182] Compared with existing methods, this method is more in line with the changes in radiation intensity data. Figure 2The day marked by the red box is marked as sunny in the existing method, but the actual radiation intensity fluctuates to a certain extent. This method captures this fluctuation and marks it as cloudy, which is more beneficial for the subsequent photovoltaic output forecast. Table 2 shows the comparison of weather classification within a year between the existing method and this method. The different classification results basically appear in the judgment of sunny days. Most of the existing methods make judgments based on comprehensive weather, and it is difficult to detect small fluctuations in radiation intensity. This method focuses on the purpose of subsequent photovoltaic output to divide the weather, and focuses the classification indicators on the fluctuation of radiation intensity. The classification results are more suitable for the research of photovoltaic output forecast.
[0183] Table 2 Comparison of classification results between existing methods and the present invention
[0184] - Existing method (days) The invention (days) sunny 172 164 partly cloudy 102 108 cloudy day 41 43 Rainy and snowy days 48 48
[0185] This embodiment performs weather classification based on radiation intensity data, which can better reflect the actual weather conditions than the existing methods. For example, in the judgment of sunny days, it can capture slight fluctuations in radiation intensity, and correctly classify some data that are misjudged as sunny in the existing methods but actually fluctuate as other weather types such as cloudy. The classification index of this method focuses on the fluctuation of radiation intensity, which is more beneficial for photovoltaic output prediction research. Because photovoltaic output is closely related to radiation intensity, accurate weather classification helps to improve the accuracy of photovoltaic output prediction. The classification threshold is optimized using a genetic algorithm to make the classification results more reasonable. From the perspective of the Pearson correlation coefficient, the optimized threshold setting can more accurately reflect the actual weather conditions and has a higher degree of adaptability. For example, in the example of Xinjiang, the optimized optimal thresholds of the four weather segments can better reflect the relationship between radiation intensity and weather type.
[0186] Example 2
[0187] Corresponding to the aforementioned weather classification method embodiment, the present disclosure also provides an embodiment of a weather classification system.
[0188] Figure 8 A module schematic diagram of a weather classification system provided by an exemplary embodiment of the present disclosure, the system comprising:
[0189] A first acquisition module 21 is used to acquire a first cumulative radiation intensity corresponding to each date included in each first time interval;
[0190] A determination module 22, configured to determine a first standard score corresponding to each date according to the first accumulated radiation intensity in each first time interval;
[0191] The classification module 23 is used to divide the first standard scores corresponding to each date in each first time interval based on the preset classification threshold corresponding to each first time interval, so as to determine the first weather classification corresponding to each date according to the division result; wherein the preset classification threshold is obtained by optimizing the initial classification threshold based on a genetic algorithm.
[0192] Alternatively, see Fig. 9 It is known that the weather classification system also includes:
[0193] A second acquisition module 24 is used to acquire first radiation intensity data within a first preset time interval;
[0194] The data division module 25 is used to determine the change point in the first radiation intensity data according to the change point detection algorithm, and divide the first radiation intensity data into a plurality of first time intervals according to the change point.
[0195] Alternatively, see Fig.10 It is known that the weather classification system also includes:
[0196] The first algorithm module 26 is used to iteratively optimize the preset classification threshold based on a genetic algorithm.
[0197] Optionally, the first algorithm module 26 is specifically configured to:
[0198] A first Pearson correlation coefficient between the first cumulative radiation intensity and the first weather classification corresponding to each date is determined, and a preset classification threshold is updated with the goal that the first Pearson correlation coefficient satisfies a first preset condition.
[0199] Alternatively, see Fig.11 It is known that the weather classification system also includes:
[0200] The second algorithm module 27 is used to iteratively optimize the initial classification threshold based on a genetic algorithm.
[0201] Optionally, the second algorithm module 27 is specifically configured to:
[0202] Obtaining the second cumulative radiation intensity corresponding to each date included in each second time interval;
[0203] Determine the second standard score corresponding to each date according to the second accumulated radiation intensity in each second time interval;
[0204] Based on the initial classification threshold corresponding to each second time interval, the second standard score corresponding to each date in each second time interval is divided respectively, so as to determine the second weather classification corresponding to each date according to the division result;
[0205] A second Pearson correlation coefficient between the second cumulative radiation intensity corresponding to each date and the second weather classification is determined, and the initial classification threshold is updated with the second Pearson correlation coefficient satisfying a second preset condition as a goal.
[0206] As for the system embodiment, since it basically corresponds to the method embodiment, the relevant parts can refer to the partial description of the method embodiment. The system embodiment described above is only illustrative, wherein the units described as separate components may or may not be physically separated, and the components as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules may be selected according to actual needs to achieve the purpose of the disclosed solution.
[0207] This embodiment performs weather classification based on radiation intensity data, which can better reflect the actual weather conditions compared to the prior art. For example, in the judgment of sunny days, it can capture slight fluctuations in radiation intensity, and correctly classify some data that are misjudged as sunny days in the prior art but actually fluctuate as other weather types such as cloudy. The classification indicators of this system focus on the fluctuations in radiation intensity, which is more beneficial for photovoltaic output forecast research. Because photovoltaic output is closely related to radiation intensity, accurate weather classification helps to improve the accuracy of photovoltaic output forecasts. The classification threshold is optimized using a genetic algorithm to make the classification results more reasonable. From the perspective of the Pearson correlation coefficient, the optimized threshold setting can more accurately reflect the actual weather conditions and has a higher degree of adaptability. For example, in the example of Xinjiang, the optimized optimal thresholds of the four weather segments can better reflect the relationship between radiation intensity and weather type.
[0208] Example 3
[0209] Fig.12 This is a structural diagram of an electronic device shown in an example embodiment of the present disclosure, the electronic device includes a memory, a processor, and a computer program stored in the memory and used to run on the processor, and when the processor executes the computer program, the weather classification method described in any of the above embodiments is implemented. Fig.12 The electronic device 90 shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0210] like Fig.12 As shown, the electronic device 90 may be in the form of a general-purpose computing device, for example, it may be a server device. The components of the electronic device 90 may include, but are not limited to: at least one processor 91, at least one memory 92, and a bus 93 connecting different system components (including the memory 92 and the processor 91).
[0211] The bus 93 includes a data bus, an address bus, and a control bus.
[0212] The memory 92 may include a volatile memory, such as a random access memory (RAM) 921 and / or a cache memory 922 , and may further include a read-only memory (ROM) 923 .
[0213] The memory 92 may also include a program tool 925 (or utility) having a set (at least one) of program modules 924, such program modules 924 including but not limited to: an operating system, one or more application programs, other program modules and program data, each of which or some combination may include an implementation of a network environment.
[0214] The processor 91 executes various functional applications and data processing by running the computer program stored in the memory 92, such as the weather classification method provided in any of the above embodiments.
[0215] The electronic device 90 may also communicate with one or more external devices 94 (e.g., keyboards, pointing devices, etc.). Such communication may be performed via an input / output (I / O) interface 95. Furthermore, the electronic device 90 may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) via a network adapter 96. As shown, the network adapter 96 communicates with other modules of the electronic device 90 via a bus 93. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the electronic device 90, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID (disk array) systems, tape drives, and data backup storage systems, etc.
[0216] It should be noted that although several units / modules or sub-units / modules of the electronic device are mentioned in the above detailed description, this division is merely exemplary and not mandatory. In fact, according to the embodiments of the present disclosure, the features and functions of two or more units / modules described above can be embodied in one unit / module. Conversely, the features and functions of one unit / module described above can be further divided into multiple units / modules to be embodied.
[0217] Example 4
[0218] The embodiments of the present disclosure also provide a computer-readable storage medium having a computer program stored thereon, and when the program is executed by a processor, the weather classification method provided in any of the above embodiments is implemented.
[0219] The readable storage medium may include but is not limited to: a portable disk, a hard disk, a random access memory, a read-only memory, an erasable programmable read-only memory, an optical storage device, a magnetic storage device or any suitable combination of the above.
[0220] Example 5
[0221] The present disclosure also provides a computer program product, including a computer program, which implements any of the above-mentioned weather classification methods when executed by a processor.
[0222] Among them, the program code for executing the computer program product of the present disclosure can be written in any combination of one or more programming languages, and the program code can be executed completely on the user device, partially on the user device, as an independent software package, partially on the user device and partially on a remote device, or completely on the remote device.
[0223] Although the specific embodiments of the present disclosure are described above, those skilled in the art should understand that this is only an example, and the protection scope of the present disclosure is defined by the appended claims. Those skilled in the art may make various changes or modifications to these embodiments without departing from the principles and essence of the present disclosure, but these changes and modifications all fall within the protection scope of the present disclosure.
Claims
1. A weather classification method, characterized in that: The weather classification method comprises: Obtaining a first cumulative radiation intensity corresponding to each date included in each first time interval; Determine a first standard score corresponding to each date according to the first cumulative radiation intensity in each of the first time intervals; Based on the preset classification threshold corresponding to each of the first time intervals, the first standard score corresponding to each date in each of the first time intervals is divided respectively, so as to determine the first weather classification corresponding to each date according to the division result; wherein the preset classification threshold is obtained after optimizing the initial classification threshold based on a genetic algorithm.
2. The weather classification method according to claim 1, characterized in that: The step of obtaining the first cumulative radiation intensity corresponding to each date included in each first time interval includes: Acquiring first radiation intensity data within a first preset time interval; A change point in the first radiation intensity data is determined according to a change point detection algorithm, and the first radiation intensity data is divided into a plurality of first time intervals according to the change point.
3. The weather classification method according to claim 1, characterized in that: The weather classification method further includes: The preset classification threshold is iteratively optimized based on a genetic algorithm.
4. The weather classification method according to claim 3, characterized in that: The iterative optimization of the preset classification threshold based on the genetic algorithm includes: Determine a first Pearson correlation coefficient between the first cumulative radiation intensity and the first weather classification corresponding to each date, and update the preset classification threshold with the goal of the first Pearson correlation coefficient satisfying a first preset condition.
5. The weather classification method according to claim 1, characterized in that: The step of setting the preset classification thresholds corresponding to the first time intervals includes: The initial classification threshold is iteratively optimized based on a genetic algorithm.
6. The weather classification method according to claim 5, characterized in that: The iterative optimization of the initial classification threshold based on a genetic algorithm comprises: Obtaining the second cumulative radiation intensity corresponding to each date included in each second time interval; Determine a second standard score corresponding to each date according to the second accumulated radiation intensity in each of the second time intervals; Based on the initial classification threshold corresponding to each of the second time intervals, the second standard score corresponding to each date in each of the second time intervals is divided respectively, so as to determine the second weather classification corresponding to each date according to the division result; Determine a second Pearson correlation coefficient between the second cumulative radiation intensity and the second weather classification corresponding to each date, and update the initial classification threshold with the second Pearson correlation coefficient satisfying a second preset condition as a goal.
7. A weather classification system, characterized in that: The weather classification system includes: A first acquisition module is used to acquire a first cumulative radiation intensity corresponding to each date included in each first time interval; a determination module, configured to determine a first standard score corresponding to each date according to the first accumulated radiation intensity in each of the first time intervals; A classification module is used to divide the first standard scores corresponding to each date in each of the first time intervals based on the preset classification thresholds corresponding to each of the first time intervals, so as to determine the first weather classification corresponding to each date according to the division results; wherein the preset classification threshold is obtained by optimizing the initial classification threshold based on a genetic algorithm.
8. An electronic device comprising a memory, a processor, and a computer program stored in the memory and used to run on the processor, characterized in that: When the processor executes the computer program, the weather classification method according to any one of claims 1 to 6 is implemented.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the weather classification method according to any one of claims 1 to 6 is implemented.
10. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the weather classification method according to any one of claims 1 to 6 is implemented.