Abnormal power consumption detection method and system for smart meters based on data analysis
By performing three-layer clustering analysis and dynamic threshold adjustment of the historical electricity consumption data of smart electricity meters, the problem of limited detection accuracy in the existing technology is solved, and the adaptive ability of accurate characterization of user electricity consumption patterns and abnormal detection is realized.
Patent Information
- Application Number
- CN202510749530.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-06
- Publication Date
- 2025-08-12
- Estimated Expiration
- 2045-06-06
AI Technical Summary
The existing smart meter abnormal electricity detection technology is difficult to adapt to the dynamic changes in user electricity usage mode, resulting in limited detection accuracy and prone to false alarms or missed alarms.
By analyzing the historical electricity consumption data of smart electricity meters, performing three-layer clustering analysis, combining external environment characteristics and composite characteristics, building a feature matrix, using time attenuation factors and hierarchical clustering to optimize model parameters, dynamically adjust thresholds, and monitoring abnormal electricity consumption behavior in real time.
It realizes accurate portrayal of user electricity usage mode, reduces false alarms, adapts to complex and changeable electricity usage scenarios, and improves the accuracy and adaptability of abnormal detection.
Smart Images

Figure CN120262702B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of abnormal power consumption detection, and in particular to a method and system for detecting abnormal power consumption of a smart meter based on data analysis. Background Art
[0002] With the intelligent transformation of power systems, smart meters are gradually replacing traditional meters as the core equipment for electricity metering. Smart meters not only record electricity consumption but also provide real-time monitoring and two-way communication capabilities, making it possible to detect anomalies in electricity usage. However, the widespread deployment of smart meters also presents a series of challenges, such as electricity fraud, equipment failure, and power theft. These abnormal electricity usage behaviors not only affect power company revenue but also pose a potential threat to power system stability and power security.
[0003] Among the current smart meter anomaly detection technologies, there are mainly the following commonly used methods: rule threshold method, statistical analysis method, machine learning-based classification method and cluster analysis method. These methods are difficult to adapt to the dynamic changes in user electricity usage patterns, resulting in limited detection accuracy.
[0004] For example, the Chinese patent application with publication number CN116975726A discloses a method and system for detecting abnormal electricity consumption behavior of power users, including: collecting user electricity consumption data from the power system; randomly injecting false data into the electricity consumption data to form abnormal electricity consumption samples; extracting features based on statistical characteristics of the electricity consumption data set containing the abnormal electricity consumption samples according to a set statistical market; and applying the feature-extracted data to a machine learning model constructed by combining an improved sparrow search algorithm with an ISSA-RF random forest to detect abnormal electricity consumption data. The method for detecting abnormal electricity consumption behavior of users provided by this invention can more efficiently and conveniently find abnormal electricity users, thereby reducing the amount of manual investigation, reducing losses for power grid companies, and also providing guarantees for the stable operation of the power grid.
[0005] For example, the Chinese patent application with publication number CN117150409A discloses a method for detecting abnormal power usage, which includes: obtaining a data set to be detected, building a power abnormality detection and judgment model, obtaining a first training data set, preprocessing and data sampling it, training the power abnormality detection and judgment model based on the sampled first training data set, inputting the data set to be detected into the power abnormality detection and judgment model, judging whether this data set is abnormal, building a power abnormality detection and recognition model, and obtaining a second training data set, training the power abnormality detection and recognition model based on the second training data set, inputting the data set judged to be abnormal into the trained power abnormality detection and recognition model, recognizing it, and obtaining a recognition result. The power abnormality detection method provided by this invention can realize power abnormality judgment and abnormality type recognition, is easy to use, and saves time and effort.
[0006] The defects of the above patent are: it is difficult to cope with complex, changeable and dynamically changing power consumption patterns, and it is easy to produce false alarms or missed alarms, resulting in limited detection accuracy. Summary of the Invention
[0007] In response to the shortcomings of the existing technology, the present invention proposes a method and system for detecting abnormal power consumption of smart meters based on data analysis. By analyzing historical power consumption data and real-time power consumption data, the time series characteristics of power consumption data and the high-dimensional characteristics of power consumption patterns are comprehensively considered. Through multi-level data screening and analysis, dynamic detection is carried out to determine in real time whether there is abnormal power consumption behavior.
[0008] To achieve the above object, the present invention provides the following technical solutions:
[0009] The method for detecting abnormal power consumption of smart meters based on data analysis includes:
[0010] Obtaining historical electricity usage data of users based on smart meters and preprocessing the acquired historical electricity usage data of users;
[0011] Extract the features of the pre-processed user historical electricity consumption data;
[0012] Perform three-layer cluster analysis on the extracted features to analyze the user's historical electricity consumption behavior;
[0013] Based on the user's historical electricity usage behavior, identify abnormal behavior that significantly deviates from normal electricity usage patterns;
[0014] The model parameters are adaptively adjusted through the feedback mechanism to monitor abnormal electricity consumption of smart meters in real time.
[0015] Specifically, extracting the features of the pre-processed historical electricity usage data of the user and analyzing the historical electricity usage behavior of the user include:
[0016] Normalize the pre-processed historical electricity consumption data of users and construct the feature vector X(t) at time t. , x m (t) represents the mth electricity consumption feature at time t. By setting a sliding window, the feature matrix T is constructed. , where x m (t n ) represents the mth electricity consumption characteristic at the nth moment;
[0017] The feature matrix T is constructed by combining external environmental features and composite features. The external environmental features include daily temperature, humidity, and holiday signs, etc. The composite features include temperature sensitivity, the ratio of power consumption to the reference period during high or low temperature periods.
[0018] Specifically, a three-layer cluster analysis is performed on the extracted features to analyze the user's historical electricity usage behavior, including:
[0019] The constructed feature matrix T is subjected to three-layer cluster analysis, including the first-layer cluster analysis, the second-layer cluster analysis, and the third-layer cluster analysis. In the first-layer clustering, the clustering parameters are iteratively optimized by maximizing the likelihood function to group the feature matrix T and divide it into probabilities. The specific formula is:
[0020] ,
[0021] Among them, p(X(t)) represents the grouping of the feature matrix T, K represents the number of clusters, represents the mixing coefficient of the k-th Gaussian distribution, represents the Gaussian distribution function, represents the mean of the k-th Gaussian distribution, represents the covariance matrix of the k-th Gaussian distribution;
[0022] In the second-level clustering, hierarchical clustering is performed on the groups p(X(t)) of the feature matrix T, a hierarchical model is constructed, and the distance between layers is calculated. The specific formula is:
[0023] ,
[0024] Among them, d ij represents the distance between the i-th cluster and the j-th cluster in the grouping of the feature matrix T, X i represents the central eigenvector of the i-th class in the group of the feature matrix T, X j represents the central eigenvector of the jth class in the group of the feature matrix T, Represents the Euclidean distance between the centers of clusters i and j.
[0025] Specifically, the extraction of features of the pre-processed historical electricity usage data of the user also includes:
[0026] In the third-layer clustering, the time decay factor is used to optimize the results of the first-layer clustering and the second-layer clustering. The optimized objective function is:
[0027] ,
[0028] in, represents the objective function value of the third-level clustering, which is used to minimize the clustering error. C represents the number of cluster centers. X p represents the p-th cluster in the grouping of the feature matrix T, c q represents the qth cluster center, Represents the p-th cluster X in the grouping of the feature matrix T p For the qth cluster center c q The membership degree, that is, the correlation between the cluster and the cluster center, represents the fuzzy factor, Represents the p-th cluster X in the grouping of the feature matrix T p For the qth cluster center c q The square of the Euclidean distance, represents the time decay factor;
[0029] According to the results of three-layer cluster analysis, the user's electricity consumption behavior is obtained.
[0030] Specifically, identifying abnormal behavior that significantly deviates from normal power usage patterns based on the user's historical power usage behavior includes:
[0031] Acquire the user's smart meter real-time data, and set the real-time data feature vector after preprocessing the user's smart meter real-time data as X;
[0032] Calculate the distance between the real-time data feature vector X and the cluster center after preprocessing the real-time data of the user's smart meter. The specific formula is:
[0033] ,
[0034] in, represents the distance from the real-time data feature vector X to the cluster center after preprocessing of the user's smart meter real-time data, and zz represents the transpose of the vector;
[0035] Determine the possibility that the user's smart meter real-time data belongs to the normal power consumption mode, and calculate the probability density value of the real-time data feature vector X of the user's smart meter real-time data after preprocessing under each cluster distribution. The specific formula is:
[0036] ,
[0037] in, represents the probability density value of the real-time data feature vector X after preprocessing the real-time data of the user's smart meter under each cluster distribution, and wd represents the dimension of the real-time data feature vector X after preprocessing the real-time data of the user's smart meter;
[0038] According to the probability density results of all clusters, the total anomaly score is calculated. The specific formula is:
[0039] ,
[0040] Wherein, S(X) represents the total anomaly score, that is, the degree to which the real-time data feature vector X deviates from the normal mode after preprocessing the real-time data of the user's smart meter, and log() represents the logarithmic function.
[0041] Specifically, the identifying, based on the user's historical electricity usage behavior, abnormal behavior that significantly deviates from the normal electricity usage pattern further includes:
[0042] Set the distance threshold to and the initial threshold of the anomaly score is , the anomaly score threshold of the current time window is adaptively updated according to the anomaly distribution of historical detection data and the stability of the current cluster center, and the anomaly score threshold of the current time window is obtained. The specific formula is:
[0043] ,
[0044] in, represents the anomaly score threshold for the current time window, Indicates the anomaly score threshold of the moment before the current time window, represents the update step size, Indicates the standard deviation of the anomaly score in the current time window;
[0045] The distance from the real-time data feature vector X to the cluster center after preprocessing the real-time data of the user's smart meter The system uses the total anomaly score S(X) to analyze the causal relationship between real-time electricity consumption data changes and historical electricity consumption behavior, and determines whether the current electricity consumption changes are caused by normal factors. At the same time, based on the time series prediction model, it predicts the electricity consumption trend in the specified time period in the future. If the deviation between the actual real-time data and the predicted trend exceeds the set threshold, the real-time data of the current user's smart meter is determined to be abnormal electricity consumption behavior, otherwise it is determined to be normal electricity consumption behavior.
[0046] Specifically, the preprocessing of the acquired historical electricity consumption data of the user includes:
[0047] Complete or remove missing data and smooth abnormal data points.
[0048] Specifically, the characteristics of the user's historical electricity usage data include:
[0049] Daily average electricity consumption, peak-to-valley ratio, current fluctuation, periodic trends and frequency of abnormal events.
[0050] The abnormal power consumption detection system of smart meters based on data analysis is used to implement the abnormal power consumption detection method of smart meters based on data analysis, including: a data acquisition module, a feature extraction module, a behavior analysis module, an abnormality analysis module and a real-time monitoring module;
[0051] The data acquisition module is used to acquire the user's historical electricity usage data according to the smart meter and pre-process the acquired user's historical electricity usage data;
[0052] The feature extraction module is used to extract the features of the pre-processed user historical electricity usage data;
[0053] The behavior analysis module is used to perform three-layer cluster analysis on the extracted features to analyze the user's historical electricity usage behavior;
[0054] The abnormality analysis module is used to identify abnormal behaviors that significantly deviate from normal electricity usage patterns based on the user's historical electricity usage behaviors;
[0055] The real-time monitoring module is used to adaptively adjust model parameters through a feedback mechanism to perform real-time monitoring of abnormal power consumption of the smart meter.
[0056] Specifically, the behavior analysis module includes: a feature extraction unit and a cluster analysis unit;
[0057] The feature extraction unit is used to extract the feature vector of the user's electricity consumption data and construct a feature matrix;
[0058] The cluster analysis unit is used to perform a three-layer cluster analysis on the constructed feature matrix to obtain the user's historical electricity usage behavior.
[0059] Specifically, the anomaly analysis module includes: a distance calculation unit, an anomaly score calculation unit and an abnormal behavior judgment unit;
[0060] The distance calculation unit is used to calculate the distance between the real-time data feature vector and the cluster center;
[0061] The anomaly score calculation unit is used to calculate the probability density of all clusters and calculate the total anomaly score based on the probability density results of all clusters;
[0062] The abnormal behavior judgment unit is used to judge whether the user's electricity usage behavior is abnormal based on the abnormality score and the distance.
[0063] Compared with the prior art, the present invention has the following beneficial effects:
[0064] 1. The present invention proposes a method for detecting abnormal electricity usage in smart meters based on data analysis. By clustering electricity usage data, the method can accurately characterize the typical electricity usage patterns of users. Through the probability density function, the method can flexibly respond to the personalized electricity usage patterns of different users, improve the accuracy of anomaly detection, and reduce false alarms.
[0065] 2. The present invention proposes a method for detecting abnormal electricity consumption in smart meters based on data analysis, which solves the inherent problems of single clustering methods in dynamic scenarios. The dynamic hierarchical fusion of time decay factor and hierarchical clustering breaks through the limitations of traditional static stratification. Closed-loop feedback and two-way optimization of parameters form a complete chain of adaptive detection, which is particularly suitable for user groups with complex electricity consumption characteristics.
[0066] 3. The present invention proposes a method for detecting abnormal electricity usage in smart meters based on data analysis, and introduces a distribution-based dynamic threshold adjustment mechanism that can adapt to changes in users' electricity usage patterns. Traditional methods use fixed thresholds, which are prone to false positives or missed positives. Dynamic threshold adjustment can be adaptively adjusted according to changes in users' electricity usage behavior, thereby achieving more accurate anomaly detection. BRIEF DESCRIPTION OF THE DRAWINGS
[0067] Figure 1 Flowchart of the method for detecting abnormal electricity consumption of smart meters based on data analysis provided by the present invention;
[0068] Figure 2 The three-layer clustering flow chart provided by the present invention;
[0069] Figure 3 This is an architecture diagram of the smart meter abnormal power consumption detection system based on data analysis provided by the present invention. DETAILED DESCRIPTION
[0070] In order to make the technical means, creative features, objectives and effects achieved by the present invention easy to understand, it should be noted that in the description of the present invention, the terms "center", "up", "down", "left", "right", "vertical", "horizontal", "inside", "outside" and the like indicate directions or positional relationships based on the directions or positional relationships shown in the accompanying drawings, which are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific direction, be constructed and operated in a specific direction, and therefore cannot be understood as a limitation on the present invention. In addition, the terms "No. 1", "No. 2" and "No. 3" are only used for descriptive purposes and cannot be understood as indicating or implying relative importance. The present invention will be further explained below in conjunction with specific embodiments.
[0071] Example 1
[0072] See also Figure 1 and Figure 2 The present invention provides an embodiment of a method for detecting abnormal electricity consumption of a smart meter based on data analysis, comprising the following specific steps:
[0073] Step S1: Obtain the user's historical electricity usage data from the smart meter. The user's historical electricity usage data includes information such as electricity usage, time period, and voltage, and pre-process the obtained user's historical electricity usage data.
[0074] The preprocessing includes: filling in missing data (such as averaging) or eliminating them, and smoothing abnormal data points to prevent misleading subsequent analysis;
[0075] Step S2: extracting features of the pre-processed user historical electricity usage data;
[0076] The specific steps of step S2 are:
[0077] Step S201: normalize the pre-processed historical electricity consumption data of the user and construct the feature vector X(t) at time t. , x m (t) represents the mth electricity consumption feature at time t. By setting a sliding window, the time series feature matrix T1 is constructed. , where x m (t n ) represents the mth electricity consumption characteristic at the nth moment;
[0078] The time series features include: daily average power consumption, peak-to-valley power consumption ratio, current fluctuation, periodic trend, abnormal event frequency, and other features. Through normalization processing, all eigenvalues are made between [0, 1] to ensure fairness when clustering data of different dimensions. The time series feature matrix is constructed by the eigenvectors of multiple time points to reflect the power consumption characteristics of users at different times.
[0079] Step S202: Construct a feature matrix T by combining external environmental features and composite features. The external environmental features include daily temperature, humidity, and holiday signs. The composite features include temperature sensitivity, which indicates a high temperature period or a low temperature period, and the ratio of power consumption to power consumption during a reference period. The reference period represents a specific time period, which is usually divided according to the variation pattern of the power load. The total power consumption during the period is divided by the number of hours during the period. For example, the reference period includes a peak period, a normal period, and a low period. Peak period: generally 10:00-12:00 and 14:00-19:00, for a total of 7 hours; Normal period: other time periods, for a total of 9 hours; Low period: generally 0:00-8:00, for a total of 8 hours. The power consumption during the peak period is divided by 7 hours, the power consumption during the normal period is divided by 9 hours, and the power consumption during the low period is divided by 8 hours.
[0080] Step S3: Perform a three-layer cluster analysis on the extracted features to analyze the user's historical electricity usage behavior;
[0081] The specific steps of step S3 are:
[0082] Step S301: Perform three-layer cluster analysis on the constructed feature matrix T, including first-layer cluster analysis, second-layer cluster analysis, and third-layer cluster analysis. In the first-layer clustering, clustering parameters are iteratively optimized by maximizing the likelihood function to group and probabilistically divide the feature matrix T. The specific formula is:
[0083] ,
[0084] Among them, p(X(t)) represents the grouping of the feature matrix T, K represents the number of clusters, which is used to divide the number of categories of the feature matrix. represents the mixing coefficient of the kth Gaussian distribution, that is, the proportion of the kth class, Represents the Gaussian distribution function, that is, the probability density of the eigenvector X(t) in the kth class, represents the mean of the k-th Gaussian distribution, that is, the center position of the k-th class, Represents the covariance matrix of the k-th Gaussian distribution, that is, the distribution range and direction of the k-th class;
[0085] By maximizing the probability density of the eigenvector X(t), the mixing coefficient, mean, and covariance of each class are iteratively optimized, and the data is finally divided into K clusters;
[0086] Gaussian distribution function The specific formula is:
[0087] ,
[0088] Among them, exp() represents the exponential function, zz represents the transpose of the vector, Represents the determinant value of the covariance matrix of the k-th Gaussian distribution, which is used to describe the stretch of the distribution. Represents the inverse matrix of the covariance of the k-th Gaussian distribution, which is used to standardize the distance of the data. a represents the dimension of the eigenvector at time t, which is equal to the length of the eigenvector. represents the circumference constant of pi;
[0089] The core of the Gaussian distribution function is based on the distance between the eigenvector and the mean, and controls the variance and correlation between features through the covariance matrix to determine the distribution of samples in the feature space;
[0090] Step S302: In the second-level clustering, hierarchical clustering is performed on the groups p(X(t)) of the feature matrix T, a hierarchical model is constructed, and the distance between layers is calculated. The specific formula is:
[0091] ,
[0092] Among them, d ij represents the distance between the i-th cluster and the j-th cluster in the grouping of the feature matrix T, X i represents the central eigenvector of the i-th class in the group of the feature matrix T, X j represents the central eigenvector of the jth class in the group of the feature matrix T, Represents the Euclidean distance between the centers of clusters i and j, and is used to calculate the shortest distance between clusters;
[0093] By calculating the minimum distance between clusters, the closest clusters are gradually merged to form a hierarchical structure, which is suitable for more complex clustering relationships;
[0094] Step S303: In the third layer of clustering, the time decay factor is used to optimize the results of the first layer of clustering and the second layer of clustering. The optimization objective function is:
[0095] ,
[0096] in, represents the objective function value of the third-level clustering, which is used to minimize the clustering error. C represents the number of cluster centers. X p represents the p-th cluster in the grouping of the feature matrix T, c q represents the qth cluster center, Represents the p-th cluster X in the grouping of the feature matrix T p For the qth cluster center c q The membership degree, that is, the correlation between the cluster and the cluster center, Represents the fuzzy factor, which is generally set to 2 and is used to control the smoothness of the membership. Represents the p-th cluster X in the grouping of the feature matrix Tp For the qth cluster center c q The square of the Euclidean distance, represents the time decay factor, , ts represents the number of days from the current data time, sx represents the attenuation coefficient;
[0097] In this embodiment, by minimizing the objective function , optimizes the membership between each data point and multiple cluster centers, so that the samples have different memberships to each cluster center, forming fuzzy class boundaries, which is convenient for describing the fuzzy characteristics of electricity consumption behavior; using the time decay factor, clustering focuses more on recent data, adapts to the dynamic changes in electricity consumption patterns, reduces the interference of outdated data on clustering results, and improves timeliness;
[0098] Step S304: Obtain the user's electricity usage behavior based on the three-layer cluster analysis results.
[0099] In this embodiment, the three-layer clustering is not a simple stacking of models. The first layer outputs the probabilistic clustering results, which serve as the input of the second layer of hierarchical clustering and are used to construct the hierarchical relationship of the user's electricity consumption behavior; the third layer optimizes the membership based on the results of the first two layers, generates dynamic cluster centers, and forms a closed-loop feedback with the Mahalanobis distance calculation in the real-time detection stage. Through the three-layer clustering, the inherent problems of a single clustering method in dynamic scenarios are solved, and technical effects exceeding expectations are produced in terms of false alarm rate, detection speed and complex pattern recognition, including: the dynamic hierarchical fusion of the time attenuation factor and hierarchical clustering, breaking through the limitations of traditional static stratification; closed-loop feedback and two-way optimization of parameters to form a complete chain of adaptive detection.
[0100] Step S4: Identify abnormal behaviors that significantly deviate from normal electricity usage patterns based on the user's historical electricity usage behaviors;
[0101] The specific steps of step S4 are:
[0102] Step S401: obtaining the user's smart meter real-time data, and setting the real-time data feature vector after pre-processing the user's smart meter real-time data as X;
[0103] Step S402: Calculate the distance between the real-time data feature vector X and the cluster center after preprocessing the real-time data of the user's smart meter. The specific formula is:
[0104] ,
[0105] in, represents the distance from the real-time data feature vector X to the cluster center after preprocessing of the user's smart meter real-time data, and zz represents the transpose of the vector;
[0106] In this embodiment, the distance here is the Mahalanobis distance. The larger the distance, the more the point deviates from the normal power consumption pattern. The data point with a large deviation will be determined as an abnormal point.
[0107] Step S403: Determine the possibility that the user's smart meter real-time data belongs to the normal power consumption mode, and calculate the probability density value of the real-time data feature vector X of the user's smart meter real-time data after preprocessing under each cluster distribution. The specific formula is:
[0108] ,
[0109] in, represents the probability density value of the real-time data feature vector X after preprocessing the real-time data of the user's smart meter under each cluster distribution, and wd represents the dimension of the real-time data feature vector X after preprocessing the real-time data of the user's smart meter;
[0110] In this embodiment, the formula is based on the probability density function of Gaussian distribution. For multidimensional data, Gaussian distribution can be characterized by the mean vector and covariance matrix: the mean vector μ k Describes the location of the data center, while the covariance matrix describes the distribution of data in different directions. By calculating the probability density value of X , it can be concluded that X falls into cluster c q The possibility of X is that the larger the density value is, the closer X is to the cluster center and the more it conforms to the typical pattern; conversely, the more X deviates from the normal pattern, the more likely it is abnormal data.
[0111] Step S404: Calculate the total anomaly score based on the probability density results of all clusters. The specific formula is:
[0112] ,
[0113] Where S(X) represents the total anomaly score, that is, the degree to which the real-time data feature vector X of the user's smart meter real-time data after preprocessing deviates from the normal mode, and log() represents the logarithmic function;
[0114] In this embodiment, the total anomaly score S(X) is calculated by calculating the total probability density of X under all clusters to measure its degree of anomaly. First, the probability density of X in each cluster is calculated. , then according to the mixing coefficient π k Perform weighting to obtain the total probability density value of X in all modes. Take the logarithm of the total probability density value and negate it to obtain the anomaly score S(X). If S(X) is large, it means that the probability of X in all modes is low, deviating from all normal modes, and therefore it is abnormal data; if S(X) is small, it means that the data point is more in line with the normal mode;
[0115] Step S405: Set the distance threshold to and the initial threshold of the anomaly score is , the anomaly score threshold of the current time window is adaptively updated according to the anomaly score of the historical detection data. The specific formula is:
[0116] ,
[0117] in, represents the anomaly score threshold for the current time window, Indicates the anomaly score threshold of the moment before the current time window, Indicates the update step size, which is used to control the change speed of the threshold. It is inversely proportional to the stability of the current cluster center, which is calculated by the historical offset of the cluster center. Indicates the standard deviation of the anomaly score in the current time window;
[0118] By dynamically adjusting the threshold, it can respond to changes in user power usage patterns and reduce false positives and missed positives;
[0119] Step S406: The distance from the real-time data feature vector X to the cluster center after preprocessing the real-time data of the user's smart meter And the total abnormality score S(X) is used to determine whether the user's electricity consumption behavior is abnormal. > or S(X)> When the user is in a state of emergency, the causal relationship between the real-time electricity consumption data changes and the historical electricity consumption behavior is analyzed to determine whether the current electricity consumption changes are caused by normal factors. At the same time, based on the time series prediction model, the electricity consumption trend in the specified time period in the future is predicted. If the deviation between the actual real-time data and the predicted trend exceeds the set threshold, the real-time data of the current user's smart meter is judged to be abnormal electricity consumption behavior, otherwise it is judged to be normal electricity consumption behavior.
[0120] Step S5: adaptively adjust the model parameters through the feedback mechanism to monitor the abnormal power consumption of the smart meter in real time.
[0121] Example 2
[0122] See also Figure 3 , another embodiment provided by the present invention: a smart meter abnormal electricity consumption detection system based on data analysis, comprising: a data acquisition module, a feature extraction module, a behavior analysis module, an abnormality analysis module and a real-time monitoring module;
[0123] The data acquisition module is used to acquire the user's historical electricity usage data according to the smart meter and pre-process the acquired user's historical electricity usage data;
[0124] The feature extraction module is used to extract the features of the pre-processed user historical electricity usage data;
[0125] The behavior analysis module is used to perform three-layer cluster analysis on the extracted features to analyze the user's historical electricity usage behavior;
[0126] The abnormality analysis module is used to identify abnormal behaviors that significantly deviate from normal electricity usage patterns based on the user's historical electricity usage behaviors;
[0127] The real-time monitoring module is used to adaptively adjust model parameters through a feedback mechanism to perform real-time monitoring of abnormal power consumption of the smart meter.
[0128] Behavior analysis module, including: feature extraction unit and cluster analysis unit;
[0129] The feature extraction unit is used to extract the feature vector of the user's electricity consumption data and construct a feature matrix;
[0130] The cluster analysis unit is used to perform a three-layer cluster analysis on the constructed feature matrix to obtain the user's historical electricity usage behavior.
[0131] Anomaly analysis module, including: distance calculation unit, anomaly score calculation unit and abnormal behavior judgment unit;
[0132] The distance calculation unit is used to calculate the distance between the real-time data feature vector and the cluster center;
[0133] The anomaly score calculation unit is used to calculate the probability density of all clusters and calculate the total anomaly score based on the probability density results of all clusters;
[0134] The abnormal behavior judgment unit is used to judge whether the user's electricity usage behavior is abnormal based on the abnormality score and the distance.
[0135] In addition, the parts of the above technical solutions provided in the embodiments of the present application that are consistent with the implementation principles of the corresponding technical solutions in the prior art are not described in detail to avoid excessive redundancy.
[0136] The above-described specific embodiments further illustrate the objectives, technical solutions, and beneficial effects of the present invention. It should be understood that the above description is merely a specific embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention shall be included within the scope of protection of the present invention.
Claims
1. A method for detecting abnormal electricity consumption of smart meters based on data analysis, characterized in that: The specific steps include: Obtaining historical electricity usage data of users based on smart meters and preprocessing the acquired historical electricity usage data of users; Extract the features of the pre-processed user historical electricity consumption data, including time series features, external environment features, and composite features; Perform three-layer cluster analysis on the extracted features to analyze the user's historical electricity consumption behavior; Based on the user's historical electricity usage behavior, identify abnormal behavior that significantly deviates from normal electricity usage patterns; Adaptively adjust model parameters through feedback mechanism to monitor abnormal power consumption of smart meters in real time; The three-layer cluster analysis is performed on the extracted features to analyze the user's historical electricity usage behavior, including: The constructed feature matrix T is subjected to three-layer cluster analysis, including the first-layer cluster analysis, the second-layer cluster analysis and the third-layer cluster analysis. In the first-layer clustering, the clustering parameters are iteratively optimized by maximizing the likelihood function, and the feature matrix T is grouped and probabilistically divided to obtain the grouping p(X(t)) of the feature matrix T. In the second layer of clustering, hierarchical clustering is performed on the grouping p(X(t)) of the feature matrix T, a hierarchical model is constructed, and the distance d between the i-th cluster and the j-th cluster in the grouping of the feature matrix T is calculated. ij ; In the third-layer clustering, the time decay factor is used to optimize the results of the first-layer clustering and the second-layer clustering, and the optimization objective function is set. The specific formula is: , in, represents the objective function value of the third-level clustering, C represents the number of cluster centers, X p represents the p-th cluster in the grouping of the feature matrix T, c q represents the qth cluster center, Represents the p-th cluster X in the grouping of the feature matrix T p For the qth cluster center c q The membership degree of represents the fuzzy factor, Represents the p-th cluster X in the grouping of the feature matrix T p For the qth cluster center c q The square of the Euclidean distance, represents the time decay factor, K represents the number of clusters; According to the results of three-layer cluster analysis, the user's electricity consumption behavior is obtained; The step of identifying abnormal behavior that significantly deviates from normal power usage patterns based on the user's historical power usage behavior includes: Acquire the user's smart meter real-time data, and set the real-time data feature vector after preprocessing the user's smart meter real-time data as X; Calculate the distance between the real-time data feature vector X and the cluster center after preprocessing the real-time data of the user's smart meter , the specific formula is: , in, represents the distance from the real-time data feature vector X to the cluster center after preprocessing of the user's smart meter real-time data, zz represents the transpose of the vector, represents the cluster center of the kth class; Determine the possibility that the user's smart meter real-time data belongs to the normal power consumption mode, and calculate the probability density value of the real-time data feature vector X after preprocessing the user's smart meter real-time data under each cluster distribution ; According to the probability density results of all clusters, the total anomaly score S(X) is calculated. The specific formula is: , Among them, S(X) represents the total anomaly score, that is, the degree to which the real-time data feature vector X deviates from the normal mode after preprocessing the real-time data of the user's smart meter, log() represents the logarithmic function, π k represents the mixing coefficient; Set the distance threshold to and the initial threshold of the anomaly score is The anomaly score threshold of the current time window is adaptively updated according to the anomaly distribution of historical detection data and the stability of the current cluster center to obtain the anomaly score threshold of the current time window , the specific formula is: , in, represents the anomaly score threshold for the current time window, Indicates the anomaly score threshold of the moment before the current time window, represents the update step size, Indicates the standard deviation of the anomaly score in the current time window; The distance from the real-time data feature vector X to the cluster center after preprocessing the real-time data of the user's smart meter And the total abnormality score S(X) is used to determine whether the user's electricity consumption behavior is abnormal. > or S(X)> When the user is in a state of emergency, the causal relationship between the real-time electricity consumption data changes and the historical electricity consumption behavior is analyzed to determine whether the current electricity consumption changes are caused by normal factors. At the same time, based on the time series prediction model, the electricity consumption trend in the specified time period in the future is predicted. If the deviation between the actual real-time data and the predicted trend exceeds the set threshold, the real-time data of the current user's smart meter is judged to be abnormal electricity consumption behavior, otherwise it is judged to be normal electricity consumption behavior.
2. The method for detecting abnormal electricity consumption of a smart meter based on data analysis according to claim 1, wherein: The features of the pre-processed historical electricity usage data of the user are extracted, including: Normalize the pre-processed historical electricity consumption data of users and construct the feature vector X(t) at time t. , x m (t) represents the mth electricity consumption feature at time t. By setting a sliding window, the time series feature matrix T1 is constructed. , where x m (t n ) represents the mth electricity consumption characteristic at the nth moment; The feature matrix T is constructed by combining external environmental features and composite features. The external environmental features include daily temperature, humidity, and holiday signs. The composite features include temperature sensitivity, whether it is a high temperature period or a low temperature period, and the ratio of power consumption to the reference period.
3. The method for detecting abnormal electricity consumption of a smart meter based on data analysis according to claim 1, wherein: The preprocessing of the acquired historical electricity consumption data of the user includes: Complete or remove missing data and smooth abnormal data points.
4. The method for detecting abnormal electricity consumption of a smart meter based on data analysis according to claim 1, wherein: The characteristics of the user's historical electricity usage data include: Daily average electricity consumption, peak-to-valley ratio, current fluctuation, periodic trends and frequency of abnormal events.
5. A smart meter abnormal power consumption detection system based on data analysis, used to implement the smart meter abnormal power consumption detection method based on data analysis according to any one of claims 1 to 4, characterized in that: include: Data acquisition module, feature extraction module, behavior analysis module, anomaly analysis module and real-time monitoring module; The data acquisition module is used to acquire the user's historical electricity usage data according to the smart meter and pre-process the acquired user's historical electricity usage data; The feature extraction module is used to extract the features of the pre-processed user historical electricity usage data; The behavior analysis module is used to perform three-layer cluster analysis on the extracted features to analyze the user's historical electricity usage behavior; The abnormality analysis module is used to identify abnormal behaviors that significantly deviate from normal electricity usage patterns based on the user's historical electricity usage behaviors; The real-time monitoring module is used to adaptively adjust model parameters through a feedback mechanism to perform real-time monitoring of abnormal power consumption of the smart meter.
6. The data analysis-based smart meter abnormal power consumption detection system according to claim 5, characterized in that: The behavior analysis module includes: a feature extraction unit and a cluster analysis unit; The feature extraction unit is used to extract the feature vector of the user's electricity consumption data and construct a feature matrix; The cluster analysis unit is used to perform a three-layer cluster analysis on the constructed feature matrix to obtain the user's historical electricity usage behavior.
7. The data analysis-based smart meter abnormal power consumption detection system according to claim 6, characterized in that: The abnormality analysis module includes: a distance calculation unit, an abnormality score calculation unit and an abnormal behavior judgment unit; The distance calculation unit is used to calculate the distance between the real-time data feature vector and the cluster center; The anomaly score calculation unit is used to calculate the probability density of all clusters and calculate the total anomaly score based on the probability density results of all clusters; The abnormal behavior judgment unit is used to judge whether the user's electricity usage behavior is abnormal based on the abnormality score and the distance.
Citation Information
Patent Citations
Method and system for detecting abnormal power consumption behavior of power consumer
CN116975726A
Power consumption abnormity detection method
CN117150409A
Power consumption behavior anomaly detection method and device and computer readable storage medium
CN112686288A
Electricity stealing user identification system based on deep well network
CN117495109A
Cited By
Electric power abnormal fluctuation detection method and system fused with time sequence modeling
CN121682584A