Electricity stealing detection and identification method based on Blending ensemble learning

Through the Blending integrated learning method, combined with ADASYN sampling and learner combination, the electricity theft detection model is constructed, which solves the problem of insufficient combination of station area and user detection in electricity theft detection technology, and improves the accuracy and detection efficiency of electricity theft user identification. , avoiding the risk of information leakage.

CN118626907APending Publication Date: 2024-09-10CHINA THREE GORGES UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410724564.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-05
Publication Date
2024-09-10

AI Technical Summary

Technical Problem

Existing electricity theft detection technology is difficult to fully integrate with user detection from the perspective of the distribution station area, resulting in incomplete analysis and the risk of information leakage, affecting the accuracy of identification of electricity theft users.

Method used

An electricity theft detection and identification method based on Blending integrated learning is adopted to obtain user power consumption data through sampling equipment. The ADASYN sampling method is used to process category imbalanced data, and the optimal combination of primary and meta-learners is selected to build a Blending integrated learning model. , identify power-stealing users, and conduct short-term power consumption forecasts and key verifications from the perspective of the Taiwan area.

Benefits of technology

Without sacrificing accuracy, it improves the accuracy of identifying power-stealing users, effectively avoids the risk of information leakage, improves detection efficiency, and can more accurately identify power-stealing users and detect suspected power-stealing areas.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118626907A
    Figure CN118626907A
Patent Text Reader

Abstract

The invention discloses an electricity larceny detection and identification method based on Blending ensemble learning. The method comprises the following steps: acquiring electricity consumption data of a user in real time by using sampling equipment; an ADASYN sampling method is adopted to process the power utilization data with unbalanced categories; performing selection through the primary learners, selecting an optimal primary learner combination, selecting the meta learner with the optimal performance through comparing the performance of the meta learners, fusing the advantages of different primary learners, and constructing a Blending ensemble learning model; based on a Blending ensemble learning model, performing short-term prediction on the electricity consumption of each transformer area in the next day based on historical data; key verification is carried out on the electricity stealing suspected districts of which the RSPE exceeds a threshold value; all users connected behind the electricity stealing suspicious transformer area are temporarily determined as suspicious users, processed data serve as input of the model, and electricity stealing user detection and recognition are completed through the constructed Blending integrated learning model; according to the method, the detection efficiency and the detection accuracy can be improved by combining court electricity larceny detection and user electricity larceny detection courts.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of power system operation safety, and in particular to a method for detecting and identifying electricity theft based on blending ensemble learning. Background Art

[0002] With the development of the economy, electricity has become an indispensable part of people's lives. In particular, in recent years, electricity consumption data has shown an explosive growth. With the continuous growth of electricity demand, abnormal electricity consumption detection has become particularly important. Electricity theft detection has become an important measure to ensure the benefits of power supply companies. Abnormal electricity consumption behavior of users not only affects the income of power supply companies, but also hinders the development of smart grids. Electricity sales are the main source of income for power supply companies, which are then invested in the construction of power stations, transmission lines, power supply equipment and the operation of power grids to maintain the stable operation and further development and growth of the entire power industry. The so-called smart grid is to analyze, utilize and make decisions on the electricity consumption data collected by the meter terminal through various technical means to achieve the purpose of improving resource utilization, maintaining safe and stable operation of the power grid, reducing transmission losses, and reducing environmental impact. However, abnormal electricity consumption behavior, mainly electricity theft, has seriously damaged the interests of power supply companies, disrupted the market electricity order, and also affected the stable operation of the power grid.

[0003] Domestic and foreign scholars have made different improvements to data-driven electricity theft detection technology, but few studies have been conducted from the perspective of distribution stations, and have not fully combined station detection with user detection, resulting in an incomplete analysis. Therefore, it is necessary to design an electricity theft detection and identification method based on blending ensemble learning to solve the above problems. Summary of the invention

[0004] The technical problem to be solved by the present invention is to provide a method for detecting and identifying electricity theft based on blending ensemble learning. The method is designed to address the problem that it is difficult to fully combine station area detection and user detection. Not only can the electricity theft user be accurately identified without sacrificing accuracy, but also the suspicious station area for electricity theft can be detected from the perspective of the station area, thereby improving the efficiency of detection. At the same time, the use of blending ensemble learning for identification can better avoid the risk of information leakage, and can effectively improve the accuracy of identifying electricity theft users.

[0005] In order to achieve the above technical effects, the technical solution adopted by the present invention is:

[0006] A method for detecting and identifying electricity theft based on blending ensemble learning, comprising:

[0007] S1, obtain user power consumption data through sampling equipment and build a user power consumption data set;

[0008] S2, uses the ADASYN sampling method to process the electricity consumption data constructed in S1, where the data set constructed in S1 has a class imbalance problem, that is, most of the user electricity consumption data sets have data skew problems such as the proportion of electricity theft users is far lower than that of normal users, and obtains a resampled data set;

[0009] S3, select the best primary learner combination through primary learners, compare the performance of meta-learners, select the best performing meta-learner to integrate the advantages of different primary learners, and build a blending ensemble learning model;

[0010] S4, through the constructed Blending ensemble learning model, makes a short-term prediction of the power consumption of each substation in the next day based on historical data;

[0011] S5, focus on checking suspected power theft areas where RSPE exceeds the threshold;

[0012] In S6, all users connected to the suspected electricity theft area are taken as detection objects, the data processed in S2 is used as the input of the model, and the electricity theft user detection and identification is completed through the Blending ensemble learning model constructed in S3.

[0013] Preferably, in step S1, when constructing the user power consumption data set, in order to ensure the adequacy of the power theft data, six types of power theft data are randomly generated according to the following six power theft modes to form a power theft data sample library; the power theft modes are as follows:

[0014] (1) Reduce the amount of electricity x in period t according to a fixed ratio α t , achieved through undervoltage method, undercurrent method and differential expansion method:

[0015] h1(x t )=αx t ,α∈(0.2,0.8);

[0016] (2) Reduce the power x according to the random threshold γ t , the amount of electricity above the threshold γ is fixed to γ, which is achieved by the differential expansion method:

[0017]

[0018] (3) All the electricity x in the random time period (t1, t2) t Set to 0, through the undervoltage method, undercurrent method and no table method to achieve:

[0019]

[0020] (4) According to the random threshold γ, the power x at any time t Setting to 0 can be achieved through undervoltage method, undercurrent method and tableless method:

[0021] h4(x t )=max{x t -γ,0};

[0022] (5) By reversing the power usage sequence, the power x t During the low electricity price period, the following can be achieved through phase shifting:

[0023] h5(x t )=x 49-t ;

[0024] (6) Take the average value of power consumption and use the undercurrent method, undervoltage method and phase shift method to achieve:

[0025] h6(x t )=mean(x).

[0026] Preferably, in step S2, using the ADASYN sampling method to process the unbalanced electricity consumption data includes:

[0027] S201, calculate the number of samples that need to be synthesized:

[0028] G=(m l -m s )×β;

[0029] Among them, m l is the number of samples in the majority class, m s is the number of minority class samples, β∈[0,1] is a random number. If β is equal to 1, the positive and negative ratio after sampling is 1:1;

[0030] S202, calculate the proportion r of the majority class among K nearest neighbors i :

[0031]

[0032] Among them, Δ i is the number of samples of the majority class in K nearest neighbors, i = 1, 2, 3, ..., m s ;

[0033] S203, for r i Standardized processing to obtain

[0034]

[0035] S204, according to the sample weight, calculate the number of new samples g that need to be generated for each minority class sample:

[0036]

[0037] In the formula, G represents the number of samples to be synthesized;

[0038] S205, calculate the number of each minority sample to be generated according to g, and generate samples according to the SMOTE algorithm:

[0039] s i =x i +(x zi -x i )×λ;

[0040] Among them, s i is a synthetic sample, x i is the i-th sample in the minority class, x zi is x i A random number of minority class sample λ∈[0,1] is randomly selected from the K nearest neighbors of .

[0041] Furthermore, ADASYN (adaptive synthetic sampling) is an adaptive synthesis algorithm. Based on the sample distribution, it uses weight distribution to generate different numbers of minority class samples for different minority class samples, which improves the overall performance of the model in the marginal area of ​​classification.

[0042] Preferably, in step S3, the best combination of primary learners is selected by comparing the performance of primary learners, and the best performing meta-learner is selected by comparing the performance of meta-learners to fuse different primary learners, and the specific steps of constructing the blending ensemble learning model are:

[0043] S301, select from four single learners KNN, LR, DT, SVM and six ensemble learners RF, AdaBoost, GBDT, XGBoost, LightGBM, CatBoost, a total of ten primary learners;

[0044] S302, using the resampled data sets as inputs of the primary learners in S301, respectively, to obtain the training results of each primary learner corresponding to the data sets, wherein the training result indicators include ACC value, F1_score value and ROC curve;

[0045] S303, adding diversity metrics based on the selected primary learners:

[0046] The above primary learners are subjected to dual diversity measurement methods of DF measurement and Q value measurement to select the primary learner combination with the best performance;

[0047] S304, training ten learners, namely KNN, LR, DT, SVM, RF, AdaBoost, GBDT, XGBoost, LightGBM and CatBoost, as meta-learners respectively, verifying the average ACC value, F1_score value and ROC curve of the trained models on the data set, and comparing and selecting the meta-learner with the best performance;

[0048] S305, construct a blending ensemble learning model.

[0049] Preferably, in step S4, a short-term forecast of the power consumption of the substation in the next day is performed, and the specific steps are as follows:

[0050] S501, reading the historical electricity consumption data of the substation area and the actual electricity consumption data for the next day;

[0051] S502, predicting the power consumption of the substation in the next day through the Blending ensemble learning model constructed in S3;

[0052] S503, comparing the predicted area power consumption data with the actual area power consumption data, and calculating RSPE;

[0053] S504: The substations with RSPE greater than the threshold are classified as suspected power theft substations, and users connected to the substations are subjected to focused detection.

[0054] Preferably, in step S5, the mathematical formula of RSPE is as follows:

[0055]

[0056] In the formula, k represents the station area number, represents the predicted active power at time t in the k-station area, It represents the actual active power at time t in station area k.

[0057] Preferably, in step S1, using a sampling device to obtain the user's power consumption data in real time includes:

[0058] The data sampling time interval is set to Pmin, the total collection time is not less than T days, the number of households collected is not less than Q households, and the collection object is the user's electricity consumption data.

[0059] Preferably, in step S3, the calculation method of the evaluation index for selecting the best base learner is:

[0060] The accuracy rate ACC indicates the ratio of all correctly classified samples to the total number of samples in the data set:

[0061]

[0062] Where TP represents the number of abnormal users correctly classified, FP represents the number of normal users incorrectly classified, TN represents the number of normal users correctly classified, FN represents the number of abnormal users incorrectly classified, TP+FP+TN+FN=total number of users;

[0063] The F1_score calculation method is:

[0064]

[0065] Where P is the precision rate, which means the ratio of samples correctly classified as abnormal users to the number of abnormal users; TPR means the ratio of samples correctly classified as abnormal users to the number of users predicted as abnormal users.

[0066] Compared with the prior art, the present invention has the following beneficial effects:

[0067] The present invention provides a method for detecting and identifying electricity theft based on blending ensemble learning, which can accurately identify electricity theft users without sacrificing accuracy, detect suspicious electricity theft stations from the perspective of stations, and improve the efficiency of detection; at the same time, using blending ensemble learning for identification can better avoid the risk of information leakage, and can effectively improve the accuracy of identifying electricity theft users. BRIEF DESCRIPTION OF THE DRAWINGS

[0068] Figure 1 It is a flow chart of the steps for detecting the radio area for stealing;

[0069] Figure 2 This is the principle diagram of the Blending strategy algorithm;

[0070] Figure 3 Flowchart of detection steps for electricity theft users;

[0071] Figure 4 This is a comparison chart between normal and abnormal areas. DETAILED DESCRIPTION

[0072] Embodiment 1:

[0073] like Figure 1 As shown, a method for detecting and identifying electricity theft based on blending ensemble learning includes:

[0074] S1, obtain user power consumption data through sampling equipment and build a user power consumption data set;

[0075] S2, using the ADASYN sampling method to process the class-imbalanced electricity consumption data to obtain a resampled data set;

[0076] S3, select the best primary learner combination through primary learners, compare the performance of meta-learners, select the best performing meta-learner to integrate the advantages of different primary learners, and build a blending ensemble learning model;

[0077] S4, through the constructed Blending ensemble learning model, makes a short-term prediction of the power consumption of each substation in the next day based on historical data;

[0078] S5, focus on checking suspected power theft areas where RSPE exceeds the threshold;

[0079] In S6, all users connected to the suspected electricity theft area are taken as detection objects, the data processed in S2 is used as the input of the model, and the electricity theft user detection and identification is completed through the Blending ensemble learning model constructed in S3.

[0080] Preferably, in step S1, when constructing the user power consumption data set, in order to ensure the adequacy of the power theft data, six types of power theft data are randomly generated according to the following six power theft modes to form a power theft data sample library; the power theft modes are as follows:

[0081] (1) Reduce the amount of electricity x in period t according to a fixed ratio α t , achieved through undervoltage method, undercurrent method and differential expansion method:

[0082] h1(x t )=αx t ,α∈(0.2,0.8);

[0083] (2) Reduce the power x according to the random threshold γ t , the amount of electricity above the threshold γ is fixed to γ, which is achieved by the differential expansion method:

[0084]

[0085] (3) All the electricity x in the random time period (t1, t2) t Set to 0, through the undervoltage method, undercurrent method and no table method to achieve:

[0086]

[0087] (4) According to the random threshold γ, the power x at any time t Setting to 0 can be achieved through undervoltage method, undercurrent method and tableless method:

[0088] h4(x t )=max{x t -γ,0};

[0089] (5) By reversing the power usage sequence, the power x tDuring the low electricity price period, the following can be achieved through phase shifting:

[0090] h5(x t )=x 49-t ;

[0091] (6) Take the average value of power consumption and use the undercurrent method, undervoltage method and phase shift method to achieve:

[0092] h6(x t )=mean(x).

[0093] Preferably, in step S2, using the ADASYN sampling method to process the unbalanced electricity consumption data includes:

[0094] S201, calculate the number of samples that need to be synthesized:

[0095] G=(m l -m s )×β;

[0096] Among them, m l is the number of samples in the majority class, m s is the number of minority class samples, β∈[0,1] is a random number. If β is equal to 1, the positive and negative ratio after sampling is 1:1;

[0097] S202, calculate the proportion r of the majority class among K nearest neighbors i :

[0098]

[0099] Among them, Δ i is the number of samples of the majority class in K nearest neighbors, i = 1, 2, 3, ..., m s ;

[0100] S203, for r i Standardized processing to obtain

[0101]

[0102] S204, according to the sample weight, calculate the number of new samples g that need to be generated for each minority class sample:

[0103]

[0104] In the formula, G represents the number of samples that need to be synthesized;

[0105] S205, calculate the number of each minority sample to be generated according to g, and generate samples according to the SMOTE algorithm:

[0106] s i =x i+(x zi -x i )×λ;

[0107] Among them, s i is a synthetic sample, x i is the i-th sample in the minority class, x zi is x i A random number of minority class sample λ∈[0,1] is randomly selected from the K nearest neighbors of .

[0108] Furthermore, ADASYN (adaptive synthetic sampling) is an adaptive synthesis algorithm. Based on the sample distribution, it uses weight distribution to generate different numbers of minority class samples for different minority class samples, which improves the overall performance of the model in the marginal area of ​​classification.

[0109] like Figure 2 As shown, preferably, in step S3, the best primary learner combination is selected by comparing the performance of the primary learners, and the best performing meta-learner is selected by comparing the performance of the meta-learners to fuse different primary learners, and the specific steps of constructing the blending ensemble learning model are:

[0110] S301, select from four single learners KNN, LR, DT, SVM and six ensemble learners RF, AdaBoost, GBDT, XGBoost, LightGBM, CatBoost, a total of ten primary learners;

[0111] S302, using the resampled data sets as inputs of the primary learners in S301, respectively, to obtain the training results of each primary learner corresponding to the data sets, wherein the training result indicators include ACC value, F1_score value and ROC curve;

[0112] S303, adding diversity metrics based on the selected primary learners:

[0113] The above primary learners are subjected to dual diversity measurement methods of DF measurement and Q value measurement to select the primary learner combination with the best performance;

[0114] S304, training ten learners, namely KNN, LR, DT, SVM, RF, AdaBoost, GBDT, XGBoost, LightGBM and CatBoost, as meta-learners respectively, verifying the average ACC value, F1_score value and ROC curve of the trained models on the data set, and comparing and selecting the meta-learner with the best performance;

[0115] S305, construct a blending ensemble learning model.

[0116] like Figure 3 As shown, preferably, in step S4, a short-term prediction of the power consumption of the substation in the next day is performed, and the specific steps are as follows:

[0117] S501, reading the historical electricity consumption data of the substation area and the actual electricity consumption data for the next day;

[0118] S502, predicting the power consumption of the substation in the next day through the Blending ensemble learning model constructed in S3;

[0119] S503, comparing the predicted area power consumption data with the actual area power consumption data, and calculating RSPE;

[0120] S504: The substations with RSPE greater than the threshold are classified as suspected power theft substations, and users connected to the substations are subjected to focused detection.

[0121] Preferably, in step S5, the mathematical formula of RSPE is as follows:

[0122]

[0123] In the formula, k represents the station area number, represents the predicted active power at time t in the k-station area, It represents the actual active power at time t in station area k.

[0124] Preferably, in step S1, using a sampling device to obtain the user's power consumption data in real time includes:

[0125] The data sampling time interval is set to Pmin, the total collection time is not less than T days, the number of households collected is not less than Q households, and the collection object is the user's electricity consumption data; the preferred sampling time scale is 30 minutes, that is, 48 ​​points a day; at least 500 days and no less than 5,000 households' data must be collected.

[0126] Preferably, in step S3, the calculation method of the evaluation index for selecting the best base learner is:

[0127] The accuracy rate ACC indicates the ratio of all correctly classified samples to the total number of samples in the data set:

[0128]

[0129] Where TP represents the number of abnormal users correctly classified, FP represents the number of normal users incorrectly classified, TN represents the number of normal users correctly classified, FN represents the number of abnormal users incorrectly classified, TP+FP+TN+FN=total number of users;

[0130] The F1_score calculation method is:

[0131]

[0132]

[0133] Where P is the precision rate, which means the ratio of samples correctly classified as abnormal users to the number of abnormal users; TPR means the ratio of samples correctly classified as abnormal users to the number of users predicted as abnormal users.

[0134] Embodiment 2:

[0135] The present invention is explained in detail in conjunction with the Irish data set and the accompanying drawings. The specific implementation steps are as follows S1: The experimental data set was released by the Irish Electricity and Sustainable Energy Authority in January 2012, including electricity usage reports of more than 6,000 Irish consumers for 535 days from 2009 to 2010; the sampling time interval is 30 minutes, as shown in Table 1 below:

[0136]

[0137] Table 1: Electricity usage report data table;

[0138] In Table 1, the first column is the user number, and each subsequent column D1, D2, D3, ... is the measurement time point.

[0139] S2, uses the ADASYN sampling method to process the unbalanced electricity consumption data. The mathematical formula of ADASYN is as follows:

[0140] (1) Calculate the number of samples that need to be synthesized. The formula is as follows:

[0141] G=(m l -m s )×β;

[0142] Among them, m l is the number of samples in the majority class, m s is the number of minority class samples, β∈[0,1] is a random number. If β is equal to 1, the positive and negative ratio after sampling is 1:1;

[0143] (2) Calculate the proportion of the majority class in K nearest neighbors. The formula is as follows:

[0144]

[0145] Among them, Δ i is the number of samples of the majority class in K nearest neighbors, i = 1, 2, 3, ..., m s ;

[0146] (3) For r iStandardization, the formula is as follows:

[0147]

[0148] (4) According to the sample weight, calculate the number of new samples required to generate each minority class sample. The formula is as follows:

[0149]

[0150] (5) Calculate the number of minority samples to be generated based on g, and generate samples based on the SMOTE algorithm. The formula is as follows:

[0151] s i =x i +(x zi -x i )×λ;

[0152] Among them, s i is a synthetic sample, x i is the i-th sample in the minority class, x zi is x i A random number of minority class sample λ∈[0,1] is randomly selected from the K nearest neighbors of .

[0153] S3, build the Blending ensemble learning model:

[0154] (1) Select the best base learner combination by comparing the performance of the base learners:

[0155] First, we consider four single learners KNN, LR, DT, SVM and six ensemble learners RF, AdaBoost, GBDT, XGBoost, LightGBM, CatBoost, and a total of 10 base learners for experiments. The data set is divided into a training set and a test set in a 70% and 30% manner for training and evaluating the model respectively. The ACC value and F1_score value are mainly considered, as shown in Table 2;

[0156] Secondly, considering the diversity measure between different base learners, the principle of selecting base learners for ensemble learning is “good but different”; therefore, the better the performance of different base learners and the greater the degree of diversity, the better the ensemble learning effect.

[0157] Primary Learner ACC F1_score KNN 0.9411 0.9681 LR 0.9092 0.9523 SVM 0.6264 0.7608 DT 0.9574 0.9769 RF 0.9608 0.9789 AdaBoost 0.9172 0.9557 GBDT 0.9628 0.9798 XGBoost 0.9694 0.9811 CatBoost 0.9748 0.9864 LightGBM 0.9721 0.9842

[0158] Table 2: Training results of 10 primary learners on the mixed dataset;

[0159] (2) By comparing the performance of meta-learners, the best meta-learner is selected to integrate the advantages of different base learners:

[0160] Based on the selected primary learner, the present invention trains the 10 learners initially compared as meta-learners respectively, compares the ACC value, F1_score value and average running time of the trained models on the data set, and selects the learner with the best performance as the meta-learner.

[0161] S4, based on the Blending ensemble learning model, makes a short-term prediction of the power consumption of each substation in the next day based on historical data. The specific steps are as follows:

[0162] Step 1: Read the historical electricity consumption data of the substation and the actual electricity consumption data for the next day;

[0163] Step 2: Use the Blending ensemble learning model to predict the power consumption of the substation in the next day;

[0164] Step 3: Compare the predicted area power consumption data with the actual area power consumption data and calculate RSPE;

[0165] Step 4: The substations with RSPE greater than the threshold are classified as suspected power theft substations, and the users connected behind the substations are focused on detection.

[0166] S5: Focus on checking suspected power theft areas where RSPE exceeds the threshold:

[0167] The mathematical formula for RSPE is as follows:

[0168]

[0169] Where k represents the station area number, represents the predicted active power at time t in the k-station area, It represents the actual active power at time t in station area k.

[0170] According to experimental experience, the area with an error threshold exceeding 10% is determined to be an abnormal area, as shown in Table 3:

[0171] Area No. RSPE Area No. RSPE Area No. RSPE 1 3.89 9 0.87 17 11.72 2 2.41 10 2.78 18 4.09 3 1.32 11 2.86 19 15.63 4 5.47 12 3.23 20 0.59 5 0.95 13 30.54 21 2.53 6 0.19 14 7.69 22 8.79 7 4.11 15 4.27 23 0.49 8 13.18 16 1.22 24 12.14

[0172] Table 3: RSPE values ​​in different areas

[0173] It can be seen from Table 3 that the RSPE of substations 8, 13, 17, 19 and 24 is greater than 10%; the final test results show that the electricity users connected to the above substations are suspected of stealing electricity.

[0174] S6: For all users connected to the suspected electricity theft area, the data processed in S2 is used as the input of the model, and the electricity theft user detection and identification is completed through the Blending ensemble learning model constructed in S3.

[0175] like Figure 4 Shown is a time-to-power consumption curve comparison of the predicted power consumption and actual power consumption of normal and abnormal substations; it can be seen that in the prediction made by the method provided in the present application, the actual power consumption and the predicted power consumption of the normal substation are basically the same, while the actual power consumption and the predicted power consumption of the abnormal substation are quite different during the peak power consumption period between 12 o'clock and 24 o'clock at night, and the presence of power theft can be seen from the detection results.

Claims

1. A method for detecting and identifying electricity theft based on blending ensemble learning, characterized in that: include: S1, obtain user power consumption data through sampling equipment and build a user power consumption data set; S2, using the ADASYN sampling method to process the class-imbalanced electricity consumption data to obtain a resampled data set; S3, select the best primary learner combination through primary learners, compare the performance of meta-learners, select the best performing meta-learner to integrate the advantages of different primary learners, and build a blending ensemble learning model; S4, through the constructed Blending ensemble learning model, makes a short-term prediction of the power consumption of each substation in the next day based on historical data; S5, focus on checking suspected power theft areas where RSPE exceeds the threshold; In S6, all users connected to the suspected electricity theft area are taken as detection objects, the data processed in S2 is used as the input of the model, and the electricity theft user detection and identification is completed through the Blending ensemble learning model constructed in S3.

2. According to the method for detecting and identifying electricity theft based on blending ensemble learning in claim 1, it is characterized in that: In step S1, when constructing the user power consumption data set, in order to ensure the adequacy of the amount of power theft data, six types of power theft data are randomly generated according to the following six power theft modes to form a power theft data sample library; the power theft modes are as follows: (1) Reduce the amount of electricity x in period t according to a fixed ratio α t , achieved through undervoltage method, undercurrent method and differential expansion method: h1(x t )=αx t ,α∈(0.2,0.8); (2) Reduce the power x according to the random threshold γ t , the amount of electricity above the threshold γ is fixed to γ, which is achieved by the differential expansion method: (3) All the electricity x in the random time period (t1, t2) t Set to 0, through the undervoltage method, undercurrent method and no table method to achieve: (4) According to the random threshold γ, the power x at any time t Setting to 0 can be achieved through undervoltage method, undercurrent method and tableless method: h4(x t )=max{x t -γ,0}; (5) By reversing the power usage sequence, the power x t During the low electricity price period, the following can be achieved through phase shifting: h5(x t )=x 49-t ; (6) Take the average value of power consumption and use the undercurrent method, undervoltage method and phase shift method to achieve: h6(x t )=mean(x)。 3. According to the method of detecting and identifying electricity theft based on blending ensemble learning in claim 1, it is characterized in that: In step S2, using the ADASYN sampling method to process the unbalanced electricity consumption data includes: S201, calculate the number of samples that need to be synthesized: G=(m l -m s )×β; Among them, m l is the number of samples in the majority class, m s is the number of minority class samples, β∈[0,1] is a random number. If β is equal to 1, the positive and negative ratio after sampling is 1:1; S202, calculate the proportion r of the majority class among K nearest neighbors i : Where Δi is the number of majority class samples in K nearest neighbors, i = 1, 2, 3, ..., m s ; S203, for r i Standardized processing to obtain S204, according to the sample weight, calculate the number of new samples g that need to be generated for each minority class sample: In the formula, G represents the number of samples that need to be synthesized; S205, calculate the number of each minority sample to be generated according to g, and generate samples according to the SMOTE algorithm: s i =x i +(x zi -x i )×λ; Among them, s i is a synthetic sample, x i is the i-th sample in the minority class, x zi is x i A random number of minority class sample λ∈[0,1] is randomly selected from the K nearest neighbors of .

4. According to the method for detecting and identifying electricity theft based on blending ensemble learning in claim 1, it is characterized in that: In step S3, the best combination of primary learners is selected by comparing the performance of primary learners, and the best performing meta-learner is selected by comparing the performance of meta-learners to fuse different primary learners. The specific steps of constructing the blending ensemble learning model are as follows: S301, select from four single learners KNN, LR, DT, SVM and six ensemble learners RF, AdaBoost, GBDT, XGBoost, LightGBM, CatBoost, a total of ten primary learners; S302, using the resampled data sets as inputs of the primary learners in S301, respectively, to obtain the training results of each primary learner corresponding to the data sets, wherein the training result indicators include ACC value, F1_score value and ROC curve; S303, adding diversity metrics based on the selected primary learners: The above primary learners are subjected to dual diversity measurement methods of DF measurement and Q value measurement to select the primary learner combination with the best performance; S304, training ten learners, namely KNN, LR, DT, SVM, RF, AdaBoost, GBDT, XGBoost, LightGBM and CatBoost, as meta-learners respectively, verifying the average ACC value, F1_score value and ROC curve of the trained models on the data set, and comparing and selecting the meta-learner with the best performance; S305, construct a blending ensemble learning model.

5. According to the method of detecting and identifying electricity theft based on blending ensemble learning in claim 1, it is characterized in that: In step S4, a short-term forecast of the power consumption of the substation in the next day is performed, and the specific steps are as follows: S501, reading the historical electricity consumption data of the substation area and the actual electricity consumption data for the next day; S502, predicting the power consumption of the substation in the next day through the Blending ensemble learning model constructed in S3; S503, comparing the predicted area power consumption data with the actual area power consumption data, and calculating RSPE; S504: The substations with RSPE greater than the threshold are classified as suspected power theft substations, and users connected to the substations are subjected to focused detection.

6. According to the method of detecting and identifying electricity theft based on blending ensemble learning in claim 1, it is characterized in that: In step S5, the mathematical formula of RSPE is as follows: In the formula, k represents the station area number, represents the predicted active power at time t in the k-station area, It represents the actual active power at time t in station area k.

7. The method for detecting and identifying electricity theft based on blending ensemble learning according to claim 1 is characterized in that: In step S1, using a sampling device to obtain the user's power consumption data in real time includes: The data sampling time interval is set to Pmin, the total collection time is not less than T days, the number of households collected is not less than Q households, and the collection object is the user's electricity consumption data.

8. The method for detecting and identifying electricity theft based on blending ensemble learning according to claim 4 is characterized in that: In step S3, the calculation method of the evaluation index for selecting the best base learner is: The accuracy rate ACC indicates the ratio of all correctly classified samples to the total number of samples in the data set: Where TP represents the number of abnormal users correctly classified, FP represents the number of normal users incorrectly classified, TN represents the number of normal users correctly classified, FN represents the number of abnormal users incorrectly classified, TP+FP+TN+FN=total number of users; The F1_score calculation method is: Where P is the precision rate, which means the ratio of samples correctly classified as abnormal users to the number of abnormal users; TPR means the ratio of samples correctly classified as abnormal users to the number of users predicted as abnormal users.