A user electricity consumption anomaly detection method based on a machine learning algorithm

By constructing a multi-feature fusion model and combining it with DS evidence theory, the problems of high cost, low efficiency and poor timeliness in the detection of abnormal power consumption in existing technologies are solved, and rapid and accurate detection of abnormal power consumption and timely alarm are achieved.

CN116680641BActive Publication Date: 2025-11-18STATE GRID SHANDONG ELECTRIC POWER CO
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310478755.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-04-28
Publication Date
2025-11-18
Estimated Expiration
2043-04-28

AI Technical Summary

Technical Problem

Existing methods for detecting abnormal electricity consumption by users suffer from high costs, low efficiency, and inability to respond in a timely manner. In particular, unsupervised learning methods have poor generalization ability, while supervised learning methods require a long time to analyze and build training and testing samples, making it impossible to quickly detect abnormal electricity consumption data.

Method used

A multi-feature fusion model is constructed. By analyzing daily power data such as current, voltage, and power factor, the features are divided into three categories: normal, suspicious, and abnormal using the K-means clustering algorithm. The features are then fused using the DS evidence theory to calculate the power abnormality index and send SMS alarms using the communication module.

Benefits of technology

It enables rapid and accurate detection of abnormal power consumption by users, reduces costs, improves detection efficiency, and can promptly send alarm text messages to users, thus improving the timeliness and accuracy of detection.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116680641B_ABST
    Figure CN116680641B_ABST
Patent Text Reader

Abstract

The application relates to a user power consumption anomaly detection method, in particular to a user power consumption anomaly detection method based on a machine learning algorithm, and belongs to the technical field of power electronic control. The method is mainly used for detecting whether user power consumption is abnormal, constructing a multi-feature fusion model, analyzing daily power data such as current, voltage and power factor, and extracting relevant power features. Then, the abnormal reliability distribution is obtained through the features to fit the multi-feature fusion algorithm. Finally, the probability of all power consumption data anomalies can be obtained. Then, the computer end can send AT instructions to the communication module through a serial data line, so that an alarm short message is sent to the user with suspected abnormal power consumption to warn the user of the power consumption anomaly.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to a method for detecting abnormal power consumption by users, and in particular to a method for detecting abnormal power consumption by users based on machine learning algorithms, belonging to the field of power electronic control technology. Background Technology

[0002] With the advancement of technology and the application of big data and related technologies in the power system, user electricity consumption data collected by smart meters is transmitted back to the terminal. Technicians can then use various algorithms to extract the necessary features and information from massive amounts of data to analyze users' electricity consumption behavior. Common abnormal electricity consumption behaviors mainly include: electricity fraud (electricity theft, leakage, or theft), equipment malfunctions, and sudden abnormal situations in residents' homes.

[0003] Currently, there are two main methods for detecting abnormal electricity consumption behavior. One relies on installing hardware devices combined with manual inspections. The other uses data analysis, employing machine learning methods such as neural networks, K-means clustering, and deep learning to analyze user electricity consumption data collected by smart meters. Because the hardware-based method involves high costs, time-consuming and labor-intensive equipment maintenance, and low efficiency, its application for detecting abnormal electricity consumption is limited. Anomaly detection algorithms can be divided into unsupervised learning and supervised learning, both of which are widely used in classifying or detecting abnormal power grid data. Unsupervised learning primarily utilizes unlabeled data to extract internal features and discover anomalies, including methods such as K-means clustering and Principal Component Analysis (PCA). Supervised learning algorithms attempt to find the intrinsic correlation between features and labels, training a classifier as a detector, and mainly include methods such as Support Vector Machines (SVM) and Logistic Regression.

[0004] While these methods have significantly improved the accuracy of anomaly detection, many problems and challenges remain. Anomaly detectors should incorporate fewer pre-set parameters to enhance their generalization ability. Unsupervised learning methods, however, require subjective parameters and therefore exhibit poor generalization. Detectors should be able to detect anomalies quickly; current methods primarily analyze and construct training and testing samples over extended periods, thus failing to react immediately to anomaly data. Summary of the Invention

[0005] To address the shortcomings of existing technologies, this invention provides a method for detecting abnormal electricity consumption by constructing a multi-feature fusion model. This model analyzes daily electricity data such as current, voltage, and power factor to extract relevant power features. Then, it obtains an anomaly reliability distribution using these features to fit a multi-feature fusion algorithm. Finally, it calculates the probability of anomalies in all electricity consumption data. Finally, it enables the sending of AT commands from a computer to a communication module via a serial data cable, thereby sending alarm SMS messages to users suspected of abnormal electricity consumption. This is a machine learning-based method for detecting abnormal electricity consumption.

[0006] To achieve the above objectives, the present invention provides the following technical solution:

[0007] A method for detecting abnormal electricity consumption by users based on machine learning algorithms includes the following steps:

[0008] (1) Data preprocessing:

[0009] By utilizing user electricity consumption data obtained from the government's social information system and analyzing the causes of abnormal electricity consumption data, electrical characteristics of current, voltage, and power factor can be extracted to detect anomalies.

[0010] There will inevitably be time points in the data where data was not collected for various reasons, resulting in missing values. Therefore, it is necessary to fill in the missing values ​​in the data.

[0011] The missing values ​​in the dataset are filled using Lagrange interpolation, and the formula is as follows:

[0012]

[0013] In the formula: i and j are the subscripts of missing and non-missing values ​​a and b; M is the number of values ​​before and after the missing data; L M(a) This is the result after inserting missing values;

[0014] (2) Feature fusion:

[0015] Multi-feature fusion is an improvement on the combination rules of the DS evidence theory based on the probability model; it requires first converting the features into normal probability, suspicious probability, and abnormal probability.

[0016] First, the K-means clustering algorithm is used to divide each of the three features of current, voltage, and power factor into three categories, representing normal, suspected, and abnormal, respectively.

[0017] Each feature yields three cluster centers and two thresholds, with the threshold being the midpoint of the cluster centers. This method primarily analyzes and detects daily data. Current balance, voltage balance, and power factor are related hourly features, with 24 features per day. Probabilities are derived based on the proportions of normal, suspicious, and abnormal intervals.

[0018]

[0019] In the formula, m is a probability function, and A i It is a symbol indicating normal, doubtful, or abnormal; N i It represents the number of features within the corresponding clustering interval each day;

[0020] For daily characteristics, such as the correlation coefficient of current, there is one characteristic for each day; the corresponding probabilities are obtained according to the inverse distance formula as follows:

[0021]

[0022] In the formula d i The distance between a feature and a cluster center is the distance between them. Therefore, we can see that the greater the distance between a feature and a cluster center, the greater the corresponding probability.

[0023] (3) Multi-feature fusion model:

[0024] This multi-feature fusion model is based on the DS evidence theory, and from step (2), it can be seen that each feature can yield a corresponding abnormal power consumption distribution, such as {m(A1), m(A2), m(A3)}; where A1 represents normal, A2 represents suspicious, and A3 represents abnormal; the specific algorithm for multi-feature fusion is as follows:

[0025] ① Assume m i m2, m3, ..., m n Let {m(A1), m(A2), m(A3)} represent the basic probability distribution of n electrical characteristics, and let {m(A1), m(A2), m(A3)} represent the abnormal power reliability distribution. Assume k... ij The degree of conflict between features i and j:

[0026]

[0027] ② Define k as the degree of conflict among n features, as shown in the following formula:

[0028]

[0029] Then ε represents the reliability of the feature:

[0030] ε=e -k (6)

[0031] ③Assume p(A) is the product of the corresponding basic values ​​of the n features, and q(A) is the average of the corresponding basic values ​​of the n features, as shown in the following formula:

[0032]

[0033]

[0034] ④ Define the normalization constant

[0035]

[0036] The new combination rules are as follows:

[0037]

[0038] Where X represents the uncertain part;

[0039] As shown in formula (10), when the conflict between the evidences is small, the fusion result is similar to the DS evidence theory. When there is no conflict, it means r = 0, and the new fusion formula is equivalent to the DS evidence theory. When there is a high degree of conflict, it means r → 1. The fusion result mainly depends on ε×q(A). The advantage of the multi-feature fusion algorithm over the DS evidence theory is that it can better handle the conflict between the evidences.

[0040] (4) Electricity consumption anomaly index algorithm:

[0041] To obtain a unified parameter to represent the degree of anomaly, the power anomaly index algorithm is used to evaluate the results of multi-feature fusion. The main formula is as follows:

[0042] s={m(A3)+m(A2)+m(X)×[1-m(A1)]}×100% (11)

[0043] Where s is the probability of a user having abnormal electricity usage, and the larger s is, the higher the probability of the user having abnormal electricity usage.

[0044] (5) User power consumption abnormality SMS alarm device:

[0045] When a user's real-time electricity consumption data is suspected of being abnormal, an AT command can be sent from a computer to the communication module via a serial data cable, thereby sending an alarm SMS to the user to alert them of the abnormal electricity consumption.

[0046] ① Computer and communication module connection:

[0047] The computer is connected to the communication module via a serial data cable. To test whether the connection is successful, you can open the corresponding window and set the corresponding parameters through the serial port debugging assistant software. Then, enter "AT" in the serial port debugging assistant window. If the window returns "OK", it means that the computer and the communication module are successfully connected.

[0048] ②Sending SMS messages:

[0049] Before sending an alarm SMS to a user with abnormal power consumption, a working SIM card needs to be installed in the designated area of ​​the communication module. After setting up the complete circuit, power on the communication module and check if the indicator light is lit. Once the module is confirmed to be working, enter the relevant AT commands in the serial port debugging assistant window to send an alarm SMS when a user is suspected of having abnormal power consumption.

[0050] The method employed is primarily based on unsupervised learning, a typical classifier approach. Current, voltage, and power factors from user electricity consumption data collected by smart meters are selected as features to determine whether electricity consumption is abnormal. The data is then preprocessed to remove missing or outlier values. K-means clustering is used on the processed dataset to cluster each feature into three classes: normal, suspected, and abnormal, calculating the probabilities for each. A multi-feature fusion model is then trained based on this data. Finally, an evaluation criterion is used to output whether a user's electricity consumption is abnormal. The model training and testing process is as follows: Figure 1 As shown in the diagram. When applying this model to determine whether a user's electricity usage is abnormal, an SMS alarm device is introduced. When the model determines that a user's electricity usage is suspected to be abnormal, an alarm SMS is promptly sent to the user via a communication module connected to the computer. Its block diagram is shown below. Figure 2 As shown. Attached Figure Description

[0051] Figure 1 This is a diagram illustrating the model training and testing process in this invention;

[0052] Figure 2 This is a block diagram of abnormal data detection and alarm in this invention;

[0053] Figure 3 This is an application scenario diagram of the present invention. Detailed Implementation

[0054] The technical solutions of the present invention will be clearly and completely described below with reference to the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments.

[0055] Example 1: A method for detecting abnormal power consumption by users based on machine learning algorithms, comprising the following steps:

[0056] (1) Data preprocessing:

[0057] By utilizing user electricity consumption data obtained from the government's social information system and analyzing the causes of abnormal electricity consumption data, electrical characteristics of current, voltage, and power factor can be extracted to detect anomalies.

[0058] There will inevitably be time points in the data where data was not collected for various reasons, resulting in missing values. Therefore, it is necessary to fill in the missing values ​​in the data.

[0059] The missing values ​​in the dataset are filled using Lagrange interpolation, and the formula is as follows:

[0060]

[0061] In the formula: i and j are the subscripts of missing and non-missing values ​​a and b; M is the number of values ​​before and after the missing data; L M(a) This is the result after inserting missing values;

[0062] (2) Feature fusion:

[0063] Multi-feature fusion is an improvement on the combination rules of the DS evidence theory based on the probability model; it requires first converting the features into normal probability, suspicious probability, and abnormal probability.

[0064] First, the K-means clustering algorithm is used to divide each of the three features of current, voltage, and power factor into three categories, representing normal, suspected, and abnormal, respectively.

[0065] Each feature yields three cluster centers and two thresholds, with the threshold being the midpoint of the cluster centers. This method primarily analyzes and detects daily data. Current balance, voltage balance, and power factor are related hourly features, with 24 features per day. Probabilities are derived based on the proportions of normal, suspicious, and abnormal intervals.

[0066]

[0067] In the formula, m is a probability function, and A i It is a symbol indicating normal, doubtful, or abnormal; N i It represents the number of features within the corresponding clustering interval each day;

[0068] For daily characteristics, such as the correlation coefficient of current, there is one characteristic for each day; the corresponding probabilities are obtained according to the inverse distance formula as follows:

[0069]

[0070] In the formula d i The distance between a feature and a cluster center is the distance between them. Therefore, we can see that the greater the distance between a feature and a cluster center, the greater the corresponding probability.

[0071] Third step: Multi-feature fusion model:

[0072] This multi-feature fusion model is based on the DS evidence theory, and from step (2), it can be seen that each feature can yield a corresponding abnormal power consumption distribution, such as {m(A1), m(A2), m(A3)}; where A1 represents normal, A2 represents suspicious, and A3 represents abnormal; the specific algorithm for multi-feature fusion is as follows:

[0073] ①Assume m1, m2, m3, ..., m n Let {m(A1), m(A2), m(A3)} represent the basic probability distribution of n electrical characteristics, and let {m(A1), m(A2), m(A3)} represent the abnormal power reliability distribution. Assume k... ij The degree of conflict between features i and j:

[0074]

[0075] ②The meaning k is the degree of conflict among the n features, and the formula is as follows:

[0076]

[0077] Then ε represents the reliability of the feature:

[0078] ε=e -k (6)

[0079] ③Assume p(A) is the product of the corresponding basic values ​​of the n features, and q(A) is the average of the corresponding basic values ​​of the n features, as shown in the following formula:

[0080]

[0081]

[0082] ③ Normalization constant

[0083]

[0084] The new combination rules are as follows:

[0085]

[0086] Where X represents the uncertain part;

[0087] As shown in formula (10), when the conflict between the evidences is small, the fusion result is similar to the DS evidence theory. When there is no conflict, it means r = 0, and the new fusion formula is equivalent to the DS evidence theory. When there is a high degree of conflict, it means r → 1. The fusion result mainly depends on ε×q(A). The advantage of the multi-feature fusion algorithm over the DS evidence theory is that it can better handle the conflict between the evidences.

[0088] (4) Electricity consumption anomaly index algorithm:

[0089] To obtain a unified parameter to represent the degree of anomaly, the power anomaly index algorithm is used to evaluate the results of multi-feature fusion. The main formula is as follows:

[0090] s={m(A3)+m(A2)+m(X)×[1-m(A1)]}×100% (11)

[0091] Where s is the probability of a user having abnormal electricity usage, and the larger s is, the higher the probability of the user having abnormal electricity usage.

[0092] (5) User power consumption abnormality SMS alarm device:

[0093] When a user's real-time electricity consumption data is suspected of being abnormal, an AT command can be sent from a computer to the communication module via a serial data cable, thereby sending an alarm SMS to the user to alert them of the abnormal electricity consumption.

[0094] ④ Computer and communication module connection:

[0095] The computer is connected to the communication module via a serial data cable. To test whether the connection is successful, you can open the corresponding window and set the corresponding parameters through the serial port debugging assistant software. Then, enter "AT" in the serial port debugging assistant window. If the window returns "OK", it means that the computer and the communication module are successfully connected.

[0096] ②Sending SMS messages:

[0097] Before sending an alarm SMS to a user with abnormal power consumption, a working SIM card needs to be installed in the designated area of ​​the communication module. After setting up the complete circuit, power on the communication module and check if the indicator light is lit. Once the module is confirmed to be working, enter the relevant AT commands in the serial port debugging assistant window to send an alarm SMS when a user is suspected of having abnormal power consumption.

[0098] Specific application scenarios: such as Figure 3As shown, a simplified power grid model consists of five parts: power generation, transmission, transformation, distribution, and consumption. The system collects user electricity consumption data through a detection system and uploads it to a terminal information processing system. Simultaneously, an electricity anomaly detection algorithm is integrated into the computer of the terminal information processing system. If an anomaly is detected in a user's electricity consumption data, the algorithm automatically matches relevant user information associated with that data. Finally, an alarm message is sent to the user's display terminal, such as a mobile phone, through an alarm device in the communication system.

Claims

1. A method for detecting abnormal user electricity consumption based on machine learning algorithms, characterized in that, Includes the following steps: (1) Data preprocessing: By utilizing user electricity consumption data obtained from the government's social information system, and analyzing the causes of abnormal electricity consumption data, electrical characteristics of current, voltage, and power factor are extracted to identify anomalies. There will inevitably be time points in the data where data was not collected for various reasons, resulting in missing values. Therefore, it is necessary to fill in the missing values ​​in the data. The missing values ​​in the dataset are filled using Lagrange interpolation, and the formula is as follows: In the formula: i and j are the subscripts of missing and non-missing values ​​a and b; M is the number of values ​​before and after the missing data; L M(a) This is the result after inserting missing values; (2) Feature fusion: Multi-feature fusion is an improvement on the combination rules of the DS evidence theory based on the probability model; it requires first converting the features into normal probability, suspicious probability, and abnormal probability. First, the K-means clustering algorithm is used to divide each of the three features of current, voltage, and power factor into three categories, representing normal, suspected, and abnormal, respectively. Each feature yields three cluster centers and two thresholds, where the threshold is the midpoint of the cluster center; this method analyzes and detects daily data; current balance, voltage balance, and power factor are related hourly features, with 24 features per day; the corresponding probabilities are obtained based on the proportions of normal, suspicious, and abnormal intervals. In the formula, m is a probability function, and A i It is a symbol indicating normal, doubtful, or abnormal; N i It represents the number of features within the corresponding clustering interval each day; For daily characteristics, the correlation coefficient of current shows that there is one characteristic for each day; the corresponding probabilities are obtained according to the inverse distance formula as follows: In the formula d i The distance between a feature and a cluster center is the distance between them. Therefore, we can see that the greater the distance between a feature and a cluster center, the greater the corresponding probability. (3) Multi-feature fusion model: This multi-feature fusion model is based on the DS evidence theory, and from step (2), it can be seen that each feature can yield the corresponding abnormal power consumption distribution, {m(A1), m(A2), m(A3)}; where A1 represents normal, A2 represents suspicious, and A3 represents abnormal; the specific algorithm for multi-feature fusion is as follows: ①Assume m1, m2, m3, ..., m n Let {m(A1), m(A2), m(A3)} represent the basic probability distribution of n electrical characteristics, and let {m(A1), m(A2), m(A3)} represent the abnormal power reliability distribution. Assume k... ij The degree of conflict between features i and j: ② Define k as the degree of conflict among n features, as shown in the following formula: Then ε represents the reliability of the feature: e=e -k ③Assume p(A) is the product of the corresponding basic values ​​of the n features, and q(A) is the average of the corresponding basic values ​​of the n features, as shown in the following formula: ④ Define the normalization constant The new combination rules are as follows: Where X represents the uncertain part; As shown in formula (10), when the conflict between the evidences is small, the fusion result is similar to the DS evidence theory. When there is no conflict, it means r = 0, and the new fusion formula is equivalent to the DS evidence theory. When there is a high degree of conflict, it means r → 1, and the fusion result depends on ε×q(A). The advantage of the multi-feature fusion algorithm over the DS evidence theory is that it handles the conflict between the evidences better. (4) Electricity consumption anomaly index algorithm: To obtain a unified parameter to represent the degree of anomaly, the power anomaly index algorithm is used to evaluate the result of multi-feature fusion, as shown in the following formula: s={m(A3)+m(A2)+m(X)×[1-m(A1)]}×100% Where s is the probability of a user having abnormal electricity usage, and the larger s is, the higher the probability of the user having abnormal electricity usage. (5) User power consumption abnormality SMS alarm device: When a user's real-time electricity consumption data is suspected of being abnormal, the computer sends AT commands to the communication module via a serial data cable, thereby sending an alarm SMS to the user to alert them of the abnormal electricity consumption. ① Computer and communication module connection: The computer is connected to the communication module via a serial data cable. To test whether the connection is successful, open the corresponding window in the serial port debugging assistant software and set the corresponding parameters. Then, enter "AT" in the serial port debugging assistant window. If the window returns "OK", it means that the computer and the communication module are successfully connected. ②Sending SMS messages: Before sending an alarm SMS to a user with abnormal power consumption, a working SIM card needs to be installed in the designated area of ​​the communication module. After setting up the complete circuit, power on the communication module and check if the indicator light is lit. Once it is confirmed that the module is working, enter the relevant AT commands in the serial port debugging assistant window to send an alarm SMS when a user is suspected of having abnormal power consumption.

Citation Information

Patent Citations

  • Method for detecting user electricity stealing severity level on the basis of clustering algorithm

    CN107169145A

  • Abnormal data discrimination method based on multi-criterion fusion

    CN110458195A