An unsupervised user electricity abnormality detection method and system based on natural corpus
By employing an unsupervised method based on natural spheres, adaptive multi-granularity representation, and fuzzy neighborhood information, the problems of parameter dependence and multi-granularity representation in user power consumption anomaly detection are solved, achieving efficient and robust power consumption anomaly detection, reducing costs and improving accuracy.
Patent Information
- Application Number
- CN202511509016.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-22
- Publication Date
- 2026-02-03
- Estimated Expiration
- 2045-10-22
AI Technical Summary
Existing methods for detecting abnormal power consumption by users are highly dependent on manually set parameters, have low robustness and detection accuracy, lack multi-granularity data representation capabilities, fail to effectively handle complex, noisy, or non-convex distributed data, and ignore uncertainty information between samples.
We employ an unsupervised method based on natural spheres, which constructs a set of spheres through adaptive multi-granularity representation and natural fuzzy neighborhood information, calculates anomaly scores, and achieves multi-granularity modeling without manual parameter tuning, capturing local density changes and global topological structure of the data.
It improves the robustness and accuracy of detecting abnormal power consumption, reduces computational resource consumption, saves labor costs, and enhances detection efficiency and model generalization ability.
Smart Images

Figure CN120995357B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of power data analysis technology, specifically to an unsupervised method and system for detecting abnormal user electricity consumption based on natural spheres. Background Technology
[0002] Anomaly detection (also known as outlier detection) is the process of identifying data instances in a dataset that significantly deviate from expected patterns or behaviors. In user electricity consumption scenarios, the importance of anomaly detection is particularly prominent. With the rapid development of smart grids, user electricity consumption data is experiencing massive growth, encompassing both normal electricity consumption patterns and potentially concealing various anomalies such as electricity theft, meter malfunctions, and abnormal load fluctuations. Timely identification of these anomalies not only helps power departments accurately combat electricity theft and reduce power loss but also provides a basis for grid dispatch optimization, ensuring the stable operation of the power system. Furthermore, it assists users in identifying potential faults in their home appliances, reducing safety hazards. Moreover, anomaly samples are often rare in user electricity consumption data, and labeling electricity consumption data for anomalies requires significant manpower, resources, and time, making label acquisition extremely difficult. Therefore, unsupervised learning, which does not rely on labels, is becoming increasingly important in user electricity consumption anomaly detection tasks.
[0003] Despite the significant advancements in machine learning-based methods for detecting anomalies in user electricity consumption, many existing approaches still face several core challenges: First, they heavily rely on manually set parameters. Traditional methods such as k-nearest neighbors, density-based methods, and clustering techniques require domain experts to pre-define sensitive parameters, such as neighborhood size or distance thresholds. However, these parameters are often difficult to determine in advance and vary considerably across different datasets, impacting model performance and reducing generalization ability. They also struggle to effectively handle complex, noisy, or non-convex data distributions, exhibiting low robustness and detection accuracy. Second, they lack multi-granularity data representation capabilities. Existing density-based detection methods are mostly limited to single, fine-grained data representations, restricting the anomaly detection model's ability to reveal hidden data patterns. Furthermore, existing detection methods often ignore uncertainty information between samples, limiting their ability to capture fuzzy relationships in the data and thus restricting model performance.
[0004] In view of the above, this application is hereby submitted. Summary of the Invention
[0005] The purpose of this invention is to provide an unsupervised user power consumption anomaly detection method and system based on natural spheres. It constructs multi-granularity anomaly scores based on natural fuzzy neighborhood information and sphere attributes, eliminating the need for manual parameter tuning. This improves the detection model's ability to handle uncertain information and its generalization ability across different datasets. By modeling data in a "coarse-to-fine" manner, it achieves multi-granularity representation, effectively dealing with complex, noisy, or non-convex distributed data, and improving the robustness, accuracy, and efficiency of user power consumption anomaly detection.
[0006] This invention is achieved through the following technical solution:
[0007] In a first aspect, the present invention provides an unsupervised method for detecting abnormal electricity consumption by users based on natural granules, the method comprising:
[0008] Obtain the original dataset and perform normalization preprocessing on the raw data in the original dataset; the raw data is user electricity consumption data.
[0009] Based on the particle distribution divergence, an adaptive multi-granularity representation is performed on the preprocessed raw data to obtain a particle set; the particle set includes several particles that cannot be further divided, and each particle includes several user samples;
[0010] Based on the set of particles, search for the natural neighbor particles of each particle, and determine the radius of the natural neighborhood based on the radius when the natural neighbor search is stable;
[0011] Based on the natural neighborhood radius, determine the natural fuzzy neighborhood radius of the particle; based on the natural fuzzy neighborhood radius, calculate the reachable distance of the natural fuzzy neighborhood and construct the natural fuzzy information particle;
[0012] The natural fuzzy neighborhood divergence of each particle is calculated based on the natural fuzzy information particles and the natural fuzzy neighborhood reachability distance.
[0013] Based on the particle attributes and natural fuzzy neighborhood divergence, the anomaly score of each user sample is calculated; and the anomaly score is compared with a preset value to identify users with abnormal electricity consumption.
[0014] Furthermore, based on the particle-sphere distribution divergence, an adaptive multi-granularity representation is performed on the preprocessed raw data to obtain a particle-sphere set, including:
[0015] Initial spheres are generated based on the preprocessed raw data;
[0016] By comparing the grain size distribution divergence before and after splitting, an adaptive splitting criterion is used to determine whether the initial grains should split further.
[0017] If the adaptive splitting criteria are met, further splitting is performed, and the split spheres replace the unsplit spheres; otherwise, the adaptive splitting ends, resulting in a set of spheres.
[0018] Furthermore, the adaptive splitting judgment is based on: ;in, The particle distribution divergence; For granules Number of user samples included; For the first Individual particle distribution divergence; For granules Number of user samples included; For the first Individual particle distribution divergence; For granules Number of user samples included.
[0019] Furthermore, natural neighbor spheres refer to two spheres that consider each other as natural neighbors. Nearest neighboring particles, Nearest neighbor particles refer to particles that are spatially closest to each other. Each ball.
[0020] Further, search the natural neighbor spheres of each sphere to determine the neighborhood radius when the natural neighbor search is stable, including:
[0021] Calculate the Euclidean distance between every two balls;
[0022] Let the initial neighborhood radius be The neighborhood radius is increased step by step, starting with 1, and for each sphere, its neighborhood radius is found. Neighbors;
[0023] Determine if two particles are neighbors: If particles are neighbors... In granules of Among the nearest neighbors, and the grains Also in the granules of Among the neighbors, and For natural neighboring particles;
[0024] The process is repeated until all natural neighbor sets stabilize and no longer change, at which point the natural neighborhood radius at which the natural neighbor search is stable is obtained. .
[0025] Furthermore, the formula for calculating the natural fuzzy neighborhood radius of the particle is:
[0026] ;
[0027] in, For granules The natural fuzzy neighborhood radius; Indicates granules of Nearest neighboring particles, It is not a parameter set manually, but an adaptive value determined based on the natural neighbor search process; Indicates granules arrive The Euclidean distance.
[0028] Furthermore, the reachable distance of the natural fuzzy neighborhood is calculated using the following formula:
[0029] ;
[0030] in, For granules To the ball The natural fuzzy neighborhood reachable distance, For granules The natural fuzzy neighborhood radius, Indicates granules arrive The Euclidean distance.
[0031] Furthermore, based on the natural fuzzy neighborhood radius, natural fuzzy information particles are constructed. A fuzzy information particle (or "information particle" or "fuzzy particle") is a collection of objects aggregated through fuzzy relationships between them. The construction steps include:
[0032] The formula for calculating the fuzzy similarity relationship between particles is as follows:
[0033] ;
[0034] in, For the first The number of balls to the first Fuzzy similarity relationships between individual spheres; For the first The number of balls to the first The Euclidean distance between each sphere; A is the attribute set; The number of attributes; The total number of particles;
[0035] Based on the fuzzy similarity relationships between particles and the natural fuzzy neighborhood radius, the membership degree of each particle to other particles is calculated using the following formula:
[0036] ;
[0037] in, For the first The number of balls to the first Membership degree between individual particles; For granules The natural fuzzy neighborhood radius.
[0038] Furthermore, based on the natural fuzzy information particles and the reachability distance of the natural fuzzy neighborhood, the natural fuzzy neighborhood divergence of the particle sphere is calculated using the following formula:
[0039] ;
[0040] in, For granules To the ball The reachable distance of the natural fuzzy neighborhood; The number of attributes; The total number of particles; The formula for calculating the particle base number of the granules is: , For granules Information particles obtained through induction;
[0041] Furthermore, based on the properties of the sphere and the natural fuzzy neighborhood divergence, the anomaly score for each user sample is calculated using the following formula:
[0042] ;
[0043] in, For users Abnormal scores; For granules Number of user samples included; For granules Number of user samples included; This represents the number of user samples.
[0044] Furthermore, the abnormal scores are compared with preset values to identify users with abnormal electricity consumption, including:
[0045] If the abnormal score is greater than the preset value, the user is considered to have abnormal electricity consumption.
[0046] If the abnormal score is less than or equal to the preset value, then the user is a normal electricity user;
[0047] The preset value is the abnormal score threshold for users with abnormal electricity consumption.
[0048] Secondly, the present invention provides an unsupervised user power consumption anomaly detection system based on natural granules, the system comprising:
[0049] The acquisition and preprocessing unit is used to acquire the raw dataset and preprocess the raw data in the raw dataset; the raw data is user electricity consumption data.
[0050] The particle generation unit is used to adaptively represent the preprocessed raw data based on the particle distribution divergence to obtain a particle set; the particle set includes several particles that cannot be further divided, and each particle includes several user samples;
[0051] The natural neighborhood radius calculation unit is used to search for the natural neighboring particles of each particle based on the particle set, and to determine the neighborhood radius when the natural neighbor search is stable as the natural neighborhood radius.
[0052] The natural fuzzy neighborhood divergence calculation unit is used to determine the natural fuzzy neighborhood radius of the particle based on the natural neighborhood radius; calculate the reachability distance of the natural fuzzy neighborhood based on the natural fuzzy neighborhood radius and construct the natural fuzzy information particle; and calculate the natural fuzzy neighborhood divergence of each information particle based on the natural fuzzy information particle and the reachability distance of the natural fuzzy neighborhood.
[0053] The user anomaly score calculation unit is used to calculate the anomaly score of each user sample based on the particle sphere attribute and the natural fuzzy neighborhood divergence.
[0054] The anomaly detection unit is used to compare the user's anomaly score with a preset value to identify users with abnormal electricity consumption.
[0055] Furthermore, the formula for calculating the user anomaly score is as follows:
[0056] ;
[0057] in, User samples Abnormal scores; For granules To the ball The reachable distance of the natural fuzzy neighborhood; For particle size distribution; For granules Number of user samples included; The total number of particles; The number of attributes; This represents the number of user samples.
[0058] Compared with the prior art, the present invention has the following advantages and beneficial effects:
[0059] 1. This invention discloses an unsupervised user power consumption anomaly detection method and system based on natural spheres, effectively combining the parameter-free advantages of natural neighbor search with the multi-granularity modeling capabilities of sphere computing (GBC). Traditional methods largely rely on sensitive, manually defined parameters and single-scale neighborhood structures. Unlike traditional methods, this invention introduces sphere computing for multi-granularity representation, which adaptively captures local density changes and global topological structures of the data, improving the robustness, accuracy, and efficiency of user power consumption anomaly detection while significantly reducing computational resource consumption.
[0060] 2. This invention discloses an unsupervised user power consumption anomaly detection method and system based on natural spheres. By constructing fuzzy information granules based on natural neighbor relationships, it can efficiently model complex, high-dimensional, and information-rich datasets with uncertainties. The anomaly score constructed in this way simultaneously considers the density of local fuzzy neighborhoods and the multi-granularity structural information of the spheres, thereby improving robustness and interpretability.
[0061] 3. This invention provides an unsupervised user power consumption anomaly detection method and system based on natural spheres. It eliminates the need for manually labeled data, significantly reducing costs and improving anomaly detection efficiency. The detection method provided by this invention is an unsupervised algorithm, requiring no training data and saving labor costs. Attached Figure Description
[0062] The accompanying drawings, which are included to provide a further understanding of embodiments of the invention and form part of this application, do not constitute a limitation thereof. In the drawings:
[0063] Figure 1 This is a flowchart of an unsupervised user power consumption anomaly detection method based on natural granules according to the present invention;
[0064] Figure 2 This is a structural block diagram of an unsupervised user power consumption anomaly detection system based on natural granules according to the present invention. Detailed Implementation
[0065] To make the objectives, technical solutions, and advantages of the present invention clearer, the present invention will be further described in detail below with reference to the embodiments and accompanying drawings. The illustrative embodiments and descriptions of the present invention are only used to explain the present invention and are not intended to limit the present invention.
[0066] While the Natural Neighbor method provides a parameter-free approach to identify anomalies by leveraging the concept of proximity, it remains limited by single-granularity distance calculations, making it difficult to effectively model complex data structures, especially in high-dimensional, unevenly dense, or non-convex distribution scenarios. Furthermore, the Natural Neighbor method does not model fuzzy relationships between samples, limiting its ability to handle implicit uncertainties in the data. Therefore, this invention proposes a novel method for detecting anomalies in user electricity consumption by combining particle sphere computation with the concept of fuzzy neighborhoods based on the Natural Neighbor search process. In this invention, adaptive particle spheres are first generated for multi-scale representation of user electricity consumption data; then, natural neighbor particle sphere relationships are constructed to model local proximity without requiring manual parameter setting. Based on this multi-granularity structure, anomaly scores for each user are calculated using natural fuzzy neighborhood information and particle sphere structure information; and the anomaly scores are compared with preset values to determine users with abnormal electricity consumption.
[0067] Example 1
[0068] like Figure 1 As shown, this invention provides an unsupervised method for detecting abnormal user electricity consumption based on natural granules. The method includes:
[0069] Step 1: Obtain the raw dataset and preprocess the raw data in the raw dataset; the raw data is user electricity consumption data.
[0070] In this embodiment, all user electricity consumption data in the original dataset are used It means that, among them, Representative by The original dataset consists of user samples. Indicates by Users are composed of attributes (features). Electricity consumption information.
[0071] In this embodiment, to avoid interference from differences in dimensions and orders of magnitude on the analysis results, the numerical data in the user electricity consumption data is first normalized using the min-max method to map its values to the range of 0 to 1; while the nominal data is left unprocessed and remains in its original state. The calculation formula is as follows:
[0072] Equation (1)
[0073] in, For normalization function, This represents the value of user x on attribute a. This represents the set of all user values for attribute a. This means finding the minimum value for all users on attribute 'a'. This means finding the maximum value of attribute 'a' for all users.
[0074] Step 2: Based on the particle distribution divergence, adaptive representation is performed on the preprocessed original data to obtain a particle set; the particle set includes several particles that cannot be further divided, and each particle includes several user samples;
[0075] Specifically, step 2 includes:
[0076] Step 21: Generate initial spheres based on the preprocessed raw data;
[0077] The initial spheres are generated as follows: Select the two user samples that are furthest apart based on the Euclidean distance between all user sample points, and then divide all user samples into two initial spheres according to their distances to these two user sample points. and The center of the ball is located within the area defined by [the boundary]. The center of the sphere is defined by a sample of users:
[0078] Equation (2)
[0079] Step 22: Compare the particle distribution divergence before splitting with the particle distribution divergence after splitting, and use adaptive splitting criteria to determine whether the initial particles should split further.
[0080] Step 23: If the adaptive splitting criteria are met, further splitting is performed, and the split spheres are used to replace the unsplit spheres; otherwise, the adaptive splitting ends, and a set of spheres is obtained.
[0081] In the above technical solution, based on the initial spheres obtained in step 21, the degree of sphere distribution divergence is used to determine whether the initial spheres need further splitting. Individual sphere distribution divergence Defined as:
[0082] Equation (3)
[0083] in, For the first Each ball; pellets Number of user samples included; For the first One user sample, Let be the coordinates of the center of the k-th sphere;
[0084] The higher the dispersion of the particle distribution, the sparser the distribution of user samples within it. Therefore, for each particle in each iteration, the two user samples farthest apart in the particle are first selected. Assuming the resulting particles after splitting are... and The divergence is respectively and Then compare the granules before splitting. and the divergence of the distribution of the split granules, if ,in, The particle distribution divergence; For granules Number of user samples included; For the first Individual particle distribution divergence; For granules Number of user samples included; For the first Individual particle distribution divergence; For granules The number of user samples included is used; then the split spheres replace the unsplit spheres. After adaptive splitting, a set of spheres is obtained. .
[0085] Step 3: Based on the set of particles, search for the natural neighbor particles of each particle, and determine the radius when the natural neighbor search is stable as the natural neighborhood radius;
[0086] In this embodiment, a natural neighbor particle refers to two particles that consider each other as their nearest neighbor particles; their relationship is then considered a natural neighbor. A nearest neighbor particle refers to particles that are spatially close, and the degree of closeness is determined by distance sorting. For example, particles... of Nearest neighbor particles refer to particles that are far from each other. Recent Each ball.
[0087] In this embodiment, searching the natural neighbor spheres of each sphere to determine the neighborhood when the natural neighbor search is stable includes:
[0088] Calculate the Euclidean distance between any two particles;
[0089] The initial neighborhood radius is gradually increased with a step size of 1. For each sphere, find its preceding... Neighbors;
[0090] Determine if two particles are neighbors: If particles are neighbors... In granules Among the nearest neighbors, and the granules Also in the granules Among its neighbors, and For natural neighboring particles;
[0091] The process is repeated until all natural neighbor sets stabilize and no longer change, at which point the natural neighbor search reaches a stable natural neighborhood radius. ,therefore It is not a parameter set manually, but an adaptive value determined based on the natural neighbor search process.
[0092] Step 4, based on natural neighborhood radius Determine the radius of the natural fuzzy neighborhood; based on the radius of the natural fuzzy neighborhood, calculate the reachable distance of the natural fuzzy neighborhood and construct the natural fuzzy information granules;
[0093] In this embodiment, the formula for calculating the natural fuzzy neighborhood radius of the particle is:
[0094] Equation (4)
[0095] in, For granules The natural fuzzy neighborhood radius; Indicates granules of Nearest neighboring particles, It is not a parameter set manually, but an adaptive value determined based on the natural neighbor search process; Indicates granules arrive The Euclidean distance.
[0096] In this embodiment, the natural fuzzy information granules are a collection of objects aggregated through fuzzy relationships between objects. The construction steps include:
[0097] The formula for calculating the fuzzy similarity relationship between particles is as follows:
[0098] Equation (5)
[0099] in, For the first The number of balls to the first The Euclidean distance between each sphere; A is the attribute set; The number of attributes; The total number of particles;
[0100] Based on the natural fuzzy neighborhood radius, the membership degree of each particle to other particles is calculated using the following formula:
[0101] Equation (6)
[0102] In this embodiment, based on the natural fuzzy neighborhood radius, the reachable distance from other particles to the natural fuzzy neighborhood of each particle is calculated using the following formula:
[0103] Equation (7)
[0104] in, For granules To the ball The natural fuzzy neighborhood reachable distance, For granules The natural fuzzy neighborhood radius.
[0105] Step 5: Based on the natural fuzzy information particles and the reachability distance of the natural fuzzy neighborhood, calculate the natural fuzzy neighborhood divergence of the particle sphere. The calculation formula is as follows:
[0106] Equation (8)
[0107] in, The number of attributes; The total number of particles; The formula for calculating the particle base number of the granules is:
[0108] Equation (9)
[0109] In the above technical solutions, the natural fuzzy neighborhood divergence of the sphere reflects the sphere's... The more structural and neighborhood information a particle contains, the denser the distribution of surrounding granules. The smaller the natural fuzzy neighborhood divergence, the lower the anomaly level.
[0110] Step 6: Calculate the anomaly score for each user sample based on the particle attributes and natural fuzzy neighborhood divergence; and compare the user anomaly score with a preset value to determine the user with abnormal electricity consumption.
[0111] In this embodiment, the formula for calculating the anomaly score is:
[0112] Equation (10)
[0113] in, User samples Abnormal scores; User samples The granule it is located in; For granules Number of user samples included; This represents the number of user samples.
[0114] In the above technical solutions, the anomaly score of this invention takes into account the multi-granularity structural information of the particle sphere where the sample is located and the local density in the fuzzy neighborhood. The larger the natural fuzzy neighborhood divergence of the particle sphere where the sample is located, the fewer samples it contains. The higher the degree of abnormality.
[0115] Finally, the abnormal scores are compared with preset values to identify users with abnormal electricity consumption. The preset values are the threshold values for abnormal scores of users with abnormal electricity consumption. If the user abnormal scores Greater than the preset value ,Right now Then the user For users with abnormal electricity consumption; if the abnormal score Less than or equal to the preset value ,Right now Then the user For normal electricity users;
[0116] In specific implementation, the present invention will be further explained below in conjunction with specific user electricity consumption data. Given a user electricity consumption dataset containing 9 user samples and 2 numerical attributes, as shown on the left side (original data) and the right side (result after normalization) of Table 1.
[0117] Table 1. Original User Electricity Consumption Data and Standardization Results
[0118] Step 1: Obtain the raw user electricity consumption data as shown in Table 1 and perform preprocessing;
[0119] To facilitate subsequent calculations, maximum-min normalization was applied to all data. The numerical data on the left side of Table 1 were mapped to the [0,1] interval according to Equation (1). The processing results are shown on the right side of Table 1.
[0120] Step 2: Based on the particle distribution divergence, adaptive representation is performed on the preprocessed original data to obtain the particle set;
[0121] The furthest user sample pair is determined based on the dataset processed in step 1. and The distance between them is calculated as follows The initial granules are divided into: granules
[0122] ; pellets .
[0123] Based on the generated initial spheres, further subdivision is performed, resulting in spheres... There is only one user sample that does not need to be subdivided, for granular samples By analyzing user samples and calculating the pairwise distances between particle samples, the farthest particle sample pair can be obtained. and Then all samples are based on and The distances were redefined. , , The center of the sphere is calculated as ,in The distance to the center of the ball is Similarly The distance to the center of the ball is 0.043. The distance to the center of the ball is 0.035. The distance to the center of the ball is 0.083. The distribution divergence is calculated as follows: Similarly, we can conclude that The distribution divergence is calculated as follows: Then comes the verification of the splitting condition; similarly, we can deduce... ,because ,
[0124] The splitting condition is met, and the splitting occurs. Subsequently, the granules continue the above process of adaptive splitting, ultimately yielding a set of granules.
[0125] .
[0126] Step 3: Based on the set of particles, search for the natural neighbor particles of each particle, and determine the radius when the natural neighbor search is stable as the natural neighborhood radius;
[0127] For the set of spheres obtained in step 2
[0128] The particle-sphere distance matrix shown in Table 2 was calculated. Initial neighborhood radius The number of times each ball is selected as a neighbor is initialized to 0. The first iteration searches each of Neighborhood, here =1, 1-neighbor is Therefore, the number of times a particle is chosen as a neighbor. Add one to the second position. Similarly, we can obtain 1-neighbor is , 1-neighbor is , 1-neighbor is , 1-neighbor is After the first iteration The second iteration begins , The new neighbor in the 2-neighborhood is ,therefore Add one to the third position. Similarly, we can conclude that The new neighbor in the 2-neighborhood is , The new neighbor in the 2-neighborhood is , The new neighbor in the 2-neighborhood is , The new neighbor in the 2-neighborhood is After the first iteration And so on, in hour, , of The iteration terminates when the value remains unchanged for three consecutive times, and the final natural neighborhood radius is... The maximum value in, ;
[0129] Table 2. Particle Distance Matrix
[0130]
[0131] Step 4, based on natural neighborhood radius Determine the radius of the natural fuzzy neighborhood; based on the radius of the natural fuzzy neighborhood, calculate the reachable distance of the natural fuzzy neighborhood and construct the natural fuzzy information granules;
[0132] Specifically, step 4 includes:
[0133] Step 41, based on the natural neighborhood radius obtained in step 3 Determine the natural fuzzy neighborhood radius of each sphere in the sphere set. , , , , ;
[0134] Step 42: Based on the natural fuzzy neighborhood radius, calculate the reachable distance from other particles to the natural fuzzy neighborhood of each particle. The calculation formula is as follows: ;
[0135] The results of calculating the reachable distance of the natural fuzzy neighborhood between particles are shown in Table 3.
[0136] Table 3 Reachable Distance of Naturally Fuzzy Neighborhood
[0137]
[0138] Step 43: Construct natural fuzzy information particles based on the natural fuzzy neighborhood radius. The construction steps include:
[0139] The formula for calculating the fuzzy similarity relationship between particles is as follows:
[0140] ;
[0141] in, For the first The number of balls to the first The Euclidean distance between each sphere; A is the attribute set; The number of attributes;
[0142] Based on the natural fuzzy neighborhood radius, the membership degree of each particle to other particles is calculated using the following formula:
[0143] ;
[0144] With granules For example, the membership degrees of each natural fuzzy information particle are:
[0145] .
[0146] Step 5: Based on the natural fuzzy information particles and the reachability distance of the natural fuzzy neighborhood, calculate the natural fuzzy neighborhood divergence of the particle sphere; using the particle sphere... For example, Similarly, we can obtain , , , .
[0147] Step 6: Calculate the anomaly score for each user sample based on the particle attributes and natural fuzzy neighborhood divergence; and compare the user anomaly score with a preset value to determine the user with abnormal electricity consumption.
[0148] Based on the natural fuzzy neighborhood divergence of the sphere obtained in step 5, the sphere The abnormal score is:
[0149] Similarly, the anomaly scores of the other individual particles can be obtained as follows: , , , Based on the sphere in which the user sample is located, anomaly scores are assigned to each user sample. , , , , .
[0150] Based on the natural outlier factor, comparing the outlier rates of all users, it is clear that users... The outlier of this user is significantly higher than that of other users. Let's set an outlier threshold. Set the value to 0.1, and then compare the outlier score of all users with the threshold. By comparison, the user The user was identified as having abnormal electricity usage.
[0151] This invention integrates natural neighborhood radius and fuzzy similarity relationships into a particle-sphere framework, achieving a truly parameter-free, multi-granularity abnormal power consumption detection method. This method eliminates the need for manual parameter tuning, improving the model's generalization ability across different datasets. By constructing adaptive particle spheres and fuzzy information granules, this invention can model data in a coarse-to-fine manner, achieving multi-granularity representation, effectively capturing fuzzy information and uncertain relationships in the data, and improving detection efficiency, robustness, and accuracy. This invention employs an unsupervised user power consumption anomaly detection method based on particle-sphere fuzzy computation and natural nearest neighbors, requiring no training data and saving labor costs.
[0152] Example 2
[0153] like Figure 2 As shown, the difference between this embodiment and Embodiment 1 is that this embodiment provides an unsupervised user power consumption anomaly detection system based on natural granules. This system corresponds one-to-one with the unsupervised user power consumption anomaly detection method based on natural granules in Embodiment 1. The system includes:
[0154] The acquisition and preprocessing unit is used to acquire the raw dataset and preprocess the raw data in the raw dataset; the raw data is user electricity consumption data.
[0155] The particle generation unit is used to adaptively represent the preprocessed raw data based on the particle distribution divergence to obtain a particle set; the particle set includes several particles that cannot be further divided, and each particle includes several user samples;
[0156] The natural neighborhood radius calculation unit is used to search for the natural neighboring particles of each particle based on the particle set, and to determine the natural neighborhood radius when the natural neighbor search is stable.
[0157] The natural fuzzy neighborhood divergence calculation unit is used to determine the natural fuzzy neighborhood radius based on the natural neighborhood radius; calculate the reachability distance of the natural fuzzy neighborhood based on the natural fuzzy neighborhood radius and construct natural fuzzy information particles; and calculate the natural fuzzy neighborhood divergence of each information particle based on the natural fuzzy information particles and the reachability distance of the natural fuzzy neighborhood.
[0158] The user anomaly score calculation unit is used to calculate the anomaly score of each user sample based on the particle sphere attribute and the natural fuzzy neighborhood divergence.
[0159] Anomaly detection unit is used to compare the user's anomaly score with a preset value to identify users with abnormal electricity consumption.
[0160] The formula for calculating the natural fuzzy neighborhood radius of a particle is:
[0161] ;
[0162] in, For granules The natural fuzzy neighborhood radius; Indicates granules of Nearest neighboring particles, It is an adaptive value determined based on the natural neighbor search process; Indicates granules arrive The Euclidean distance;
[0163] The formula for calculating the reachability distance of a natural fuzzy neighborhood is:
[0164] ;
[0165] in, For granules To the ball The natural fuzzy neighborhood reachable distance, For granules The natural fuzzy neighborhood radius, Indicates granules arrive The Euclidean distance.
[0166] As a further implementation, the formula for calculating the user anomaly score is as follows:
[0167] ;
[0168] in, User samples Abnormal scores; For granules To the ball The reachable distance of the natural fuzzy neighborhood; For particle size distribution; For granules Number of user samples included; The total number of particles; The number of attributes; This represents the number of user samples.
[0169] The execution process of each unit can be carried out according to the steps of the unsupervised user power consumption anomaly detection method based on natural spheres in Embodiment 1, and will not be described in detail in this embodiment.
[0170] Those skilled in the art will understand that embodiments of this application can be provided as methods, systems, or computer program products. Therefore, this application can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, this application 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.
[0171] This application is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of this application. 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... Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.
[0172] 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.
[0173] 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.
[0174] The specific embodiments described above further illustrate the purpose, technical solution, and beneficial effects of the present invention. It should be understood that the above description is only a specific embodiment of the present invention and is not intended to limit the scope of protection of the present invention. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of the present invention should be included within the scope of protection of the present invention.
Claims
1. An unsupervised method for detecting abnormal user electricity consumption based on natural granules, characterized in that, The method includes: Obtain the raw dataset and preprocess the raw data in the raw dataset; the raw data is user electricity consumption data. Based on the particle distribution divergence, the preprocessed raw data is adaptively represented to obtain a particle set; the particle set includes several particles that cannot be further divided, and each particle includes several user samples; Based on the set of particles, search for the natural neighbor particles of each particle to determine the natural neighborhood radius when the natural neighbor search is stable; Based on the natural neighborhood radius, determine the natural fuzzy neighborhood radius of the particle; based on the natural fuzzy neighborhood radius, calculate the reachable distance of the natural fuzzy neighborhood and construct the natural fuzzy information particle; Based on the natural fuzzy information particles and the reachability distance of the natural fuzzy neighborhood, the natural fuzzy neighborhood divergence of each particle is calculated; Based on the properties of the sphere and the natural fuzzy neighborhood divergence, an anomaly score is calculated for each user sample; and the anomaly score is compared with a preset value to determine abnormal electricity users. The formula for calculating the natural fuzzy neighborhood radius of a particle is: ; in, For granules The natural fuzzy neighborhood radius; Indicates granules of Nearest neighboring particles, It is an adaptive value determined based on the natural neighbor search process; Indicates granules arrive The Euclidean distance; The formula for calculating the reachability distance of a natural fuzzy neighborhood is: ; in, For granules To the ball The natural fuzzy neighborhood reachable distance, For granules The natural fuzzy neighborhood radius, Indicates granules arrive The Euclidean distance.
2. The unsupervised user power consumption anomaly detection method based on natural granules according to claim 1, characterized in that, Based on the particle distribution divergence, an adaptive representation is performed on the preprocessed raw data to obtain a particle set, including: Initial spheres are generated based on the preprocessed raw data; By comparing the grain size distribution divergence before and after splitting, an adaptive splitting criterion is used to determine whether the initial grains should split further. If the adaptive splitting criteria are met, further splitting is performed, and the split spheres replace the unsplit spheres; otherwise, the adaptive splitting ends, resulting in a set of spheres.
3. The unsupervised user power consumption anomaly detection method based on natural granules according to claim 2, characterized in that, The adaptive splitting judgment criteria are as follows: ;in, The particle distribution divergence; For granules Number of user samples included; For the first Individual particle distribution divergence; For granules Number of user samples included; For the first Individual particle distribution divergence; For granules Number of user samples included.
4. The unsupervised user electricity consumption anomaly detection method based on natural granules according to claim 1, characterized in that, The natural neighbor spheres refer to two spheres that consider each other as their nearest neighbors. The nearest neighbors are spheres that are close in spatial location, and the degree of closeness is determined by distance sorting.
5. The unsupervised user power consumption anomaly detection method based on natural granules according to claim 1, characterized in that, Search for the natural neighbor spheres of each sphere and determine the neighborhood radius when the natural neighbor search is stable, including: Calculate the Euclidean distance between any two particles; The initial neighborhood radius is gradually increased with a step size of 1. For each sphere, find its preceding... Neighbors; Determine if two particles are neighbors: If particles are neighbors... In granules Among the nearest neighbors, and the granules Also in the granules Among its neighbors, and For natural neighboring particles; The process is repeated until all natural neighbor sets stabilize and no longer change, at which point the natural neighborhood radius at which the natural neighbor search is stable is obtained. .
6. The unsupervised user power consumption anomaly detection method based on natural granules according to claim 1, characterized in that, The construction steps of the natural fuzzy information particles include: The formula for calculating the fuzzy similarity relationship between particles is as follows: ; in, For the first The number of balls to the first Fuzzy similarity relationships between individual spheres; For the first The number of balls to the first The Euclidean distance between each sphere; For attribute set; The number of attributes; The total number of particles; Based on the fuzzy similarity relationships and natural fuzzy neighborhood radii among the particles, the membership degree of each particle to other particles is calculated using the following formula: ; in, For the first The number of balls to the first Membership degree between individual particles; For granules The natural fuzzy neighborhood radius.
7. The unsupervised user power consumption anomaly detection method based on natural granules according to claim 1, characterized in that, The formula for calculating the natural fuzzy neighborhood divergence is as follows: ; in, For granules To the ball The reachable distance of the natural fuzzy neighborhood; The number of attributes; The total number of particles; The formula for calculating the particle base number is as follows: , For granules Information particles obtained through induction; The formula for calculating the anomaly score is: ; in, User samples Abnormal scores; User samples The granule it is located in; For granules Number of user samples included; This represents the number of user samples.
8. The unsupervised user power consumption anomaly detection method based on natural granules according to claim 1, characterized in that, The user's abnormal score is compared with a preset value to identify users with abnormal electricity consumption, including: If the abnormal score is greater than the preset value, the user is considered to have abnormal electricity consumption. If the abnormal score is less than or equal to the preset value, then the user is a normal electricity user; The preset value is the abnormal score threshold for users with abnormal electricity consumption.
9. An unsupervised user power consumption anomaly detection system based on natural granules, characterized in that, The system includes: The acquisition and preprocessing unit is used to acquire the raw dataset and preprocess the raw data in the raw dataset; the raw data is user electricity consumption data. The particle generation unit is used to adaptively represent the preprocessed raw data based on the particle distribution divergence to obtain a particle set; the particle set includes several particles that cannot be further divided, and each particle includes several user samples; The natural neighborhood radius calculation unit is used to search for the natural neighboring particles of each particle based on the particle set, and to determine the neighborhood radius when the natural neighbor search is stable as the natural neighborhood radius. The natural fuzzy neighborhood divergence calculation unit is used to determine the natural fuzzy neighborhood radius of the particle based on the natural neighborhood radius; calculate the reachability distance of the natural fuzzy neighborhood based on the natural fuzzy neighborhood radius and construct the natural fuzzy information particle; and calculate the natural fuzzy neighborhood divergence of each information particle based on the natural fuzzy information particle and the reachability distance of the natural fuzzy neighborhood. The user anomaly score calculation unit is used to calculate the anomaly score of each user sample based on the particle sphere attribute and the natural fuzzy neighborhood divergence. Anomaly detection unit is used to compare the user's anomaly score with a preset value to identify users with abnormal electricity consumption. The formula for calculating the natural fuzzy neighborhood radius of a particle is: ; in, For granules The natural fuzzy neighborhood radius; Indicates granules of Nearest neighboring particles, It is an adaptive value determined based on the natural neighbor search process; Indicates granules arrive The Euclidean distance; The formula for calculating the reachability distance of a natural fuzzy neighborhood is: ; in, For granules To the ball The natural fuzzy neighborhood reachable distance, For granules The natural fuzzy neighborhood radius, Indicates granules arrive The Euclidean distance.
Citation Information
Patent Citations
DBSCAN point cloud clustering method for multi-granularity neighbors based on granular balls
CN118015318A
Electricity stealing detection method based on directed density ratio of particles and balls
CN120822051A