A distributed settlement method and financial robot
By classifying the data of photovoltaic power generation users and using machine learning models, identifying and processing abnormal data, the settlement problem in the abnormal photovoltaic power generation is solved, and the accuracy and efficiency of settlement are improved.
Patent Information
- Application Number
- CN202410910028.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-09
- Publication Date
- 2024-11-15
- Estimated Expiration
- 2044-07-09
AI Technical Summary
The existing distributed photovoltaic settlement method cannot be effectively processed when there is abnormality in photovoltaic power generation, resulting in low settlement efficiency and error-prone.
By collecting time series power generation data and meteorological data of photovoltaic power generation users, performing two classifications, and generating machine learning models to identify abnormal power generation data, correcting predicted power generation volume, and ensuring the accuracy of cost settlement.
Effectively identify and process abnormal power generation data, reduce fee settlement errors and improve settlement accuracy and efficiency.
Smart Images

Figure CN118469654B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of data processing, and in particular relates to a distributed settlement method and a financial robot. Background Art
[0002] As the country continues to increase its support for renewable energy, technological progress and cost reduction have also promoted the rapid development of the photovoltaic industry. The market size of the photovoltaic industry is getting bigger and bigger, and there are more and more participants in photovoltaic power generation. Manual offline settlement is inefficient and prone to errors. In order to improve the efficiency of photovoltaic settlement. A similar prior art document with a publication number of CN114004588A provides an integrated settlement platform for distributed photovoltaic users, which includes: electricity information collection terminal, electricity fee accounting and issuance terminal, tax control bill terminal, financial payment terminal, and user communication terminal. Similar prior art also has a public document with publication number CN115760483A, which discloses a method for electricity settlement for distributed photovoltaic multi-user access. The method installs a comprehensive metering and collection device at the distributed photovoltaic grid-connected point and the user's gateway meter side, and the comprehensive metering and collection device is networked with the distributed photovoltaic meter and the load user meter. The method includes using the comprehensive metering and collection device to collect power information and electricity information respectively; using the comprehensive metering and collection device based on the power information and the electricity information, calculating the online electricity consumption and local consumption electricity consumption of each distributed photovoltaic user; when the grid settlement period is reached, calculating the local consumption electricity contribution percentage and the online electricity contribution percentage of each distributed photovoltaic user; based on the local consumption electricity contribution percentage and the online electricity contribution percentage of each distributed photovoltaic user, completing the electricity settlement. However, the above two documents do not take into account the problem that settlement cannot be made when photovoltaic power generation is abnormal. Therefore, the present invention provides a settlement method and a financial robot for distributed. Summary of the invention
[0003] The present invention collects and stores relevant data of each photovoltaic power generation user, the relevant data including time series power generation data and corresponding meteorological data, performs a first classification on the relevant data according to the time series power generation data, determines the optimal number of classifications during the first classification, performs a second classification on the relevant data of each category after the first classification according to the relevant meteorological data, uses the relevant data of multiple different categories generated after the second classification as a training data set, uses the training data set to generate a first prediction model and a second prediction model through a machine learning algorithm, marks abnormal power generation data according to the prediction data of the first prediction model and the second prediction model, calculates the total power generation data without abnormalities, and performs fee settlement for users. The present invention can identify abnormal power generation data and reduce fee settlement errors.
[0004] In order to achieve the above-mentioned object of the invention, the present invention provides a distributed settlement method as described below, which is mainly implemented by executing the following steps:
[0005] Step S1, collecting and storing relevant data of each photovoltaic power generation user, the relevant data including time series power generation data and corresponding meteorological data, the time series power generation data is the photovoltaic power generation at every preset period, the meteorological data includes solar radiation value, temperature, humidity, precipitation, wind direction and wind speed, calculating the correlation coefficient between each meteorological data and the power generation data, and obtaining a plurality of relevant meteorological data whose correlation coefficient is greater than a first threshold, the first threshold being a preset value for judging the size of the correlation;
[0006] Step S2, performing a first classification on the relevant data according to the time series power generation data, determining an optimal number of classifications during the first classification process, and performing a second classification on the relevant data of each category after the first classification according to the relevant meteorological data;
[0007] Step S3, using the relevant data of multiple different categories generated after the second classification as training data sets, and using the training data sets to train and generate a first prediction model and a second prediction model through a machine learning algorithm;
[0008] Step S4, obtaining target meteorological data of a target date, inputting the target meteorological data into the first prediction model and the second prediction model, outputting corresponding predicted power generation data according to the first prediction model, obtaining the prediction deviation of the predicted power generation data according to the second prediction model, obtaining corresponding actual power generation data after the target date, modifying the predicted power generation data according to the prediction deviation to obtain a revised predicted power generation range, judging whether the actual power generation data is within the predicted power generation range, if so, recording the actual power generation data, if not, marking the actual power generation data as abnormal data;
[0009] Step S5: Obtain the total power generation data of all normal actual power generation data within the target period and settle fees for the user based on the total power generation data.
[0010] As a preferred technical solution of the present invention, it is characterized in that, in the step S2, the relevant data is classified for the first time according to the time series power generation data, and the process of determining the optimal number of classifications during the first classification process includes the following steps:
[0011] The time series power generation data is obtained, a first classification number s is preset, and the first classification number s is a positive integer greater than 1, and a change trend of each of the time series power generation data is obtained, and the time series power generation data with similar change trends are classified into one class, and an evaluation value f(s) is calculated when the time series power generation data is classified into s classes, and an evaluation value f(s+1) is calculated when the time series power generation data is classified into s+1 classes, and a first difference between the evaluation value f(s) and the evaluation value f(s+1) is calculated, and the first difference is compared with a first threshold value, and if the first difference is greater than or equal to the first threshold value, The first threshold, the evaluation value classified into s+1 categories is smaller than the evaluation value classified into s categories, and the first difference is greater than the first threshold, and the evaluation value still has room to decrease, calculate the evaluation value f(s+2) when the time series power generation data is divided into s+2 categories, calculate the second difference between the evaluation value f(s+1) and the evaluation value f(s+2), compare the second difference with the first threshold, if the second difference is greater than or equal to the first threshold, repeat this step to calculate the third difference between the evaluation value f(s+2) and the evaluation value f(s+3), until the calculated difference is less than the first threshold.
[0012] As a preferred technical solution of the present invention, it is characterized in that the process of calculating the evaluation value f(s) when the time series power generation data is divided into s categories includes the following steps:
[0013] The number m of time series power generation data of the first category is obtained, and the first difference c1 between m-1 time series power generation data and the representative time series power generation data is calculated using the first formula, wherein the first formula is:
[0014] ;
[0015] Where n is the number of time periods in a time series data, t represents the tth time period, and W r (t) represents the power generation of the representative time series power generation data r in the t-th time period, W m (t) represents the power generation of the time series power generation data m in the t-th time period, and the second difference c2 between the m-1 time series power generation data and the representative time series power generation data is calculated using the second formula, and the second formula is:
[0016] ;
[0017] Where, ΔW r (t) = W r (t)-W r (t-1), ΔW m (t) = W m (t)-W m(t-1), use the third formula to calculate the total difference C between the mth time series power generation data and the representative time series power generation data m , the third formula is:
[0018] ;
[0019] The difference of the first category is calculated using the fourth formula, which is:
[0020] ;
[0021] The evaluation value f(s) when the number of classifications is s is calculated using the fifth formula, which is:
[0022] ;
[0023] Among them, s is the number of categories, C i is the difference of the i-th category.
[0024] As a preferred technical solution of the present invention, it is characterized in that, in the step S2, the process of performing a second classification on the relevant data of each category after the first classification according to the relevant meteorological data comprises the following steps:
[0025] After the first classification, all the relevant meteorological data belonging to the same category are obtained, and some of the relevant meteorological data are selected from the relevant meteorological data as the first selected data. The first selected data are first classified into M categories for the second time, and the first representative meteorological data of each category after the second classification is calculated. Some of the relevant meteorological data are selected from the relevant meteorological data as the second selected data again, and the relevant meteorological data in the second selected data set are respectively classified into M categories, and the second representative meteorological data of each category is calculated again. It is determined whether the first representative meteorological data and the second representative meteorological data of each category are the same. If they are the same, the remaining unselected relevant meteorological data are continued to be classified into M categories. If they are not the same, the first selected data and the second selected data are reclassified, and this step is repeated until all relevant meteorological data are classified.
[0026] As a preferred technical solution of the present invention, it is characterized in that the process of calculating the first representative meteorological data of each category after the second classification includes the following steps:
[0027] Obtain all relevant meteorological data belonging to the same category, and use the sixth formula to calculate the difference between any two pieces of the relevant meteorological data. The sixth formula is:
[0028] ;
[0029] Among them, q is the number of data in each relevant meteorological data, x i is the i-th data of the first relevant meteorological data, y i For the i-th data of the second relevant meteorological data, after obtaining the difference between each relevant meteorological data and all other relevant meteorological data, the sum of the differences of each data is calculated to obtain the minimum sum of the differences. The relevant meteorological data corresponding to the minimum sum of the differences is the first representative meteorological data.
[0030] As a preferred technical solution of the present invention, it is characterized in that, in the step S3, the process of using the training data set to train and generate the first prediction model and the second prediction model through a machine learning algorithm includes the following steps:
[0031] Step S31, dividing the training data set into a first data set and a second data set, and further dividing the first data set into a first sub-data set and a second sub-data set according to a first ratio, wherein the first ratio refers to a ratio of the first sub-data set to the second sub-data set in the first sub-data set;
[0032] Step S32: using the first sub-data set to generate a first prediction model through training by a machine learning algorithm, and also using the second data set to test the first prediction model to obtain a first accuracy of the first prediction model, and determining whether the first accuracy is greater than a preset second threshold;
[0033] Step S33: If it is not greater than, return to step S31 to re-divide the first data set and increase the proportion of the first sub-data set during segmentation. If it is greater than, use the second sub-data set to generate a second prediction model through machine learning algorithm training, and the second prediction model is used to predict the prediction deviation of the first prediction model.
[0034] The present invention also provides a financial robot, comprising the following modules:
[0035] A data collection module is used to collect and store relevant data of each photovoltaic power generation user, wherein the relevant data includes time series power generation data and corresponding meteorological data, wherein the time series power generation data is the amount of photovoltaic power generation at every preset period, and the meteorological data includes solar radiation value, temperature, humidity, precipitation, wind direction and wind speed, calculate the correlation coefficient between each meteorological data and the power generation data, and obtain a plurality of relevant meteorological data whose correlation coefficient is greater than a first threshold value, wherein the first threshold value is a preset value for judging the size of the correlation;
[0036] A data classification module, used for performing a first classification on the relevant data according to the time series power generation data, determining an optimal number of classifications during the first classification process, and performing a second classification on the relevant data of each category after the first classification according to relevant meteorological data;
[0037] A model training module, used to use the relevant data of multiple different categories generated after the second classification as a training data set, and use the training data set to train and generate a first prediction model and a second prediction model through a machine learning algorithm;
[0038] a data marking module, which obtains target meteorological data of a target date, inputs the target meteorological data into the first prediction model and the second prediction model, outputs corresponding predicted power generation data according to the first prediction model, obtains the prediction deviation of the predicted power generation data according to the second prediction model, obtains corresponding actual power generation data after the target date, modifies the predicted power generation data according to the prediction deviation to obtain a revised predicted power generation range, determines whether the actual power generation data is within the predicted power generation range, and if so, records the actual power generation data, and if not, no longer marks the actual power generation data as abnormal data;
[0039] The settlement module is used to obtain the total power generation data of all normal actual power generation data within the target period and settle fees for users based on the total power generation data.
[0040] Compared with the prior art, the beneficial effects of the present invention are at least as follows:
[0041] In the present invention, firstly, relevant data of each photovoltaic power generation user is collected and stored, the relevant data including time series power generation data and corresponding meteorological data, the relevant data is classified for the first time according to the time series power generation data, the optimal number of classifications is determined during the first classification, the relevant data of each category after the first classification is classified for the second time according to the relevant meteorological data, the relevant data of multiple different categories generated after the second classification are used as training data sets, the training data sets are used to generate a first prediction model and a second prediction model through machine learning algorithm training, abnormal power generation data is marked according to the prediction data of the first prediction model and the second prediction model, the total power generation data without abnormality is calculated to settle fees for users, the present invention can identify abnormal power generation data and reduce fee settlement errors. BRIEF DESCRIPTION OF THE DRAWINGS
[0042] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings in the following description are only embodiments of the present invention. For those of ordinary skill in the art, other drawings can be obtained based on the provided drawings without creative work.
[0043] Figure 1 A flowchart of a distributed settlement method according to the present invention;
[0044] Figure 2 A schematic diagram showing how the evaluation value of the classification in the present invention changes as the number of classifications increases;
[0045] Figure 3 It is a schematic diagram of two time series power generation data in one category of the present invention;
[0046] Figure 4 The present invention is a structural diagram of a financial robot. DETAILED DESCRIPTION
[0047] In order to make the purpose, technical solution and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention.
[0048] It is understood that the terms "first", "second", etc. used in this application may be used herein to describe various elements, but unless otherwise specified, these elements are not limited by these terms. These terms are only used to distinguish a first element from another element. For example, without departing from the scope of this application, a first xx script may be referred to as a second xx script, and similarly, a second xx script may be referred to as a first xx script.
[0049] The present invention provides Figure 1 A distributed settlement method is shown, which is mainly implemented by executing the following steps:
[0050] Step S1, collect and store relevant data of each photovoltaic power generation user, the relevant data including time series power generation data and corresponding meteorological data, the time series power generation data is the photovoltaic power generation at every preset period, the meteorological data includes solar radiation value, temperature, humidity, precipitation, wind direction and wind speed, calculate the correlation coefficient of each meteorological data and power generation data, and obtain multiple relevant meteorological data with correlation coefficients greater than a first threshold, the first threshold is a preset value for judging the size of the correlation.
[0051] Specifically, in order to accurately settle accounts for each photovoltaic power generation user, it is necessary to accurately obtain the power generation of the photovoltaic power generation user. However, due to various reasons, the actual power generation of the photovoltaic power generation user may be abnormal. Therefore, in order to accurately settle accounts for photovoltaic power generation users, the present invention first predicts the power generation data, and determines whether the actual power generation data is abnormal by comparing the predicted value with the actual power generation data. The abnormal data is marked and the user is settled after offline verification. In order to accurately predict the power generation data of each photovoltaic power generation user, the relevant data of each photovoltaic power generation user is collected and stored. The relevant data includes time series power generation data and corresponding meteorological data. The time series power generation data is the photovoltaic power generation at every preset period. The preset period can be half an hour, 1 hour, 2 hours, etc. This embodiment takes 2 hours as an example. The meteorological data includes solar radiation value, temperature, humidity, precipitation, wind direction and wind speed, etc., but not all meteorological data are consistent with photovoltaic power generation. The meteorological data is related, so the correlation coefficient of each meteorological data and the power generation data is calculated. The meteorological data with a correlation coefficient greater than the first threshold is the meteorological data we need to use. The meteorological data with a correlation coefficient greater than the first threshold is called relevant meteorological data. The first threshold is a preset value for judging the size of the correlation. It can be judged comprehensively according to the usage conditions. Usually, the judgment standard of the correlation is greater than 0 and less than or equal to 0.3 for weak correlation, greater than 0.3 and less than or equal to 0.5 for low correlation, greater than 0.5 and less than or equal to 0.8 for significant correlation, and greater than 0.8 and less than or equal to 1 for high correlation. Since the present embodiment is to predict the power generation data, the meteorological data with small correlation has a relatively small impact on the prediction of the power generation data. For the accuracy of the prediction, the meteorological data with weak correlation is not considered, so the first threshold is set to 0.3, and the meteorological data with weak correlation is removed. When judging the correlation in other cases, the threshold can also be set to 0.3 or 0.8.
[0052] Step S2: Classify the relevant data for the first time, determine the optimal number of classifications during the first classification, and classify the relevant data of each category after the first classification for the second time according to the relevant meteorological data.
[0053] Specifically, in order to accurately predict the power generation data, the data is first classified for the first time, and the optimal number of classifications is determined during the first classification process. The specific method of the first classification is explained in detail later. After the first classification, the related data with similar power generation are classified into the same category. For the multiple categories of the first classification, a second classification is performed according to the relevant meteorological data. The second classification is to classify the related data with similar power generation according to the relevant meteorological data, and classify the related data with similar relevant meteorological data into the same category.
[0054] Step S3: Use the relevant data of multiple different categories generated after the second classification as training data sets, and use the training data sets to train and generate the first prediction model and the second prediction model through a machine learning algorithm.
[0055] Specifically, in order to accurately predict power generation, the relevant data of multiple different categories generated after the second classification are used as training data sets. The training data sets are used to generate a first prediction model and a second prediction model through machine learning algorithm training. The first prediction model is used to predict the corresponding power generation data based on the relevant meteorological data, and the second prediction model is used to obtain the prediction deviation of the first prediction model.
[0056] Step S4, obtain the target meteorological data of the target date, input the target meteorological data into the first prediction model and the second prediction model, output the corresponding predicted power generation data according to the first prediction model, obtain the prediction deviation of the predicted power generation data according to the second prediction model, obtain the corresponding actual power generation data after the target date, modify the predicted power generation data according to the prediction deviation to obtain the revised predicted power generation range, judge whether the actual power generation data is within the predicted power generation range, if so, record the actual power generation data, if not, no longer mark the actual power generation data as abnormal data.
[0057] Specifically, the target meteorological data of the target date is obtained. The target date refers to a certain day in the future. The target meteorological data can be obtained through the weather forecast issued by the National Meteorological Center. The target meteorological data is input into the first prediction model. The first prediction model obtains the predicted power generation data. The second prediction model obtains the prediction deviation of the predicted power generation data. After the target date, the actual power generation data of the target date is obtained. The predicted power generation data is modified according to the prediction deviation to obtain the modified predicted power generation range. The prediction deviation is 10%, and the predicted power generation data is 100. The modified power generation range is 90 to 110. It is judged whether the actual power generation data is within the predicted power generation range. Assuming that the actual power generation data is 80, the actual power generation data is not within the predicted power generation range, indicating that the actual power generation data is abnormal. The actual power generation data is marked as abnormal data, and there are many reasons for the abnormality during the inspection. It may be that there is a problem with the photovoltaic component, so the photovoltaic component needs to be checked offline. After the inspection, the abnormal power generation data is settled separately. Assuming that the actual power generation data is 95, the actual power generation data is within the predicted power generation range, indicating that the actual power generation data is normal, and the actual power generation data is recorded.
[0058] Step S5: Obtain the total power generation data of all normal actual power generation data within the target period and settle the fees for the user according to the total power generation data.
[0059] Specifically, photovoltaic settlement is generally settled on a monthly basis. After each month, all normal actual power generation data of the previous month are counted, and users are settled based on electricity prices and total power generation data.
[0060] The present invention can accurately predict the power generation, determine whether the actual power generation is abnormal according to the predicted power generation, mark the abnormal power generation data, and settle the normal power generation data according to the normal process. The present invention can timely discover the abnormal data for maintenance and avoid errors in settlement.
[0061] Furthermore, the relevant data is classified for the first time according to the time series power generation data, and the process of determining the optimal number of classifications during the first classification is mainly achieved by executing the following steps:
[0062] Acquire time series power generation data, preset a first classification number s, the first classification number s is a positive integer greater than 1, obtain the change trend of each time series power generation data, classify the time series power generation data with similar change trends into one class, calculate the evaluation value f(s) when the time series power generation data is divided into s classes, calculate the evaluation value f(s+1) when the time series power generation data is divided into s+1 classes, calculate the first difference between the evaluation value f(s) and the evaluation value f(s+1), compare the first difference with the first threshold, and if the first difference is greater than or equal to the first threshold, A threshold value is set, the evaluation value classified into s+1 categories is smaller than the evaluation value classified into s categories, and the first difference is greater than the first threshold value, and the evaluation value still has room to decrease. Calculate the evaluation value f(s+2) when the time series power generation data is divided into s+2 categories, calculate the second difference between the evaluation value f(s+1) and the evaluation value f(s+2), compare the second difference with the first threshold value, if the second difference is greater than or equal to the first threshold value, repeat this step to calculate the third difference between the evaluation value f(s+2) and the evaluation value f(s+3), until the calculated difference is less than the first threshold value.
[0063] Specifically, according to experimental data, Figure 2 As shown in the figure, the classification evaluation value changes with the increase of the number of classifications. Figure 2It can be seen that in the process of data classification, the evaluation value of the classification will gradually decrease as the number of classifications increases. However, as the number of classifications continues to increase, the evaluation value of the classification will not decrease as the number of classifications increases, but will tend to be flat. Therefore, it can be seen that the more classifications the better. Therefore, in order to obtain the optimal number of classifications, first set the first classification number s, where s is a positive integer greater than 1. Assume that s is 2, obtain the change trend of each time series power generation data, and classify the time series power generation data with similar change trends into one class. The specific classification method can use existing technologies such as the k-means clustering algorithm, clustering with the specific value and time of power generation as the characteristics, and calculate the evaluation value f(2) when the number of classifications is 2. The specific method of calculating the evaluation value will be explained in detail later. Then add 1 to s, divide the time series power generation data into 3 classes, and calculate the evaluation value f(3) when the number of classifications is 3. Calculate the difference between f(2)-f(3), compare the difference and the second The size of the threshold. If the difference is greater than or equal to the second threshold, it means that the evaluation value when the number of categories is 3 is lower than the evaluation value when the number of categories is 2, and the reduction is larger, which means that classifying the data into 3 categories has a better aggregation degree than classifying it into 2 categories. Continue to classify the data into 4 categories, calculate the evaluation value f(4) when the number of categories is 4, calculate f(3)-f(4) to obtain the difference, and continue to compare the current difference with the size of the second threshold. If the difference is also greater than or equal to the second threshold, continue to classify the data into 5 categories, calculate the evaluation value f(5) when the number of categories is 5, calculate f(4)-f(5) to obtain the difference. If the current difference is less than the second threshold, it means that the evaluation value f(5) when classified into 5 categories is not much lower than the evaluation value f(4) when classified into 4 categories. This means that if the data is continued to be classified into more categories, the evaluation value will not be reduced too much. Moreover, continuing to classify the data into more categories will increase the amount of calculation and make the classification slower, and the clustering degree will not change significantly. At this time, dividing the data into 4 categories is the optimal number of categories.
[0064] Furthermore, the process of calculating the evaluation value f(s) when the time series power generation data is divided into s classes is mainly implemented by executing the following steps:
[0065] The number m of time-series power generation data of the first category is obtained, and the first difference c1 between m-1 time-series power generation data and the representative time-series power generation data is calculated using the first formula. The first formula is:
[0066] ;
[0067] Where n is the number of time periods in a time series data, t represents the tth time period, and W r (t) represents the power generation of the time series power generation data r in the tth time period, W m(t) represents the power generation of the time series power generation data m in the tth time period, and the second difference c2 between m-1 time series power generation data and the representative time series power generation data is calculated using the second formula. The second formula is:
[0068] ;
[0069] Where, ΔW r (t) = W r (t)-W r (t-1), ΔW m (t) = W m (t)-W m (t-1), use the third formula to calculate the total difference C between the mth time series power generation data and the representative time series power generation data m , the third formula is:
[0070] ;
[0071] The difference of the first category is calculated using the fourth formula, which is:
[0072] ;
[0073] The fifth formula is used to calculate the evaluation value f(s) when the number of classifications is s. The fifth formula is:
[0074] ;
[0075] Among them, s is the number of categories, C i is the difference of the i-th category.
[0076] Specifically, Figure 3 As shown, it is a schematic diagram of two time series power generation data in one category, where p1 refers to the power generation of the first time series power generation data in each time period, and p2 refers to the power generation of the second time series power generation data in each time period. Assuming that there are A time series power generation data in total, the A time series power generation data are classified into s categories. The evaluation value f(s) represents the degree of aggregation of the A time series power generation data into s categories. The lower the evaluation value, the better the degree of aggregation of the current classification. First, the number m of time power generation data in the first category is obtained, and the representative time series data of each category is obtained. The representative time series data is the central data of the cluster. Assuming that the rth time in the m time series power generation data is the representative time series data, the first difference between the mth time series power generation data and the representative time series data is calculated using the above first formula. In the first formula, n is the number of time periods in a time series data. In this embodiment, power generation data is obtained once every 2 hours, so n is 12, t represents the tth time period, and W r(t) represents the power generation of the time series power generation data r in the tth time period, W m (t) represents the power generation of the time series power generation data m in the tth time period.
[0077] The second difference between the mth time series power generation data and the representative time series power generation data is calculated using the second formula. In the second formula, ΔW r (t) refers to the difference between the power generation data representing the time series power generation data in the t-th time period and the power generation data representing the time series power generation data in the t-1th time period, ΔW m (t) refers to the difference between the power generation data of the mth time series power generation data in the tth time period and the power generation data of the mth time series in the t-1th time period. The total difference between the mth time series power generation data and the representative time series power generation data is calculated by the third formula mentioned above, where the total difference is equal to the first difference plus the second difference. The difference of the first category is calculated by the fourth formula mentioned above, where m is the number of time series power generation data in the first category. The evaluation value when the number of categories is s is calculated by the fifth formula mentioned above.
[0078] Furthermore, the process of performing a second classification on the relevant data of each category after the first classification according to the relevant meteorological data is specifically implemented by executing the following steps:
[0079] After the first classification, all relevant meteorological data belonging to the same category are obtained, and several relevant meteorological data are selected from the relevant meteorological data as the first selected data. The first selected data are first classified into M categories for the second time, and the first representative meteorological data of each category after the second classification is calculated. Several relevant meteorological data are selected from the relevant meteorological data as the second selected data again, and the relevant meteorological data in the second selected data set are classified into M categories respectively, and the second representative meteorological data of each category is calculated again. It is determined whether the first representative meteorological data and the second representative meteorological data of each category are the same. If they are the same, the remaining unselected relevant meteorological data are continued to be classified into M categories. If they are not the same, the first selected data and the second selected data are reclassified, and this step is repeated until all relevant meteorological data are classified.
[0080] Specifically, after the first classification, the related data with similar changes in power generation data are classified into the same category. Since the first classification is based only on the power generation data and does not take into account the meteorological data, there may be different related meteorological data in the related data classified into the same category, so all the related meteorological data belonging to the same category are obtained, and some of them are selected as the first selected data. The first selected data is first classified into M categories for the second time. M is pre-set and can be 8, 10 or more. The specific classification method can use existing technologies such as K-means clustering algorithm for classification. After classification, the first representative meteorological data of each category is obtained by calculation. The specific method of obtaining the data center will be discussed later. A detailed explanation is given, and then several data are selected from the unselected related meteorological data as the second selected data, and the data in the second selected data are clustered into M categories respectively, and the second representative meteorological data of each category is calculated again to determine whether the first data center and the second data center of each category are the same. If they are the same, the aggregation degree of classification is still good after adding the second selected data to each category, and the remaining unselected meteorological data are clustered into M categories. If they are not the same, it means that the aggregation degree is not good after adding the second selected data to each category, so the first selected data and the second selected data need to be reclassified, and this step is repeated until all relevant meteorological data have been classified.
[0081] Furthermore, the process of calculating the first representative meteorological data of each category after the second classification is specifically implemented by executing the following steps:
[0082] Obtain all relevant meteorological data belonging to the same category, and use the sixth formula to calculate the difference between any two pieces of relevant meteorological data. The sixth formula is:
[0083] ;
[0084] Among them, q is the number of data in each relevant meteorological data, x i is the i-th data of the first relevant meteorological data, y i For the i-th data of the second relevant meteorological data, after obtaining the difference between each relevant meteorological data and all other relevant meteorological data, the sum of the differences of each data is calculated to obtain the minimum sum of the differences. The relevant meteorological data corresponding to the minimum sum of the differences is the first representative meteorological data.
[0085] Specifically, in order to calculate the first representative meteorological data of the classified relevant meteorological data, the difference between each relevant meteorological data and all other relevant meteorological data is calculated according to the sixth formula above. In the sixth formula, q is the number of data in each relevant meteorological data. For example, if the relevant meteorological data is solar radiation value, temperature and humidity, then q is equal to 3, x iis the i-th data of the first relevant meteorological data, y i For the i-th data of the second relevant meteorological data, after obtaining the difference between each relevant meteorological data and all other relevant meteorological data, the sum of the differences of each relevant meteorological data is calculated to obtain the minimum sum of differences. The relevant meteorological data corresponding to the minimum sum of differences is the first representative meteorological data. The method for calculating the second representative meteorological data of each category is the same as the method for calculating the first representative meteorological data.
[0086] Further, in step S3, the process of generating the first prediction model and the second prediction model by training the training data set through a machine learning algorithm is specifically implemented by executing the following steps:
[0087] Step S31, dividing the training data set into a first data set and a second data set, and further dividing the first data set into a first sub-data set and a second sub-data set according to a first ratio;
[0088] Step S32: using the first sub-data set to generate a first prediction model through training with a machine learning algorithm, and also using the second data set to test the first prediction model to obtain a first accuracy of the first prediction model, and determining whether the first accuracy is greater than a second threshold;
[0089] Step S33: If it is not greater than, return to step S31 to re-divide the first data set and increase the proportion of the first sub-data set during segmentation. If it is greater than, use the second sub-data set to generate a second prediction model through machine learning algorithm training, and the second prediction model is used to predict the prediction deviation of the first prediction model.
[0090] Specifically, the first prediction model can be a BP neural network model, whose input data is various relevant meteorological data, and the output data is predicted power generation data. The BP neural network model can be constructed using MATLAB or Python software, which is specifically a prior art and will not be repeated here. In order to train the first prediction model and the second prediction model, the training data set is divided into a first data set and a second data set, and the first data set is also divided into a first sub-data set and a second sub-data set according to a first ratio, wherein the first ratio refers to the ratio of the first sub-data set to the second sub-data set in the first sub-data set. For example, if the first ratio is 1.5, the corresponding ratio value is 3:2, the first sub-data set accounts for six-tenths of the first data set, and the second sub-data set accounts for four-tenths of the first data set. The first sub-data set is used to train and generate a first prediction model, and the second sub-data set is used to test the first prediction model to obtain a first accuracy of the first prediction model, for example, the result of dividing the number of correct predictions by the total number is used as the first accuracy, or the mean square error MSE is used as the first accuracy; if the first accuracy is greater than the third threshold, it means that the accuracy of the first prediction model training meets the requirements. The second prediction model is trained using the second sub-dataset. The second prediction model is used to predict the prediction deviation of the first prediction model. For example, the second prediction model obtains the corresponding prediction value from the first prediction model, and then calculates the difference between the predicted value and the actual value to obtain the prediction deviation of the first prediction model. If the first accuracy is less than the third threshold, it means that the prediction of the first prediction model is not accurate enough to meet the requirements. Return to step S31 to adjust the first ratio. For example, adjust the value of the first ratio to 4, so that the first sub-dataset accounts for eight-tenths of the first data set, and the second sub-dataset accounts for two-tenths of the first data set. The number of the first sub-datasets is increased, and the first prediction model is continuously trained. In this way, a first prediction model capable of accurate prediction is obtained.
[0091] According to another aspect of the embodiment of the present invention, Figure 4 As shown, a financial robot is also provided, including a data collection module, a data classification module, a model training module, a data marking module and a settlement module, which is used to implement a distributed settlement method as described above. The specific functions of each module are as follows:
[0092] A data collection module is used to collect and store relevant data of each photovoltaic power generation user, the relevant data including time series power generation data and corresponding meteorological data, the time series power generation data is the photovoltaic power generation at every preset period, the meteorological data includes solar radiation value, temperature, humidity, precipitation, wind direction and wind speed, calculate the correlation coefficient of each meteorological data and power generation data, and obtain multiple relevant meteorological data with a correlation coefficient greater than a first threshold;
[0093] A data classification module is used to perform a first classification on the relevant data according to the time series power generation data, determine the optimal number of classifications during the first classification process, and perform a second classification on the relevant data of each category after the first classification according to the relevant meteorological data;
[0094] A model training module, used to use the relevant data of multiple different categories generated after the second classification as a training data set, and use the training data set to train and generate a first prediction model and a second prediction model through a machine learning algorithm;
[0095] A data marking module obtains target meteorological data of a target date, inputs the target meteorological data into a first prediction model and a second prediction model, outputs corresponding predicted power generation data according to the first prediction model, obtains a prediction deviation of the predicted power generation data according to the second prediction model, obtains corresponding actual power generation data after the target date, modifies the predicted power generation data according to the prediction deviation to obtain a revised predicted power generation range, determines whether the actual power generation data is within the predicted power generation range, and if so, records the actual power generation data, and if not, no longer marks the actual power generation data as abnormal data;
[0096] The settlement module is used to obtain the total power generation data of all normal actual power generation data within the target period and settle the fees for users based on the total power generation data.
[0097] In summary, the present invention provides a distributed settlement method and a financial robot, the method comprising collecting and storing relevant data of each photovoltaic power generation user, the relevant data comprising time series power generation data and corresponding meteorological data, performing a first classification on the relevant data according to the time series power generation data, determining the optimal number of classifications during the first classification, performing a second classification on the relevant data of each category after the first classification according to the relevant meteorological data, using the relevant data of multiple different categories generated after the second classification as a training data set, using the training data set to generate a first prediction model and a second prediction model through a machine learning algorithm, marking abnormal power generation data according to the prediction data of the first prediction model and the second prediction model, calculating the total power generation data without abnormalities to settle fees for users, the present invention can identify abnormal power generation data and reduce fee settlement errors.
[0098] It should be understood that, although each step in the flow chart of each embodiment of the present invention is shown in sequence according to the indication of the arrow, these steps are not necessarily performed in sequence according to the order indicated by the arrow. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be performed in other orders. Moreover, at least a portion of the steps in each embodiment may include a plurality of sub-steps or a plurality of stages, and these sub-steps or stages are not necessarily performed at the same time, but can be performed at different times, and the execution order of these sub-steps or stages is not necessarily performed in sequence, but can be performed in turn or alternately with at least a portion of other steps or sub-steps or stages of other steps.
[0099] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the above-mentioned program can be stored in a non-volatile computer-readable storage medium. When the program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
[0100] The technical features of the above-mentioned embodiments can be combined arbitrarily. In order to make the description concise, not all possible combinations of the technical features in the above-mentioned embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0101] The above-mentioned embodiments only express several implementation methods of the present invention, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the patent of the present invention. It should be pointed out that, for ordinary technicians in this field, several variations and improvements can be made without departing from the concept of the present invention, and these all belong to the protection scope of the present invention. Therefore, the protection scope of the patent of the present invention shall be subject to the attached claims.
[0102] The above are only preferred embodiments of the present invention and are not intended to limit the present invention. Any modifications, equivalent substitutions and improvements made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A settlement method for distributed photovoltaic power generation users, characterized in that: The steps include: Step S1, collecting and storing relevant data of each photovoltaic power generation user, the relevant data including time series power generation data and corresponding meteorological data, the time series power generation data is the photovoltaic power generation at every preset period, the meteorological data includes solar radiation value, temperature, humidity, precipitation, wind direction and wind speed, calculating the correlation coefficient between each meteorological data and the power generation data, and obtaining a plurality of relevant meteorological data whose correlation coefficient is greater than a first threshold, the first threshold being a preset value for judging the size of the correlation; Step S2, performing a first classification on the relevant data according to the time series power generation data, determining an optimal number of classifications during the first classification process, and performing a second classification on the relevant data of each category after the first classification according to the relevant meteorological data; Step S3, using the relevant data of multiple different categories generated after the second classification as a training data set, and using the training data set to train and generate a first prediction model and a second prediction model through a machine learning algorithm; Step S4, obtaining target meteorological data of a target date, inputting the target meteorological data into the first prediction model and the second prediction model, outputting corresponding predicted power generation data according to the first prediction model, obtaining the prediction deviation of the predicted power generation data according to the second prediction model, obtaining corresponding actual power generation data after the target date, modifying the predicted power generation data according to the prediction deviation to obtain a revised predicted power generation range, judging whether the actual power generation data is within the predicted power generation range, if so, recording the actual power generation data, if not, marking the actual power generation data as abnormal data; Step S5, obtaining total power generation data of all normal actual power generation data within the target period and performing fee settlement for the user according to the total power generation data; Wherein, in the step S2, the relevant data is classified for the first time according to the time series power generation data, and the process of determining the optimal number of classifications during the first classification process includes the following steps: The time series power generation data is obtained, a first classification number s is preset, and the first classification number s is a positive integer greater than 1, and a change trend of each of the time series power generation data is obtained, and the time series power generation data with similar change trends are classified into one class, and an evaluation value f(s) is calculated when the time series power generation data is classified into s classes, and an evaluation value f(s+1) is calculated when the time series power generation data is classified into s+1 classes, and a first difference between the evaluation value f(s) and the evaluation value f(s+1) is calculated, and the first difference is compared with a first threshold value, and if the first difference is greater than or equal to the first difference, At the first threshold, the evaluation value classified into s+1 categories is smaller than the evaluation value classified into s categories, and the first difference is greater than the first threshold, and the evaluation value still has room to decrease, calculate the evaluation value f(s+2) when the time series power generation data is divided into s+2 categories, calculate the second difference between the evaluation value f(s+1) and the evaluation value f(s+2), compare the second difference with the first threshold, if the second difference is greater than or equal to the first threshold, repeat this step to calculate the third difference between the evaluation value f(s+2) and the evaluation value f(s+3), until the calculated difference is less than the first threshold.
2. The method according to claim 1, characterized in that The process of calculating the evaluation value f(s) when the time series power generation data is divided into s classes comprises the following steps: The number m of time series power generation data of the first category is obtained, and the first difference c1 between m-1 time series power generation data and the representative time series power generation data is calculated using the first formula, wherein the first formula is: ; Wherein, n is the number of time periods in a time series data, t represents the t-th time period, Wr(t) represents the power generation of the representative time series power generation data r in the t-th time period, Wm(t) represents the power generation of the time series power generation data m in the t-th time period, and the second difference c2 between m-1 time series power generation data and the representative time series power generation data is calculated using the second formula, and the second formula is: ; Wherein, ΔWr(t)=Wr(t)-Wr(t-1), ΔWm(t)=Wm(t)-Wm(t-1), and the total difference Cm between the mth time series power generation data and the representative time series power generation data is calculated using the third formula, which is: ; The difference of the first category is calculated using the fourth formula, which is: ; The evaluation value f(s) when the number of classifications is s is calculated using the fifth formula, which is: ; Among them, s is the number of categories, and Ci is the difference of the i-th category.
3. The method according to claim 1, characterized in that In step S2, the process of performing a second classification on the relevant data of each category after the first classification according to the relevant meteorological data includes the following steps: After the first classification, all the relevant meteorological data belonging to the same category are obtained, and some of the relevant meteorological data are selected from the relevant meteorological data as the first selected data. The first selected data are first classified into M categories for the second time, and the first representative meteorological data of each category after the second classification is calculated. Some of the relevant meteorological data are selected from the relevant meteorological data as the second selected data again, and the relevant meteorological data in the second selected data set are respectively classified into M categories, and the second representative meteorological data of each category is calculated again. It is determined whether the first representative meteorological data and the second representative meteorological data of each category are the same. If they are the same, the remaining unselected relevant meteorological data are continued to be classified into M categories. If they are not the same, the first selected data and the second selected data are reclassified, and this step is repeated until all relevant meteorological data are classified.
4. The method according to claim 3, characterized in that The process of calculating the first representative meteorological data of each category after the second classification includes the following steps: Obtain all relevant meteorological data belonging to the same category, and use the sixth formula to calculate the difference between any two pieces of the relevant meteorological data. The sixth formula is: ; Among them, q is the number of data in each relevant meteorological data, x i is the i-th data of the first relevant meteorological data, y i For the i-th data of the second relevant meteorological data, after obtaining the difference between each relevant meteorological data and all other relevant meteorological data, the sum of the differences of each data is calculated to obtain the minimum sum of the differences. The relevant meteorological data corresponding to the minimum sum of the differences is the first representative meteorological data.
5. The method according to claim 1, characterized in that In step S3, the process of using the training data set to train and generate the first prediction model and the second prediction model through a machine learning algorithm includes the following steps: Step S31, dividing the training data set into a first data set and a second data set, and further dividing the first data set into a first sub-data set and a second sub-data set according to a first ratio, wherein the first ratio refers to a ratio of the first sub-data set to the second sub-data set in the first sub-data set; Step S32: using the first sub-data set to generate a first prediction model through training by a machine learning algorithm, and also using the second data set to test the first prediction model to obtain a first accuracy of the first prediction model, and determining whether the first accuracy is greater than a preset second threshold; Step S33: If it is not greater than, return to step S31 to re-divide the first data set and increase the proportion of the first sub-data set during segmentation. If it is greater than, use the second sub-data set to generate a second prediction model through machine learning algorithm training, and the second prediction model is used to predict the prediction deviation of the first prediction model.
6. A financial robot, used to implement the method according to any one of claims 1 to 5, characterized in that: Includes the following modules: A data collection module is used to collect and store relevant data of each photovoltaic power generation user, wherein the relevant data includes time series power generation data and corresponding meteorological data, wherein the time series power generation data is the amount of photovoltaic power generation at every preset period, and the meteorological data includes solar radiation value, temperature, humidity, precipitation, wind direction and wind speed, calculate the correlation coefficient between each meteorological data and the power generation data, and obtain a plurality of relevant meteorological data whose correlation coefficient is greater than a first threshold value, wherein the first threshold value is a preset value for judging the size of the correlation; A data classification module, used for performing a first classification on the relevant data according to the time series power generation data, determining an optimal number of classifications during the first classification process, and performing a second classification on the relevant data of each category after the first classification according to relevant meteorological data; The process of first classifying the relevant data according to the time series power generation data and determining the optimal number of classifications during the first classification includes the following steps: The time series power generation data is obtained, a first classification number s is preset, and the first classification number s is a positive integer greater than 1, and a change trend of each of the time series power generation data is obtained, and the time series power generation data with similar change trends are classified into one class, and an evaluation value f(s) is calculated when the time series power generation data is classified into s classes, and an evaluation value f(s+1) is calculated when the time series power generation data is classified into s+1 classes, and a first difference between the evaluation value f(s) and the evaluation value f(s+1) is calculated, and the first difference is compared with a first threshold value, and if the first difference is greater than or equal to the first difference, At the first threshold, the evaluation value classified into s+1 categories is smaller than the evaluation value classified into s categories, and the first difference is greater than the first threshold, and the evaluation value still has room to decrease, calculate the evaluation value f(s+2) when the time series power generation data is divided into s+2 categories, calculate the second difference between the evaluation value f(s+1) and the evaluation value f(s+2), compare the second difference with the first threshold, if the second difference is greater than or equal to the first threshold, repeat this step to calculate the third difference between the evaluation value f(s+2) and the evaluation value f(s+3), until the calculated difference is less than the first threshold; A model training module, used to use the relevant data of multiple different categories generated after the second classification as a training data set, and use the training data set to train and generate a first prediction model and a second prediction model through a machine learning algorithm; a data marking module, which obtains target meteorological data of a target date, inputs the target meteorological data into the first prediction model and the second prediction model, outputs corresponding predicted power generation data according to the first prediction model, obtains the prediction deviation of the predicted power generation data according to the second prediction model, obtains corresponding actual power generation data after the target date, modifies the predicted power generation data according to the prediction deviation to obtain a revised predicted power generation range, determines whether the actual power generation data is within the predicted power generation range, and if so, records the actual power generation data, and if not, no longer marks the actual power generation data as abnormal data; The settlement module is used to obtain the total power generation data of all normal actual power generation data within the target period and settle fees for users based on the total power generation data.
