Abnormal electricity utilization detection method based on electricity utilization analysis
By combining electricity consumption analysis with association rule mining and KMeans clustering algorithm, abnormal electricity users in the power grid system are identified and analyzed. This solves the problems of low accuracy and low efficiency in existing technologies and achieves efficient abnormal electricity consumption detection and cause analysis.
Patent Information
- Application Number
- CN202511691301.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-18
- Publication Date
- 2026-02-13
AI Technical Summary
Existing technologies are insufficient to effectively identify abnormal power users in the power grid system, leading to power and economic losses. Furthermore, existing methods are inaccurate and inefficient, and do not consider the correlation between users' electricity consumption behaviors.
This study employs an electricity consumption analysis-based approach. It obtains electricity consumption data from smart meters or power company databases, performs data preprocessing and cleaning, utilizes association rule mining algorithms to discover correlations in electricity consumption characteristics, and combines KMeans clustering algorithm and outlier detection to identify abnormal groups and perform visualization analysis.
It enables effective identification and cause analysis of abnormal electricity consumption behavior, improves identification accuracy, reduces model training difficulty and cost, and enhances the interpretability of results.
Smart Images

Figure CN121524879A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of abnormal power consumption detection, and in particular to an abnormal power consumption detection method based on power consumption analysis. Background Technology
[0002] There are some abnormal electricity users in the power grid system. These users may have problems such as equipment failure, energy waste, or electricity theft, which can lead to power losses and additional costs. By identifying abnormal electricity users, timely measures can be taken to resolve these issues and reduce power and economic losses. The electricity usage behavior of abnormal users can also have an unstable impact on the power supply, such as excessive load, frequent start-stop cycles, or unreasonable electricity usage patterns.
[0003] Because raw electricity consumption data may contain missing, outlier, or duplicate values, data cleaning and preprocessing are necessary to ensure accuracy and completeness. Extracting effective features from raw data is crucial for identifying anomalous groups, but selecting and extracting features relevant to anomalous groups remains a challenge. Furthermore, current methods for identifying anomalous groups generally rely on statistical analysis, which is inaccurate and inefficient, and fails to consider the correlation between users' electricity consumption behaviors, leading to identification errors. Summary of the Invention
[0004] To address the aforementioned problems, the present invention aims to provide an abnormal electricity consumption detection method based on electricity consumption analysis, which can effectively identify abnormal groups based on electricity consumption analysis.
[0005] To achieve the above objectives, the present invention adopts the following technical solution:
[0006] An abnormal power consumption detection method based on power consumption analysis includes the following steps:
[0007] Step 1. Obtain the user's electricity consumption data from smart meters, sensor devices, or the power company's database, including information such as electricity consumption, usage time, and usage patterns. Specific data may also include daily / hourly electricity consumption, usage time periods, and types of electrical equipment.
[0008] Step 2: Data preprocessing: Cleaning, denoising, and normalizing the collected data;
[0009] Step 3: Based on the association rule mining algorithm, discover the association relationships between different electricity consumption characteristics, such as the association rules between electricity consumption and electricity consumption time.
[0010] Step 4: Extract features from the association rule mining results to serve as feature vectors for electricity consumption.
[0011] Step 5: Apply the extracted feature vectors to the KMeans clustering algorithm to divide users into different groups;
[0012] Step 6: Perform anomaly detection on users in each group, using the outlier detection method in the KMeans algorithm to identify anomalous groups;
[0013] Step 7: Visualize the identified abnormal groups and conduct in-depth analysis of abnormal electricity usage behavior to identify the causes of the abnormalities and possible solutions.
[0014] Further, step 2 is as follows:
[0015] Step 2.1 First, process missing values, outliers, and duplicate values to ensure the integrity and accuracy of the data.
[0016] For missing values, interpolation is used to fill them.
[0017] For outliers, identify and remove them through statistical analysis or visualization methods.
[0018] For duplicate values, detect and delete duplicate records to ensure that there is no duplicate information in the data;
[0019] Step 2.2: Smooth the data using the moving average method to obtain the noise-removed data sequence;
[0020] Given a window size of n, the smoothed value of the i-th data point is:
[0021]
[0022] Finally, the max-min normalization method is used to process the data to ensure that the numerical ranges of different features are consistent and to improve the comparability of the data.
[0023] Furthermore, step 3 specifically involves:
[0024] Step 3.1: Based on the characteristics of the dataset and the mining objectives, set the minimum support threshold to 0.1 and the minimum confidence threshold to 0.7 to filter frequent itemsets and association rules;
[0025] Step 3.2: Mining frequent itemsets based on the Apriori algorithm;
[0026] Step 3.3: Utilize the results of frequent itemset mining to generate association rules and calculate the confidence of the rules;
[0027] For each frequent itemset X, generate an association rule X⇒Y, where Y is a subset of X, and calculate the confidence of the association rule:
[0028]
[0029] in, ;
[0030] Step 3.4: Based on the confidence level of the rules, filter out the support levels of association rules that are higher than the preset support and confidence levels.
[0031] Furthermore, step 5 specifically involves:
[0032] Step 5.1: Use the feature vectors extracted from the association rule mining results as input data.
[0033] Step 5.2: Determine the optimal K value using the Elbow Method.
[0034] Step 5.3: Randomly select K data points as initial cluster centers.
[0035] Step 5.4: For each data point, calculate its distance to all cluster centers and assign it to the cluster represented by the nearest cluster center.
[0036] Calculate the distance between data point x and cluster center c using Euclidean distance:
[0037]
[0038] Where xi and ci are the coordinates of data point x and cluster center c in the i-th dimension, respectively;
[0039] Step 5.5: Recalculate the centroid Cj of each cluster, typically the mean of all points within the cluster;
[0040]
[0041] Where Sj is the set of all data points in the j-th cluster;
[0042] Step 5.6: Repeat steps 5.4 and 5.5 until the cluster centers no longer change significantly or the preset number of iterations is reached;
[0043] Step 5.7: Perform feature analysis on the user groups obtained from clustering to understand the electricity consumption characteristics of different groups.
[0044] Furthermore, the outlier detection method in the KMeans algorithm is used to identify anomalous groups. Specifically, outlier detection is performed on the feature vectors of users in each group, and the feature vectors of each group are treated as a subset of the dataset.
[0045] Determine the metrics for outlier detection, including the distance from data points to cluster centers;
[0046] Apply the KMeans algorithm to each subset of data to obtain cluster centers.
[0047] Calculate the distance from each data point to its cluster center, and mark data points whose distance exceeds a certain threshold as outliers.
[0048] The number of data points marked as outliers in each group is counted to determine which group's users are identified as an outlier.
[0049] An abnormal power consumption detection system based on power consumption analysis includes a processor, a memory, and a computer program stored in the memory. When the processor executes the computer program, it specifically performs the steps in the abnormal power consumption detection method based on power consumption analysis as described above.
[0050] A computer storage medium, characterized in that the computer storage medium stores a plurality of instructions, the instructions being adapted to be loaded by a processor and executed as described above.
[0051] The present invention has the following beneficial effects:
[0052] 1. This invention combines association rule mining and KMeans clustering algorithm to identify abnormal groups in electricity consumption, which can effectively identify abnormal groups based on electricity consumption analysis and provide a reference for further electricity management and optimization.
[0053] 2. This invention transforms the results of association rule mining into feature vectors, thereby better describing the correlation between different features in electricity consumption. It combines K-MEANS clustering and association rule mining algorithms to identify abnormal groups, solving the problem that a single algorithm may not be able to effectively identify abnormal groups. At the same time, it does not require a large amount of labeled data for training, reducing the difficulty and cost of model training. Through association rule mining, it can not only identify abnormal groups, but also find the possible causes of abnormal electricity consumption behavior, enhancing the interpretability of the results. Attached Figure Description
[0054] Figure 1 This is a flowchart of the method of the present invention;
[0055] Figure 2 This is a schematic diagram of the model training process provided in an embodiment of the present invention;
[0056] Figure 3 This is a schematic diagram of outliers in an embodiment of the present invention. Detailed Implementation
[0057] The present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments:
[0058] refer to Figure 1In this embodiment, step 1 is provided: obtaining the user's electricity consumption data from a smart meter, sensor device, or power company's database, including information such as electricity consumption, electricity consumption time, and electricity consumption pattern. Specific data also includes daily / hourly electricity consumption, electricity consumption time periods, and types of electrical equipment.
[0059] Step 2: Data preprocessing: Cleaning, denoising, and normalizing the collected data to ensure data quality and comparability.
[0060] Step 2.1 First, process missing values, outliers, and duplicate values to ensure the integrity and accuracy of the data.
[0061] For missing values, interpolation is used to fill them.
[0062] For outliers, identify and remove them through statistical analysis or visualization methods.
[0063] For duplicate values, detect and delete duplicate records to ensure that there is no duplicate information in the data;
[0064] Step 2.2: Smooth the data using the moving average method to obtain the noise-removed data sequence;
[0065] Given a window size of n, the smoothed value of the i-th data point is:
[0066]
[0067] Data normalization: The max-min normalization method processes data to ensure that the numerical ranges of different features are consistent, thereby improving the comparability of data.
[0068] Step 3: Based on the association rule mining algorithm, discover the association relationships between different electricity consumption characteristics, such as the association rules between electricity consumption and electricity consumption time.
[0069] Step 3.1: Based on the characteristics of the dataset and the mining objectives, set the minimum support threshold to 0.1 and the minimum confidence threshold to 0.7 to filter frequent itemsets and association rules;
[0070] Step 3.2: Mining frequent itemsets based on the Apriori algorithm;
[0071] Step 3.3: Utilize the results of frequent itemset mining to generate association rules and calculate the confidence of the rules;
[0072] For each frequent itemset X, generate an association rule X⇒Y, where Y is a subset of X, and calculate the confidence of the association rule:
[0073]
[0074] in, ;
[0075] Step 3.4: Based on the confidence level of the rules, filter out the support levels of association rules with high support and confidence.
[0076] Step 4: Extract features from the results of association rule mining to serve as feature vectors for electricity consumption.
[0077] Extract frequently occurring features and rule combinations from frequent itemsets and association rules, such as {A, B}, {B, C}, {A, C}, etc.
[0078] The extracted features are encoded using one-hot encoding to convert them into numerical form. Each feature is encoded as either 0 or 1, indicating whether the feature appears in the feature combination.
[0079] The encoded features are combined into a feature vector, with each feature corresponding to one dimension of the vector.
[0080] Step 5: Apply the extracted feature vectors to the KMeans clustering algorithm to divide users into different groups.
[0081] Step 5.1: Use the feature vectors extracted from the association rule mining results as input data.
[0082] Step 5.2: Determine the optimal K value using the Elbow Method.
[0083] Step 5.3: Randomly select K data points as initial cluster centers.
[0084] Step 5.4: For each data point, calculate its distance to all cluster centers and assign it to the cluster represented by the nearest cluster center.
[0085] Calculate the distance between data point x and cluster center c using Euclidean distance:
[0086]
[0087] Where xi and ci are the coordinates of data point x and cluster center c in the i-th dimension, respectively;
[0088] Step 5.5: Recalculate the centroid Cj of each cluster, typically the mean of all points within the cluster;
[0089]
[0090] Where Sj is the set of all data points in the j-th cluster;
[0091] Step 5.6: Repeat steps 5.4 and 5.5 until the cluster centers no longer change significantly or the preset number of iterations is reached;
[0092] Step 5.7: Perform feature analysis on the user groups obtained from clustering to understand the electricity consumption characteristics of different groups.
[0093] Step 6: Perform anomaly detection on users in each group, using the outlier detection method in the KMeans algorithm to identify anomalous groups.
[0094] Specifically: outlier detection is performed on the feature vectors of users in each group, and the feature vectors of each group are treated as a subset of the dataset.
[0095] Determine the metrics for outlier detection, including the distance from data points to cluster centers;
[0096] Apply the KMeans algorithm to each subset of data to obtain cluster centers.
[0097] Calculate the distance from each data point to its cluster center, and mark data points whose distance exceeds a certain threshold as outliers.
[0098] The number of data points marked as outliers in each group is counted to determine which group's users are identified as an outlier.
[0099] Step 7: Visualize the identified abnormal groups and conduct in-depth analysis of abnormal electricity usage behavior to identify the causes of the abnormalities and possible solutions.
[0100] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.
[0101] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0102] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.
[0103] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.
[0104] The above description is merely a preferred embodiment of the present invention and is not intended to limit the present invention in any other way. Any person skilled in the art may make changes or modifications to the above-disclosed technical content to create equivalent embodiments. However, any simple modifications, equivalent changes, and modifications made to the above embodiments based on the technical essence of the present invention without departing from the scope of the present invention shall still fall within the protection scope of the present invention.
Claims
1. A method for detecting abnormal electricity consumption based on electricity consumption analysis, characterized in that, Includes the following steps: Step 1. Obtain the user's electricity consumption data from smart meters, sensor devices, or the power company's database; Step 2: Data preprocessing: Cleaning, denoising, and normalizing the collected data; Step 3: Based on the association rule mining algorithm, discover the correlation between different electricity consumption characteristics; Step 4: Extract features from the association rule mining results to serve as feature vectors for electricity consumption. Step 5: Apply the extracted feature vectors to the KMeans clustering algorithm to divide users into different groups; Step 6: Perform anomaly detection on users in each group, using the outlier detection method in the KMeans algorithm to identify anomalous groups; Step 7: Visualize the identified abnormal groups and conduct in-depth analysis of abnormal electricity usage behavior to identify the causes of the abnormalities and possible solutions.
2. The abnormal power consumption detection method based on power consumption analysis according to claim 1, characterized in that, Step 2 is as follows: Step 2.1 First, process missing values, outliers, and duplicate values to ensure the integrity and accuracy of the data. For missing values, interpolation is used to fill them in. For outliers, identify and remove them through statistical analysis or visualization methods. For duplicate values, detect and delete duplicate records to ensure that there is no duplicate information in the data; Step 2.2: Smooth the data using the moving average method to obtain the noise-removed data sequence; Given a window size of n, the smoothed value of the i-th data point is: Finally, the max-min normalization method is used to process the data to ensure that the numerical ranges of different features are consistent and to improve the comparability of the data.
3. The abnormal power consumption detection method based on power consumption analysis according to claim 1, characterized in that, Step 3 specifically includes: Step 3.1: Based on the characteristics of the dataset and the mining objectives, set the minimum support threshold to 0.1 and the minimum confidence threshold to 0.7 to filter frequent itemsets and association rules; Step 3.2: Mining frequent itemsets based on the Apriori algorithm; Step 3.3: Utilize the results of frequent itemset mining to generate association rules and calculate the confidence of the rules; For each frequent itemset X, generate an association rule X⇒Y, where Y is a subset of X, and calculate the confidence of the association rule: in, ; Step 3.4: Based on the confidence level of the rules, filter out the support levels of association rules that are higher than the preset support and confidence levels.
4. The abnormal power consumption detection method based on power consumption analysis according to claim 1, characterized in that, Step 5 specifically involves: Step 5.1: Use the feature vectors extracted from the association rule mining results as input data. Step 5.2: Determine the optimal K value using the Elbow Method. Step 5.3: Randomly select K data points as initial cluster centers. Step 5.4: For each data point, calculate its distance to all cluster centers and assign it to the cluster represented by the nearest cluster center. Calculate the distance between data point x and cluster center c using Euclidean distance: Where xi and ci are the coordinates of data point x and cluster center c in the i-th dimension, respectively; Step 5.5: Recalculate the centroid Cj of each cluster, typically the mean of all points within the cluster; Where Sj is the set of all data points in the j-th cluster; Step 5.6: Repeat steps 5.4 and 5.5 until the cluster centers no longer change significantly or the preset number of iterations is reached; Step 5.7: Perform feature analysis on the user groups obtained from clustering to understand the electricity consumption characteristics of different groups.
5. The abnormal power consumption detection method based on power consumption analysis according to claim 1, characterized in that, The method of outlier detection in the KMeans algorithm is used to identify abnormal groups. Specifically, outlier detection is performed on the feature vectors of users in each group, and the feature vectors of each group are treated as a subset of the dataset. Determine the metrics for outlier detection, including the distance from data points to cluster centers; Apply the KMeans algorithm to each subset of data to obtain cluster centers. Calculate the distance from each data point to its cluster center, and mark data points whose distance exceeds a certain threshold as outliers. The number of data points marked as outliers in each group is counted to determine which group's users are identified as an outlier.
6. An abnormal power consumption detection system based on power consumption analysis, characterized in that, It includes a processor, a memory, and a computer program stored in the memory. When the processor executes the computer program, it specifically performs the steps in the abnormal power consumption detection method based on power consumption analysis as described in any one of claims 1-5.
7. A computer storage medium, characterized in that, The computer storage medium stores a plurality of instructions, which are adapted to be loaded by a processor and executed as the method steps of any one of claims 1 to 5.
Citation Information
Patent Citations
Electricity consumption abnormity group identification method combining association rule mining and KMeans clustering algorithm
CN118916771A