Abnormal electricity consumption behavior detection method, device, computer equipment and storage medium
By correcting outliers in user profiles and detecting power data, the problem of inaccurate detection of abnormal electricity use behavior in the prior art is solved, and higher detection accuracy is achieved.
Patent Information
- Application Number
- CN202111069926.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-13
- Publication Date
- 2025-03-04
- Estimated Expiration
- 2041-09-13
AI Technical Summary
The prior art has misjudgments in detecting abnormal electricity use behaviors, resulting in inaccurate detection.
By obtaining the power data of the user to be evaluated, the electricity consumption curve to be evaluated is determined, and the user profile is corrected when the similarity between the curve and the industry standard curve is below the preset threshold. At the same time, the power data to be measured in the segmented time series is obtained from the power data, and whether there are outliers are detected, and whether the user has abnormal power consumption behavior is determined based on the detection results of multiple segmented time series.
It improves the accuracy of abnormal electricity use behavior detection, reduces misjudgment caused by abnormal user profiles, and can more accurately detect time points in the power data that are inconsistent with normal electricity use behavior.
Smart Images

Figure CN113723861B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of electric power Internet of Things, and in particular to a method, device, computer equipment and storage medium for detecting abnormal power consumption behavior. Background Art
[0002] With the rapid development of power Internet of Things technology, the application of metering automation system is becoming more and more popular. The metering automation system is applied to the server, which obtains the user's power data from the metering terminal and monitors the power consumption of each user based on the collected power data.
[0003] In traditional technical solutions, the corresponding power consumption curve to be evaluated is generally determined based on the power data of the user to be evaluated, and the similarity between the power consumption curve to be evaluated and the industry standard curve is compared. When the similarity between the two is lower than the preset similarity threshold, it is determined that the user to be evaluated has abnormal power consumption behavior. However, there are many reasons for the low similarity between the power consumption curve to be evaluated and the industry standard curve. According to the current technical solution, it may cause misjudgment of abnormal power consumption behavior, that is, inaccurate detection of abnormal power consumption behavior.
[0004] Therefore, how to improve the accuracy of abnormal power consumption behavior detection is a technical problem that technical personnel in this field currently need to solve. Summary of the invention
[0005] Based on this, it is necessary to provide a method, device, computer equipment and storage medium for detecting abnormal power usage behavior, which can improve the accuracy of abnormal power usage behavior detection, in order to address the above technical problems.
[0006] A method for detecting abnormal electricity consumption behavior, the method comprising:
[0007] Acquire the power data of the user to be evaluated; wherein the power data includes current data, phase angle data and electric energy data;
[0008] Determine the power consumption curve to be evaluated according to the electric energy data, and when the similarity between the power consumption curve to be evaluated and the industry standard curve is lower than a preset similarity threshold, modify the user profile of the user to be evaluated;
[0009] Acquire the to-be-measured electric quantity data corresponding to the segmented time series from the electric quantity data, and determine whether there are outliers in the to-be-measured electric quantity data;
[0010] According to the detection results of the outliers respectively detected in the plurality of segmented time series, it is determined whether the user to be evaluated has abnormal electricity usage behavior.
[0011] In one embodiment, the process of determining whether the user to be evaluated has abnormal electricity usage behavior based on the detection results of outliers detected respectively from the plurality of segmented time series includes:
[0012] Determining the total number of abnormal time series according to the number of segmented time series with outliers in the plurality of segmented time series;
[0013] When the total number of abnormal time series is greater than a preset number threshold, it is determined that the user to be evaluated has abnormal electricity usage behavior;
[0014] Otherwise, it is determined that the power data of the user to be evaluated is occasionally abnormal.
[0015] In one embodiment, the process of obtaining the measured electric quantity data corresponding to the segmented time series from the electric quantity data and determining whether there are outliers in the measured electric quantity data includes:
[0016] Determine a segmented time series through a sliding time window, and obtain the to-be-measured electric quantity data corresponding to the segmented time series from the electric quantity data;
[0017] Calculating the norm of the measured electrical quantity data corresponding to the segmented time series and the norm difference of adjacent segmented time series;
[0018] Determining a corresponding statistical feature according to the norm and the norm difference;
[0019] Determine a corresponding first feature vector according to the statistical feature, and reconstruct the first feature vector into a second feature vector;
[0020] According to whether the reconstruction error of the first eigenvector and the second eigenvector is greater than a preset error threshold, it is determined whether there is an outlier in the electric quantity data to be measured in the corresponding segmented time series.
[0021] In one of the embodiments, after determining that the power data of the user to be evaluated is occasionally abnormal, the method further includes:
[0022] Data repair is performed on the electric quantity data corresponding to the detected outliers.
[0023] In one embodiment, the process of repairing the power data corresponding to the detected outlier includes:
[0024] Acquire a preset number of adjacent electric quantity data adjacent to the outlier;
[0025] An average value of the preset number of adjacent electric quantity data is determined, and the electric quantity data of the outlier is repaired by using the average value.
[0026] In one embodiment, the process of determining the power consumption curve to be evaluated based on the power data, and when the similarity between the power consumption curve to be evaluated and the industry standard curve is lower than a preset similarity threshold, modifying the user profile of the user to be evaluated includes:
[0027] Determining the power consumption curve to be evaluated according to the power data;
[0028] When the similarity between the electricity consumption curve to be evaluated and the industry standard curve is lower than the preset similarity threshold, segmenting the user name in the user profile of the user to be evaluated, and converting the target word vector according to the segmentation result;
[0029] Determine the target industry classification corresponding to the target word vector according to the similarity between the target word vector and each preset word vector and the correspondence between each preset word vector and the preset industry classification;
[0030] If the industry classification in the user profile is inconsistent with the target industry classification, the user profile is modified according to the target industry classification.
[0031] In one embodiment, the method further comprises:
[0032] The repaired power data and / or the corrected user profile are visually displayed.
[0033] A device for detecting abnormal electricity consumption behavior, the device comprising:
[0034] An acquisition module is used to acquire the power data of the user to be evaluated; wherein the power data includes current data, phase angle data and electric energy data;
[0035] A correction module, used to determine the power consumption curve to be evaluated according to the electric energy data, and to correct the user profile of the user to be evaluated when the similarity between the power consumption curve to be evaluated and the industry standard curve is lower than a preset similarity threshold;
[0036] A determination module, used to obtain the to-be-measured electric quantity data corresponding to the segmented time series from the electric quantity data, and determine whether there are outliers in the to-be-measured electric quantity data;
[0037] The judgment module is used to determine whether the user to be evaluated has abnormal electricity usage behavior based on the detection results of outliers detected respectively from the multiple segmented time series.
[0038] A computer device comprises a memory and a processor, wherein the memory stores a computer program, and when the processor executes the computer program, the following steps are implemented:
[0039] Acquire the power data of the user to be evaluated; wherein the power data includes current data, phase angle data and electric energy data;
[0040] Determine the power consumption curve to be evaluated according to the electric energy data, and when the similarity between the power consumption curve to be evaluated and the industry standard curve is lower than a preset similarity threshold, modify the user profile of the user to be evaluated;
[0041] Acquire the to-be-measured electric quantity data corresponding to the segmented time series from the electric quantity data, and determine whether there are outliers in the to-be-measured electric quantity data;
[0042] According to the detection results of the outliers detected by the multiple segmented time series, it is determined whether the user to be evaluated has abnormal electricity consumption behavior. A computer readable storage medium stores a computer program, and when the computer program is executed by a processor, the following steps are implemented:
[0043] Acquire the power data of the user to be evaluated; wherein the power data includes current data, phase angle data and electric energy data;
[0044] Determine the power consumption curve to be evaluated according to the electric energy data, and when the similarity between the power consumption curve to be evaluated and the industry standard curve is lower than a preset similarity threshold, modify the user profile of the user to be evaluated;
[0045] Acquire the to-be-measured electric quantity data corresponding to the segmented time series from the electric quantity data, and determine whether there are outliers in the to-be-measured electric quantity data;
[0046] According to the detection results of the outliers respectively detected in the plurality of segmented time series, it is determined whether the user to be evaluated has abnormal electricity usage behavior.
[0047] The above-mentioned abnormal electricity usage behavior detection method, device, computer equipment and storage medium, in this method, when the similarity between the electricity usage curve to be evaluated and the industry standard curve is lower than the preset similarity threshold, the user profile of the user to be evaluated is corrected, and after excluding the misjudgment of the user's abnormal electricity usage behavior caused by the abnormal user profile, it is further determined whether there are outliers in the measured electricity data corresponding to the segmented time series, and the time points in the electricity data that are inconsistent with the normal electricity usage behavior are obtained, and based on the detection results of the outliers detected in multiple segmented time series, it is determined whether the user to be evaluated has abnormal electricity usage behavior. Therefore, this method can detect abnormal electricity usage behavior more accurately. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] Figure 1 This is a diagram of an application environment of a method for detecting abnormal power consumption behavior in an embodiment;
[0049] Figure 21 is a flow chart of a method for detecting abnormal power consumption behavior in one embodiment;
[0050] Figure 3 A schematic diagram of a flow chart of a method for detecting abnormal power consumption behavior in another embodiment;
[0051] Figure 4 is a structural block diagram of an abnormal power consumption behavior detection device in one embodiment;
[0052] Figure 5 FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0053] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0054] The abnormal power consumption behavior detection method provided in this application can be applied to Figure 1 In the application environment shown. Among them, the server 102 communicates with the metering terminal 104 through the network. Specifically, the server 102 refers to a device used for statistical analysis of electricity data in the power Internet of Things. It can be implemented by an independent server or a server cluster composed of multiple servers, or by various personal computers, laptops, tablet computers, etc. The metering terminal 104 refers to a device used to collect electricity data of each user, such as a smart meter, a load management terminal, and a distribution transformer monitoring metering terminal; in actual applications, metering terminals 104 can be set at multiple different locations to collect electricity data respectively, so as to use the server 102 to perform statistical analysis on the electricity data collected by multiple metering terminals 104.
[0055] In one embodiment, Figure 2 As shown, a method for detecting abnormal power consumption behavior is provided. Figure 1 The server in the example is used to illustrate the following steps:
[0056] Step 202, obtaining the power data of the user to be evaluated; wherein the power data includes current data, phase angle data and electric energy data.
[0057] Specifically, the user to be evaluated refers to a user who needs to be detected for abnormal electricity consumption behavior. The user to be evaluated in this embodiment generally refers to a corporate enterprise user. Electricity data refers to data that characterizes the user's electricity consumption. Generally, electricity data includes current data, phase data, and electric energy data; among which, current data refers to the magnitude of the current; phase is a physical quantity that reflects the state of alternating current, and phase data refers to the direction of alternating current corresponding to the time of collection; electric energy data refers to the user's daily electricity consumption; in other embodiments, electricity data may also include other information, which is not limited in this embodiment.
[0058] In this embodiment, the electricity data of the user to be evaluated may be collected through the metering terminal and the collected electricity data may be sent to the server, so that the server obtains the electricity data of the user to be evaluated; more specifically, in a specific implementation manner, the metering terminal obtains the current data, phase data and electric energy data of 96 points of the user to be evaluated at intervals of 15 minutes; and the metering terminal sends the electricity data to the server via WIFI, an operating network or NFC (near field communication), which is not limited in this embodiment.
[0059] It should also be noted that after obtaining the electricity data, the obtained electricity data can be preprocessed, including format conversion of the electricity data, removal of missing values in the electricity data, and normalization of the electricity data. The preprocessed electricity data is then used for processing and analysis, which can further improve the accuracy of abnormal electricity usage behavior detection.
[0060] Step 204 , determining the power consumption curve to be evaluated based on the power data, and when the similarity between the power consumption curve to be evaluated and the industry standard curve is lower than a preset similarity threshold, modifying the user profile of the user to be evaluated.
[0061] Specifically, in this step, the power consumption curve to be evaluated is first determined using the power data, that is, each power data is fitted into a corresponding curve according to the collection time sequence of each power data, and the curve can intuitively represent the change of the power consumption of the user to be evaluated over time.
[0062] In addition, an industry standard curve corresponding to the industry to which the user to be evaluated belongs is obtained; specifically, the standard electricity consumption curve is obtained by clustering electricity consumption curves of different industries, and each industry can be clustered to obtain one or more industry standard curves.
[0063] The similarity between the electricity consumption curve to be evaluated and the industry standard curve of the corresponding industry is calculated. Specifically, the similarity between the electricity consumption curve to be evaluated and the industry standard curve can be determined by calculating the Euclidean distance, cosine distance, etc. The present embodiment does not limit the method for calculating the similarity. Moreover, when the similarity between the two is calculated by calculating the Euclidean distance, the smaller the Euclidean distance, the higher the similarity. When the calculated similarity is lower than the preset similarity threshold, that is, the Euclidean distance exceeds the preset threshold, it indicates that there may be problems with the electricity data of the user to be evaluated.
[0064] It is understandable that the user profile of the user to be evaluated may be pre-stored in the server or obtained from the metering terminal when collecting electricity data, which is not limited in this embodiment. Profile abnormality is one of the main reasons for the low similarity between the electricity consumption curve to be evaluated and the industry standard curve. User misreporting or server statistics may cause profile abnormality. Therefore, when it is determined that the similarity between the electricity consumption curve to be evaluated and the industry standard curve is lower than the preset similarity threshold, the user profile of the user to be evaluated is corrected.
[0065] Step 206 , obtaining the to-be-measured electric quantity data corresponding to the segmented time series from the electric quantity data, and determining whether there are outliers in the to-be-measured electric quantity data.
[0066] Specifically, first determine the segmented time series, such as T1 to T2 is a segmented time series, and T2 to T3 is a segmented time series; according to the correspondence between the time points corresponding to each electric quantity data and the segmented time series to which it belongs, determine the electric quantity data to be measured corresponding to each segmented time series from the electric quantity data; then determine whether there are outliers in the electric quantity data to be measured in each segmented time series.
[0067] It should be noted that, while ensuring that the user profile is correct, the cause of the abnormal power data may be the presence of outliers in the power data, where outlier detection is to find the time points in the power data that are inconsistent with normal power consumption behavior. In this step, it is necessary to further determine whether there are outliers in the power data to be measured corresponding to the segmented time series. Specifically, it can be clustering the power data to be measured in the segmented time series, or it can be determined by calculating the reconstruction error to determine whether there are outliers in the power data to be measured, which is not limited in this embodiment.
[0068] Step 208 , determining whether the user to be evaluated has abnormal electricity usage behavior based on the detection results of outliers detected respectively from the multiple segmented time series.
[0069] Specifically, abnormal electricity usage behavior refers to abnormal electricity usage behavior of users, such as electricity theft by users; in actual operation, multiple segmented time series are obtained, and the detection results of outliers corresponding to the measured electricity data in each segmented time series are determined respectively, and the detection results include the existence of outliers or the absence of outliers; then, based on the detection results of the outliers determined in each segmented time series, it is judged whether the number of outliers in the electricity data meets the conditions for determining abnormal electricity usage behavior. It should be noted that in this embodiment, the specific number of segmented time series is generally set according to actual experience, and is generally more than two, and this embodiment does not limit this.
[0070] In the above-mentioned abnormal electricity usage behavior detection method, when the similarity between the electricity usage curve to be evaluated and the industry standard curve is lower than a preset similarity threshold, the user profile of the user to be evaluated is corrected. After eliminating the misjudgment of the user's abnormal electricity usage behavior caused by the abnormal user profile, it is further determined whether there are outliers in the measured electricity data corresponding to the segmented time series, and the time points in the electricity data that are inconsistent with the normal electricity usage behavior are obtained. Based on the detection results of the outliers detected in multiple segmented time series, it is determined whether the user to be evaluated has abnormal electricity usage behavior. Therefore, this method can detect abnormal electricity usage behavior more accurately.
[0071] like Figure 3 As shown, it is a flow chart of another abnormal power usage behavior detection method provided by an embodiment of the present invention; based on the above embodiment, this embodiment further illustrates and optimizes the technical solution. Specifically, in this embodiment, according to the detection results of outliers detected respectively from multiple segmented time series, the process of determining whether the user to be evaluated has abnormal power usage behavior includes:
[0072] According to the number of segmented time series with outliers in multiple segmented time series, the total number of abnormal time series is determined;
[0073] When the total number of abnormal time series is greater than the preset number threshold, it is determined that the user to be evaluated has abnormal electricity consumption behavior;
[0074] Otherwise, the power data of the user to be evaluated is determined to be occasional abnormality.
[0075] Specifically, in the present embodiment, after determining whether there are outliers in each segmented time series, the number of segmented time series with outliers in multiple segmented time series is counted to determine the total number of abnormal time series. In addition, a preset number threshold is set, that is, the limit value of the total number of abnormal time series. The total number of abnormal time series is compared with the preset number threshold. When the total number of abnormal time series is greater than the preset number threshold, it indicates that there are long-term abnormalities in the electricity data of the user to be evaluated, and therefore it is determined that the user to be evaluated has abnormal electricity usage behavior. If not, it indicates that the electricity data of the user to be evaluated is an occasional abnormality.
[0076] It should be noted that in actual operation, after determining that the user to be evaluated has abnormal electricity usage behavior, the abnormal electricity usage behavior can be further recorded; for example, the detection time of the abnormal electricity usage behavior can be recorded, and the abnormal segmented time series corresponding to the abnormal electricity usage behavior can be recorded, etc., so as to facilitate subsequent data tracing for the abnormal electricity usage behavior.
[0077] It can be seen that in this embodiment, by comparing the total number of abnormal time series with the preset number threshold, it is determined whether the user to be evaluated has abnormal electricity usage behavior, and the judgment process is accurate and convenient.
[0078] On the basis of the above embodiment, this embodiment further illustrates and optimizes the technical solution. Specifically, the process of obtaining the measured electric quantity data corresponding to the segmented time series from the electric quantity data and determining whether there are outliers in the measured electric quantity data includes:
[0079] Determine the segmented time series through the sliding time window, and obtain the to-be-measured electric quantity data corresponding to the segmented time series from the electric quantity data;
[0080] Calculate the norm of the measured power data corresponding to the segmented time series and the norm difference of the adjacent segmented time series;
[0081] Determine the corresponding statistical features according to the norm and the norm difference;
[0082] Determine a corresponding first eigenvector according to the statistical feature, and reconstruct the first eigenvector into a second eigenvector;
[0083] According to whether the reconstruction error between the first eigenvector and the second eigenvector is greater than a preset error threshold, it is determined whether there is an outlier in the electric quantity data to be measured in the corresponding segmented time series.
[0084] In this embodiment, the electric quantity data includes current data, phase angle data and electric energy data, that is, the electric quantity data is a multidimensional time series. Therefore, the outlier detection algorithm of the multidimensional time series is used to determine whether there are outliers in the electric quantity data to be measured in the segmented time series.
[0085] Specifically, first set the window size of the sliding time window, which is the time length of the segmented time series; determine the segmented time series through the sliding time window, and obtain the measured power data corresponding to the segmented time series from the power data. More specifically, the segmented time series corresponding to each sliding time window is T w ={S1, S2, ..., S i , …, S w}, where S i =(I i ,φ i , P i ) represents a set of measured power data S corresponding to time i i , I i represents the current data corresponding to time point i, φ i represents the phase data corresponding to time point i, P i Represents the electric energy data corresponding to time point i.
[0086] Then, the norm of the measured power data corresponding to the segmented time series and the norm difference of the adjacent segmented time series are calculated; more specifically, according to Calculate the norm of the measured power data in the segmented time series, where N t Represents the norm of the t-th (1≤t≤w) segmented time series; according to dN=N t+1 -N t Calculate the norm difference of adjacent segmented time series, where dN t (1≤t≤w) represents the Nth t+1 and N t The norm difference between two adjacent segmented time series.
[0087] The calculated norm and norm difference are used as the first-order feature G of the measured power data of the segmented time series, and the statistical features of the first-order feature G are extracted as the second-order features to obtain the feature matrix H; where the statistical features include mean, maximum, minimum, standard deviation, etc. The feature matrix H is concatenated row by row to obtain the first feature vector F, and the first feature vector F is reconstructed into the second feature vector through the autoencoder Then the first eigenvector F and the second eigenvector The reconstruction error is calculated; the reconstruction error is compared with a preset error threshold; if the calculated reconstruction error is greater than the preset error threshold, it indicates that there are outliers in the electric quantity data to be measured in the segmented time series; otherwise, it indicates that there are no outliers in the electric quantity data to be measured in the segmented time series.
[0088] It should be noted that the autoencoder is an unsupervised learning method suitable for identifying outliers. By comparing the deviation between the original input data and the reconstructed data, it can be determined whether there are outliers. The autoencoder can be specifically an LSTM (Long Short-Term Memory) autoencoder. LSTM is a special convolutional neural network. Its advantage is that it can solve the long-term dependency problem of ordinary RNN (Recurrent Neural Network) and is suitable for measuring time series curves. The implementation process of the LSTM autoencoder is divided into encoding and decoding. The encoding process includes converting the first eigenvector F into an intermediate vector of a fixed dimension, and the decoding process includes converting the intermediate vector obtained by encoding into a eigenvector, that is, obtaining the second eigenvector
[0089] It can be seen that this embodiment determines the statistical features in the segmented time series, determines the corresponding first eigenvector based on the statistical features, and reconstructs the first eigenvector into a second eigenvector; determines whether there are outliers in the measured electrical quantity data in the corresponding segmented time series based on whether the reconstruction error between the first eigenvector and the second eigenvector is greater than a preset error threshold; and determines whether there are outliers based on the reconstruction error, which can be more accurate.
[0090] On the basis of the above embodiment, this embodiment further illustrates and optimizes the technical solution. Specifically, after determining that the power data of the user to be evaluated is occasionally abnormal, the method further includes:
[0091] Perform data repair on the power data corresponding to the detected outliers.
[0092] Specifically, in this embodiment, when the power data of the user to be evaluated is determined to be an occasional abnormality, it means that the power data at the time point corresponding to the outlier in the power data is incorrect. Therefore, a more accurate power repair value is determined, and the determined power repair value is used to replace the power data corresponding to the outlier, thereby achieving data repair of the power data of the outlier.
[0093] As a preferred embodiment, the process of repairing the power data corresponding to the detected outliers includes:
[0094] Obtaining a preset number of adjacent electric quantity data adjacent to the outlier;
[0095] An average value of a preset number of adjacent electric quantity data is determined, and the average value is used to perform data repair on the electric quantity data of the outliers.
[0096] It should be noted that the present embodiment uses the sampling moving average method for data repair. The moving average method is a method of predicting the power data of the outlier using a set of power data closest to the outlier, that is, the average value of the adjacent power data. Specifically, the adjacent power data refers to the power data at the time point close to the outlier in the time series, which can be a preset number of adjacent power data before the outlier or a preset number of adjacent power data after the outlier, or a portion of the data before and after the outlier, with the total amount of data being a preset number; after obtaining the preset number of adjacent power data adjacent to the outlier, the average value of the preset number of adjacent power data obtained is calculated, and the average value is used as the power repair value, and the average value is used to repair the power data of the outlier.
[0097] In a specific implementation, the power data is repaired using a moving average method, and the power repair value is calculated using the following calculation formula:
[0098]
[0099] Among them, E r is the power repair value, E d is the power data at the time point corresponding to the outlier, that is, the actual power data corresponding to the predicted outlier; N is the number of moving periods; E d-1 is the electricity data at a time point before the outlier point; E d-2 is the electricity data at two time points before the outlier point; E d-N is the electricity data of the N time points before the outlier; assuming that N=7 is set, that is, the historical data of the past 7 days is used as the adjacent electricity data, and the electricity data of the time point corresponding to the outlier is repaired with the average value of the adjacent electricity data of these 7 days.
[0100] It should also be noted that, in actual operation, after the power data of the outlier point is repaired, a repair mark may be further added to the outlier point to mark that the power data at the time point is obtained through data repair.
[0101] It can be seen that this embodiment uses the average value of the adjacent power data adjacent to the outlier to repair the power data of the outlier, which can relatively ensure the accuracy of the power repair value.
[0102] Based on the above embodiment, this embodiment further illustrates and optimizes the technical solution. Specifically, the process of determining the power consumption curve to be evaluated according to the electric energy data, and correcting the user profile of the user to be evaluated when the similarity between the power consumption curve to be evaluated and the industry standard curve is lower than the preset similarity threshold, includes:
[0103] Determine the power consumption curve to be evaluated based on the power data;
[0104] When the similarity between the power consumption curve to be evaluated and the industry standard curve is lower than the preset similarity threshold, the user name in the user profile of the user to be evaluated is segmented, and the target word vector is obtained according to the segmentation result;
[0105] Determine the target industry classification corresponding to the target word vector according to the similarity between the target word vector and each preset word vector and the correspondence between each preset word vector and the preset industry classification;
[0106] If the industry classification in the user profile is inconsistent with the target industry classification, the user profile will be modified according to the target industry classification.
[0107] The industries to be classified are pre-sorted to obtain the corresponding industry library; the industry library includes preset word vectors and preset industry classifications, and the corresponding relationship between the preset word vectors and the preset industry classifications is set, so the corresponding industry classification can be determined according to a certain word vector. In actual operation, the industry classification code corresponding to each industry classification can be further set, that is, the corresponding relationship between the word vector, industry classification and industry classification code is set.
[0108] In this embodiment, after determining the electricity consumption curve to be evaluated based on the electric energy data and calculating the similarity between the electricity consumption curve to be evaluated and the industry standard curve, when the similarity is lower than the preset similarity threshold, the user name is first segmented and the industry name is extracted through automatic inspection. The automatic inspection includes the steps of segmentation, filtering, word vector generation and similarity matching.
[0109] More specifically, Jieba word segmentation can be used to segment the user names in the user files of the users to be evaluated. For example, the word segmentation of "China Telecom Co., Ltd. Cloud Computing Guizhou Branch" can be obtained as "China / Telecom / Shares / Limited / Company / Cloud Computing / Guizhou / Branch"; then the word segmentation results are filtered to remove the preset regions, "shares", "limited" and other word segmentation results that are not related to the industry. The word segmentation result obtained after filtering is "Telecom / Cloud Computing"; word vectors are generated for the word segmentation results obtained after filtering, and word2vec is used to convert the word segmentation results into the corresponding target word vectors, and the words in the word segmentation results are converted into target word vectors. The word vector is converted into a corresponding mathematical vector; after the corresponding target word vector is obtained according to the word segmentation result, the similarity between the target word vector and each preset word vector is calculated, the preset word vector with the highest similarity to the target word vector is determined, and the preset industry classification corresponding to the preset word vector is determined, and the preset industry classification is determined as the target industry classification, that is, the target industry classification corresponding to the target word vector is obtained; then the target industry classification is compared with the industry classification in the user file, if the two are consistent, it means that the industry classification in the user file is correct; otherwise, it means that the industry classification in the user file is incorrect, so the target industry classification is used to modify the industry classification in the user file.
[0110] More specifically, when calculating the similarity between the target word vector and each preset word vector, the text similarity between the two can be calculated by calculating the cosine distance, Euclidean distance, Jaccard distance or edit distance between the two. Assuming that the target word vector is L1 and the preset word vector is L2, the cosine distance between the two is d = (L1·L2) / (|L1|*|L2|). The smaller the cosine distance, the higher the similarity between the two, and the more similar the two vectors are. In this way, the word segmentation result "telecommunication / cloud computing" of the target word vector can be matched to the industry classification of "information transmission, software and information technology services".
[0111] In addition, in order to further improve the accuracy of modifying the user profile, before modifying the user profile, it can be further manually verified. After the manual verification is correct, the industry classification in the user profile can be modified using the target industry classification. After modifying the user profile, it is necessary to re-determine the corresponding industry standard curve based on the industry classification in the user profile, and then recalculate the similarity between the power consumption curve to be evaluated and the industry standard curve based on the re-determined industry standard curve.
[0112] It should also be noted that if the similarity between the target word vector and each preset word vector is lower than the minimum similarity value, the target industry classification corresponding to the target word vector cannot be determined. Therefore, it is also possible to manually check whether the user profile is abnormal.
[0113] It can be seen that correcting the user profile according to the method of this embodiment can not only reduce the workload of manual operations, but also achieve accurate and efficient repair.
[0114] Based on the above embodiment, this embodiment further illustrates and optimizes the technical solution. Specifically, the method further includes:
[0115] Visualize the repaired power data and / or the corrected user profile.
[0116] Specifically, visualization refers to using computer graphics and image processing technology to convert data into graphics or images and display them on the screen; in this embodiment, after the power data is repaired, the repaired power data is visualized, and / or after the user file is corrected, the user file is visualized.
[0117] More specifically, in actual operation, Tableau can be used to create a visual worksheet to achieve data visualization. This embodiment does not limit the specific visualization method. In a specific implementation, power data is collected, including current data, phase data, and electric energy data. After data repair is performed on the power data, data curves corresponding to each type of data are determined respectively, and each data curve is visualized to more intuitively display the power data.
[0118] In addition, the power data can be filtered through the time filter to filter out the power data of the target time period, and a data curve of the power data corresponding to the target time period can be generated to visualize the power data of the target time period.
[0119] In addition, if it is determined that the similarity between the power consumption curve to be evaluated and the industry standard power consumption curve is not equal to a preset similarity threshold, the power consumption curve to be evaluated and the industry standard power consumption curve may be directly visualized.
[0120] In addition, the power data before repair and the power data after repair can be compared and displayed, the user profile before correction and the user profile after correction can be compared and displayed, and the repaired power data and / or the corrected user profile can be marked to more intuitively display the repair status of the power data and / or the correction status of the user profile.
[0121] It should be understood that, although the steps in each flow chart involved in the above-described embodiment are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a portion of the steps in each flow chart involved in the above-described embodiment may include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily carried out in sequence, but can be executed in turn or alternately with other steps or at least a portion of the steps or stages in other steps.
[0122] In one embodiment, Figure 4 As shown, a device for detecting abnormal power consumption behavior is provided, comprising:
[0123] The acquisition module 402 is used to acquire the power data of the user to be evaluated; wherein the power data includes current data, phase angle data and electric energy data;
[0124] The correction module 404 is used to determine the power consumption curve to be evaluated according to the power data, and to correct the user profile of the user to be evaluated when the similarity between the power consumption curve to be evaluated and the industry standard curve is lower than a preset similarity threshold;
[0125] The determination module 406 is used to obtain the to-be-measured electric quantity data corresponding to the segmented time series from the electric quantity data, and determine whether there are outliers in the to-be-measured electric quantity data;
[0126] The judgment module 408 is used to determine whether the user to be evaluated has abnormal electricity usage behavior based on the detection results of outliers detected respectively in the multiple segmented time series.
[0127] An abnormal power usage behavior detection device provided in an embodiment of the present invention has the same beneficial effects as the above-mentioned abnormal power usage behavior detection method.
[0128] In one embodiment, the determination module includes:
[0129] A first determination submodule is used to determine the total number of abnormal time series according to the number of segmented time series with outliers in the plurality of segmented time series;
[0130] The first determination submodule is used to determine that the user to be evaluated has abnormal electricity usage behavior when the total number of abnormal time series is greater than a preset number threshold;
[0131] The second determination submodule is used to determine that the power data of the user to be evaluated is an occasional abnormality when the total number of abnormal time series is less than or equal to a preset number threshold.
[0132] In one embodiment, the determining module includes:
[0133] The first acquisition submodule is used to determine the segmented time series through the sliding time window, and obtain the to-be-measured electric quantity data corresponding to the segmented time series from the electric quantity data;
[0134] The calculation submodule is used to calculate the norm of the electric quantity data to be measured corresponding to the segmented time series and the norm difference of the adjacent segmented time series;
[0135] A second determination submodule is used to determine corresponding statistical features according to the norm and the norm difference;
[0136] A reconstruction submodule, used to determine a corresponding first eigenvector according to the statistical features, and reconstruct the first eigenvector into a second eigenvector;
[0137] The third determination submodule is used to determine whether there are outliers in the measured electrical quantity data in the corresponding segmented time series according to whether the reconstruction error between the first eigenvector and the second eigenvector is greater than a preset error threshold.
[0138] In one embodiment, the apparatus further comprises:
[0139] The repair module is used to repair the power data corresponding to the detected outliers.
[0140] In one embodiment, the repair module includes:
[0141] The second acquisition submodule is used to acquire a preset number of adjacent electric quantity data adjacent to the outlier;
[0142] The fourth determination submodule is used to determine an average value of a preset number of adjacent electric quantity data, and use the average value to perform data repair on the electric quantity data of the outlier.
[0143] In one embodiment, the correction module includes:
[0144] A fifth determination submodule, used to determine the power consumption curve to be evaluated according to the power data;
[0145] The word segmentation submodule is used to segment the user name in the user profile of the user to be evaluated when the similarity between the power consumption curve to be evaluated and the industry standard curve is lower than the preset similarity threshold, and convert the target word vector according to the word segmentation result;
[0146] A sixth determination submodule, configured to determine a target industry classification corresponding to the target word vector according to the similarity between the target word vector and each preset word vector and the correspondence between each preset word vector and the preset industry classification;
[0147] The correction submodule is used to modify the user profile according to the target industry classification if the industry classification in the user profile is inconsistent with the target industry classification.
[0148] In one embodiment, the apparatus further comprises:
[0149] The visualization module is used to visualize the repaired power data and / or the corrected user profile.
[0150] For the specific definition of the abnormal power usage behavior detection device, please refer to the definition of the abnormal power usage behavior detection method above, which will not be repeated here. Each module in the above-mentioned abnormal power usage behavior detection device can be implemented in whole or in part by software, hardware and a combination thereof. The above-mentioned modules can be embedded in or independent of the processor in the computer device in the form of hardware, or can be stored in the memory of the computer device in the form of software, so that the processor can call and execute the operations corresponding to the above modules.
[0151] In one embodiment, a computer device is provided. The computer device may be a server, and its internal structure diagram may be as follows: Figure 5As shown. The computer device includes a processor, a memory and a network interface connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The database of the computer device is used to store power data. The network interface of the computer device is used to communicate with an external terminal through a network connection. When the computer program is executed by the processor, a method for detecting abnormal power consumption behavior is implemented.
[0152] Those skilled in the art will understand that Figure 5 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0153] In one embodiment, a computer device is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:
[0154] Obtaining the power data of the user to be evaluated; wherein the power data includes current data, phase angle data and electric energy data;
[0155] Determine the power consumption curve to be evaluated based on the power data, and modify the user profile of the user to be evaluated when the similarity between the power consumption curve to be evaluated and the industry standard curve is lower than a preset similarity threshold;
[0156] Obtaining the to-be-measured electric quantity data corresponding to the segmented time series from the electric quantity data, and determining whether there are outliers in the to-be-measured electric quantity data;
[0157] According to the detection results of outliers detected respectively from multiple segmented time series, it is determined whether the user to be evaluated has abnormal electricity consumption behavior.
[0158] A computer device provided by an embodiment of the present invention has the same beneficial effects as the above-mentioned abnormal power consumption behavior detection method.
[0159] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
[0160] Obtaining the power data of the user to be evaluated; wherein the power data includes current data, phase angle data and electric energy data;
[0161] Determine the power consumption curve to be evaluated based on the power data, and modify the user profile of the user to be evaluated when the similarity between the power consumption curve to be evaluated and the industry standard curve is lower than a preset similarity threshold;
[0162] Obtaining the to-be-measured electric quantity data corresponding to the segmented time series from the electric quantity data, and determining whether there are outliers in the to-be-measured electric quantity data;
[0163] According to the detection results of outliers detected respectively from multiple segmented time series, it is determined whether the user to be evaluated has abnormal electricity consumption behavior.
[0164] A computer-readable storage medium provided in an embodiment of the present invention has the same beneficial effects as the above-mentioned abnormal power consumption behavior detection method.
[0165] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory or optical memory, etc. Volatile memory can include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).
[0166] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0167] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.
Claims
1. A method for detecting abnormal electricity consumption behavior, characterized in that: The method comprises: Acquire the power data of the user to be evaluated; wherein the power data includes current data, phase angle data and electric energy data; Determine a power consumption curve to be evaluated according to the electric energy data, and modify the user profile of the user to be evaluated when the similarity between the power consumption curve to be evaluated and the industry standard curve is lower than a preset similarity threshold, wherein the industry standard curve is obtained by clustering power consumption curves of different industries; Acquire the to-be-measured electric quantity data corresponding to the segmented time series from the electric quantity data, and determine whether there are outliers in the to-be-measured electric quantity data; According to the number of segmented time series with outliers in the multiple segmented time series, the total number of abnormal time series is determined. When the total number of abnormal time series is greater than a preset number threshold, it is determined that the user to be evaluated has abnormal electricity usage behavior; otherwise, the electricity data of the user to be evaluated is determined to be an occasional abnormality.
2. The method according to claim 1, characterized in that The process of acquiring the to-be-measured electric quantity data corresponding to the segmented time series from the electric quantity data and determining whether there are outliers in the to-be-measured electric quantity data includes: Determine a segmented time series through a sliding time window, and obtain the to-be-measured electric quantity data corresponding to the segmented time series from the electric quantity data; Calculating the norm of the measured electrical quantity data corresponding to the segmented time series and the norm difference of adjacent segmented time series; Determining a corresponding statistical feature according to the norm and the norm difference; Determine a corresponding first feature vector according to the statistical feature, and reconstruct the first feature vector into a second feature vector; According to whether the reconstruction error of the first eigenvector and the second eigenvector is greater than a preset error threshold, it is determined whether there is an outlier in the electric quantity data to be measured in the corresponding segmented time series.
3. The method according to claim 1, characterized in that After determining that the power data of the user to be evaluated is occasionally abnormal, the method further includes: Data repair is performed on the electric quantity data corresponding to the detected outliers.
4. The method according to claim 3, characterized in that The process of repairing the power data corresponding to the detected outliers includes: Acquire a preset number of adjacent electric quantity data adjacent to the outlier; An average value of the preset number of adjacent electric quantity data is determined, and the electric quantity data of the outlier is repaired by using the average value.
5. The method according to any one of claims 1 to 4, characterized in that: The process of determining the power consumption curve to be evaluated according to the electric energy data, and correcting the user profile of the user to be evaluated when the similarity between the power consumption curve to be evaluated and the industry standard curve is lower than a preset similarity threshold, includes: Determining the power consumption curve to be evaluated according to the power data; When the similarity between the electricity consumption curve to be evaluated and the industry standard curve is lower than the preset similarity threshold, segmenting the user name in the user profile of the user to be evaluated, and converting the target word vector according to the segmentation result; Determine the target industry classification corresponding to the target word vector according to the similarity between the target word vector and each preset word vector and the correspondence between each preset word vector and the preset industry classification; If the industry classification in the user profile is inconsistent with the target industry classification, the user profile is modified according to the target industry classification.
6. The method according to claim 5, characterized in that The method further comprises: The repaired power data and / or the corrected user profile are visually displayed.
7. A device for detecting abnormal electricity usage behavior, characterized in that: The device comprises: An acquisition module is used to acquire the power data of the user to be evaluated; wherein the power data includes current data, phase angle data and electric energy data; a correction module, configured to determine a power consumption curve to be evaluated according to the electric energy data, and to correct the user profile of the user to be evaluated when the similarity between the power consumption curve to be evaluated and the industry standard curve is lower than a preset similarity threshold, wherein the industry standard curve is obtained by clustering power consumption curves of different industries; A determination module, used to obtain the to-be-measured electric quantity data corresponding to the segmented time series from the electric quantity data, and determine whether there are outliers in the to-be-measured electric quantity data; The judgment module is used to determine the total number of abnormal time series according to the number of segmented time series with outliers in the multiple segmented time series. When the total number of abnormal time series is greater than a preset number threshold, it is determined that the user to be evaluated has abnormal electricity usage behavior; otherwise, it is determined that the electricity data of the user to be evaluated is an occasional abnormality.
8. The device according to claim 7, characterized in that The device also includes a repair module, which is used to perform data repair on the power data corresponding to the detected outliers.
9. A computer device comprising a memory and a processor, wherein the memory stores a computer program, wherein: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 6 are implemented.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 6 are implemented.
Citation Information
Patent Citations
Abnormal electricity consumption client detection method based on PSO algorithm
CN103678766A
User power consumption data anomaly detection method and device and computer equipment
CN113284000A