Abnormal power consumption behavior identification method based on improved DBSCAN algorithm

Through the improved DBSCAN algorithm combined with least squares method and APAA algorithm, the parameters are adaptively determined, which solves the complexity and computational burden of the existing abnormal electricity behavior recognition methods and improves the recognition accuracy.

CN120408452APending Publication Date: 2025-08-01STATE GRID FUJIAN ELECTRIC POWER CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510672423.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-05-23
Publication Date
2025-08-01

AI Technical Summary

Technical Problem

The existing abnormal electricity behavior recognition methods have complex modeling, high computational burden and strong parameter dependence, resulting in insufficient recognition accuracy.

Method used

The improved DBSCAN algorithm is adopted, combined with the least squares method and the APAA algorithm, and through segmented linear fitting, load feature extraction and first-order differential cosine distance calculation, clustering parameters are adaptively determined and abnormal electricity consumption behavior is identified.

Benefits of technology

It improves the accuracy of identification of abnormal electricity use behavior, reduces the computational complexity and parameter dependence, and has engineering practicality.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120408452A_ABST
    Figure CN120408452A_ABST
Patent Text Reader

Abstract

The invention provides an abnormal power consumption behavior identification method based on an improved DBSCAN algorithm. The method comprises the following steps: S1, obtaining metering point working condition data through a power consumption information acquisition system; s2, fitting the cumulative electricity consumption curve by adopting a self-piecewise linear fitting method based on a least square method; s3, main characteristics of load data are acquired for the daily load curve of the marked user based on an APAA algorithm; s4, dividing the load curve marking the user i into a plurality of data sets based on the inflection points obtained in the step S2; and S5, calculating the similarity of the data set clustering centers by adopting a first-order difference cosine distance, setting a threshold value through experience for judgment, and marking the user as an abnormal user when the result is lower than the threshold value.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of abnormal power consumption of special transformers and low-voltage substation area users, and particularly to a method for identifying abnormal power consumption behaviors based on an improved DBSCAN algorithm. Background Technique

[0002] Abnormal power consumption behaviors of users not only damage the economic interests of the power industry, but also affect the safe operation of the power grid. The early means of identifying abnormal power consumption behaviors by relying on technicians to regularly inspect electricity meters are less efficient. The identification of abnormal power consumption behaviors based on data-driven has gradually become a research hotspot due to its advantages such as flexible use, low cost, and high accuracy. Currently, the methods for identifying abnormal power consumption behaviors based on data mining mainly include three subcategories: classification-based, regression-based, and clustering-based.

[0003] (1) The classification-based method improves the classification accuracy by training a large number of labeled sample data. However, the establishment process of the classification model is generally complex, and the acquisition process of the labeled data set requires a large amount of manpower, financial resources, and time.

[0004] (2) The regression-based method usually combines a load forecasting method and uses the deviation between the actual power consumption and the predicted value to determine whether a user consumes power abnormally. However, the randomness of users' power consumption behaviors makes the accuracy of short-term load forecasting for a single user not ideal. In addition, due to the different power consumption patterns of each user, it is usually necessary to establish a regression model for each user, resulting in a large computational burden.

[0005] (3) The clustering-based method divides unlabeled samples into different clusters through certain specific algorithms, so that the samples in the same cluster have some similar attributes, and then identifies suspected abnormal users according to the degree of deviation of the samples from the cluster. However, traditional clustering-based methods, such as k-means clustering, are strongly dependent on parameters. Summary of the Invention

[0006] In view of this, the purpose of the present invention is to provide a method for identifying abnormal power consumption behaviors based on an improved DBSCAN algorithm, which solves the deficiencies of the existing methods for identifying abnormal power consumption behaviors, such as complex modeling, large computational burden, and strong parameter dependence, and can effectively improve the identification accuracy of specific abnormal power consumption categories.

[0007] To achieve the above purpose, the present invention adopts the following technical solutions: A method for identifying abnormal power consumption behaviors based on an improved DBSCAN algorithm, including the following steps:

[0008] S1: Obtain the working condition data of the metering point through the power consumption information acquisition system, obtain the daily active power data P of the electric energy meter corresponding to the user i,t,d , and construct the daily power consumption sequence of each user With the cumulative power consumption curve

[0009] S2: Use the self - segmented linear fitting method based on the least - squares method to fit the cumulative power consumption curve and set the number of segments n Seg , and calculate the inflection points and the slopes of each straight - line segment If the difference between the slopes of adjacent segments is higher than the threshold record the user as a marked user;

[0010] S3: Based on the APAA algorithm, obtain the main characteristics of the load data from the daily load curves of the marked users, and reduce the computational difficulty caused by redundant data;

[0011] S4: Based on the inflection points obtained in step S2, divide the load curve of the marked user i into multiple data sets, and use the density - based clustering algorithm DBSCAN to cluster the load - feature sequences in the data sets after division for each user to obtain user load clustering clusters;

[0012] S5: Use the first - order difference cosine distance to calculate the similarity of the clustering centers of each data set, and make a judgment by empirically setting a threshold. When the result is lower than the threshold, mark the user as an abnormal user.

[0013] In a preferred embodiment, step 3 specifically includes:

[0014] Step S31: Normalize the load data, set the time - window length as Δt, and the normalization method uses the Min - Max normalization method. The calculation formula is as follows:

[0015]

[0016] Where: x is the vector to be normalized, min(x) and max(x) respectively represent the minimum and maximum values of the vector x;

[0017] Step S32: Record the number of ramp - up events on the load sequence within each time window Set the initial value of the number of ramp - up events within each time window to 0. If the difference between the maximum and minimum values of the user load within the time window is higher than the set threshold δ ramp , it is considered that a ramp - up event occurs within this time window;

[0018] The calculation formula for the load change amplitude is:

[0019]

[0020] Step S33: Record the number of edge points on the load sequence within each time window Set the initial value of the number of edge points in each time window to 0. Within the time window Δt, if the change amplitude of the load at a certain moment t compared to the loads at the two adjacent moments before and after exceeds the set threshold δ peak , this moment is considered an edge point; by default, the moments before and after are not edge points during the calculation;

[0021] The calculation formula for the load change amplitude is:

[0022]

[0023] Step S34: If the number of ramp events and edge points in the time window is not 0, the data within this time window is retained; otherwise, the data for this time window segment takes the mean value of the load for this segment;

[0024] Step S35: Output the load feature sequence

[0025] In a preferred embodiment, the specific steps of step 4 are as follows:

[0026] Step S41: Generate the neighborhood radius and density threshold; calculate the cosine similarity between the load on the dth day and the loads of other days, and sort them in ascending order to obtain Then calculate the distance vector of the loads of all days of user i to obtain the distance matrix Calculate the mean value of the similarities of each column in turn to obtain N increasing candidate neighborhood radius parameters And calculate the number of dates within the neighborhood of each day's load of the user under this neighborhood radius for each candidate parameter, and take the average value of this number of dates as the density threshold Obtain the algorithm candidate parameter pair of user i

[0027] Step 42: Let d = 1, and input the neighborhood radius parameter and density threshold as and Initialize the sample set Mark each sample as unprocessed, let n = 1, and the number of clusters c after clustering = 0;

[0028] Step 43: Select a sample If the mark status of the sample is unprocessed, proceed to the next step; otherwise, n = n + 1, and continue to judge the next object;

[0029] Step 44: Initialize the counter Count c (n) to 0, and calculate the cosine similarity between the sample and the sample m ∈ {1, 2, …, m, …, D} in the sample set If increment the counter by one;

[0030] Step 45: If mark the sample as a boundary vector or a noise vector, and return to Step 44;

[0031] Step 46: c = c + 1. For the sample create a new cluster Mark as a core vector, and include all samples that satisfy into the cluster

[0032] Step 47: Obtain the vectors that are density-connected to the sample ; Detect one by one the vectors in the cluster that have not been processed Calculate its neighborhood with as the radius If the number of elements in the neighborhood reaches Detect the set

[0033] Step 48: n = n + 1, and return to Step 43; When n = D + 1, output the clustering result, and the result includes the cluster partition the clustering centers of each cluster and the marking situation of each vector;

[0034] Step 49: d = d + 1, and return to Step 41. When Δc ≤ 1 or d = D, output the optimal parameter pair Output the clustering result at this time.

[0035] In a preferred embodiment, the specific steps of Step 5 include:

[0036] The first-order difference operation of the load is defined as:

[0037]

[0038] In the formula: is the normalized load of user i at time t on the d-th day, is the normalized load of user i at time t + 1 on the d-th day, is the value of the t-th dimension of the d-th load difference vector of the i-th user;

[0039] The differential cosine distance of the load is defined as:

[0040]

[0041] In the formula:​ is the cosine distance between the d-th and d'-th load difference vectors; is the 2-norm of the load difference vector of the i-th user on the d-th day.

[0042] Compared with the prior art, the present invention has the following beneficial effects:

[0043] 1. A method for identifying abnormal electricity consumption behavior of users based on an improved DBSCAN algorithm is proposed, which solves the deficiencies of the existing abnormal electricity consumption behavior identification methods, such as complex modeling, large computational burden, and strong parameter dependence, and can effectively improve the identification accuracy of specific electricity consumption anomaly categories.

[0044] 2. The DBSCAN density clustering algorithm with self-adaptive determination of parameters and the calculation of the similarity of clustering centers by the first-order difference cosine distance are simple to implement and have certain engineering practicability. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] Figure 1 is a schematic diagram of the method for identifying abnormal electricity consumption behavior of users based on an improved DBSCAN algorithm according to a preferred embodiment of the present invention. DETAILED DESCRIPTION OF THE INVENTION

[0046] The present invention will be further described below with reference to the drawings and embodiments.

[0047] It should be noted that the following detailed description is illustrative and is intended to provide further explanation of the present application. Unless otherwise specified, all technical and scientific terms used herein have the same meaning as commonly understood by those of ordinary skill in the technical field to which the present application belongs.

[0048] It should be noted that the terms used herein are only for describing specific embodiments and are not intended to limit the exemplary embodiments according to the present application; as used herein, unless the context clearly indicates otherwise, the singular forms are also intended to include the plural forms. In addition, it should be understood that when the terms "comprising" and / or "including" are used in this specification, they indicate the presence of features, steps, operations, devices, components, and / or combinations thereof.

[0049] An abnormal electricity consumption behavior identification method based on an improved DBSCAN algorithm, referring to Figure 1 , includes the following steps:

[0050] S1: Obtain the metering point operating condition data through the electricity information acquisition system to obtain the daily active power data P of the electricity meter corresponding to the user i,t,d , and construct the daily electricity consumption sequence of each user and the cumulative electricity consumption curve

[0051] S2: Fit the cumulative power consumption curve using the self - segmented linear fitting method based on the least - squares method, and set the number of segments n Seg , and calculate the inflection points of the segmented function after fitting and the slopes of each straight - line segment If the difference in slopes of adjacent segments is higher than the threshold record the user as a marked user;

[0052] S3: Based on the APAA algorithm, obtain the main features of the load data from the daily load curves of marked users, and reduce the computational difficulty caused by redundant data;

[0053] S3 - 1: Normalize the data. Set the time - window length as Δt, and the normalization method uses the Min - Max normalization method. The calculation formula is as follows:

[0054]

[0055] In the formula: x is the vector to be normalized, min(x) and max(x) represent the minimum and maximum values of the vector x respectively;

[0056] S3 - 2: Record the number of ramp - up events in the load sequence within each time window Set the initial value of the number of ramp - up events in each time window as 0. If the difference between the maximum and minimum values of the user load within the time window is higher than the set threshold δ ramp , it is considered that a ramp - up event has occurred within this time window;

[0057] The calculation formula for the load change amplitude is:

[0058]

[0059] S3 - 3: Record the number of edge points in the load sequence within each time window Set the initial value of the number of edge points in each time window as 0. Within the time window Δt, for the load at a certain moment t, if the change amplitude with the loads of the two adjacent moments before and after exceeds the set threshold δ peak , this moment is considered an edge point. When calculating, it is default that the adjacent moments before and after are not edge points;

[0060] The calculation formula for the load change amplitude is:

[0061]

[0062] S3 - 4: If the number of ramp - up events and edge points within the time window is not 0, the data within this time window is retained; otherwise, the data for this time - window segment takes the mean value of the load for this segment;

[0063] S3 - 5: Output the load - feature sequence

[0064] S4: Based on the inflection points obtained in step S2, divide the load curve of user i into multiple data sets, and use the density-based clustering algorithm DBSCAN to cluster the load feature sequences in the divided data sets of each user to obtain user load clustering clusters;

[0065] S4-1: Generate the neighborhood radius and density threshold. Calculate the cosine similarity between the load on the d-th day and the loads on other days, and sort them in ascending order to obtain Then calculate the distance vector of all daily loads of user i to obtain the distance matrix Calculate the mean value of the similarities of each column in turn to obtain N increasing candidate neighborhood radius parameters And for each candidate parameter, calculate the number of dates in the neighborhood of each daily load of the user under this neighborhood radius, and use the average value of this number of dates as the density threshold Obtain the algorithm candidate parameter pair of user i

[0066] 4-2: Let d = 1, and input the neighborhood radius parameter and density threshold as And Initialize the sample set Mark each sample as unprocessed, set n = 1, and the number of clusters after clustering c = 0;

[0067] 4-3: Select the sample If the marking status of the sample is unprocessed, proceed to the next step; otherwise, n = n + 1, and continue to judge the next object;

[0068] 4-4: Initialize the counter Count c (n) to 0, and calculate the cosine similarity between the sample and the sample m ∈ {1, 2,..., m,..., D} in the sample set If Increment the counter by one;

[0069] 4-5: If Mark the sample as a border vector or a noise vector, and return to step 4-4;

[0070] 4-6: c = c + 1, and for the sample Create a new cluster Mark as a core vector, and include all samples that satisfy into the cluster

[0071] 4-7: Obtain the samples related to the sample Density-connected vectors. Detect each cluster The vectors in it that have not been processed yet Calculate its neighborhood Ω with ε-Eps (P i,q ) as the radius. If the number of elements in the neighborhood reaches Detect set Ω ε-Eps (P i,q ). If there are vectors that have not been assigned to any cluster, assign them to cluster

[0072] 4 - 8: n = n + 1, return to step 4 - 3; when n = D + 1, output the clustering result, which includes the cluster partition The clustering centers of each cluster and the marking situation of each vector;

[0073] 4 - 9: d = d + 1, return to step 4 - 1. When Δc ≤ 1 or d = D, output the optimal parameter pair Output the clustering result at this time;

[0074] S5: Calculate the similarity of the clustering centers of each dataset using the first - order difference cosine distance, judge by setting a threshold through experience, and mark the user as an abnormal user when the result is lower than the threshold.

[0075] The first - order difference operation of the load is defined as:

[0076]

[0077] In the formula: is the normalized load of user i at time t on day d, is the value of the t - th dimension of the d - th load difference vector of the i - th user;

[0078] The difference cosine distance of the load is defined as:

[0079]

[0080] In the formula: is the cosine distance between the d - th and d'- th load difference vectors; is the 2 - norm of the load difference vector of the i - th user on day d.

[0081] The present invention proposes a method for identifying abnormal electricity consumption behaviors of users based on an improved DBSCAN algorithm. The cumulative electricity consumption curve is fitted by a self-segmented linear fitting method based on the least squares method to obtain labeled users; the APAA algorithm is used to extract the main features of the daily load information of the labeled users, eliminate misidentifications caused by too small load fluctuations of users, and reduce the computational complexity; the improved DBSCAN density clustering algorithm is used to adaptively determine the parameters of the DBSCAN algorithm, cluster the daily load feature sequences of each labeled user, and obtain the daily load clustering clusters of the labeled users; based on the first-order difference cosine distance, the similarity of the clustering centers is calculated to identify abnormal users and improve the accuracy of electricity consumption anomaly identification.

Claims

1. An abnormal electricity consumption behavior recognition method based on an improved DBSCAN algorithm, characterized in that It includes the following steps: Step S1: Obtain the metering point operating condition data through the power consumption information acquisition system to get the daily active power data P of the electricity meter corresponding to the user, and construct the daily electricity consumption sequence of each user i,t,d , and the cumulative electricity consumption curve Step S2: Use the self-segmented linear fitting method based on the least squares method to fit the cumulative power consumption curve Set the number of segments n for segmentation Seg Calculate the inflection points of the segmented function after fitting And the slopes of each straight line segment If the slope difference between adjacent segments is higher than the threshold Record the user as a marked user; Step S3: Based on the APAA algorithm, obtain the main characteristics of the load data from the daily load curve of the marked users, and reduce the computational difficulty caused by redundant data; Step S4: Based on the inflection points obtained in Step S2, divide the load curve of the marked user i into multiple data sets, and use the density-based clustering algorithm DBSCAN algorithm to cluster the load feature sequences in the data sets divided for each user to obtain user load clustering clusters; Step S5: Use the first-order difference cosine distance to calculate the similarity of the clustering centers of each data set, and judge by empirically setting a threshold. When the result is lower than the threshold, mark the user as an abnormal user.

2. The abnormal power consumption behavior recognition method based on the improved DBSCAN algorithm according to claim 1, characterized in that The specific content of Step 3 includes: Step S31: Normalize the load data, set the time window length to Δt, and adopt the Min-Max normalization method. The calculation formula is as follows: In the formula: x is the vector to be normalized, and min(x) and max(x) respectively represent the minimum and maximum values of the vector x; Step S32: Record the number of ramping events on the load sequence within each time window Set the initial value of the number of ramping events in each time window to 0. If the difference between the maximum and minimum values of the user load within the time window is higher than the set threshold δ ramp , it is considered that a ramping event has occurred within this time window; The calculation formula for the load change range is as follows: Step S33: Record the number of edge points on the load sequence within each time window Set the initial value of the number of edge points within each time window to 0. Within the time window Δt, if the change amplitude of the load at a certain moment t compared to the loads at the two adjacent moments before and after exceeds the set threshold δ peak , consider this moment as an edge point; by default, the moments before and after are not edge points during the calculation; The calculation formula for the load change amplitude is: Step S34: If the number of ramp events and edge points in the time window is not 0, the data in this time window is retained; otherwise, the data in this time window segment takes the mean value of the load in this segment; Step S35: Output the load characteristic sequence 3. The abnormal power consumption behavior recognition method based on the improved DBSCAN algorithm according to claim 1, wherein The specific content of Step 4 includes: Step S41: Generate the neighborhood radius and density threshold; calculate the cosine similarity between the load on the d-th day and the loads on other days, and sort them in ascending order to obtain Then calculate the distance vector of all daily loads of user i to obtain the distance matrix Calculate the mean value of the similarities in each column in turn to obtain N increasing candidate neighborhood radius parameters And calculate the number of dates within the neighborhood of each daily load of the user under this neighborhood radius for each candidate parameter, and take the average value of this number of dates as the density threshold Obtain the algorithm candidate parameter pair of user i Step 42: Set d = 1, and input the neighborhood radius parameter and density threshold respectively as and Initialize the sample set Mark each sample as unprocessed, set n = 1, and the number of clusters c after clustering = 0; Step 43: Select a sample If the sample is in the unprocessed marked state, proceed to the next step; otherwise, n = n + 1 and continue to judge the next object; Step 44: Initialize the counter Count c (n) to 0, and calculate the cosine similarity between the sample and the samples in the sample set If increment the counter by one; Step 45: If Mark the sample as a boundary vector or a noise vector, and return to Step 44; Step 46: c = c + 1, for the sample Create a new cluster Mark as the core vector, and include all samples that satisfy into the cluster ​ Step 47: Obtain the vector connected to the sample density; Detect each cluster for the vectors that have not been processed yet Calculate its neighborhood Ω with ε-Eps (P i,q ) as the radius. If the number of elements in the neighborhood Ω ε-Eps (P i,q ) reaches the detection set Ω ε-Eps (P i,q ), if there is a vector that has not been assigned to any cluster, assign it to the cluster Step 48: n = n + 1, return to Step 43; when n = D + 1, output the clustering result, which includes the cluster division The clustering center of each cluster And the marking situation of each vector; Step 49: d = d + 1, return to Step 41, and when Δc ≤ 1 or d = D, output the optimal parameter pair Output the clustering result at this time.

4. The abnormal electricity consumption behavior recognition method based on the improved DBSCAN algorithm according to claim 1, characterized in that The specific content of Step 5 includes: The first-order difference operation of the load is defined as: Where: is the normalized load of user i at time t on day d, is the normalized load of user i at time t + 1 on day d, is the value of the t-th dimension of the d-th load difference vector of the i-th user; The difference cosine distance of the load is defined as: Wherein: is the cosine distance between the d-th and d'-th load difference vectors; is the 2-norm of the load difference vector of the i-th user on the d-th day.