CN113361943A - Special transformer user electricity stealing detection method and system based on decision tree rule generation - Google Patents
Special transformer user electricity stealing detection method and system based on decision tree rule generation Download PDFInfo
- Publication number
- CN113361943A CN113361943A CN202110684430.XA CN202110684430A CN113361943A CN 113361943 A CN113361943 A CN 113361943A CN 202110684430 A CN202110684430 A CN 202110684430A CN 113361943 A CN113361943 A CN 113361943A
- Authority
- CN
- China
- Prior art keywords
- electricity stealing
- data
- electricity
- decision tree
- electrical
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 230000005611 electricity Effects 0.000 title claims abstract description 214
- 238000001514 detection method Methods 0.000 title claims abstract description 95
- 238000003066 decision tree Methods 0.000 title claims abstract description 66
- 238000000034 method Methods 0.000 claims abstract description 42
- 238000012549 training Methods 0.000 claims description 32
- 238000012360 testing method Methods 0.000 claims description 24
- 230000002159 abnormal effect Effects 0.000 claims description 19
- 238000013138 pruning Methods 0.000 claims description 17
- 230000006399 behavior Effects 0.000 claims description 15
- 239000006185 dispersion Substances 0.000 claims description 8
- 238000004590 computer program Methods 0.000 claims description 5
- 238000011835 investigation Methods 0.000 description 9
- 238000005070 sampling Methods 0.000 description 5
- 239000013598 vector Substances 0.000 description 5
- 238000011161 development Methods 0.000 description 4
- 230000018109 developmental process Effects 0.000 description 4
- 238000010586 diagram Methods 0.000 description 4
- 238000010801 machine learning Methods 0.000 description 4
- 230000003287 optical effect Effects 0.000 description 3
- 230000005856 abnormality Effects 0.000 description 2
- 150000001875 compounds Chemical class 0.000 description 2
- 235000019800 disodium phosphate Nutrition 0.000 description 2
- 230000000694 effects Effects 0.000 description 2
- 238000005516 engineering process Methods 0.000 description 2
- 230000003068 static effect Effects 0.000 description 2
- 230000032683 aging Effects 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 239000003245 coal Substances 0.000 description 1
- 238000000802 evaporation-induced self-assembly Methods 0.000 description 1
- 238000010248 power generation Methods 0.000 description 1
- 238000007781 pre-processing Methods 0.000 description 1
- 230000000630 rising effect Effects 0.000 description 1
- 238000012795 verification Methods 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q10/00—Administration; Management
- G06Q10/06—Resources, workflows, human or project management; Enterprise or organisation planning; Enterprise or organisation modelling
- G06Q10/063—Operations research, analysis or management
- G06Q10/0639—Performance analysis of employees; Performance analysis of enterprise or organisation operations
- G06Q10/06393—Score-carding, benchmarking or key performance indicator [KPI] analysis
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/21—Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
- G06F18/214—Generating training patterns; Bootstrap methods, e.g. bagging or boosting
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F18/00—Pattern recognition
- G06F18/20—Analysing
- G06F18/24—Classification techniques
- G06F18/243—Classification techniques relating to the number of classes
- G06F18/24323—Tree-organised classifiers
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06N—COMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
- G06N20/00—Machine learning
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06Q—INFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
- G06Q50/00—Information and communication technology [ICT] specially adapted for implementation of business processes of specific business sectors, e.g. utilities or tourism
- G06Q50/06—Energy or water supply
Landscapes
- Engineering & Computer Science (AREA)
- Business, Economics & Management (AREA)
- Theoretical Computer Science (AREA)
- Human Resources & Organizations (AREA)
- Physics & Mathematics (AREA)
- Data Mining & Analysis (AREA)
- General Physics & Mathematics (AREA)
- Economics (AREA)
- Artificial Intelligence (AREA)
- Evolutionary Computation (AREA)
- General Engineering & Computer Science (AREA)
- Computer Vision & Pattern Recognition (AREA)
- Strategic Management (AREA)
- Health & Medical Sciences (AREA)
- Marketing (AREA)
- Entrepreneurship & Innovation (AREA)
- Educational Administration (AREA)
- Development Economics (AREA)
- Evolutionary Biology (AREA)
- Bioinformatics & Computational Biology (AREA)
- General Business, Economics & Management (AREA)
- Tourism & Hospitality (AREA)
- Life Sciences & Earth Sciences (AREA)
- Bioinformatics & Cheminformatics (AREA)
- Software Systems (AREA)
- Primary Health Care (AREA)
- General Health & Medical Sciences (AREA)
- Water Supply & Treatment (AREA)
- Public Health (AREA)
- Medical Informatics (AREA)
- Mathematical Physics (AREA)
- Computing Systems (AREA)
- Game Theory and Decision Science (AREA)
- Operations Research (AREA)
- Quality & Reliability (AREA)
- Remote Monitoring And Control Of Power-Distribution Networks (AREA)
Abstract
The invention provides a special transformer user electricity stealing detection method and system based on decision tree rule generation. The method provided by the invention can quickly and accurately complete the classification and identification of the special transformer electricity stealing users and normal users according to the electrical indexes of each user, effectively improve the accuracy of electricity stealing detection, generate specific electricity stealing detection rules and conveniently eliminate the electricity stealing rules on the spot.
Description
Technical Field
The invention relates to the technical field of electricity stealing detection, in particular to a method and a system for detecting electricity stealing of a special transformer user based on decision tree rule generation.
Background
The electricity stealing process is a process that electricity consumption customers adopt illegal concealment means or other illegal behaviors to realize that the electricity consumption metering is smaller than the actual consumption. The electricity stealing process can pay less electricity consumption for electricity stealing customers, and under the drive of huge economic benefits, although China adopts measures of relevant laws such as 'electricity stealing law' and the like, improvement of electric energy meters and the like to prevent electricity stealing, electricity stealing behaviors are often prohibited. According to the relevant data, the electricity stolen by the national network company 2015 year by year reaches 20 hundred million kilowatt hours, if the electricity price is calculated according to the current electricity price of 0.58 yuan per kilowatt hour, the direct economic loss caused by the electricity is 11 billion yuan, which accounts for 10% of the annual profit paid by the national network company 2015 year, and the profit of the national network company 2015 year by one tenth is stolen. In addition, the damage of electricity stealing is very wide, and electricity stealing users modify electric energy meters and modify transmission lines privately, which easily causes electrical equipment faults, short circuits of lines and even casualties.
The electric larceny behavior is considerable in quantity and scale, electric larceny groups are specialized and diversified, and the electric larceny main body is not only provided with individual households and resident users, but also provided with personnel of enterprises and public institutions in part of China. Under the drive of huge economic benefits, the electricity stealing main bodies gradually spread from individuals to unit main bodies, wherein the electricity stealing rate of enterprises with relatively small scale is higher than that of other users, for example, seven to eight achievements in the annual electricity stealing phenomenon of a certain province concentrated by private enterprises in southeast province occur on private enterprises and township enterprises; the power stealing rates of public enterprises and public institutions are on the trend of rising year by year, for example, the refund amount of a large-scale national coal enterprise in a certain province is found to be as high as 300 ten thousand yuan after the power stealing; what is more frightened is that the users of the institutions and utilities start to participate in electricity stealing, and the number of the users increases year by year, for example, 13900 more times are checked from 2010 to 2015. The above examples show that the electricity stealing behavior in China is rampant day by day, the main body of electricity stealing is varied and punishment on the electricity stealing behavior is inevitable.
Disclosure of Invention
The invention provides a special transformer user electricity stealing detection method and system based on decision tree rule generation, which can quickly and efficiently detect the abnormity of power consumption data of a power grid user, and can generate electricity stealing detection rules for on-site investigation according to electric data collected by an intelligent electric meter.
The invention provides a special transformer user electricity stealing detection method based on decision tree rule generation, which comprises the following steps:
acquiring original electrical data of a user, and calculating an electrical index according to the original electrical data; wherein the electrical index comprises: out-of-limit frequency, ring ratio similarity, dispersion coefficient, power consumption amplitude, equivalent line impedance, three-phase unbalance, voltage deviation, power factor and abnormal frequency;
and inputting the electrical index into an electricity stealing detection model, and determining whether the electricity stealing behavior exists in the user corresponding to the electrical index.
Further, before inputting the electrical index into the electricity larceny detection model, the method further includes:
establishing an electricity stealing detection model; the method comprises the following steps:
calculating Gini coefficients of the electrical index under different threshold values;
and taking the electrical index with the minimum Gini coefficient as a root node characteristic, dividing the electrical index into two sample intervals according to the Gini coefficient of the electrical index, and generating each node of the decision tree according to the Gini coefficient corresponding to the electrical index through a preset rule.
Further, after generating each node of the decision tree according to the Gini coefficient corresponding to the electrical index through the preset rule, the method further includes:
and pruning the decision tree according to the cost complexity by a pruning strategy to optimize the electricity stealing detection model.
Further, after generating each node of the decision tree according to the Gini coefficient corresponding to the electrical index through the preset rule, the method further includes:
acquiring historical data, and dividing the historical data into training data and testing data; wherein the historical data comprises: the electricity stealing user labels corresponding to the electricity consumption data of the historical electricity stealing users and the electricity consumption data for identifying the electricity stealing users, and the normal user labels corresponding to the electricity consumption data of the historical normal users and the electricity consumption data for identifying the normal users;
training the electricity stealing detection model according to the training data;
testing the trained electricity stealing detection model according to the test data and calculating an error value; and when the error value is smaller than the preset error value, finishing training the electricity stealing detection model.
The second aspect of the present invention provides a system for detecting electricity stealing of a specific transformer user based on a decision tree rule generation, comprising:
the electric index module is used for acquiring original electric data of a user and calculating an electric index according to the original electric data; wherein the electrical index comprises: out-of-limit frequency, ring ratio similarity, dispersion coefficient, power consumption amplitude, equivalent line impedance, three-phase unbalance, voltage deviation, power factor and abnormal frequency;
and the electricity stealing behavior judging module is used for inputting the electrical indexes into an electricity stealing detection model and determining whether the electricity stealing behavior exists in the user corresponding to the electrical indexes.
Further, still include: the electricity stealing detection model establishing module is used for:
establishing an electricity stealing detection model; the method comprises the following steps:
calculating Gini coefficients of the electrical index under different threshold values;
and taking the electrical index with the minimum Gini coefficient as a root node characteristic, dividing the electrical index into two sample intervals according to the Gini coefficient of the electrical index, and generating each node of the decision tree according to the Gini coefficient corresponding to the electrical index through a preset rule.
Further, the electricity stealing detection model establishing module is further configured to:
and pruning the decision tree according to the cost complexity by a pruning strategy to optimize the electricity stealing detection model.
Further, the electricity stealing detection model establishing module is further configured to:
acquiring historical data, and dividing the historical data into training data and testing data; wherein the historical data comprises: the electricity stealing user labels corresponding to the electricity consumption data of the historical electricity stealing users and the electricity consumption data for identifying the electricity stealing users, and the normal user labels corresponding to the electricity consumption data of the historical normal users and the electricity consumption data for identifying the normal users;
training the electricity stealing detection model according to the training data;
testing the trained electricity stealing detection model according to the test data and calculating an error value; and when the error value is smaller than the preset error value, finishing training the electricity stealing detection model.
A third aspect of the present invention provides a terminal device, including:
one or more processors;
a memory coupled to the processor for storing one or more programs;
when executed by the one or more processors, cause the one or more processors to implement a method for detection of electricity theft for a specific subscriber based on decision tree rule generation as claimed in any one of the preceding claims.
A fourth aspect of the present invention provides a computer-readable storage medium having stored thereon a computer program for execution by a processor to implement the method for detecting electricity stealing by a specially-changed user based on decision tree rule generation as defined in any one of the above.
Compared with the prior art, the embodiment of the invention has the beneficial effects that:
the electricity stealing detection method for the special transformer user based on the decision tree rule generation, provided by the invention, uses the electricity stealing detection model obtained through machine learning training to automatically identify the electricity consumption data of the user input into the model, and the model can automatically determine whether the electricity consumption of the user is in an abnormal state. In the data-oriented method, the method provided by the invention can automatically identify users with abnormal electricity consumption from the huge amount of power grid data without manual identification, and can efficiently provide corresponding data for subsequent further electricity stealing detection, thereby improving the efficiency of electricity stealing detection. In addition, the invention can output the rule of electricity stealing detection, has higher electricity stealing detection accuracy and real investigation feasibility, and can be used for guiding the development of the actual electricity stealing investigation work.
Drawings
In order to more clearly illustrate the technical solution of the present invention, the drawings needed to be used in the embodiments will be briefly described below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a flow chart of a method for detecting electricity stealing of a specific transformer user based on decision tree rule generation according to an embodiment of the present invention;
FIG. 2 is a flowchart of a power stealing detection method for a specific transformer user based on decision tree rule generation according to another embodiment of the present invention;
FIG. 3 is a flowchart of a power stealing detection method for a specific transformer user based on decision tree rule generation according to another embodiment of the present invention;
FIG. 4 is a flow diagram of optimal decision tree generation provided by an embodiment of the present invention;
FIG. 5 is a diagram of an apparatus for a power stealing detection system for a specific transformer subscriber based on decision tree rule generation according to an embodiment of the present invention;
FIG. 6 is a diagram of an apparatus of a power stealing detection system for a specific transformer subscriber based on decision tree rule generation according to another embodiment of the present invention;
fig. 7 is a block diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be understood that the step numbers used herein are for convenience of description only and are not intended as limitations on the order in which the steps are performed.
It is to be understood that the terminology used in the description of the invention herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the invention. As used in the specification of the present invention and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
The terms "comprises" and "comprising" indicate the presence of the described features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
The term "and/or" refers to and includes any and all possible combinations of one or more of the associated listed items.
A first aspect.
Referring to fig. 1-2, an embodiment of the present invention provides a method for detecting electricity stealing of a specific transformer user based on a decision tree rule, including:
and S10, acquiring the original electrical data of the user, and calculating the electrical index according to the original electrical data.
Wherein the electrical index comprises: out-of-limit frequency, ring ratio similarity, dispersion coefficient, power consumption amplitude, equivalent line impedance, three-phase unbalance, voltage deviation, power factor and abnormal frequency.
In a specific embodiment, the out-of-limit frequency refers to the number of times that the three-phase voltage data of the special transformer user exceeds an allowable upper limit in an acquisition period, and the higher the out-of-limit frequency is, the higher the electricity utilization abnormal degree of the special transformer user is. Out-of-limit frequency of user iIs defined as:
wherein T represents the daily sampling frequency of the data; dstartRepresents the start date of the sample; dendIndicating an end date of the sampling;is a variable from 0 to 1, ifEqual to 0, representing the electrical sampling data of user i at d days tThe threshold is not out of limit, otherwise, the threshold is out of limit;representing the upper limit of allowable electrical sampling data.
The ring ratio similarity refers to the active power of the specific variable userAnd the lower the similarity of the ring ratio is, the more abnormal the electricity utilization rule of the day is compared with the electricity utilization rule of the previous day. Ring ratio similarity of user iIs defined as:
wherein D is the number of days taken, D ═ Dstart-Dend;Acquiring a vector for the electricity of the user i in d days; ρ (X, Y) is Pearson correlation coefficient; cov (X, Y) is the vector X and Y covariance; var (X) is the variance of vector X;
the discrete coefficient refers to the degree of dispersion of the electrical acquisition data, and generally speaking, users with large discrete coefficients have a high possibility of electrical abnormality. Discrete coefficient of user iCan be defined as:
ψ∈{E,UA,IA,UB,IB,UC,IC,P,Q}
The power consumption amplitude refers to the maximum value of the electrical collected data, and the power consumption amplitude of the user i is defined as
ψ∈{E,UA,IA,UB,IB,UC,IC,P,Q},t∈[1,T]
The equivalent line impedance reflects the degree of aging of the user power supply line. The larger the equivalent line impedance is, the more the power supply line of the electric power consumer is deteriorated, and the higher the possibility of abnormality occurrence is. Equivalent line impedance of user iIs defined as:
(ψ1,ψ2)∈{(UA,IA),(UB,IB),(UC,IC)},t∈[1,T-1]
the three-phase unbalance degree refers to the amplitude difference degree of three-phase current or voltage of a specially-changed user. If the unbalance of three phases is too high, the power loss of the user power supply line will increaseAnd can affect the safety of the power supply and the electricity utilization of the power consumers. Three-phase imbalance of user iIs defined as:
(ψ1,ψ2,ψ3)∈{(UA,UB,UC),(IA,IB,IC)}
The voltage deviation refers to the degree of deviation between the actual voltage of the user and the nominal voltage. The larger the voltage deviation degree is, the higher the probability of abnormal electricity utilization of the special transformer user is, and the voltage deviation of the user iCan be defined as:
ψ∈{UA,UB,UC},t∈[1,T]
The power factor is the ratio of active power to apparent power of an alternating current circuit, and the higher the power factor is, the more fully the power generation equipment can be utilized under a certain voltage and power of user electrical equipment.Power factor of user iCan be expressed as:
in the formula (I), the compound is shown in the specification,andrespectively the active power and the reactive power of the user i at d days and t moments.
The abnormal frequency refers to the number of the metering data as null values and the number of alarm events recorded by the electric meter, and the abnormal frequency F of the user inum(i) Is defined as:
in the formula (I), the compound is shown in the specification,andrespectively taking the number of null values and the number of times of the alarm events of the electric meter as various metering data of the user i;is a variable of 0-1 if the userif the metering data at d days and t times of i is empty, the metering data areIs 1, otherwise is 0.
And S30, inputting the electrical index into an electricity stealing detection model, and determining whether the electricity stealing behavior exists in the user corresponding to the electrical index.
In a specific embodiment, before the step S30, the method further includes:
and S20, establishing a power stealing detection model.
The step S20 includes:
and calculating Gini coefficients of the electrical index under different threshold values.
And taking the electrical index with the minimum Gini coefficient as a root node characteristic, dividing the electrical index into two sample intervals according to the Gini coefficient of the electrical index, and generating each node of the decision tree according to the Gini coefficient corresponding to the electrical index through a preset rule.
In a specific embodiment, after generating, according to a preset rule, each node of the decision tree according to the Gini coefficient corresponding to the electrical index, the method further includes:
and pruning the decision tree according to the cost complexity by a pruning strategy to optimize the electricity stealing detection model.
In another specific embodiment, after generating each node of the decision tree according to the Gini coefficient corresponding to the electrical index by using the preset rule, the method further includes:
acquiring historical data, and dividing the historical data into training data and testing data; wherein the historical data comprises: the electricity stealing user labels corresponding to the electricity consumption data of the historical electricity stealing users and the electricity consumption data for identifying the electricity stealing users, and the normal user labels corresponding to the electricity consumption data of the historical normal users and the electricity consumption data for identifying the normal users;
training the electricity stealing detection model according to the training data;
testing the trained electricity stealing detection model according to the test data and calculating an error value; and when the error value is smaller than the preset error value, finishing training the electricity stealing detection model.
In a specific embodiment, the electrical indexes obtained by calculation of each user are used as input features of the model, a complete decision tree model is established, Gini coefficients of the features under different thresholds are calculated, the minimum Gini is selected as a root node feature, then the samples are divided according to the size relation between the feature value of each sample and the threshold, one type is samples with the feature value larger than or equal to the threshold, and the other type is samples with the feature value smaller than the threshold. And by analogy, continuously selecting the division basis of different nodes according to the Gini coefficient to generate each node of the decision tree. The Gini coefficients are defined as follows:
in the formula, piThe different categories of the users are compared under each value for the characteristic i.
In another embodiment, a pruning strategy is adopted to prune the nodes of the decision tree, where the pruning criterion is the cost complexity α, which is calculated as follows:
where R (t) is the error cost of the leaf node, which is the product of the ratio of the leaf node error rate to the number of samples, R (T) represents the error cost of the pruned sub-tree, and N (T) is the number of nodes of the sub-tree.
The electricity stealing detection method for the special transformer user based on the decision tree rule generation, provided by the invention, uses the electricity stealing detection model obtained through machine learning training to automatically identify the electricity consumption data of the user input into the model, and the model can automatically determine whether the electricity consumption of the user is in an abnormal state. In the data-oriented method, the method provided by the invention can automatically identify users with abnormal electricity consumption from the huge amount of power grid data without manual identification, and can efficiently provide corresponding data for subsequent further electricity stealing detection, thereby improving the efficiency of electricity stealing detection. In addition, the invention can output the rule of electricity stealing detection, has higher electricity stealing detection accuracy and real investigation feasibility, and can be used for guiding the development of the actual electricity stealing investigation work.
In a specific embodiment, the present invention provides a method for detecting electricity stealing of a specific transformer user based on a decision tree rule, comprising:
step 1, inputting historical intelligent ammeter data of the searched electricity stealing special transformer user and normal special transformer user according to the user number;
step 2, calculating electrical indexes of each user, such as out-of-limit frequency, discrete coefficient, ring ratio similarity and the like, according to the collected electrical data to form user electrical characteristic vectors;
step 3, establishing a complete decision tree model based on the electric characteristic vector of the user and the label information of whether the electricity is stolen or not, so as to divide the electricity stealing and normal users;
step 4, pruning the nodes of the decision tree by adopting a pruning strategy, verifying the classification capability of the optimal decision tree by adopting a cross verification method, and ensuring the generalization capability of the decision tree;
step 5, adopting the generated optimal decision tree to predict each user on the test set;
and 6, outputting the electricity stealing detection rule which can be checked in the field.
In one embodiment, as shown in fig. 3, a specific flow of a power stealing detection method for a specific transformer user based on decision tree rule generation is provided. Referring to fig. 3, the technology for detecting electricity stealing of a dedicated transformer user based on the decision tree rule specifically includes steps S102 to S106, and the steps are specifically as follows:
step S102: preprocessing the original electrical data, respectively and randomly selecting a certain number of electricity stealing users and normal users, and dividing the original data into training set data and test set data to obtain the multiple groups of data.
Step S104: calculating the proposed electrical index, and inputting the electrical index into the electricity stealing detection model;
step S106: determining whether a user corresponding to the electricity consumption data has electricity stealing behavior according to the electricity stealing detection model; the detection model is obtained by training a decision tree by using a plurality of groups of data, the plurality of groups of data comprise a first class of data and a second class of data, and each group of data in the first class of data comprises: the electricity consumption data of the electricity stealing users and the electricity stealing user labels corresponding to the group of data are identified; each set of data in the second class of data comprises: the electricity consumption data of the normal users and the normal user labels corresponding to the group of data are identified.
Specifically, in step S102, historical meter data of the detected electricity stealing dedicated transformer users and other normal dedicated transformer users needs to be collected, the meter data should have basic characteristics of instantaneity and richness, the collection time of each user should be kept the same, and the sampling span of each user is generally at least 1 month;
in step S104, it is necessary to calculate each electrical index, specifically including an out-of-limit frequency, a ring ratio similarity, a dispersion coefficient, a power consumption amplitude coefficient, an equivalent line impedance, a three-phase imbalance, and the like, based on the collected various electrical data of the user;
in step S106, fig. 4 is a flowchart of generating an optimal decision tree model, where first, Gini coefficients of the features under different thresholds are calculated, the smallest Gini is selected as a root node feature, then a sample is divided, and division bases of different nodes are continuously selected according to the Gini coefficients, then, nodes of the decision tree are pruned by using a pruning strategy, and finally, according to the generated optimal decision tree, a user of the test set is predicted, a power stealing detection effect of the decision tree is evaluated, and a power stealing detection rule which can be investigated in the field is output.
Taking a special transformer user in a certain district in south China as an example, wherein electricity stealing users are 109 users, normal users are 172 users, in order to train a decision tree model and verify the electricity stealing detection effect of the obtained model, a training set and a test set are divided, wherein the training set comprises 129 normal users and 81 electricity stealing users, the test set comprises 43 normal users and 28 electricity stealing users, and the prediction result of the obtained model on the test set please refer to attached table 1.
TABLE 1
Predicting electricity stealing users | Predicting normal users | |
Actual electricity stealing subscriber | 23 | 5 |
Actual normal user | 4 | 39 |
The electricity stealing detection technology for the special transformer users based on the decision tree rule generation, provided by the invention, uses an electricity stealing detection model obtained through machine learning training to automatically identify the electricity consumption data of the users input into the model, and the model can automatically determine whether the electricity consumption of the users is in an abnormal state. In the data-oriented method, the method provided by the invention can automatically identify users with abnormal electricity consumption from the huge amount of power grid data without manual identification, and can efficiently provide corresponding data for subsequent further electricity stealing detection, thereby improving the efficiency of electricity stealing detection.
In addition, the invention can output the rule of electricity stealing detection, has higher electricity stealing detection accuracy and real investigation feasibility, and can be used for guiding the development of the actual electricity stealing investigation work.
Additional aspects and advantages of the invention will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by practice of the invention.
A second aspect.
Referring to fig. 5-6, an embodiment of the present invention provides a system for detecting electricity stealing of a specific transformer user based on a decision tree rule, including:
the electric index module 10 is used for acquiring original electric data of a user and calculating an electric index according to the original electric data; wherein the electrical index comprises: out-of-limit frequency, ring ratio similarity, dispersion coefficient, power consumption amplitude, equivalent line impedance, three-phase unbalance, voltage deviation, power factor and abnormal frequency.
And the electricity stealing behavior judging module 30 is used for inputting the electrical indexes into the electricity stealing detection model and determining whether the electricity stealing behavior exists in the user corresponding to the electrical indexes.
In a specific embodiment, the system for detecting electricity stealing of a dedicated transformer user based on decision tree rule generation further includes:
a power stealing detection model building module 20 for:
establishing an electricity stealing detection model; the method comprises the following steps:
calculating Gini coefficients of the electrical index under different threshold values;
and taking the electrical index with the minimum Gini coefficient as a root node characteristic, dividing the electrical index into two sample intervals according to the Gini coefficient of the electrical index, and generating each node of the decision tree according to the Gini coefficient corresponding to the electrical index through a preset rule.
In a specific embodiment, the electricity larceny detection model building module 20 is further configured to:
and pruning the decision tree according to the cost complexity by a pruning strategy to optimize the electricity stealing detection model.
In a specific embodiment, the electricity larceny detection model building module 20 is further configured to:
acquiring historical data, and dividing the historical data into training data and testing data; wherein the historical data comprises: the electricity stealing user labels corresponding to the electricity consumption data of the historical electricity stealing users and the electricity consumption data for identifying the electricity stealing users, and the normal user labels corresponding to the electricity consumption data of the historical normal users and the electricity consumption data for identifying the normal users;
training the electricity stealing detection model according to the training data;
testing the trained electricity stealing detection model according to the test data and calculating an error value; and when the error value is smaller than the preset error value, finishing training the electricity stealing detection model.
The electricity stealing detection system for the special transformer user based on the decision tree rule generation, provided by the invention, uses the electricity stealing detection model obtained through machine learning training to automatically identify the electricity consumption data of the user input into the model, and the model can automatically determine whether the electricity consumption of the user is in an abnormal state. In the data-oriented method, the method provided by the invention can automatically identify users with abnormal electricity consumption from the huge amount of power grid data without manual identification, and can efficiently provide corresponding data for subsequent further electricity stealing detection, thereby improving the efficiency of electricity stealing detection. In addition, the invention can output the rule of electricity stealing detection, has higher electricity stealing detection accuracy and real investigation feasibility, and can be used for guiding the development of the actual electricity stealing investigation work.
In a third aspect.
The present invention provides an electronic device, including:
a processor, a memory, and a bus;
the bus is used for connecting the processor and the memory;
the memory is used for storing operation instructions;
the processor is configured to invoke the operation instruction, and the executable instruction enables the processor to execute an operation corresponding to the specific change user electricity stealing detection method generated based on the decision tree rule as shown in the first aspect of the application.
In an alternative embodiment, an electronic device is provided, as shown in fig. 7, the electronic device 5000 shown in fig. 7 includes: a processor 5001 and a memory 5003. The processor 5001 and the memory 5003 are coupled, such as via a bus 5002. Optionally, the electronic device 5000 may also include a transceiver 5004. It should be noted that the transceiver 5004 is not limited to one in practical application, and the structure of the electronic device 5000 is not limited to the embodiment of the present application.
The processor 5001 may be a CPU, general purpose processor, DSP, ASIC, FPGA or other programmable logic device, transistor logic device, hardware component, or any combination thereof. Which may implement or perform the various illustrative logical blocks, modules, and circuits described in connection with the disclosure. The processor 5001 may also be a combination of processors implementing computing functionality, e.g., a combination comprising one or more microprocessors, a combination of DSPs and microprocessors, or the like.
The memory 5003 may be, but is not limited to, a ROM or other type of static storage device that can store static information and instructions, a RAM or other type of dynamic storage device that can store information and instructions, an EEPROM, a CD-ROM or other optical disk storage, optical disk storage (including compact disk, laser disk, optical disk, digital versatile disk, blu-ray disk, etc.), magnetic disk storage media or other magnetic storage devices, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer.
The memory 5003 is used for storing application program codes for executing the present solution, and the execution is controlled by the processor 5001. The processor 5001 is configured to execute application program code stored in the memory 5003 to implement the teachings of any of the foregoing method embodiments.
Among them, electronic devices include but are not limited to: mobile terminals such as mobile phones, notebook computers, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), in-vehicle terminals (e.g., in-vehicle navigation terminals), and the like, and fixed terminals such as digital TVs, desktop computers, and the like.
A fourth aspect.
The invention provides a computer readable storage medium, on which a computer program is stored, which when executed by a processor implements the method for detecting electricity stealing of a specific transformer user based on decision tree rule generation as shown in the first aspect of the present application.
Yet another embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored, which, when run on a computer, enables the computer to perform the corresponding content in the aforementioned method embodiments.
Claims (10)
1. A method for detecting electricity stealing of a special transformer user based on decision tree rule generation is characterized by comprising the following steps:
acquiring original electrical data of a user, and calculating an electrical index according to the original electrical data; wherein the electrical index comprises: out-of-limit frequency, ring ratio similarity, dispersion coefficient, power consumption amplitude, equivalent line impedance, three-phase unbalance, voltage deviation, power factor and abnormal frequency;
and inputting the electrical index into an electricity stealing detection model, and determining whether the electricity stealing behavior exists in the user corresponding to the electrical index.
2. The method for detecting electricity stealing of a specific transformer user based on decision tree rule generation as claimed in claim 1, wherein before inputting the electrical index into the electricity stealing detection model, the method further comprises:
establishing an electricity stealing detection model; the method comprises the following steps:
calculating Gini coefficients of the electrical index under different threshold values;
and taking the electrical index with the minimum Gini coefficient as a root node characteristic, dividing the electrical index into two sample intervals according to the Gini coefficient of the electrical index, and generating each node of the decision tree according to the Gini coefficient corresponding to the electrical index through a preset rule.
3. The method as claimed in claim 2, wherein after generating the nodes of the decision tree according to the Gini coefficients corresponding to the electrical indicators by the preset rules, the method further comprises:
and pruning the decision tree according to the cost complexity by a pruning strategy to optimize the electricity stealing detection model.
4. The method as claimed in claim 2, wherein after generating the nodes of the decision tree according to the Gini coefficients corresponding to the electrical indicators by the preset rules, the method further comprises:
acquiring historical data, and dividing the historical data into training data and testing data; wherein the historical data comprises: the electricity stealing user labels corresponding to the electricity consumption data of the historical electricity stealing users and the electricity consumption data for identifying the electricity stealing users, and the normal user labels corresponding to the electricity consumption data of the historical normal users and the electricity consumption data for identifying the normal users;
training the electricity stealing detection model according to the training data;
testing the trained electricity stealing detection model according to the test data and calculating an error value; and when the error value is smaller than the preset error value, finishing training the electricity stealing detection model.
5. A system for detecting electricity stealing of a specially-changed user based on decision tree rule generation is characterized by comprising:
the electric index module is used for acquiring original electric data of a user and calculating an electric index according to the original electric data; wherein the electrical index comprises: out-of-limit frequency, ring ratio similarity, dispersion coefficient, power consumption amplitude, equivalent line impedance, three-phase unbalance, voltage deviation, power factor and abnormal frequency;
and the electricity stealing behavior judging module is used for inputting the electrical indexes into an electricity stealing detection model and determining whether the electricity stealing behavior exists in the user corresponding to the electrical indexes.
6. The system of claim 5, wherein the system further comprises: the electricity stealing detection model establishing module is used for:
establishing an electricity stealing detection model; the method comprises the following steps:
calculating Gini coefficients of the electrical index under different threshold values;
and taking the electrical index with the minimum Gini coefficient as a root node characteristic, dividing the electrical index into two sample intervals according to the Gini coefficient of the electrical index, and generating each node of the decision tree according to the Gini coefficient corresponding to the electrical index through a preset rule.
7. The system for detecting electricity stealing of a specialized transformer user generated based on decision tree rules according to claim 6, wherein the electricity stealing detection model building module is further configured to:
and pruning the decision tree according to the cost complexity by a pruning strategy to optimize the electricity stealing detection model.
8. The system for detecting electricity stealing of a specialized transformer user generated based on decision tree rules according to claim 6, wherein the electricity stealing detection model building module is further configured to:
acquiring historical data, and dividing the historical data into training data and testing data; wherein the historical data comprises: the electricity stealing user labels corresponding to the electricity consumption data of the historical electricity stealing users and the electricity consumption data for identifying the electricity stealing users, and the normal user labels corresponding to the electricity consumption data of the historical normal users and the electricity consumption data for identifying the normal users;
training the electricity stealing detection model according to the training data;
testing the trained electricity stealing detection model according to the test data and calculating an error value; and when the error value is smaller than the preset error value, finishing training the electricity stealing detection model.
9. A terminal device, comprising:
one or more processors;
a memory coupled to the processor for storing one or more programs;
when executed by the one or more processors, cause the one or more processors to implement the method of detection of electricity theft for a specially-altered user generated based on decision tree rules of any one of claims 1 to 4.
10. A computer-readable storage medium having stored thereon a computer program, wherein the computer program is executed by a processor to implement the method for detecting electricity theft of a specific variant user based on decision tree rule generation according to any of claims 1 to 4.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110684430.XA CN113361943A (en) | 2021-06-21 | 2021-06-21 | Special transformer user electricity stealing detection method and system based on decision tree rule generation |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202110684430.XA CN113361943A (en) | 2021-06-21 | 2021-06-21 | Special transformer user electricity stealing detection method and system based on decision tree rule generation |
Publications (1)
Publication Number | Publication Date |
---|---|
CN113361943A true CN113361943A (en) | 2021-09-07 |
Family
ID=77535237
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202110684430.XA Pending CN113361943A (en) | 2021-06-21 | 2021-06-21 | Special transformer user electricity stealing detection method and system based on decision tree rule generation |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN113361943A (en) |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106355209A (en) * | 2016-09-07 | 2017-01-25 | 国网电力科学研究院武汉南瑞有限责任公司 | System and method for diagnosing electricity stealing on basis of decision tree algorithms |
CN108490288A (en) * | 2018-03-09 | 2018-09-04 | 华南师范大学 | A kind of stealing detection method and system |
CN110390472A (en) * | 2019-07-03 | 2019-10-29 | 浙江大学 | A kind of low-voltage customer multiplexing electric abnormality appraisal procedure based on data-driven method |
CN111343127A (en) * | 2018-12-18 | 2020-06-26 | 北京数安鑫云信息技术有限公司 | Method, device, medium and equipment for improving crawler recognition recall rate |
CN111428804A (en) * | 2020-04-01 | 2020-07-17 | 广东电网有限责任公司 | Random forest electricity stealing user detection method with optimized weighting |
US20210097449A1 (en) * | 2020-12-11 | 2021-04-01 | Intel Corporation | Memory-efficient system for decision tree machine learning |
-
2021
- 2021-06-21 CN CN202110684430.XA patent/CN113361943A/en active Pending
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN106355209A (en) * | 2016-09-07 | 2017-01-25 | 国网电力科学研究院武汉南瑞有限责任公司 | System and method for diagnosing electricity stealing on basis of decision tree algorithms |
CN108490288A (en) * | 2018-03-09 | 2018-09-04 | 华南师范大学 | A kind of stealing detection method and system |
CN111343127A (en) * | 2018-12-18 | 2020-06-26 | 北京数安鑫云信息技术有限公司 | Method, device, medium and equipment for improving crawler recognition recall rate |
CN110390472A (en) * | 2019-07-03 | 2019-10-29 | 浙江大学 | A kind of low-voltage customer multiplexing electric abnormality appraisal procedure based on data-driven method |
CN111428804A (en) * | 2020-04-01 | 2020-07-17 | 广东电网有限责任公司 | Random forest electricity stealing user detection method with optimized weighting |
US20210097449A1 (en) * | 2020-12-11 | 2021-04-01 | Intel Corporation | Memory-efficient system for decision tree machine learning |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
Gu et al. | Bad data detection method for smart grids based on distributed state estimation | |
Flueck et al. | A new power sensitivity method of ranking branch outage contingencies for voltage collapse | |
CN108198408B (en) | Self-adaptive anti-electricity-stealing monitoring method and system based on electricity information acquisition system | |
CN106505557B (en) | Remote measurement error identification method and device | |
CN111507611A (en) | Method and system for determining electricity stealing suspected user | |
Cheng et al. | Enhanced state estimation and bad data identification in active power distribution networks using photovoltaic power forecasting | |
CN113011481A (en) | Electric energy meter function abnormity evaluation method and system based on decision tree algorithm | |
Liu | FDI and employment by industry: A co-integration study | |
Yoon et al. | Deep learning-based method for the robust and efficient fault diagnosis in the electric power system | |
CN113408804A (en) | Electricity stealing behavior detection method, system, terminal equipment and storage medium | |
CN113361943A (en) | Special transformer user electricity stealing detection method and system based on decision tree rule generation | |
CN111932078A (en) | Risk user identification method based on measurement data multi-situation evaluation | |
CN115166625A (en) | Intelligent ammeter error estimation method and device | |
CN113065234B (en) | Batch reliability risk level assessment method and system for intelligent electric meters | |
CN115954956A (en) | Method and system for evaluating access capacity of distributed power supply of power distribution network | |
CN112649641B (en) | Electricity stealing user judging method based on electricity stealing characteristics | |
CN113092934B (en) | Single-phase earth fault judgment method and system based on clustering and LSTM | |
CN110873857A (en) | Intelligent electric energy meter running state evaluation method and system based on multi-source data fusion | |
CN115290798B (en) | Stability performance monitoring method and terminal of transformer oil chromatographic online monitoring device | |
CN112150036B (en) | Method and device for detecting gas theft of boiler gas user based on data driving | |
Hussin et al. | The Impact of Energy Consumption on Malaysia Gross Domestic Product | |
Madhu Kishore Devara et al. | Synchrophasor assisted power system state estimation with a quadratically‐decaying exponential criterion | |
CN115015829A (en) | Method, device and equipment for detecting abnormal operation of three-phase four-wire intelligent electric energy meter | |
Xiaofeng et al. | An Improved Decision Tree Algorithm for Electricity Theft Prediction and Analysis | |
CN116992384A (en) | Power consumer electricity larceny detection method and device, electronic equipment and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20210907 |