A power consumption anomaly detection method based on fuzzy rough entropy

CN116433049BActive Publication Date: 2026-10-30SICHUAN UNIV
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202310414937.2
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-04-18
Publication Date
2026-10-30
Estimated Expiration
2043-04-18

AI Technical Summary

Technical Problem

[0004]本发明的目的是为了解决传统用电异常检测方法主要是基于数据驱动的方法,存在的检测混合异构数据时的大量有用信息丢失,模型检测性能差的情况,使用效果不够理想等缺点,而提出的一种基于模糊粗糙熵的用电异常检测方法

Benefits of technology

[0054]本发明中,所述的一种基于模糊粗糙熵的用电异常检测方法,解决了现有模糊粗糙熵由于采用交操作在高维度情况无法有效区分相似度的问题,无需提前训练模型,减少了操作人员工作量,及早发现用电数据异常问题,提高检测效率;

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116433049B_ABST
    Figure CN116433049B_ABST
Patent Text Reader

Abstract

The application discloses a power consumption anomaly detection method based on fuzzy rough entropy, and relates to the technical field of power consumption anomaly detection.The method specifically comprises the following steps: standardizing numerical data; calculating a distance matrix of each attribute; calculating a fuzzy similarity matrix; calculating fuzzy rough entropy based on distance; sorting attributes according to the size of fuzzy rough entropy to obtain an attribute sequence and an attribute set sequence; calculating a distance matrix and a fuzzy similarity matrix of the attribute set sequence; respectively calculating fuzzy rough relative entropy matrices of the two sequences; calculating weight matrices of the two sequences; calculating an anomaly score of each user; and judging whether the score of each user is greater than a threshold value one by one, and outputting an abnormal user if the score is greater than the threshold value until the judgment on all users is completed.The application can effectively extract fuzzy and uncertain information of power consumption anomaly data by using fuzzy rough entropy, thereby improving the detection performance of a model and effectively processing a mixed and heterogeneous data set.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of power consumption anomaly detection technology, and in particular to a power consumption anomaly detection method based on fuzzy rough entropy. Background Technology

[0002] Electricity is indispensable to people's daily lives, and its safety has a crucial impact on people's lives and the national power industry. Currently, with rising electricity demand, various equipment malfunctions and electricity theft are occurring frequently, posing significant threats to the safe operation of the power grid. With the widespread adoption of smart meters in my country, the amount of data collected by electricity information systems is constantly increasing. However, due to a lack of intelligent data analysis methods, it is impossible to quickly extract useful information from massive amounts of data. Therefore, electricity data anomaly detection technology can not only provide better protection for the safe operation of the power grid but also help power companies avoid greater hidden dangers and recover huge economic losses. Traditional electricity anomaly detection methods are mainly data-driven, including classification, regression, and clustering algorithms. Classification algorithms divide user sets into normal and abnormal categories based on user characteristics, and their models generally require labeled datasets for construction. However, these datasets require manual label verification, which consumes a lot of manpower. Regression algorithms mainly predict users' short-term electricity consumption and then compare the predicted values ​​with the actual consumption to determine whether anomalies have occurred. In practical applications, regression models often suffer from insufficient prediction accuracy. In particular, because each person's electricity consumption patterns are different, anomaly detection requires building a separate regression model for each user. The creation and storage of these models typically incur significant time and storage space costs. Clustering methods, on the other hand, categorize similar objects into different groups, ensuring that objects within the same group share similarities in certain attributes, while differing from objects in other groups. In anomaly detection, this allows a minority of users whose electricity consumption behavior does not conform to the majority to be identified as anomalous users. However, the performance of clustering models largely depends on parameter selection, and due to the varying electricity consumption patterns across seasons, parameter reselection is necessary at seasonal changes, leading to computational complexity. Furthermore, clustering is not suitable for detecting large amounts of high-dimensional electricity consumption data, thus exhibiting certain limitations.

[0003] The methods described above are primarily applicable to numerical data. However, when applied to numerical attribute datasets, these methods require data discretization, which significantly increases the time consumed in data preprocessing and can easily lead to information loss, thus affecting the model's detection performance. Furthermore, traditional electricity anomaly detection methods are mainly data-driven, which suffers from significant information loss when detecting mixed heterogeneous data, resulting in poor model detection performance and less than ideal results. Summary of the Invention

[0004] The purpose of this invention is to address the shortcomings of traditional power consumption anomaly detection methods, which are mainly based on data-driven approaches. These shortcomings include the loss of a large amount of useful information when detecting mixed heterogeneous data, poor model detection performance, and unsatisfactory results. Therefore, this invention proposes a power consumption anomaly detection method based on fuzzy coarse entropy.

[0005] To achieve the above objectives, the present invention adopts the following technical solution:

[0006] A method for detecting abnormal electricity consumption based on fuzzy coarse entropy includes the following steps:

[0007] S1: Standardize the numerical data.

[0008] The units of the numerical attribute data in the dataset are unified. The min-max standardization method is used to normalize the original data attribute values, reducing the value range of these attributes to [0,1]. The calculation formula is as follows:

[0009]

[0010] Where f[·] represents normalization; c(u) represents the value of user u on attribute c; min(c) represents the minimum value of all users on attribute c; and max(c) represents the maximum value of all users on attribute c.

[0011] S2: Calculate the distance matrix for each attribute.

[0012] Calculate the distance matrix Dis of the dataset under each attribute. c Dis c (u i ,u j ) = Dis c (u j ,u i ) represents user u i and u j The distance on attribute c; where if c is a nominal attribute, the Hamming distance is used to measure the difference between the attribute values ​​of the two users; if c is a numerical attribute, the Euclidean distance is used.

[0013] S3: Calculate the fuzzy similarity matrix based on the distance matrix.

[0014] After calculating the distance matrix, the mixed fuzzy similarity matrix of the corresponding attributes is calculated using the following formula, where B represents any attribute in attribute set C. When the distance is less than a certain threshold, it indicates that the two users have a certain degree of similarity under that attribute; otherwise, it indicates that the two users have no similarity.

[0015]

[0016] Among them, R B R represents the fuzzy similarity matrix of attribute subset B. B (u i ,u j ) represents user u i and u j The fuzzy similarity in attribute subset B; parameter ε is an adjustable threshold, ranging from [0,1]; Dis B (u i ,u j ) represents user u i and u j The distance on attribute c; |B| represents the number of attributes B, i.e., |B| = 1;

[0017] From fuzzy similarity relation R B Caused by user u i The definition of fuzzy information particles is:

[0018] SIM RB (u i ) = SIM B (u i )={R B (u i ,u1),R B (u i ,u2),…,R B (u i ,u n )}

[0019] For any integer j, 0 < j ≤ m, the j-th element R in this grain B (u i ,u j ) is represented as u i and u j Regarding the fuzzy similarity of B; it can be analyzed that if R B (u i ,u j ) = 0, indicating that u j It definitely does not belong to u i fuzzy information granular SIM RB (u i Conversely, if R B (u i ,u j If ) = 1, then it means u j It must belong to SIM RB (u i ).

[0020] S4: Calculate the distance-based fuzzy coarse entropy.

[0021] Based on the calculated fuzzy similarity, the fuzzy coarse entropy for each attribute is calculated; the distance-based fuzzy coarse entropy is defined as follows:

[0022]

[0023] Where, E(B)=E(R) B R represents a fuzzy similarity relation. B Fuzzy rough entropy; SIM RB (u i ) represents user u i In fuzzy similarity relation R B Fuzzy information particles, |U| represents the number of users in user set U.

[0024] S5: Obtain the attribute sequence and attribute set sequence based on the magnitude of the fuzzy coarse entropy.

[0025] The attributes are sorted in ascending order based on the magnitude of the fuzzy coarse entropy of each attribute, resulting in the following attribute sequence:

[0026] S = <c′1,c′2,…,c′ m >

[0027] Where S represents the attribute sequence, and m represents the number of attributes in the attribute set C; the fuzzy rough entropy of any attribute in S is less than or equal to the fuzzy rough entropy of the next attribute.

[0028] To construct the attribute set sequence, we set attribute c′1 as the first element of the sequence. Then, we add one attribute to attribute set C in a forward direction to obtain a new element, until all attributes are added and attribute set C becomes the last element of the sequence. The final attribute set sequence is as follows:

[0029] AS = <C1,C2,…,C m >

[0030] Where AS represents the sequence of attribute sets, m represents the number of attributes in attribute set C; any subset of attributes in AS is contained in attribute set C, and the first subset C1 is equal to the first attribute c′1 of the attribute sequence, while the last subset C1 is equal to the first attribute c′1 of the attribute sequence. m It is equal to the attribute set C itself; for any integer j, 0 < j < m, the (j+1)th attribute subset is equal to the j-th attribute subset plus the (j+1)th attribute of the attribute sequence, that is, C j+1 =C j ∪{c′ j+1}

[0031] S6: Calculate the distance matrix and similarity matrix for each subset of attributes in the attribute set sequence.

[0032] After obtaining the attribute set sequence, the distance matrix and similarity matrix for each attribute subset of the attribute set sequence are calculated sequentially using the same calculation method as steps S2 to S4. Since the number of attributes in the attribute subset is greater than or equal to 1, the distance matrix is ​​calculated using the following formula.

[0033]

[0034] Among them, Dis B Dis represents the distance matrix of attribute subset B. B (u i ,u k ) represents user u i and u j The difference lies in the values ​​of attribute subset B; |B| represents the number of attributes in attribute subset B, a k (u i ) represents user u i The value of the k-th attribute in B. This formula uses Hamming distance to measure the difference between nominal attribute values, denoted by the symbol... Hamming distance is used for calculation; differences between numerical attribute values ​​are measured using Euclidean distance; and for calculating the differences between users on a mixed attribute set B, which contains both nominal and numerical attributes, B needs to be divided into a nominal attribute subset B1 and a numerical attribute subset B2, which obviously satisfy B = B1∪B2 and... Then user u i and u j The formula for calculating the difference on attribute set B is Dis. B (u i ,u j ) = Dis B1 (u i ,u j )+Dis B2 (u i ,u j ).

[0035] S7: Calculate the fuzzy rough relative entropy matrix for each sub-attribute set of the two sequences respectively.

[0036] The definition of fuzzy rough relative entropy is as follows:

[0037]

[0038] Among them, RE B (u) represents the fuzzy rough relative entropy of user u with respect to the attribute subset B; u i ≠u, indicating that in the fuzzy similarity relation R BThe fuzzy coarse entropy of user set U after removing u, where |U| represents the number of users in user set U, SIM B (u i ) represents user u i Regarding the fuzzy information granules of attribute subset B; E(R) B This indicates that in the fuzzy similarity relation R B The fuzzy rough entropy of the user set U. B (u) can analyze the degree of anomaly of u; when u is removed from the user set U, if E u (R B Compared to E(R) B If the value of E changes significantly, it indicates a high degree of abnormality in u, suggesting it is more likely an abnormal user; conversely, if E... u (R B If the change is small, it indicates that the degree of abnormality of u is very low, and the probability of it being an abnormal user is even smaller; therefore, the relative fuzzy coarse entropy RE of u is small. B The lower (u) is, the higher the degree of abnormality of u;

[0039] Based on the above idea, the fuzzy rough relative entropy will be calculated sequentially for each attribute or subset of attributes in the two sequences, after removing one user from U each time, thus forming two fuzzy rough relative entropy matrices as follows:

[0040]

[0041]

[0042] Among them, REM S and REM AS Represent the fuzzy rough relative entropy matrix of the attribute sequence and the fuzzy rough relative entropy matrix of the attribute set sequence, respectively; REM S (i,j) represents user u i Regarding the j-th attribute c′ in the attribute sequence S j Fuzzy rough relative entropy REM AS (i,j) represents user u i Regarding the j-th attribute subset C in the attribute set sequence AS j Fuzzy rough relative entropy

[0043] S8: Calculate the weight matrix for the two sequences.

[0044] Besides utilizing uncertain metrics like fuzzy coarse entropy, the definition of the weight function can also effectively help amplify the difference in abnormal scores between abnormal and normal users. Therefore, after calculating the fuzzy coarse relative entropy, the weights of each subset of the two sequences are calculated, forming the weight matrices of the corresponding sequences as follows:

[0045]

[0046]

[0047] Among them, W S and W AS Let W represent the weight matrix of the attribute sequence and the weight matrix of the attribute set sequence, respectively; in the weight matrix W... S and W AS In the context of user set U, |U| represents the number of users in user set U. S (i,j) represents user u i Regarding the j-th attribute c′ in the attribute sequence S j The weights, Indicates user u i Regarding the j-th attribute c′ in the attribute sequence S j Fuzzy information particles; W AS (i,j) represents user u i Regarding the j-th attribute subset C in the attribute set sequence AS j The weights, Indicates user u i Regarding the j-th attribute subset C in the attribute set sequence AS j fuzzy information particles.

[0048] S9: Calculate the anomaly score for each user based on the relative entropy matrix and the weight matrix.

[0049]

[0050] Among them, score(u i ) represents user u i The anomaly score obtained on attribute set C; |C| represents the number of attributes in attribute set C; REM S (i,j) represents user u i Regarding the j-th attribute c′ in the attribute sequence S j fuzzy rough relative entropy, REM AS (i,j) represents user u i Regarding the j-th attribute subset C in the attribute set sequence AS j Fuzzy, rough relative entropy; W S (i,j) represents user u i Regarding the j-th attribute c′ in the attribute sequence S j The weights, W AS (i,j) represents user u i Regarding the j-th attribute subset C in the attribute set sequence AS j The weights.

[0051] S10: Determine whether each abnormal score is greater than the threshold.

[0052] Given a threshold μ, for any user u∈U, if score(u)>μ, then the user is determined to be an abnormal user in the user set U.

[0053] In this invention, a method for detecting abnormal electricity consumption based on fuzzy coarse entropy is described. This method utilizes fuzzy similarity relationships based on distance metrics to construct fuzzy coarse entropy, uses fuzzy coarse relative entropy to analyze the degree of user abnormality, and obtains more useful information by constructing attribute sequences and attribute set sequences.

[0054] The present invention provides a method for detecting abnormal electricity consumption based on fuzzy coarse entropy, which solves the problem that existing fuzzy coarse entropy methods cannot effectively distinguish similarity in high-dimensional situations due to the use of intersection operations. It eliminates the need for pre-training models, reduces the workload of operators, detects abnormal electricity consumption data earlier, and improves detection efficiency.

[0055] This invention utilizes the improved fuzzy rough entropy to effectively extract fuzzy and uncertain information from abnormal electricity consumption data, thereby improving the detection performance of the model. It also expands the traditional fuzzy rough set method, effectively handling mixed heterogeneous datasets, and is not affected by the type of dataset, making it applicable to various types of electricity consumption data. Attached Figure Description

[0056] Figure 1 This is a schematic diagram of the steps of a power consumption anomaly detection method based on fuzzy rough entropy proposed in this invention. Detailed Implementation

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

[0058] Example 1

[0059] Reference Figure 1 One embodiment of this solution is a method for detecting abnormal electricity consumption based on fuzzy coarse entropy, comprising the following steps:

[0060] S1: Obtain electricity consumption data and standardize the numerical objects in the electricity consumption data to obtain the information system;

[0061] S2: Based on the information system, calculate the distance matrix for each attribute;

[0062] S3: Calculate the fuzzy similarity matrix for each attribute based on the distance matrix;

[0063] S4: Calculate the distance-based fuzzy coarse entropy for each attribute;

[0064] S5: Sort the attributes according to the magnitude of the fuzzy coarse entropy to obtain the attribute sequence and the attribute set sequence;

[0065] S6: Calculate the distance matrix and fuzzy similarity matrix for each attribute subset of the attribute set sequence;

[0066] S7: Calculate the fuzzy rough relative entropy matrix for each sub-attribute set of the two sequences respectively;

[0067] S8: Calculate the weight matrices for the two sequences;

[0068] S9: Calculate the anomaly score for each user based on the relative entropy matrix and the weight matrix;

[0069] S10: Determine whether the outlier degree of each user in the information system is greater than the threshold. If so, output the abnormal user; otherwise, proceed to the next user for judgment, until all users have been judged.

[0070] In practical applications of fuzzy rough sets, electricity consumption data is imported into an information system (or information table), where each row represents a user and each column represents an attribute of the object. The values ​​of the attributes can be numerical (such as electricity consumption, voltage, etc.), nominal (such as user type, wiring method), or mixed (i.e., including both numerical and nominal values). An information system is represented as (U, C), where U represents the user set and C represents the attribute set.

[0071] In this embodiment, the numerical attributes are first preprocessed using the min-max normalization method to obtain the electricity consumption dataset. The improved fuzzy coarse entropy effectively reflects the discriminative power of the electricity consumption data. Then, attribute sequences and attribute set sequences are constructed. The fuzzy coarse relative entropy and weight matrix corresponding to the two sequences are used to construct anomaly scores to evaluate the degree of anomaly of users. This solves the problem that existing electricity consumption anomaly detection methods cannot effectively handle complex electricity consumption data with characteristics such as multi-source heterogeneity, fuzziness, and uncertainty. This method can train the model without labeling data and can effectively realize unsupervised anomaly detection of hybrid electricity consumption data.

[0072] In S1, The expression for its normalization is:

[0073]

[0074] Where f[·] represents normalization; c(u) represents the value of user u on attribute c; min(c) represents the minimum value of all users on attribute c; max(c) represents the maximum value of all users on attribute c;

[0075] In this embodiment, the value range of numerical data is adjusted to the real number range of 0-1 through the min-max normalization operation, while the nominal data remains unchanged.

[0076] S2 specifically refers to:

[0077] Hamming distance is used to measure the distance between two users on nominal attributes, while Euclidean distance is used to calculate the distance between them on numerical attributes. This results in a distance matrix Dis for each attribute c. c Among them, Dis c (u i ,u j ) = Dis c (u j ,u i ) represents user u i and u j Distance on attribute c.

[0078] S3 specifically refers to:

[0079] After calculating the distance matrix, the mixed fuzzy similarity matrix of the corresponding attributes is calculated using the following formula, where B represents any attribute in attribute set C; that is, when the distance is less than a certain threshold, it indicates that the two users have a certain similarity under that attribute, otherwise it indicates that the two users have no similarity; and it can be analyzed that if R B (u i ,u j ) = 0, indicating that u j It definitely does not belong to u i Fuzzy information particles Conversely, if R B (u i ,u j If ) = 1, then it means u j It must belong to

[0080]

[0081] Among them, R B R represents the fuzzy similarity matrix of attribute subset B. B (u i ,u j ) represents user u i and u j The fuzzy similarity in attribute subset B; parameter ε is an adjustable threshold, ranging from [0,1]; Dis B (u i ,u j ) represents user u i and u jThe distance on attribute c; |B| represents the number of attributes B, i.e., |B| = 1;

[0082] S4 specifically refers to:

[0083] Calculate the distance-based fuzzy coarse entropy for each attribute;

[0084]

[0085] Among them, SIM Rc (u i ) = SIM c (u i )={R c (u i ,u1),R c (u i ,u2),…,R c (u i ,u n )}, Indicates user u i Regarding R c The fuzzy information granules; for any integer j, 0 < j ≤ m, the j-th element R in the granule c (u i ,u j ) is represented as u i and u j Regarding the fuzzy similarity of c; furthermore, |U| represents the number of users in user set U.

[0086] S5 specifically refers to:

[0087] Arrange the attributes in ascending order according to the magnitude of the fuzzy coarse entropy, and the attribute sequence is as follows:

[0088] S = <c′1,c′2,…,c′ m >

[0089] Where S represents the attribute sequence, and m represents the number of attributes in the attribute set C; the fuzzy rough entropy of any attribute in S is less than or equal to the fuzzy rough entropy of the next attribute.

[0090] To construct the attribute set sequence, we set attribute c′1 as the first element of the sequence. Then, we add one attribute to attribute set C in a forward direction to obtain a new element, until all attributes are added and attribute set C becomes the last element of the sequence. The final attribute set sequence is as follows:

[0091] AS = <C1,C2,…,C m >

[0092] Where AS represents the sequence of attribute sets, m represents the number of attributes in attribute set C; any subset of attributes in AS is contained in attribute set C, and the first subset C1 is equal to the first attribute c′1 of the attribute sequence, while the last subset C1 is equal to the first attribute c′1 of the attribute sequence. m It is equal to the attribute set C itself; for any integer j, 0 < j < m, the (j+1)th attribute subset is equal to the j-th attribute subset plus the (j+1)th attribute of the attribute sequence, that is, C j+1 =C j ∪{c′ j+1}

[0093] S6 specifically refers to:

[0094] After obtaining the attribute set sequence, the distance matrix and similarity matrix for each attribute subset of the attribute set sequence are calculated sequentially using the same calculation method as steps S2 to S4. Since the number of attributes in the attribute subset is greater than or equal to 1, the distance matrix is ​​calculated using the following formula.

[0095]

[0096] Among them, Dis B Dis represents the distance matrix of attribute subset B. B (u i ,u k ) represents user u i and u j The difference lies in the values ​​of attribute subset B; |B| represents the number of attributes in attribute subset B, a k (u i ) represents user u i The value of the k-th attribute in B. This formula uses Hamming distance to measure the difference between nominal attribute values, denoted by the symbol... Hamming distance is used for calculation; differences between numerical attribute values ​​are measured using Euclidean distance; and for calculating the differences between users on a mixed attribute set B, which contains both nominal and numerical attributes, B needs to be divided into a nominal attribute subset B1 and a numerical attribute subset B2, which obviously satisfy B = B1∪B2 and... Then user u i and u j The formula for calculating the difference on attribute set B is:

[0097] S7 specifically refers to:

[0098] The definition of fuzzy rough relative entropy is as follows:

[0099]

[0100] Among them, RE B (u) represents the fuzzy rough relative entropy of user u. u i ≠u, indicating that in the fuzzy similarity relation R B The fuzzy coarse entropy of user set U after removing u, where |U| represents the number of users in user set U, SIM B (u i ) represents user u i Regarding the fuzzy information granules of attribute subset B; E(R) B This indicates that in the fuzzy similarity relation R B The fuzzy rough entropy of the user set U. B (u) can analyze the degree of anomaly of u; when u is removed from the user set U, if E u (R B Compared to E(R) B If the value of E changes significantly, it indicates a high degree of abnormality in u, suggesting it is more likely an abnormal user; conversely, if E... u (R B If the change is small, it indicates that the degree of abnormality of u is very low, and the probability of it being an abnormal user is even smaller; therefore, the relative fuzzy coarse entropy RE of u is small. B The lower (u) is, the higher the degree of abnormality of u;

[0101] Based on the above idea, the fuzzy rough relative entropy will be calculated sequentially for each attribute or subset of attributes in the two sequences after removing one user from U each time, thus forming two fuzzy rough relative entropy matrices as follows:

[0102]

[0103] REM AS (i,j)=RE Cj (u i );

[0104] Among them, REM S and REM AS Represent the fuzzy rough relative entropy matrix of the attribute sequence and the fuzzy rough relative entropy matrix of the attribute set sequence, respectively; REM S (i,j) represents user u i Regarding the j-th attribute c′ in the attribute sequence S j Fuzzy rough relative entropy RE c′j (u i REM AS (i,j) represents user u i Regarding the j-th attribute subset C in the attribute set sequence AS j Fuzzy rough relative entropy

[0105] S8 specifically refers to:

[0106] Besides utilizing uncertain metrics like fuzzy coarse entropy, the definition of the weight function can also effectively help amplify the difference in abnormal scores between abnormal and normal users. Therefore, after calculating the fuzzy coarse relative entropy, the weights of each subset of the two sequences are calculated, forming the weight matrices of the corresponding sequences as follows:

[0107]

[0108]

[0109] Among them, W S and W AS Let W represent the weight matrix of the attribute sequence and the weight matrix of the attribute set sequence, respectively; in the weight matrix W... S and W AS In the context of user set U, |U| represents the number of users in user set U. S (i,j) represents user u i Regarding the j-th attribute c′ in the attribute sequence S j The weights, Indicates user u i Regarding the j-th attribute c′ in the attribute sequence S j Fuzzy information particles; W AS (i,j) represents user u i Regarding the j-th attribute subset C in the attribute set sequence AS j The weights, Indicates user u i Regarding the j-th attribute subset C in the attribute set sequence AS j fuzzy information particles.

[0110] S9 specifically refers to:

[0111] Evaluate each user's outlier score using distance-based outlier scores;

[0112]

[0113] Among them, score(u i ) represents user u i The anomaly score obtained on attribute set C; |C| represents the number of attributes in attribute set C; REM S (i,j) represents user u i Regarding the j-th attribute c′ in the attribute sequence S j fuzzy rough relative entropy, REM AS (i,j) represents user u i Regarding the j-th attribute subset C in the attribute set sequence AS j Fuzzy, rough relative entropy; W S (i,j) represents user ui Regarding the j-th attribute c′ in the attribute sequence S j The weights, W AS (i,j) represents user u i Regarding the j-th attribute subset C in the attribute set sequence AS j The weights.

[0114] S10 specifically refers to:

[0115] Determine whether the outlier of each user in the information system is greater than the threshold. If so, output the outlier user; otherwise, proceed to the next user and continue until all users have been determined.

[0116] Example 2

[0117] Referring to Table 1, c1 is the nominal attribute, c2 and c3 are numerical attributes, and x1,...,x6 represent all users in the user set U. This solution provides one embodiment: a method for detecting abnormal electricity consumption based on fuzzy coarse entropy, comprising the following steps.

[0118] Table 1 Electricity Consumption Information

[0119]

[0120] S1: Standardize the numerical data: Use the min-max standardization formula to preprocess the attribute values ​​of c2 and c3. The preprocessing results are shown on the right side of Table 1.

[0121] S2: Calculate the distance matrix for each attribute according to Table 1; Hamming distance is used to measure the distance between two users on nominal attributes, while Euclidean distance is used to calculate the distance between two users on numerical attributes. Finally, the distance matrix Dis for each attribute c is obtained. c .

[0122]

[0123]

[0124]

[0125] S3: Calculate the fuzzy similarity matrix for each attribute based on the distance matrix; where the parameter ε is 0.5.

[0126]

[0127]

[0128]

[0129] S4: Calculate the distance-based fuzzy coarse entropy for each attribute.

[0130] E(c1)=1.1258, E(c2)=1.7088, E(c3)=1.5457

[0131] S5: Sort the attributes in ascending order according to the magnitude of the fuzzy coarse entropy to obtain the attribute sequence and attribute set sequence.

[0132] S =<c1,c3,c2>

[0133] AS=<C1,C2,C3>=<{c1},{c1,c3},{c1,c2,c3}>

[0134] S6: Calculate the distance matrix for each subset of attributes in the sequence of attribute sets.

[0135]

[0136]

[0137]

[0138] The fuzzy similarity matrix of each sub-attribute set in the attribute set sequence is obtained from the distance matrix.

[0139]

[0140]

[0141]

[0142] S7: Calculate the fuzzy rough relative entropy matrix for each sub-attribute set of the two sequences respectively.

[0143]

[0144]

[0145] S8: Calculate the weight matrix for the two sequences.

[0146]

[0147]

[0148] S9. Calculate the anomaly score for each user based on the relative entropy matrix and the weight matrix.

[0149]

[0150] Similarly, we can obtain:

[0151] score(x2)≈0.3722, score(x3)≈0.3825,

[0152] score(x4)≈0.3753, score(x5)≈0.3901, score(x6)≈0.3645.

[0153] S10: Let μ = 0.38. Check each user in the information system for outlier scores. If the outlier score is greater than the threshold, output the outlier user; otherwise, proceed to the next user. Continue this process until all users have been checked. Finally, the set of users with outliers greater than the threshold μ is the desired outlier set OS = {u1, u3}.

[0154] The above description is only a preferred embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any equivalent substitutions or modifications made by those skilled in the art within the scope of the technology disclosed in the present invention, based on the technical solution and inventive concept of the present invention, should be covered within the scope of protection of the present invention.

[0155] The preferred embodiments of the present invention disclosed above are merely illustrative of the invention. These preferred embodiments do not exhaustively describe all details, nor do they limit the invention to the specific implementations described. Clearly, many modifications and variations can be made based on the content of this specification. This specification selects and specifically describes these embodiments to better explain the principles and practical applications of the invention, thereby enabling those skilled in the art to better understand and utilize the invention. The invention is limited only by the claims and their full scope and equivalents.

Claims

1. A method for detecting abnormal electricity consumption based on fuzzy rough entropy, characterized in that, Includes the following steps: Electricity consumption data is imported into an information system and represented as (U,C), where U represents the user set and C represents the attribute set. The attribute values ​​include numerical, nominal, and mixed types. Numerical types include electricity consumption and voltage, nominal types include user type and wiring method, and mixed types include both numerical and nominal types. S1: Standardize the numerical data; The units of the numerical attribute data in the dataset are unified. The min-max standardization method is used to normalize the original data attribute values, reducing the value range of these attributes to [0,1]. The calculation formula is as follows: Where f[·] represents normalization; c(u) represents the value of user u on attribute c; min(c) represents the minimum value of all users on attribute c; max(c) represents the maximum value of all users on attribute c; S2: Calculate the distance matrix for a single attribute; Calculate the distance matrix Dis of the dataset under each attribute. c Dis c (u i ,u j ) = Dis c (u j ,u i ) represents user u i and u j The distance on attribute c; where, if c is a nominal attribute, the Hamming distance is used to measure the difference between the attribute values ​​of the two users; if c is a numerical attribute, the Euclidean distance is used. S3: Calculate the fuzzy similarity matrix for a single attribute based on the distance matrix; After calculating the distance matrix, the fuzzy similarity matrix of the corresponding attribute is calculated using the following formula, where B represents any attribute in attribute set C; Among them, R B R represents the fuzzy similarity matrix of attribute subset B. B (u i ,u j ) represents user u i and u j The fuzzy similarity in attribute subset B; parameter ε is an adjustable threshold, ranging from [0,1]; Dis B (u i ,u j ) represents user u i and u j Distance on attribute c; From fuzzy similarity relation R B Caused by user u i The definition of fuzzy information particles is: For any integer j, 0 < j ≤ m, the j-th element R in this grain B (u i ,u j ) is represented as u i and u j Regarding the fuzzy similarity of B; analysis shows that if R B (u i ,u j ) = 0, indicating that u j It definitely does not belong to u i Fuzzy information particles Conversely, if R B (u i ,u j If ) = 1, then it means u j It must belong to ; S4: Calculate the distance-based fuzzy coarse entropy; Based on the calculated fuzzy similarity, the fuzzy coarse entropy for each attribute is calculated; the distance-based fuzzy coarse entropy is defined as follows: Where, E(B)=E(R) B R represents a fuzzy similarity relation. B Fuzzy rough entropy; Indicates user u i In fuzzy similarity relation R B Fuzzy information particles, |U| represents the number of users in user set U; S5: Obtain the attribute sequence and attribute set sequence based on the magnitude of the fuzzy coarse entropy; The attributes are sorted in ascending order based on the magnitude of the fuzzy coarse entropy of each attribute, resulting in the following attribute sequence: S=<c′1,c′2,…,c′ m > Where S represents the attribute sequence, and m represents the number of attributes in the attribute set C; the fuzzy rough entropy of any attribute in S is less than or equal to the fuzzy rough entropy of the next attribute. To construct the attribute set sequence, we set attribute c′1 as the first element of the sequence. Then, we add one attribute to attribute set C in a forward direction to obtain a new element, until all attributes are added and attribute set C becomes the last element of the sequence. The final attribute set sequence is as follows: AS=<C1,C2,…,C m > Where AS represents the sequence of attribute sets, m represents the number of attributes in attribute set C; any subset of attributes in AS is contained in attribute set C, and the first subset C1 is equal to the first attribute c′1 of the attribute sequence, while the last subset C1 is equal to the first attribute c′1 of the attribute sequence. m It is equal to the attribute set C itself; for any integer j, 0 < j < m, the (j+1)th attribute subset is equal to the j-th attribute subset plus the (j+1)th attribute of the attribute sequence, that is, C j+1 =C j ∪{c′ j+1 }; S6: Calculate the distance matrix and similarity matrix for each attribute subset in the attribute set sequence; After obtaining the attribute set sequence, the distance matrix and similarity matrix for each attribute subset of the attribute set sequence are calculated sequentially using the same calculation method as steps S2 to S4. Since the number of attributes in the attribute subset is greater than or equal to 1, the distance matrix is ​​calculated using the following formula. Among them, Dis B Dis represents the distance matrix of attribute subset B. B (u i ,u k ) represents user u i and u j The difference lies in the values ​​of attribute subset B; |B| represents the number of attributes in attribute subset B, a k (u i ) represents user u i The value of the k-th attribute in B; the Hamming distance metric is used in this formula to measure the difference between nominal attribute values, denoted by the symbol... Hamming distance is used for calculation; differences between numerical attribute values ​​are measured using Euclidean distance; and for calculating the differences between users on a mixed attribute set B, which contains both nominal and numerical attributes, B needs to be divided into a nominal attribute subset B1 and a numerical attribute subset B2, which obviously satisfy B = B1∪B2 and... Then user u i and u j The formula for calculating the difference on attribute set B is: ; S7: Calculate the fuzzy rough entropy matrix for each sub-attribute set of the two sequences respectively; The definition of fuzzy rough relative entropy is as follows: Among them, RE B (u) represents the fuzzy rough relative entropy of user u with respect to the attribute subset B; u i ≠u, indicating that in the fuzzy similarity relation R B The fuzzy rough entropy of the user set U after removing u, SIM B (u i ) represents user u i Regarding the fuzzy information granules of attribute subset B; E(R) B This indicates that in the fuzzy similarity relation R B Fuzzy rough entropy of user set U; RE B (u) Analyze the degree of abnormality of u; The fuzzy rough relative entropy will be calculated sequentially for each attribute subset of the two sequences after removing one user from U, thus forming two fuzzy rough relative entropy matrices as follows: Among them, REM S and REM AS Represent the fuzzy rough relative entropy matrix of the attribute sequence and the fuzzy rough relative entropy matrix of the attribute set sequence, respectively; REM S (i,j) represents user u i Regarding the j-th attribute c′ in the attribute sequence S j Fuzzy rough relative entropy REM AS (i,j) represents user u i Regarding the j-th attribute subset C in the attribute set sequence AS j Fuzzy rough relative entropy ; S8: Calculate the weight matrices for the two sequences; After calculating the fuzzy rough relative entropy, the weights of each subset of the two sequences are calculated, and the weight matrices of the corresponding sequences are constructed as follows: Among them, W S and W AS Let W represent the weight matrix of the attribute sequence and the weight matrix of the attribute set sequence, respectively; in the weight matrix W... S and W AS In the middle, W S (i,j) represents user u i Regarding the j-th attribute c′ in the attribute sequence S j The weights, Indicates user u i Regarding the j-th attribute c′ in the attribute sequence S j Fuzzy information particles; W AS (i,j) represents user u i Regarding the j-th attribute subset C in the attribute set sequence AS j The weights, Indicates user u i Regarding the j-th attribute subset C in the attribute set sequence AS j Fuzzy information particles; S9: Calculate the anomaly score for each user based on the relative entropy matrix and the weight matrix; Among them, score(u i ) represents user u i The anomaly score obtained on attribute set C; |C| represents the number of attributes in attribute set C; REM S (i,j) represents user u i Regarding the j-th attribute c′ in the attribute sequence S j fuzzy rough relative entropy, REM AS (i,j) represents user u i Regarding the j-th attribute subset C in the attribute set sequence AS j fuzzy rough relative entropy; W S (i,j) represents user u i Regarding the j-th attribute c′ in the attribute sequence S j The weights, W AS (i,j) represents user u i Regarding the j-th attribute subset C in the attribute set sequence AS j The weights; The distance-based fuzzy coarse anomaly score is used as an indicator to determine whether a user has abnormal electricity usage. That is, the higher the anomaly score of object u, the greater the probability that u is abnormal. S10: Determine whether each abnormal score is greater than the threshold; Given a threshold μ, for any user u∈U, if score(u)>μ, then the user is determined to be an abnormal user in the user set U.