CN110209260B - Power consumption abnormality detection method, device, equipment and computer readable storage medium - Google Patents

Power consumption abnormality detection method, device, equipment and computer readable storage medium Download PDF

Info

Publication number
CN110209260B
CN110209260B CN201910342461.XA CN201910342461A CN110209260B CN 110209260 B CN110209260 B CN 110209260B CN 201910342461 A CN201910342461 A CN 201910342461A CN 110209260 B CN110209260 B CN 110209260B
Authority
CN
China
Prior art keywords
power consumption
class
subclasses
abnormality detection
abnormal
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910342461.XA
Other languages
Chinese (zh)
Other versions
CN110209260A (en
Inventor
邓悦
金戈
徐亮
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ping An Technology Shenzhen Co Ltd
Original Assignee
Ping An Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ping An Technology Shenzhen Co Ltd filed Critical Ping An Technology Shenzhen Co Ltd
Priority to CN201910342461.XA priority Critical patent/CN110209260B/en
Publication of CN110209260A publication Critical patent/CN110209260A/en
Application granted granted Critical
Publication of CN110209260B publication Critical patent/CN110209260B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F1/00Details not covered by groups G06F3/00 - G06F13/00 and G06F21/00
    • G06F1/26Power supply means, e.g. regulation thereof
    • G06F1/32Means for saving power
    • G06F1/3203Power management, i.e. event-based initiation of a power-saving mode
    • G06F1/3206Monitoring of events, devices or parameters that trigger a change in power modality

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)
  • Supply And Distribution Of Alternating Current (AREA)

Abstract

The invention relates to the technical field of artificial intelligence. A power consumption abnormality detection method, apparatus, device, and computer-readable storage medium are disclosed. The power consumption abnormality detection method includes: the power consumption corresponding to each power consumption period of the object to be detected is obtained, and N power consumption is obtained; clustering N power consumption by a K-means algorithm to obtain K classes; obtaining a characteristic vector of each power consumption in each class; based on the feature vector, clustering the power consumption in each class into M subclasses through a K-means algorithm to obtain K.M subclasses; and marking subclasses with data volume smaller than X in the K.times.M subclasses as power consumption abnormal subclasses. According to the invention, on one hand, the efficiency of detecting the abnormality of the power consumption is improved, and on the other hand, the accuracy of detecting the abnormality of the power consumption is improved.

Description

Power consumption abnormality detection method, device, equipment and computer readable storage medium
Technical Field
The present invention relates to the field of artificial intelligence technologies, and in particular, to a method, an apparatus, a device, and a computer readable storage medium for detecting power consumption anomalies.
Background
At present, abnormality detection of the power consumption is generally performed by an abnormality detection method based on a distribution assumption. That is, it is assumed that the power consumption belongs to a certain type of distribution (e.g., normal distribution), and then data far from the assumed distribution among the power consumption data is defined as an outlier. However, since the distribution of the electricity consumption is not the existing common distribution, the accuracy of abnormality detection of the electricity consumption using an abnormality detection method based on a distribution assumption is not high.
Disclosure of Invention
The invention mainly aims to provide a power consumption abnormality detection method, a device, equipment and a computer readable storage medium, aiming at solving the technical problem that the accuracy of abnormality detection on power consumption is not high by using an abnormality detection mode based on distribution assumption.
In order to achieve the above object, the present invention provides a power consumption abnormality detection method, comprising the steps of:
dividing a preset duration into N power consumption periods, and obtaining power consumption corresponding to each power consumption period of an object to be detected to obtain N power consumption;
clustering the N power consumption by a K-means algorithm to obtain K classes;
the method comprises the steps of obtaining characteristic information of each power consumption in each class, and obtaining a characteristic vector of each power consumption in each class according to the characteristic information;
based on the characteristic vector of each power consumption in each class, clustering the power consumption in each class into M subclasses through a K-means algorithm to obtain K.M subclasses;
and marking the subclasses with the data quantity smaller than X in the K.times.M subclasses as abnormal power consumption subclasses.
Optionally, the step of obtaining the feature information of each power consumption in each class and obtaining the feature vector of each power consumption in each class according to the feature information includes:
the method comprises the steps of obtaining date information, weather information and season information of each power consumption in each class, and obtaining a first characteristic vector corresponding to the date information, a second characteristic vector corresponding to the weather information and a third characteristic vector corresponding to the season information of each power consumption in each class based on a preset characteristic information-characteristic vector conversion rule.
Optionally, the step of clustering the power consumption in each class into M subclasses by using a K-means algorithm based on the feature vector of each power consumption in each class, and obtaining k×m subclasses includes:
according to the feature vector of each power consumption in each class and the similarity measurement method, calculating and obtaining the similarity between every two power consumption in each class;
and clustering the power consumption in each class into M subclasses through a K-means algorithm according to the similarity between every two power consumption in each class, so as to obtain K.times.M subclasses.
Optionally, the step of calculating the similarity between every two power consumption in each class according to the feature vector of each power consumption in each class and the similarity measurement method includes:
and according to the characteristic vector of each power consumption in each class and the Euclidean distance calculating method, calculating the Euclidean distance between every two power consumption in each class, and taking the Euclidean distance between every two power consumption in each class as the similarity between every two power consumption in each class.
Optionally, the step of marking a subclass with a data size smaller than X of the k×m subclasses as a power consumption anomaly subclass includes:
by the formulaAnd calculating to obtain X, and marking the subclass with the data volume smaller than X in the K.times.M subclasses as an abnormal power consumption subclass.
Optionally, after the step of marking the subclass with the data size smaller than X of the k×m subclasses as an abnormal power consumption subclass, the method further includes:
detecting whether an abnormal event exists according to the power consumption in the power consumption abnormal subclass;
and if the abnormal event exists, outputting an alarm prompt of the abnormal event.
Optionally, the step of detecting whether an abnormal event exists according to the power consumption in the power consumption abnormal subclass includes:
determining that the power consumption abnormal subclass is larger than a preset threshold value, and the power consumption period exceeds the target power consumption of the preset period;
detecting whether a power consumption period with target power consumption exceeding a preset number is within an event occurrence period;
and if the electricity consumption time period with the target electricity consumption exceeding the preset number is in the event occurrence time period, determining that an abnormal event exists in the event occurrence time period.
In addition, in order to achieve the above object, the present invention also provides a power consumption abnormality detection apparatus including:
the acquisition module is used for dividing the preset duration into N power consumption periods, and acquiring power consumption corresponding to each power consumption period of the object to be detected to obtain N power consumption;
the first clustering module is used for clustering the N power consumption through a K-means algorithm to obtain K classes;
the feature calculation module is used for acquiring the feature information of each power consumption in each class and obtaining the feature vector of each power consumption in each class according to the feature information;
the second clustering module is used for clustering the power consumption in each class into M subclasses through a K-means algorithm based on the characteristic vector of each power consumption in each class to obtain K.M subclasses;
and the marking module is used for marking the subclass with the data volume smaller than X in the K.times.M subclasses as the abnormal power consumption subclass.
Optionally, the feature calculation module includes:
the characteristic information acquisition unit is used for acquiring date information, weather information and season information of each power consumption in each class;
the conversion unit is used for obtaining a first characteristic vector corresponding to the date information, a second characteristic vector corresponding to the weather information and a third characteristic vector corresponding to the season information of each power consumption in each class based on a preset characteristic information-characteristic vector conversion rule.
Optionally, the second aggregation module includes:
the similarity calculation unit is used for calculating the similarity between every two power consumption in each class according to the feature vector of each power consumption in each class and the similarity measurement method;
and the clustering unit is used for clustering the power consumption in each class into M subclasses through a K-means algorithm according to the similarity between every two power consumption in each class, so as to obtain K.times.M subclasses.
Optionally, the similarity calculation unit includes:
and the similarity calculation subunit is used for calculating the Euclidean distance between every two power consumption in each class according to the characteristic vector of each power consumption in each class and the Euclidean distance calculation method, and taking the Euclidean distance between every two power consumption in each class as the similarity between every two power consumption in each class.
Optionally, the marking module includes:
a threshold calculating unit for passing through the formulaCalculating to obtain X;
and the marking unit is used for marking the subclass with the data volume smaller than X in the K.times.M subclasses as the abnormal power consumption subclass.
Optionally, the power consumption abnormality detection device further includes:
the abnormal event detection module is used for detecting whether an abnormal event exists according to the power consumption in the power consumption abnormal subclass;
and the alarm module is used for outputting an alarm prompt of the abnormal event if the abnormal event exists.
Optionally, the abnormal event detection module includes:
the searching unit is used for determining the target power consumption of which the power consumption period exceeds the preset period and is larger than the preset threshold in the power consumption abnormal subclass;
the detection unit is used for detecting whether the electricity consumption time period with the target electricity consumption exceeding the preset number is in the event occurrence time period;
and the judging unit is used for judging that an abnormal event exists in the event occurrence period if the electricity utilization period with the target electricity consumption exceeding the preset number is in the event occurrence period.
In addition, in order to achieve the above object, the present invention also provides a power consumption abnormality detection apparatus including: the power consumption abnormality detection method comprises the steps of a memory, a processor and a power consumption abnormality detection program stored in the memory and capable of running on the processor, wherein the power consumption abnormality detection program is executed by the processor to realize the power consumption abnormality detection method.
In addition, in order to achieve the above object, the present invention also provides a computer-readable storage medium having stored thereon a power consumption abnormality detection program that, when executed by a processor, implements the steps of the power consumption abnormality detection method described above.
Based on the power consumption and the characteristic information of the power consumption, the power consumption corresponding to each power consumption period of the object to be detected in the preset time length is clustered twice to obtain K.times.M subclasses, and the subclasses with the data quantity smaller than X in the K.times.M subclasses are marked as power consumption abnormal subclasses, so that the power consumption in the power consumption abnormal subclasses is rapidly determined to be abnormal data. On one hand, the efficiency of carrying out anomaly detection on the power consumption is improved, and on the other hand, the accuracy of carrying out anomaly detection on the power consumption is improved.
Drawings
FIG. 1 is a schematic diagram of a power consumption abnormality detection device in a hardware operating environment according to an embodiment of the present invention;
FIG. 2 is a flowchart illustrating an embodiment of a power consumption anomaly detection method according to the present invention;
fig. 3 is a schematic functional block diagram of an embodiment of the power consumption abnormality detection apparatus according to the present invention.
The achievement of the objects, functional features and advantages of the present invention will be further described with reference to the accompanying drawings, in conjunction with the embodiments.
Detailed Description
It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
Referring to fig. 1, fig. 1 is a schematic diagram of a power consumption abnormality detection device in a hardware running environment according to an embodiment of the present invention.
The power consumption abnormality detection device in the embodiment of the invention can be a PC, or can be terminal equipment with data processing capability such as a portable computer, a server and the like.
As shown in fig. 1, the power consumption abnormality detection apparatus may include: a processor 1001, such as a CPU, a network interface 1004, a user interface 1003, a memory 1005, a communication bus 1002. Wherein the communication bus 1002 is used to enable connected communication between these components. The user interface 1003 may include a Display, an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may further include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface). The memory 1005 may be a high-speed RAM memory or a stable memory (non-volatile memory), such as a disk memory. The memory 1005 may also optionally be a storage device separate from the aforementioned processor 1001.
It will be appreciated by those skilled in the art that the power consumption abnormality detection apparatus structure shown in fig. 1 does not constitute a limitation of the power consumption abnormality detection apparatus, and may include more or less components than those illustrated, or may combine some components, or may be arranged in different components.
As shown in fig. 1, an operating system, a network communication module, a user interface module, and a power consumption abnormality detection program may be included in a memory 1005 as one type of computer storage medium.
In the power consumption abnormality detection apparatus shown in fig. 1, the network interface 1004 is mainly used for connecting to a background server, and performing data communication with the background server; the user interface 1003 is mainly used for connecting a client (user side) and performing data communication with the client; and the processor 1001 may be used to call the power consumption abnormality detection program stored in the memory 1005 and perform the operations of the embodiments of the following power consumption abnormality detection method.
Referring to fig. 2, fig. 2 is a flowchart illustrating an embodiment of a power consumption abnormality detection method according to the present invention.
The power consumption abnormality detection method includes:
step S10, dividing a preset duration into N power consumption periods, and obtaining power consumption corresponding to each power consumption period of an object to be detected to obtain N power consumption;
in this embodiment, if abnormality detection is required for the electricity consumption of the object to be detected in the period of 2018, the prediction duration is from 1 month 1 day 00:00 in 2018 to 31 days 24:00 in 2018; if abnormality detection is required for the electricity consumption of the object to be detected in the period from 1 month in 2018 to 6 months in 2018, the predicted time period is 24:00 from 1 month in 2018 to 30 months in 2018.
In this embodiment, 15 minutes, 30 minutes or 60 minutes may be taken as a power consumption period, which is specifically selected according to actual needs.
In this embodiment, the object to be detected may be a building, a room, or one or more devices.
In a specific embodiment, the preset time period is 2018, 1, 00, 31, 24, 00, 60 minutes is taken as a power consumption period, and the object to be detected is a building A. I.e., n=365×24=8760, the corresponding power consumption amount 1 of the building a power consumption period 1 (2018, 1 month, 1 day, 00:00 to 2018, 1 month, 1 day, 01:00) is acquired, the corresponding power consumption amount 2 … … of the power consumption period 2 (2018, 1, 02, 00) is used electric period 8760 (2018 12, 31, 23:00 to 2018 12, 31, 24:00) corresponds to electric power consumption 8760.
Step S20, clustering the N power consumption by a K-means algorithm to obtain K classes;
in this embodiment, the clustering algorithm employs a K-means algorithm. The K-means algorithm is a hard clustering algorithm, is representative of a typical prototype-based objective function clustering method, is an adjustment rule of iterative operation by taking a certain distance from a data point to a prototype as an optimized objective function and utilizing a function extremum solving method. The working procedure for the k-means algorithm is described as follows: firstly, arbitrarily selecting k objects from n data objects as initial clustering centers; for the remaining other objects, they are respectively assigned to clusters (represented by the cluster centers) most similar to the other objects according to their similarity (distance) to the cluster centers; then calculating the cluster center (the average value of all objects in the cluster) of each obtained new cluster; this process is repeated until the standard measure function begins to converge. The mean square error is generally used as a standard measure function. The k clusters have the following characteristics: the clusters themselves are as compact as possible, while the clusters are as separated as possible.
In this embodiment, the value of K is first set, where K may be an integer between 20 and 30, and in one embodiment, k=20. Clustering the N power consumption by a K-means algorithm, wherein the specific steps for obtaining K classes are as follows:
a. randomly selecting 20 power consumption from N (8760 power consumption here) as an initial clustering center;
b. calculating the difference value between the residual 8740 power consumption and each initial clustering center, and dividing each power consumption in the 8740 power consumption into a class corresponding to the initial clustering center with the smallest difference value according to the calculation result to obtain 20 classes (class 1-class 20);
c. calculating the average value of each class (taking class 1 as an example, calculating the average value of all power consumption contained in class 1) to obtain 20 average values;
d. calculating the difference value between 8760 power consumption and each average value, and dividing each power consumption in the 8760 power consumption into a class corresponding to the average value with the smallest difference value according to the calculation result to obtain 20 new classes;
e. repeating the steps c to d until the data in each class is not changed any more, and obtaining K classes at this time, namely K classes in the step S20.
Step S30, obtaining the characteristic information of each power consumption in each class, and obtaining the characteristic vector of each power consumption in each class according to the characteristic information;
in this embodiment, the characteristic information is some information that may affect the power consumption, such as date information (holiday or workday), season information, weather information. Of course, the feature information may be expanded according to actual needs, and the type of information contained in the feature information is not limited herein.
In one embodiment, the characteristic information includes date information (holiday or workday), season information, weather information. And preset the feature information-feature vector conversion rule. The preset feature information-feature vector conversion rule is shown in table 1:
TABLE 1
The date information, season information, weather information of each power consumption in each class are acquired. And obtaining the characteristic vector of each power consumption in each class according to the preset characteristic information-characteristic vector conversion rule. For example, the characteristic information of a certain power consumption is: holidays, sunny days and summer, the characteristic vector of the power consumption is (1, 1), and the characteristic information of a certain power consumption is: the characteristic vector of the power consumption is 0,0.75,0.5 when the user is working, cloudy and autumn.
Step S40, based on the characteristic vector of each power consumption in each class, clustering the power consumption in each class into M subclasses through a K-means algorithm to obtain K.times.M subclasses;
in this embodiment, taking class a of the K classes as an example, assuming that class a includes 1000 power consumption, according to the above step S30, a feature vector of each power consumption in class a is obtained, and thus 1000 feature vectors are obtained.
In this embodiment, the value of M is first set, where M may be an integer between 10 and 15, and in one embodiment, m=10.
f, randomly selecting 10 feature vectors from 1000 feature vectors to serve as initial clustering centers;
g, calculating the similarity between the rest 990 eigenvectors and each initial clustering center, and dividing the power consumption corresponding to each eigenvector in the 990 eigenvectors into the class corresponding to the initial clustering center most similar to the power consumption according to the calculation result to obtain 10 classes (class 1-class 10);
h, calculating the average value of each class (taking class 1 as an example, assuming that class 1 contains 200 corresponding power consumption, the eigenvectors are (X1, Y1, Z1), (X2, Y2, Z2) … … (X200, Y200, Z200), and the average value of class 1 is (X) Flat plate ,Y Flat plate ,Z Flat plate ) Wherein X is Flat plate Is the average value of X1 to X200, Y Flat plate Is the average value of Y1 to Y200, Z Flat plate Average value of Z1 to Z200), 10 average values are obtained;
i, calculating the similarity between 1000 feature vectors and each mean value, and dividing the power consumption corresponding to each feature vector in the 1000 feature vectors into classes corresponding to the most similar mean value according to the calculation result to obtain 20 new classes;
j, repeating the steps h to i until the data in each class is not changed any more, and obtaining M subclasses.
Similarly, for other classes in the K classes, k×m subclasses can be obtained according to the above manner from step f to step j.
Wherein, euclidean distance, manhattan distance, normalized Euclidean distance, etc. between two data can be calculated as the similarity of the two data.
And S50, marking the subclass with the data volume smaller than X in the K.times.M subclasses as an abnormal power consumption subclass.
In real life, since the abnormal situation is always rare, if the amount of data contained in a certain subclass is small, the subclass is an abnormal power consumption subclass. In this embodiment, the value of X may be preset according to the actual situation, for example, x=100, i.e. the subclass with the data amount (i.e. the number of power consumption contained) smaller than 100 in the k×m subclasses is marked as the abnormal power consumption subclass.
In this embodiment, the preset duration is divided into N power consumption periods, and power consumption corresponding to each power consumption period of the object to be detected is obtained, so as to obtain N power consumption; clustering the N power consumption by a K-means algorithm to obtain K classes; the method comprises the steps of obtaining characteristic information of each power consumption in each class, and obtaining a characteristic vector of each power consumption in each class according to the characteristic information; based on the characteristic vector of each power consumption in each class, clustering the power consumption in each class into M subclasses through a K-means algorithm to obtain K.M subclasses; and marking the subclasses with the data quantity smaller than X in the K.times.M subclasses as abnormal power consumption subclasses. According to the embodiment, based on the power consumption and the characteristic information of the power consumption, the power consumption corresponding to each power consumption period of the object to be detected in the preset time length is clustered twice to obtain K.times.M subclasses, and the subclasses with the data quantity smaller than X in the K.times.M subclasses are marked as power consumption abnormal subclasses, so that the power consumption in the power consumption abnormal subclasses is rapidly determined to be abnormal data. On one hand, the efficiency of carrying out anomaly detection on the power consumption is improved, and on the other hand, the accuracy of carrying out anomaly detection on the power consumption is improved.
Further, step S30 includes:
in this embodiment, the characteristic information is some information that may affect the power consumption, such as date information (holiday or workday), season information, weather information. Of course, the feature information may be expanded according to actual needs, and the type of information contained in the feature information is not limited herein.
In one embodiment, the characteristic information includes date information (holiday or workday), season information, weather information. And preset the feature information-feature vector conversion rule. The preset feature information-feature vector conversion rule is shown in table 2:
TABLE 2
The date information, season information, weather information of each power consumption in each class are acquired. According to the preset characteristic information-characteristic vector conversion rule, a first characteristic vector corresponding to the power consumption date information, a second characteristic vector corresponding to the season information and a third characteristic vector corresponding to the weather information in each class can be obtained. For example, the characteristic information of a certain power consumption is: holidays, sunny days and summer, the characteristic vector of the power consumption is (1, 1), and the characteristic information of a certain power consumption is: the characteristic vector of the power consumption is 0,0.75,0.5 when the user is working, cloudy and autumn.
In this embodiment, the feature information corresponding to the power consumption is converted into the feature vector, so that the power consumption is conveniently clustered based on the feature vector.
Further, step S40 includes:
step S401, calculating the similarity between every two power consumption in each class according to the feature vector of each power consumption in each class and the similarity measurement method;
and step S402, clustering the power consumption in each class into M subclasses through a K-means algorithm according to the similarity between every two power consumption in each class, so as to obtain K.times.M subclasses.
In this embodiment, taking class a of the K classes as an example, assuming that class a includes 1000 power consumption, according to the above step S30, a feature vector of each power consumption in class a is obtained, and thus 1000 feature vectors are obtained.
In this embodiment, the value of M is first set, where M may be an integer between 10 and 15, and in one embodiment, m=10.
f, randomly selecting 10 feature vectors from 1000 feature vectors to serve as initial clustering centers;
g, calculating the similarity between the rest 990 eigenvectors and each initial clustering center, and dividing the power consumption corresponding to each eigenvector in the 990 eigenvectors into the class corresponding to the initial clustering center most similar to the power consumption according to the calculation result to obtain 10 classes (class 1-class 10);
h, calculating the average value of each class (taking class 1 as an example, assuming that class 1 contains 200 corresponding power consumption, wherein the characteristic vectors are (X1, Y1, Z1), (X2, Y2, Z2) … … (X200, Y200, Z200), and the average value of class 1 is (X plane, Y plane, Z plane), wherein X plane is the average value of X1-X200, Y plane is the average value of Y1-Y200, and Z plane is the average value of Z1-Z200), so as to obtain 10 average values;
i, calculating the similarity between 1000 feature vectors and each mean value, and dividing the power consumption corresponding to each feature vector in the 1000 feature vectors into classes corresponding to the most similar mean value according to the calculation result to obtain 20 new classes;
j, repeating the steps h to i until the data in each class is not changed any more, and obtaining M subclasses.
Similarly, for other classes in the K classes, k×m subclasses can be obtained according to the above manner from step f to step j.
Wherein, euclidean distance, manhattan distance, normalized Euclidean distance, etc. between two data can be calculated as the similarity of the two data.
Further, step S401 includes:
and according to the characteristic vector of each power consumption in each class and the Euclidean distance calculating method, calculating the Euclidean distance between every two power consumption in each class, and taking the Euclidean distance between every two power consumption in each class as the similarity between every two power consumption in each class.
In this embodiment, the feature vectors of the two power consumption amounts can be expressed as: power consumption 1 (X1, Y1, Z1), power consumption 2 (X2, Y2, Z2), the euclidean distance between two power consumption:
based on the above formula, the Euclidean distance between every two power consumption in each class can be calculated and used as the similarity between every two power consumption in each class.
Further, step S50 includes:
by the formulaAnd calculating to obtain X, and marking the subclass with the data volume smaller than X in the K.times.M subclasses as an abnormal power consumption subclass.
In real life, since the abnormal situation is always rare, if the amount of data contained in a certain subclass is small, the subclass is an abnormal power consumption subclass. In this embodiment, the formula is usedAnd calculating to obtain X, wherein N is the number of the acquired power consumption, kxM is the number of the subclasses, and X is the number of the power consumption contained in each subclass when the N power consumption is evenly put into each subclass.
In actual detection, if the amount of data (i.e., the number of power consumption contained in a certain subclass) is smaller than X, i.e., the amount of data contained in the subclass is smaller than the total case, the subclass is marked as an abnormal power consumption subclass.
Further, after step S50, the method further includes:
step S60, detecting whether an abnormal event exists according to the power consumption in the power consumption abnormal subclass;
in this embodiment, it is determined that the power consumption abnormal subclass is greater than a preset threshold, and the power consumption period exceeds the target power consumption of the preset period; detecting whether a power consumption period with target power consumption exceeding a preset number is within an event occurrence period; and if the electricity consumption time period with the target electricity consumption exceeding the preset number is in the event occurrence time period, determining that an abnormal event exists in the event occurrence time period.
And step S70, if an abnormal event exists, outputting an alarm prompt of the abnormal event.
If an abnormal event exists, notifying the abnormal event to a manager.
In one embodiment, if 3 power consumption abnormality sub-classes are marked in step S50, the total of the 3 power consumption abnormality sub-classes includes 100 power consumption. It is further detected whether there is a target power consumption greater than a preset threshold (set according to actual needs, for example, to 200 degrees) and the power consumption period exceeds a preset period (for example, the preset period is set to 10:00 to 22:00 per day) among the 100 power consumption.
If there are several target power consumption amounts, it is further detected whether a power consumption period in which there are more than a preset number (e.g., set to 5) of target power consumption amounts is within the event occurrence period. In this embodiment, the event occurrence period may be set to be daily. If the electricity consumption period in which there are more than the preset number (e.g., set to 5) of target electricity consumption is in the event occurrence period, that is, there are at least 5 target electricity consumption on the day of the date D, it is indicated that the electricity consumption condition of the object to be detected is abnormal on the day, that is, it is determined that there is an abnormal event on the day of the date D. The alarm prompt of the abnormal event can be output, for example, the power consumption corresponding to each power consumption period of the day D is generated to the manager terminal for the related manager to conduct manual investigation.
In this embodiment, each power consumption in the power consumption abnormal subclass is deeply analyzed, and when it is determined that an abnormal event exists (probably due to an equipment intermittent fault) according to the analysis result, an alarm prompt is output for a manager to investigate. The intelligent management of the electricity utilization information is realized, and the electricity utilization safety is enhanced.
Referring to fig. 3, fig. 3 is a schematic functional block diagram of an embodiment of an abnormal power consumption detection apparatus according to the present invention.
The power consumption abnormality detection device includes:
the acquiring module 10 is configured to divide a preset duration into N power consumption periods, and acquire power consumption corresponding to each power consumption period of the object to be detected, so as to obtain N power consumption;
the first clustering module 20 is configured to cluster the N power consumption by using a K-means algorithm to obtain K classes;
the feature calculation module 30 is configured to obtain feature information of each power consumption in each class, and obtain a feature vector of each power consumption in each class according to the feature information;
the second clustering module 40 is configured to cluster the power consumption in each class into M subclasses by using a K-means algorithm based on the feature vector of each power consumption in each class, so as to obtain k×m subclasses;
the marking module 50 is configured to mark a subclass with a data size smaller than X of the k×m subclasses as an abnormal power consumption subclass.
Further, the feature calculation module 30 includes:
a feature information acquiring unit 301, configured to acquire date information, weather information, and season information of each power consumption in each class;
the conversion unit 302 is configured to obtain a first feature vector corresponding to date information, a second feature vector corresponding to weather information, and a third feature vector corresponding to season information of each power consumption in each class based on a preset feature information-feature vector conversion rule.
Further, the second aggregation module 40 includes:
a similarity calculating unit 401, configured to calculate, according to the feature vector of each power consumption in each class and the similarity measurement method, a similarity between every two power consumption in each class;
and a clustering unit 402, configured to cluster the power consumption in each class into M subclasses by using a K-means algorithm according to the similarity between every two power consumption in each class, so as to obtain k×m subclasses.
Further, the similarity calculation unit 401 includes:
and the similarity calculation subunit is used for calculating the Euclidean distance between every two power consumption in each class according to the characteristic vector of each power consumption in each class and the Euclidean distance calculation method, and taking the Euclidean distance between every two power consumption in each class as the similarity between every two power consumption in each class.
Further, the marking module 50 includes:
a threshold calculating unit for passing through the formulaCalculating to obtain X;
and the marking unit is used for marking the subclass with the data volume smaller than X in the K.times.M subclasses as the abnormal power consumption subclass.
Further, the power consumption abnormality detection device further includes:
an abnormal event detection module 60, configured to detect whether an abnormal event exists according to the power consumption in the power consumption abnormal subclass;
and the alarm module 70 is used for outputting an alarm prompt of the abnormal event if the abnormal event exists.
Further, the abnormal event detection module 60 includes:
the searching unit is used for determining the target power consumption of which the power consumption period exceeds the preset period and is larger than the preset threshold in the power consumption abnormal subclass;
the detection unit is used for detecting whether the electricity consumption time period with the target electricity consumption exceeding the preset number is in the event occurrence time period;
and the judging unit is used for judging that an abnormal event exists in the event occurrence period if the electricity utilization period with the target electricity consumption exceeding the preset number is in the event occurrence period.
The specific embodiment of the power consumption abnormality detection device of the present invention is substantially the same as each embodiment of the power consumption abnormality detection method described above, and will not be described herein.
In addition, an embodiment of the present invention further provides a computer readable storage medium, where a power consumption abnormality detection program is stored, where the power consumption abnormality detection program when executed by a processor implements the steps of the power consumption abnormality detection method described above.
The specific embodiments of the computer readable storage medium of the present invention are substantially the same as the embodiments of the power consumption abnormality detection method described above, and will not be described herein.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The foregoing embodiment numbers of the present invention are merely for the purpose of description, and do not represent the advantages or disadvantages of the embodiments.
From the above description of the embodiments, it will be clear to those skilled in the art that the above-described embodiment method may be implemented by means of software plus a necessary general hardware platform, but of course may also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. ROM/RAM, magnetic disk, optical disk) as described above, comprising instructions for causing a terminal device (which may be a mobile phone, a computer, a server, an air conditioner, or a network device, etc.) to perform the method according to the embodiments of the present invention.
The foregoing description is only of the preferred embodiments of the present invention, and is not intended to limit the scope of the invention, but rather is intended to cover any equivalents of the structures or equivalent processes disclosed herein or in the alternative, which may be employed directly or indirectly in other related arts.

Claims (9)

1. The power consumption abnormality detection method is characterized by comprising the following steps:
dividing a preset duration into N power consumption periods, and obtaining power consumption corresponding to each power consumption period of an object to be detected to obtain N power consumption;
clustering the N power consumption by a K-means algorithm to obtain K classes;
the method comprises the steps of obtaining characteristic information of each power consumption in each class, and obtaining a characteristic vector of each power consumption in each class according to the characteristic information;
based on the characteristic vector of each power consumption in each class, clustering the power consumption in each class into M subclasses through a K-means algorithm to obtain K.M subclasses;
and marking subclasses with data volume smaller than X in the K.times.M subclasses as abnormal power consumption subclasses, wherein X is a preset numerical value or a quotient of N and K.times.M, N is the quantity of power consumption in the preset duration, and K.times.M is the quantity of subclasses.
2. The method for detecting power consumption abnormality according to claim 1, wherein the step of obtaining feature information of each power consumption in each class and obtaining feature vectors of each power consumption in each class based on the feature information comprises:
acquiring date information, weather information and season information of each power consumption in each class;
based on a preset characteristic information-characteristic vector conversion rule, a first characteristic vector corresponding to the date information, a second characteristic vector corresponding to the weather information and a third characteristic vector corresponding to the season information of each power consumption in each class are obtained.
3. The method for detecting abnormal power consumption according to claim 1, wherein the step of clustering the power consumption in each class into M subclasses by a K-means algorithm based on the feature vector of each power consumption in each class, to obtain k×m subclasses includes:
according to the feature vector of each power consumption in each class and the similarity measurement method, calculating and obtaining the similarity between every two power consumption in each class;
and clustering the power consumption in each class into M subclasses through a K-means algorithm according to the similarity between every two power consumption in each class, so as to obtain K.times.M subclasses.
4. The method for detecting power consumption abnormality according to claim 3, wherein the step of calculating the similarity between every two power consumption in each class according to the feature vector of each power consumption in each class and the similarity measurement method comprises:
and according to the characteristic vector of each power consumption in each class and the Euclidean distance calculating method, calculating the Euclidean distance between every two power consumption in each class, and taking the Euclidean distance between every two power consumption in each class as the similarity between every two power consumption in each class.
5. The power consumption abnormality detection method according to any one of claims 1 to 4, characterized by further comprising, after the step of marking a subclass having a data amount smaller than X among the k×m subclasses as a power consumption abnormality subclass:
detecting whether an abnormal event exists according to the power consumption in the power consumption abnormal subclass;
and if the abnormal event exists, outputting an alarm prompt of the abnormal event.
6. The method of claim 5, wherein the step of detecting whether an abnormal event exists based on the power consumption in the power consumption abnormal subclass comprises:
determining that the power consumption abnormal subclass is larger than a preset threshold value, and the power consumption period exceeds the target power consumption of the preset period;
detecting whether a power consumption period with target power consumption exceeding a preset number is within an event occurrence period;
and if the electricity consumption time period with the target electricity consumption exceeding the preset number is in the event occurrence time period, determining that an abnormal event exists in the event occurrence time period.
7. An electric power consumption abnormality detection device, characterized by comprising:
the acquisition module is used for dividing the preset duration into N power consumption periods, and acquiring power consumption corresponding to each power consumption period of the object to be detected to obtain N power consumption;
the first clustering module is used for clustering the N power consumption through a K-means algorithm to obtain K classes;
the feature calculation module is used for acquiring the feature information of each power consumption in each class and obtaining the feature vector of each power consumption in each class according to the feature information;
the second clustering module is used for clustering the power consumption in each class into M subclasses through a K-means algorithm based on the characteristic vector of each power consumption in each class to obtain K.M subclasses;
the marking module is used for marking subclasses with data volume smaller than X in the K X M subclasses as abnormal power consumption subclasses, X is a preset numerical value or a quotient of N and K X M, N is the quantity of power consumption in the preset duration, and K X M is the quantity of the subclasses.
8. A power consumption abnormality detection apparatus, characterized by comprising: a memory, a processor, and a power consumption abnormality detection program stored on the memory and executable on the processor, the power consumption abnormality detection program implementing the steps of the power consumption abnormality detection method according to any one of claims 1 to 6 when executed by the processor.
9. A computer-readable storage medium, wherein a power consumption abnormality detection program is stored on the computer-readable storage medium, the power consumption abnormality detection program implementing the steps of the power consumption abnormality detection method according to any one of claims 1 to 6 when executed by a processor.
CN201910342461.XA 2019-04-26 2019-04-26 Power consumption abnormality detection method, device, equipment and computer readable storage medium Active CN110209260B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910342461.XA CN110209260B (en) 2019-04-26 2019-04-26 Power consumption abnormality detection method, device, equipment and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910342461.XA CN110209260B (en) 2019-04-26 2019-04-26 Power consumption abnormality detection method, device, equipment and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN110209260A CN110209260A (en) 2019-09-06
CN110209260B true CN110209260B (en) 2024-02-23

Family

ID=67786454

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910342461.XA Active CN110209260B (en) 2019-04-26 2019-04-26 Power consumption abnormality detection method, device, equipment and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN110209260B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113051128B (en) * 2019-12-27 2022-06-28 Oppo广东移动通信有限公司 Power consumption detection method and device, electronic equipment and storage medium
CN114167223B (en) * 2022-02-11 2022-05-31 北京美达龙源环保电气有限公司 Power supply abnormity detection method and device and computer readable storage medium

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2015162229A (en) * 2014-02-28 2015-09-07 Kddi株式会社 Program, device, and method for estimating user attribute from power consumption in characteristic time zone
JP2015197741A (en) * 2014-03-31 2015-11-09 Kddi株式会社 Device, program, and method for estimating life pattern on basis of power consumption
CN108228862A (en) * 2018-01-12 2018-06-29 上海市建筑科学研究院 A kind of method for processing abnormal data and system of energy consumption monitoring platform
CN109034244A (en) * 2018-07-27 2018-12-18 国家电网有限公司 Line loss abnormality diagnostic method and device based on electric quantity curve characteristic model
JP2018205953A (en) * 2017-06-01 2018-12-27 三菱電機株式会社 Load estimation device and load estimation method
CN109284307A (en) * 2018-09-27 2019-01-29 平安科技(深圳)有限公司 A kind of the clustering processing method, apparatus and electronic equipment of data on flows
CN109447103A (en) * 2018-09-07 2019-03-08 平安科技(深圳)有限公司 A kind of big data classification method, device and equipment based on hard clustering algorithm

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8515967B2 (en) * 2010-03-29 2013-08-20 International Business Machines Corporation Cost and power efficient storage area network provisioning

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2015162229A (en) * 2014-02-28 2015-09-07 Kddi株式会社 Program, device, and method for estimating user attribute from power consumption in characteristic time zone
JP2015197741A (en) * 2014-03-31 2015-11-09 Kddi株式会社 Device, program, and method for estimating life pattern on basis of power consumption
JP2018205953A (en) * 2017-06-01 2018-12-27 三菱電機株式会社 Load estimation device and load estimation method
CN108228862A (en) * 2018-01-12 2018-06-29 上海市建筑科学研究院 A kind of method for processing abnormal data and system of energy consumption monitoring platform
CN109034244A (en) * 2018-07-27 2018-12-18 国家电网有限公司 Line loss abnormality diagnostic method and device based on electric quantity curve characteristic model
CN109447103A (en) * 2018-09-07 2019-03-08 平安科技(深圳)有限公司 A kind of big data classification method, device and equipment based on hard clustering algorithm
CN109284307A (en) * 2018-09-27 2019-01-29 平安科技(深圳)有限公司 A kind of the clustering processing method, apparatus and electronic equipment of data on flows

Also Published As

Publication number Publication date
CN110209260A (en) 2019-09-06

Similar Documents

Publication Publication Date Title
CN109684047B (en) Event processing method, device, equipment and computer storage medium
US20170109431A1 (en) Method and apparatus for grouping network service users
CN110209260B (en) Power consumption abnormality detection method, device, equipment and computer readable storage medium
CN111698303A (en) Data processing method and device, electronic equipment and storage medium
CN110381126A (en) Electrical equipment recognition methods, system, equipment and medium based on edge calculations
CN112668632B (en) Data processing method and device, computer equipment and storage medium
CN111898247B (en) Landslide displacement prediction method, landslide displacement prediction equipment and storage medium
CN112541016A (en) Power consumption abnormality detection method, device, computer equipment and storage medium
CN110569509A (en) risk group identification method and device
CN117176611A (en) Performance test method, system and medium of distributed communication library
CN110851502A (en) Load characteristic scene classification method based on data mining technology
CN115760486A (en) Method, device and equipment for estimating temporary construction scale and readable storage medium
CN115935284A (en) Power grid abnormal voltage detection method, device, equipment and storage medium
CN113837467B (en) Point-to-point energy project evaluation method and device, computer equipment and storage medium
CN110598995A (en) Intelligent customer rating method and device and computer readable storage medium
CN111309993B (en) Enterprise asset data portrayal generation method and system
CN112035552B (en) Method and device for predicting severity of voltage sag based on association rule
CN109977992B (en) Electronic device, method for identifying batch registration behaviors and storage medium
CN113256422A (en) Method and device for identifying bin account, computer equipment and storage medium
CN112364263A (en) Multi-dimensional data-based group renting house identification method, device, equipment and medium
CN113051128B (en) Power consumption detection method and device, electronic equipment and storage medium
CN116167829B (en) Multidimensional and multi-granularity user behavior analysis method
CN112906999B (en) Telephone traffic index optimization effect evaluation method and device and computing equipment
CN115693962B (en) Substation equipment monitoring method and device, electronic equipment and medium
CN112257923B (en) Heavy overload early warning method and device and electronic equipment

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant