Electricity stealing detection method based on logistic regression and intelligent measurement switch
By using a logistic regression-based electricity theft detection method, the method extracts the electricity consumption decline trend and line loss index from the measured switch meter data, constructs an electricity theft identification sample dataset, and trains a logistic regression model. This solves the problems of low accuracy and resource waste in existing electricity theft detection methods, and achieves accurate detection of electricity theft.
Patent Information
- Application Number
- CN202411031003.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-30
- Publication Date
- 2024-11-15
AI Technical Summary
Existing methods for detecting electricity theft rely on manual inspection, resulting in low accuracy. Furthermore, the weights of the input indicators for the models depend on expert experience, leading to a high rate of false alarms and false negatives, and making it impossible to quickly locate users who steal electricity.
A logistic regression-based electricity theft detection method is adopted. By acquiring data from the measured switching electricity meter, the power consumption decline trend, line loss index, and alarm frequency index are extracted to construct an electricity theft identification sample dataset, train a logistic regression model, and achieve accurate detection of electricity theft.
It enables accurate detection of electricity theft by any user within the low-voltage distribution area of the measuring switch, reducing resource waste and improving detection accuracy.
Smart Images

Figure CN118965112A_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of power theft detection, and in particular relates to a power theft detection method based on logistic regression and an intelligent measuring switch. Background Art
[0002] Traditional methods of preventing electricity theft mainly rely on regular inspections, regular calibration of electricity meters, and user reports of electricity theft to detect electricity theft or metering device failures. However, this method is too dependent on people and the goal of catching leaks is unclear. At present, the power supply bureau uses marketing auditors, electricity inspection personnel, and metering staff to use the metering abnormality alarm function and electricity data query function to carry out user online monitoring, and establishes data analysis models by collecting data such as power abnormalities, load abnormalities, terminal alarms, master station alarms, and line loss abnormalities to monitor electricity theft users in real time and detect metering equipment failures. According to the current, voltage, load data, etc. related to the customer's metering point before and after the alarm event, an indicator-weighted electricity consumption abnormality analysis model is constructed to check whether the customer has electricity theft, illegal electricity use, and metering device failures.
[0003] Although the above-mentioned anti-electricity theft diagnosis method can obtain certain data of user abnormalities, it is unable to quickly locate the leakage user due to too many false alarms or missed alarms at the terminal, which often leaves auditors at a loss. Moreover, when using this method to build a model, the weight of the model input indicator requires the knowledge and experience of experts to judge, which is very subjective and has obvious defects. Summary of the invention
[0004] In view of the above-mentioned deficiencies in the prior art, the present invention provides a method for detecting electricity theft based on logistic regression and an intelligent measuring switch, which extracts the relationship between the user's electricity consumption decline trend index, line loss index and alarm number index and the user's electricity theft behavior through a logistic regression model, thereby realizing the detection and identification of the electricity theft behavior of the electricity user, and solving the problem of false reporting and missing reporting caused by insufficient accuracy of the existing electricity theft detection method.
[0005] In order to achieve the above-mentioned object of the invention, the technical solution adopted by the present invention is:
[0006] On the one hand, the present invention provides a method for detecting electricity theft based on logistic regression, comprising the following steps:
[0007] S1. Obtain meter reading data of all the meters under the measuring switch, and pre-process the meter reading data to obtain a data set for electricity theft analysis;
[0008] S2. Extract the power consumption decline trend index, line loss index and alarm number index corresponding to the user profile data on the power theft analysis base date based on the power theft analysis data set;
[0009] S3. Combine the power consumption decline trend index, line loss index and alarm number index corresponding to each user's archive data on the power theft analysis base date with the user's power theft tag to obtain a number of power theft identification sample data, and construct a power theft identification sample data set;
[0010] S4. Training and testing the electricity theft classification prediction model based on the electricity theft identification sample data set to obtain a trained electricity theft classification prediction model;
[0011] S5. Obtain the electricity theft analysis features of the user to be analyzed for electricity theft, and perform electricity theft classification and identification on the electricity theft analysis features based on the trained electricity theft classification prediction model to obtain electricity theft detection results.
[0012] The beneficial effects of the present invention are as follows: a method for detecting electricity theft based on logistic regression provided by the present invention obtains an electricity theft analysis data set by acquiring and preprocessing the meter reading data of all the electricity meters under the measuring switch, thereby providing a power grid-related data basis for detecting and identifying users who may theoretically commit electricity theft; by extracting the electricity consumption decline trend index, line loss index and alarm number index corresponding to the user profile data on the electricity theft analysis base date, an electricity theft identification sample data set is constructed, which provides a basis for training a logistic regression model to extract the characteristic relationship between the three types of indicators and the user's electricity theft label, and obtain an electricity theft classification prediction model; based on the electricity theft classification prediction model, electricity theft classification detection is implemented for any electricity theft analysis day of the user to be analyzed for electricity theft, and its electricity theft detection result is obtained. The method of the present invention comprehensively considers the electricity consumption decline trend index, line loss index and alarm number index, and can realize accurate detection of electricity theft behavior of any user at any time in the low-voltage area of the measuring switch.
[0013] Furthermore, the S1 comprises the following steps:
[0014] S11, obtaining meter reading data of all the meters under the measuring switch, wherein the meter reading data includes power load data at different times, terminal alarm data, penalty data for breach of contract and electricity theft, and user file data, and the meter reading data are all data independently archived based on user file data;
[0015] S12, based on the user file data, select the user file data of non-electricity theft monitoring objects to establish an electricity whitelist, and construct a first pre-processed data set based on the read data of the electric meter corresponding to the user file data in the non-electricity whitelist;
[0016] S13, filtering and deleting the meter reading data corresponding to holidays in the first preprocessing data set to obtain a second preprocessing data set;
[0017] S14. If the meter reading data of each meter in the second preprocessed data set has missing data items, and the number of missing data items is less than a preset data missing item number threshold, interpolation is used to fill in the missing meter reading data to obtain an electricity theft analysis data set.
[0018] The beneficial effects of adopting the above further scheme are as follows: the present invention provides a method for obtaining an electricity theft analysis data set, and through the meter reading data of all the meters hanging under the measuring switch, it is possible to independently file the power grid related data of each user based on the user profile data, so as to facilitate the accurate execution of electricity theft behavior detection for users in the low-voltage power area to which the measuring switch belongs. By obtaining the electric load data, terminal alarm data and breach of contract electricity theft penalty data from the meter, it is possible to provide a basis for the corresponding extraction of electricity consumption downward trend indicators, line loss indicators and alarm number indicators. By establishing an electricity whitelist, it is possible to effectively narrow the scope of electricity theft detection, avoid unnecessary waste of resource costs for electricity theft detection, and increase the feasibility and accuracy of electricity theft detection by filling the difference of the limited and fewer missing items in the meter reading data.
[0019] Furthermore, S2 comprises the following steps:
[0020] S21, selecting a base date for electricity theft analysis, and using the period from N days before the base date to N days after the electricity theft analysis date as a window period for electricity theft analysis;
[0021] S22, based on the power load data in the data read by each electric meter in the power theft analysis data set, calculate the power consumption change rate within the power theft analysis window period;
[0022] The calculation expression of the electricity consumption change rate during the electricity theft analysis window period is as follows:
[0023]
[0024] Among them, k i represents the rate of change of electricity consumption on the ith day during the electricity theft analysis window, l represents the number of days for electricity theft analysis, and f l represents the electricity consumption data on the first day, Indicates the average power consumption data during the power theft analysis window period. represents the average number of electricity theft analysis days within the electricity theft analysis window period, f i represents the electricity consumption data of the i-th day, l i represents the i-th day in the electricity theft analysis window period;
[0025] S23. According to the electricity consumption change rate during the electricity theft analysis window period, the number of days on which the electricity consumption change rate of the current day is lower than that of the previous day is counted, and an electricity consumption decrease trend indicator corresponding to the user profile data is obtained;
[0026] The calculation expression of the power consumption downward trend indicator is as follows:
[0027]
[0028] Among them, T represents the downward trend index of electricity consumption during the electricity theft analysis window period, and D i represents the downward trend indicator on the i-th day, where i∈[-N,N];
[0029] S24, extracting the line-user topology relationship based on the user profile data in the electricity theft analysis data set, and calculating the line loss rate;
[0030] The calculation expression of the line loss rate is as follows:
[0031]
[0032] Among them, t l represents the line loss rate on the first day, s l represents the power supply of the line on the first day, Σ m f l (m) represents the total power consumption of users on the line on the lth day, and m represents the mth user;
[0033] S25. Statistical average line loss rate V from the start of the electricity theft analysis window to the electricity theft analysis base date i 1 The average line loss rate V from the electricity theft analysis base date to the end of the electricity theft analysis window period i 2 , get the line loss index corresponding to the user profile data;
[0034] The calculation expression of the line loss index corresponding to the user profile data is as follows:
[0035]
[0036] Where E(i) represents the line loss index corresponding to the user profile data on the i-th day;
[0037] S26. Based on the terminal alarm data of the meter reading data in the electricity theft analysis data set, the total number of terminal alarms on the electricity theft analysis base day corresponding to the user file data is obtained, and used as the alarm number indicator corresponding to the user file data.
[0038] The beneficial effect of adopting the above further scheme is: the present invention provides a method for extracting the electricity consumption decline trend index, line loss index and alarm number index corresponding to the user profile data based on the electricity theft analysis base date and the electricity theft analysis window period, which provides a basis for combining the user's electricity theft tag on the electricity theft analysis base date to form electricity theft identification sample data and constructing an electricity theft identification sample data set.
[0039] Furthermore, the user electricity theft tag includes a user electricity theft occurrence tag and a user electricity non-theft tag.
[0040] The beneficial effect of adopting the above further scheme is as follows: in the present invention, user electricity theft tags are divided into user electricity theft occurrence tags and user electricity non-theft tags, and electricity theft identification sample data is formed by combining the electricity consumption decline trend index, line loss index and alarm number index corresponding to each user's archive data on the electricity theft analysis base date with the user's electricity theft tag, so as to facilitate the logistic regression model to extract the characteristic relationship between the three types of indicator data and the user's electricity theft tag classification, and provide a basis for obtaining an electricity theft classification prediction model based on the electricity theft identification sample data set.
[0041] Furthermore, the S4 comprises the following steps:
[0042] S41, dividing the electricity theft identification sample data set into a training set and a test set;
[0043] S42. Train and test the logistic regression model based on the training set and the test set to obtain a trained electricity theft classification prediction model.
[0044] The beneficial effect of adopting the above further scheme is: dividing the electricity theft identification sample data set into a training set and a test set can realize the effective training and testing of the logistic regression model, thereby providing a basis for obtaining an electricity theft classification prediction model that meets the electricity theft identification accuracy.
[0045] Further, the S42 comprises the following steps:
[0046] S421. Assume that the electricity theft identification sample data in the training set obeys Bernoulli distribution;
[0047] S422, assuming that the probability of selecting the electricity theft identification sample data in the training set is a sigmoid function;
[0048] The calculation expression of the probability of selecting the electricity theft identification sample data in the training set is as follows:
[0049]
[0050] Among them, σ(x) represents the probability of selecting the electricity theft identification sample data in the training set, e represents the exponential basis constant, w represents the electricity theft identification learning parameter, T represents the transposition, and x represents the electricity theft identification sample data in the training set;
[0051] S423, inputting the electricity theft identification sample data in the selected training set as electricity theft identification features into the logistic regression model for batch training, and obtaining an electricity theft classification prediction model after the batch training is completed;
[0052] The calculation expression of the electricity theft classification prediction model is as follows:
[0053]
[0054] Among them, y represents the classification result of electricity theft identification, ∈ represents belonging to, ET represents the electricity theft category, NET represents the non-electricity theft category, and P(y|x,w) represents the probability of electricity theft identification classification;
[0055] S424, selecting electricity theft identification sample data in the test set to test the electricity theft classification prediction model after batch training, until the accuracy of the test result reaches the accuracy threshold, or the batch training times reaches the training times threshold, to obtain a trained electricity theft classification prediction model.
[0056] The beneficial effects of adopting the above further scheme are as follows: the present invention provides a method for training and testing a logistic regression model through a sample data set for electricity theft identification, as well as a method for calculating an electricity theft classification prediction model, which detects and classifies electricity theft based on the probability value of electricity theft identification classification, and can accurately and effectively detect electricity theft based on the electricity consumption downward trend indicator, line loss indicator and alarm number indicator.
[0057] Furthermore, the S5 comprises the following steps:
[0058] S51, selecting an electricity theft analysis day for the user to be analyzed for electricity theft;
[0059] S52, based on the electricity theft analysis day, taking the period from N days before the electricity theft analysis day to N days after the electricity theft analysis day as the electricity theft analysis window period;
[0060] S53, based on the power theft analysis window period, obtaining the power consumption decrease trend index, line loss index and alarm number index corresponding to the user profile data of the user to be analyzed for power theft as the power theft analysis feature;
[0061] S54, inputting the features to be analyzed for electricity theft into the trained electricity theft classification prediction model to perform electricity theft classification and identification, and obtaining electricity theft detection results.
[0062] The beneficial effects of adopting the above further scheme are as follows: the present invention provides a method for classifying and identifying electricity theft by using an electricity theft classification prediction model to analyze the electricity theft characteristics of a user to be analyzed for electricity theft. By setting an electricity theft analysis day and an electricity theft analysis window period through reading data from an electric meter of the user to be analyzed for electricity theft, an electricity consumption decrease trend indicator, a line loss indicator, and an alarm number indicator corresponding to the user profile data of the user to be analyzed for electricity theft can be extracted. The electricity theft analysis characteristics formed based on the three types of indicators are input into the electricity theft classification prediction model, so that electricity theft detection can be realized for the user to be analyzed for electricity theft, and the corresponding electricity theft detection result can be obtained. The feature extraction and analysis of the three types of indicators based on the trained electricity theft classification prediction model can realize accurate identification and detection of electricity theft behavior.
[0063] On the other hand, the present invention also provides a measuring switch for a power theft detection method based on logistic regression, comprising:
[0064] The substation topology drawing module is used to use the edge concentrator of the low-voltage substation where the intelligent measuring switch is located to perform topological identification on the electric meters in the low-voltage substation, and draw a low-voltage substation topology map with line-user topological relationship;
[0065] The meter reading and recording module is used to record the power load data, terminal alarm data and penalty data of breach of contract and power theft of each meter every day, and store them in the data storage module;
[0066] The index extraction module is used to analyze and extract the power load data, terminal alarm data and penalty data for breach of contract and power theft according to the power theft analysis day and the power theft analysis window period, and obtain the power consumption decline trend index, line loss index and alarm number index corresponding to the user profile data of the user to be analyzed for power theft as the power theft analysis features;
[0067] The electricity theft analysis module is used to classify and identify the input electricity theft analysis features using the trained electricity theft classification prediction model to obtain the electricity theft detection results;
[0068] The data communication module is used to report the analysis characteristics of the electricity to be stolen and the detection results of the electricity theft to the edge terminal corresponding to the low-voltage area through the HPLC communication module, the 485 communication module and the Bluetooth module.
[0069] The beneficial effects of the present invention are as follows: based on the above-mentioned electricity theft detection method based on logistic regression, the present invention provides a measuring switch of the electricity theft detection method based on logistic regression, which is used to implement the above-mentioned method, so as to accurately detect the electricity theft behavior of all electricity users in the low-voltage substation where the measuring switch is located, and feed back the detection results to the edge terminal, thereby providing a basis for the rectification of electricity theft behavior.
[0070] Other advantages of the present invention will be analyzed in more detail in subsequent embodiments. BRIEF DESCRIPTION OF THE DRAWINGS
[0071] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.
[0072] Figure 1 This is a flowchart of the steps of a method for detecting electricity theft based on logistic regression in Example 1 of the present invention.
[0073] Figure 2 This is a block diagram of a measuring switch of a method for detecting electricity theft based on logistic regression in Embodiment 2 of the present invention. DETAILED DESCRIPTION
[0074] The technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. The components of the embodiments of the present invention generally described and shown in the drawings here can be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of the present invention provided in the drawings is not intended to limit the scope of the claimed invention, but merely represents the selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without making creative work belong to the scope of protection of the present invention.
[0075] Example 1: Figure 1 As shown, in one embodiment of the present invention, the present invention provides a method for detecting electricity theft based on logistic regression, characterized in that it includes the following steps:
[0076] S1, obtaining meter reading data of all the meters hanging under the measuring switch, and preprocessing the meter reading data to obtain a data set for electricity theft analysis; S1 includes the following steps:
[0077] S11. Obtain meter reading data of all meters connected to the measuring switch, wherein the meter reading data includes power load data at different times, terminal alarm data, penalty data for breach of contract and electricity theft, and user profile data. The meter reading data are all independently filed based on user profile data. In this embodiment, the terminal alarm data includes alarm prompts related to electricity theft, such as voltage phase loss and current reverse polarity.
[0078] S12. Based on the user profile data, select the user profile data of non-electricity theft monitoring objects to establish an electricity usage whitelist, and construct a first pre-processed data set based on the meter reading data corresponding to the user profile data in the non-electricity theft monitoring objects; in this embodiment, the non-electricity theft monitoring objects include power production enterprise users, government agencies, etc.
[0079] S13, filtering and deleting the meter reading data corresponding to holidays in the first preprocessing data set to obtain a second preprocessing data set;
[0080] S14. If there are missing data items in the meter reading data of each meter in the second preprocessing data set, and the number of missing data items is less than the preset data missing item number threshold, the missing meter reading data is filled with interpolation to obtain the electricity theft analysis data set. In this embodiment, the missing data items refer to the missing electric load data, terminal alarm data, breach of contract electricity theft penalty data or user profile data in the meter reading data at certain times, and the data missing item threshold is 15 to 22, preferably 20.
[0081] S2. Extract the power consumption decline trend index, line loss index and alarm number index corresponding to the user profile data on the power theft analysis base date based on the power theft analysis data set;
[0082] The S2 comprises the following steps:
[0083] S21. Select an electricity theft analysis base date, and use the period from N days before the electricity theft analysis base date to N days after the electricity theft analysis date as the electricity theft analysis window period. In this embodiment, the value range of N is 10-31.
[0084] S22, based on the power load data in the data read by each electric meter in the power theft analysis data set, calculate the power consumption change rate within the power theft analysis window period;
[0085] The calculation expression of the electricity consumption change rate during the electricity theft analysis window period is as follows:
[0086]
[0087] Among them, k i represents the rate of change of electricity consumption on the ith day during the electricity theft analysis window, l represents the number of days for electricity theft analysis, and f l represents the electricity consumption data on the first day, Indicates the average power consumption data during the power theft analysis window period. represents the average number of electricity theft analysis days within the electricity theft analysis window period, f i represents the electricity consumption data of the i-th day, l i represents the i-th day in the electricity theft analysis window period;
[0088] The electricity consumption of normal users is relatively stable, while the electricity consumption of electricity thieves shows a downward trend and then tends to be stable after the electricity theft occurs. On this basis, this scheme conducts an indicator analysis of the electricity consumption trend during the electricity theft analysis window period through the electricity consumption change rate during the electricity theft analysis window period.
[0089] S23. According to the electricity consumption change rate during the electricity theft analysis window period, the number of days on which the electricity consumption change rate of the current day is lower than that of the previous day is counted, and an electricity consumption decrease trend indicator corresponding to the user profile data is obtained;
[0090] The calculation expression of the power consumption downward trend indicator is as follows:
[0091]
[0092] Among them, T represents the downward trend index of electricity consumption during the electricity theft analysis window period, and D i represents the downward trend indicator on the i-th day, where i∈[-N,N];
[0093] S24, extracting the line-user topology relationship based on the user profile data in the electricity theft analysis data set, and calculating the line loss rate;
[0094] In this embodiment, the line-user topological relationship is the topological relationship between the user and its power line, and one power line supplies multiple users at the same time; the line loss rate can be used as a reference indicator for the line loss rate of users on the same power line. If the user steals electricity, the line loss rate of the day will increase. However, due to the fluctuation of the user's daily electricity consumption, simply taking the increase in the line loss rate of the day as a feature of electricity theft will also result in a large error; therefore, in this solution, the average value of the line loss rate in the first half and the second half of the entire electricity theft analysis window is used to determine whether the growth rate is greater than the preset line loss growth rate threshold, and to determine whether there is a certain suspicion of electricity theft, wherein the line loss growth rate threshold is 1%.
[0095] The calculation expression of the line loss rate is as follows:
[0096]
[0097] Among them, t l represents the line loss rate on the first day, s l represents the power supply of the line on the first day, Σ m f l (m) represents the total power consumption of users on the line on the lth day, and m represents the mth user;
[0098] S25. Statistical average line loss rate V from the start of the electricity theft analysis window to the electricity theft analysis base date i 1 The average line loss rate V from the electricity theft analysis base date to the end of the electricity theft analysis window period i 2 , get the line loss index corresponding to the user profile data;
[0099] The calculation expression of the line loss index corresponding to the user profile data is as follows:
[0100]
[0101] Where E(i) represents the line loss index corresponding to the user profile data on the i-th day;
[0102] S26. Based on the terminal alarm data of the meter reading data in the electricity theft analysis data set, the total number of terminal alarms on the electricity theft analysis base day corresponding to the user file data is obtained, and used as the alarm number indicator corresponding to the user file data.
[0103] S3. Combine the power consumption decline trend index, line loss index and alarm number index corresponding to each user's archive data on the power theft analysis base date with the user's power theft tag to obtain a number of power theft identification sample data, and construct a power theft identification sample data set;
[0104] The user electricity theft tag includes a user electricity theft occurrence tag and a user electricity non-theft tag.
[0105] In this embodiment, the electricity theft identification sample data set includes several user electricity theft identification samples, each of which includes independently filed user profile data, and a power consumption decline trend indicator, line loss indicator, alarm number indicator and user electricity theft label corresponding to the user profile data.
[0106] S4. Training and testing the electricity theft classification prediction model based on the electricity theft identification sample data set to obtain a trained electricity theft classification prediction model;
[0107] The S4 comprises the following steps:
[0108] S41, dividing the electricity theft identification sample data set into a training set and a test set; in this embodiment, the training set accounts for any 80% of the electricity theft identification samples in the electricity theft identification sample data set, and the test set accounts for the remaining 20% of the electricity theft identification samples in the electricity theft identification sample data set.
[0109] S42. Train and test the logistic regression model based on the training set and the test set to obtain a trained electricity theft classification prediction model.
[0110] The S42 comprises the following steps:
[0111] S421. Assume that the electricity theft identification sample data in the training set obeys Bernoulli distribution;
[0112] S422, assuming that the probability of selecting the electricity theft identification sample data in the training set is a sigmoid function;
[0113] The calculation expression of the probability of selecting the electricity theft identification sample data in the training set is as follows:
[0114]
[0115] Among them, σ(x) represents the probability of selecting the electricity theft identification sample data in the training set, e represents the exponential basis constant, w represents the electricity theft identification learning parameter, T represents the transposition, and x represents the electricity theft identification sample data in the training set;
[0116] S423, inputting the electricity theft identification sample data in the selected training set as electricity theft identification features into the logistic regression model for batch training, and obtaining an electricity theft classification prediction model after the batch training is completed;
[0117] The calculation expression of the electricity theft classification prediction model is as follows:
[0118]
[0119] Among them, y represents the classification result of electricity theft identification, ∈ represents belonging to, ET represents the electricity theft category, NET represents the non-electricity theft category, and P(y|x,w) represents the probability of electricity theft identification classification;
[0120] In this embodiment, the power consumption downward trend indicator, line loss indicator and alarm number indicator corresponding to the user profile data in the power theft identification sample data are used as power theft identification features for feature learning and recognition training, and the obtained power theft identification classification results are divided into two categories: power theft category and non-power theft category.
[0121] S424, selecting electricity theft identification sample data in the test set to test the electricity theft classification prediction model after batch training, until the accuracy of the test result reaches the accuracy threshold, or the batch training times reaches the training times threshold, to obtain a trained electricity theft classification prediction model.
[0122] In this embodiment, the accuracy of the test result is the consistency rate between the electricity theft identification classification result corresponding to the electricity theft identification sample and the actual corresponding user electricity theft label. The accuracy threshold is set to 93%, and the training number threshold is set to 10,000 times.
[0123] S5. Obtain the electricity theft analysis features of the user to be analyzed for electricity theft, and perform electricity theft classification and identification on the electricity theft analysis features based on the trained electricity theft classification prediction model to obtain electricity theft detection results.
[0124] The S5 comprises the following steps:
[0125] S51, selecting an electricity theft analysis day for the user to be analyzed for electricity theft;
[0126] S52, based on the electricity theft analysis day, taking the period from N days before the electricity theft analysis day to N days after the electricity theft analysis day as the electricity theft analysis window period;
[0127] S53, based on the power theft analysis window period, obtaining the power consumption decrease trend index, line loss index and alarm number index corresponding to the user profile data of the user to be analyzed for power theft as the power theft analysis feature;
[0128] S54, inputting the features to be analyzed for electricity theft into the trained electricity theft classification prediction model to perform electricity theft classification and identification, and obtaining electricity theft detection results.
[0129] Example 2: Figure 2 As shown, based on Example 1, the present invention provides a measuring switch of a power theft detection method based on logistic regression, comprising:
[0130] The substation topology drawing module is used to use the edge concentrator of the low-voltage substation where the intelligent measuring switch is located to perform topological identification on the electric meters in the low-voltage substation, and draw a low-voltage substation topology map with line-user topological relationship;
[0131] The meter reading and recording module is used to record the power load data, terminal alarm data and penalty data of breach of contract and power theft of each meter every day, and store them in the data storage module;
[0132] The index extraction module is used to analyze and extract the power load data, terminal alarm data and penalty data for breach of contract and power theft according to the power theft analysis day and the power theft analysis window period, and obtain the power consumption decline trend index, line loss index and alarm number index corresponding to the user profile data of the user to be analyzed for power theft as the power theft analysis features;
[0133] The electricity theft analysis module is used to classify and identify the input electricity theft analysis features using the trained electricity theft classification prediction model to obtain the electricity theft detection results;
[0134] The data communication module is used to report the electricity theft analysis characteristics and electricity theft detection results to the edge terminal corresponding to the low-voltage area through the HPLC communication module, the 485 communication module and the Bluetooth module. In this embodiment, the edge terminal corresponding to the low-voltage area is the concentrator corresponding to the low-voltage area.
[0135] The above description is only a specific implementation mode of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be covered by the protection scope of the present invention.
Claims
1. A method for detecting electricity theft based on logistic regression, characterized in that: The steps include: S1. Obtain meter reading data of all the meters under the measuring switch, and pre-process the meter reading data to obtain a data set for electricity theft analysis; S2. Extract the power consumption decline trend index, line loss index and alarm number index corresponding to the user profile data on the power theft analysis base date based on the power theft analysis data set; S3. Combine the power consumption decline trend index, line loss index and alarm number index corresponding to each user's archive data on the power theft analysis base date with the user's power theft tag to obtain a number of power theft identification sample data, and construct a power theft identification sample data set; S4. Training and testing the electricity theft classification prediction model based on the electricity theft identification sample data set to obtain a trained electricity theft classification prediction model; S5. Obtain the electricity theft analysis features of the user to be analyzed for electricity theft, and perform electricity theft classification and identification on the electricity theft analysis features based on the trained electricity theft classification prediction model to obtain an electricity theft detection result.
2. The method for detecting electricity theft based on logistic regression according to claim 1, characterized in that: The S1 comprises the following steps: S11, obtaining meter reading data of all the meters under the measuring switch, wherein the meter reading data includes power load data at different times, terminal alarm data, penalty data for breach of contract and electricity theft, and user file data, and the meter reading data are all data independently archived based on user file data; S12, based on the user file data, select the user file data of non-electricity theft monitoring objects to establish an electricity whitelist, and construct a first pre-processed data set based on the read data of the electric meter corresponding to the user file data in the non-electricity whitelist; S13, filtering and deleting the meter reading data corresponding to holidays in the first preprocessing data set to obtain a second preprocessing data set; S14. If the meter reading data of each meter in the second preprocessed data set has missing data items, and the number of missing data items is less than a preset data missing item number threshold, interpolation is used to fill in the missing meter reading data to obtain an electricity theft analysis data set.
3. The method for detecting electricity theft based on logistic regression according to claim 2, characterized in that: The S2 comprises the following steps: S21, selecting a base date for electricity theft analysis, and using the period from N days before the base date to N days after the electricity theft analysis date as a window period for electricity theft analysis; S22, based on the power load data in the data read by each electric meter in the power theft analysis data set, calculate the power consumption change rate within the power theft analysis window period; The calculation expression of the electricity consumption change rate during the electricity theft analysis window period is as follows: Among them, k i represents the rate of change of electricity consumption on the ith day during the electricity theft analysis window, l represents the number of days for electricity theft analysis, and f l represents the electricity consumption data on the first day, Indicates the average power consumption data during the power theft analysis window period. represents the average number of electricity theft analysis days within the electricity theft analysis window period, f i represents the electricity consumption data of the i-th day, l i represents the i-th day in the electricity theft analysis window period; S23. According to the electricity consumption change rate during the electricity theft analysis window period, the number of days on which the electricity consumption change rate of the current day is lower than that of the previous day is counted, and an electricity consumption decrease trend indicator corresponding to the user profile data is obtained; The calculation expression of the power consumption downward trend indicator is as follows: Among them, T represents the downward trend index of electricity consumption during the electricity theft analysis window period, and D i represents the downward trend indicator on the i-th day, where i∈[-N,N]; S24, extracting the line-user topology relationship based on the user profile data in the electricity theft analysis data set, and calculating the line loss rate; The calculation expression of the line loss rate is as follows: Among them, t l represents the line loss rate on the first day, s l represents the power supply of the line on the first day, represents the total power consumption of users on the line on the lth day, and m represents the mth user; S25. Statistical average line loss rate from the start of the electricity theft analysis window to the electricity theft analysis base date The average line loss rate from the electricity theft analysis base date to the end of the electricity theft analysis window period Get the line loss index corresponding to the user profile data; The calculation expression of the line loss index corresponding to the user profile data is as follows: Where E(i) represents the line loss index corresponding to the user profile data on the i-th day; S26. Based on the terminal alarm data of the meter reading data in the electricity theft analysis data set, the total number of terminal alarms on the electricity theft analysis base day corresponding to the user file data is obtained, and used as the alarm number indicator corresponding to the user file data.
4. The method for detecting electricity theft based on logistic regression according to claim 3, characterized in that: The user electricity theft tag includes a user electricity theft occurrence tag and a user electricity non-theft tag.
5. The method for detecting electricity theft based on logistic regression according to claim 4, characterized in that: The S4 comprises the following steps: S41, dividing the electricity theft identification sample data set into a training set and a test set; S42. Train and test the logistic regression model based on the training set and the test set to obtain a trained electricity theft classification prediction model.
6. The method for detecting electricity theft based on logistic regression according to claim 5, characterized in that: The S42 comprises the following steps: S421. Assume that the electricity theft identification sample data in the training set obeys Bernoulli distribution; S422, assuming that the probability of selecting the electricity theft identification sample data in the training set is a sigmoid function; The calculation expression of the probability of selecting the electricity theft identification sample data in the training set is as follows: Among them, σ(x) represents the probability of selecting the electricity theft identification sample data in the training set, e represents the exponential basis constant, w represents the electricity theft identification learning parameter, T represents the transposition, and x represents the electricity theft identification sample data in the training set; S423, inputting the electricity theft identification sample data in the selected training set as electricity theft identification features into the logistic regression model for batch training, and obtaining an electricity theft classification prediction model after the batch training is completed; S424, selecting electricity theft identification sample data in the test set to test the electricity theft classification prediction model after batch training, until the accuracy of the test result reaches the accuracy threshold, or the batch training times reaches the training times threshold, to obtain a trained electricity theft classification prediction model; The calculation expression of the trained electricity theft classification prediction model is as follows: Among them, y represents the classification result of electricity theft identification, ∈ represents belonging to, ET represents the electricity theft class, NET represents the non-electricity theft class, and P(y|x,w) represents the probability of electricity theft identification classification.
7. The method for detecting electricity theft based on logistic regression according to claim 6, characterized in that: The S5 comprises the following steps: S51, selecting an electricity theft analysis day for the user to be analyzed for electricity theft; S52, based on the electricity theft analysis day, taking the period from N days before the electricity theft analysis day to N days after the electricity theft analysis day as the electricity theft analysis window period; S53, based on the power theft analysis window period, obtaining the power consumption decrease trend index, line loss index and alarm number index corresponding to the user profile data of the user to be analyzed for power theft as the power theft analysis feature; S54, inputting the features to be analyzed for electricity theft into the trained electricity theft classification prediction model to perform electricity theft classification and identification, and obtaining electricity theft detection results.
8. A measuring switch for the electricity theft detection method based on logistic regression according to any one of claims 1 to 7, characterized in that: include: The substation topology drawing module is used to use the edge concentrator of the low-voltage substation where the intelligent measuring switch is located to perform topological identification on the electric meters in the low-voltage substation, and draw a low-voltage substation topology map with line-user topological relationship; The meter reading and recording module is used to record the power load data, terminal alarm data and penalty data of breach of contract and power theft of each meter every day, and store them in the data storage module; The index extraction module is used to analyze and extract the power load data, terminal alarm data and penalty data for breach of contract and power theft according to the power theft analysis day and the power theft analysis window period, and obtain the power consumption decline trend index, line loss index and alarm number index corresponding to the user profile data of the user to be analyzed for power theft as the power theft analysis features; The electricity theft analysis module is used to classify and identify the input electricity theft analysis features using the trained electricity theft classification prediction model to obtain the electricity theft detection results; The data communication module is used to report the analysis characteristics of the electricity to be stolen and the detection results of the electricity theft to the edge terminal corresponding to the low-voltage area through the HPLC communication module, 485 communication module or Bluetooth module.
Citation Information
Cited By
Digital graph fused electricity larceny behavior early warning method, system and device
CN119989282A
