CN111223006A - Abnormal electricity utilization detection method and device - Google Patents

Abnormal electricity utilization detection method and device Download PDF

Info

Publication number
CN111223006A
CN111223006A CN201911358731.2A CN201911358731A CN111223006A CN 111223006 A CN111223006 A CN 111223006A CN 201911358731 A CN201911358731 A CN 201911358731A CN 111223006 A CN111223006 A CN 111223006A
Authority
CN
China
Prior art keywords
electricity
training
data
abnormal
electricity utilization
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.)
Pending
Application number
CN201911358731.2A
Other languages
Chinese (zh)
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.)
State Grid Corp of China SGCC
Beijing University of Posts and Telecommunications
Information and Telecommunication Branch of State Grid Jibei Electric Power Co Ltd
Original Assignee
State Grid Corp of China SGCC
Beijing University of Posts and Telecommunications
Information and Telecommunication Branch of State Grid Jibei Electric Power 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 State Grid Corp of China SGCC, Beijing University of Posts and Telecommunications, Information and Telecommunication Branch of State Grid Jibei Electric Power Co Ltd filed Critical State Grid Corp of China SGCC
Priority to CN201911358731.2A priority Critical patent/CN111223006A/en
Publication of CN111223006A publication Critical patent/CN111223006A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06QINFORMATION AND COMMUNICATION TECHNOLOGY [ICT] SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES; SYSTEMS OR METHODS SPECIALLY ADAPTED FOR ADMINISTRATIVE, COMMERCIAL, FINANCIAL, MANAGERIAL OR SUPERVISORY PURPOSES, NOT OTHERWISE PROVIDED FOR
    • G06Q50/00Systems or methods specially adapted for specific business sectors, e.g. utilities or tourism
    • G06Q50/06Electricity, gas or water supply
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/21Design or setup of recognition systems or techniques; Extraction of features in feature space; Blind source separation
    • G06F18/214Generating training patterns; Bootstrap methods, e.g. bagging or boosting
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/044Recurrent networks, e.g. Hopfield networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/04Architecture, e.g. interconnection topology
    • G06N3/045Combinations of networks
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06NCOMPUTING ARRANGEMENTS BASED ON SPECIFIC COMPUTATIONAL MODELS
    • G06N3/00Computing arrangements based on biological models
    • G06N3/02Neural networks
    • G06N3/08Learning methods
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02EREDUCTION OF GREENHOUSE GAS [GHG] EMISSIONS, RELATED TO ENERGY GENERATION, TRANSMISSION OR DISTRIBUTION
    • Y02E40/00Technologies for an efficient electrical power generation, transmission or distribution
    • Y02E40/70Smart grids as climate change mitigation technology in the energy generation sector
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y04INFORMATION OR COMMUNICATION TECHNOLOGIES HAVING AN IMPACT ON OTHER TECHNOLOGY AREAS
    • Y04SSYSTEMS INTEGRATING TECHNOLOGIES RELATED TO POWER NETWORK OPERATION, COMMUNICATION OR INFORMATION TECHNOLOGIES FOR IMPROVING THE ELECTRICAL POWER GENERATION, TRANSMISSION, DISTRIBUTION, MANAGEMENT OR USAGE, i.e. SMART GRIDS
    • Y04S10/00Systems supporting electrical power generation, transmission or distribution
    • Y04S10/50Systems or methods supporting the power network operation or management, involving a certain degree of interaction with the load-side end user applications

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Health & Medical Sciences (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Artificial Intelligence (AREA)
  • General Health & Medical Sciences (AREA)
  • Evolutionary Computation (AREA)
  • General Engineering & Computer Science (AREA)
  • Computational Linguistics (AREA)
  • Mathematical Physics (AREA)
  • Biomedical Technology (AREA)
  • Biophysics (AREA)
  • Business, Economics & Management (AREA)
  • Software Systems (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • Economics (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Evolutionary Biology (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Public Health (AREA)
  • Water Supply & Treatment (AREA)
  • Human Resources & Organizations (AREA)
  • Marketing (AREA)
  • Primary Health Care (AREA)
  • Strategic Management (AREA)
  • Tourism & Hospitality (AREA)
  • General Business, Economics & Management (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

The invention provides a method and a device for detecting abnormal electricity consumption, which comprise the following steps: acquiring original power consumption data from a power grid as training power consumption data; preprocessing the training electricity consumption data to obtain a training electricity consumption data sample; constructing an abnormal electricity consumption data sample based on the training electricity consumption data sample; and training to obtain an abnormal electricity utilization detection model for detecting abnormal electricity utilization data by using the training electricity utilization data samples and the abnormal electricity utilization data samples. The abnormal electricity utilization detection model can be used for obtaining a relatively accurate electricity utilization data classification result, can be applied to a power grid to realize an abnormal electricity utilization detection function, and reduces loss caused by abnormal electricity utilization.

Description

Abnormal electricity utilization detection method and device
Technical Field
The invention relates to the technical field of power grid detection, in particular to a method and a device for detecting abnormal power utilization.
Background
Non-technical Loss (NTL) refers to the electric energy that has been transmitted to the user side for use but is not billed, mainly caused by electricity stealing or other fraudulent electricity usage by the user. The detection of the abnormal power consumption of the user in the traditional sense is mainly obtained by the home screening of technical personnel, which wastes time and labor and has inaccurate detection result; some professional anti-electricity-theft metering equipment has the anti-electricity-theft function, but the cost is too high due to additional configuration.
Disclosure of Invention
In view of the above, the present invention provides a method and an apparatus for detecting abnormal power consumption, which can use a data analysis method to realize the function of detecting abnormal power consumption.
Based on the above purpose, the present invention provides an abnormal electricity usage detection method, which includes:
acquiring original power consumption data from a power grid as training power consumption data;
preprocessing the training electricity consumption data to obtain a training electricity consumption data sample;
constructing an abnormal electricity consumption data sample based on the training electricity consumption data sample;
and training to obtain an abnormal electricity utilization detection model for detecting abnormal electricity utilization data by using the training electricity utilization data samples and the abnormal electricity utilization data samples.
Optionally, the abnormal electricity utilization detection model is a depth bidirectional LSTM model or a depth bidirectional GRU model.
Optionally, the abnormal electricity consumption data sample includes a simulation of a total time electricity stealing data sample and/or a simulation of a specific time period electricity stealing data sample.
Optionally, the constructing an abnormal electricity consumption data sample based on the training electricity consumption data sample includes:
dividing the training electricity consumption data sample into a first data sample and a second data sample;
and constructing the abnormal electricity utilization data sample based on the first data sample.
Optionally, the training of the training electricity consumption data sample and the abnormal electricity consumption data sample is used to obtain an abnormal electricity consumption detection model for detecting abnormal electricity consumption data, and the training includes:
and training to obtain the abnormal electricity utilization detection model by using the abnormal electricity utilization data sample and the second data sample.
Optionally, the preprocessing is performed on the training electricity consumption data to obtain a training electricity consumption data sample, and the method includes:
and sequentially carrying out missing value processing, smoothing processing, normalization processing and feature extraction processing on the training electricity consumption data to obtain the training electricity consumption data sample.
Optionally, the method further includes:
acquiring the original power utilization data from a power grid in real time;
preprocessing the original electricity utilization data to obtain a real-time electricity utilization data sample;
and inputting the real-time electricity consumption data sample into the abnormal electricity consumption detection model to obtain a normal electricity consumption data result or an abnormal electricity consumption data result.
An embodiment of the present invention further provides an abnormal power consumption detection apparatus, including:
the acquisition module is used for acquiring original power consumption data from a power grid as training power consumption data;
the preprocessing module is used for preprocessing the training electricity consumption data to obtain a training electricity consumption data sample;
the construction module is used for constructing an abnormal electricity utilization data sample based on the training electricity utilization data sample;
and the training module is used for training to obtain an abnormal electricity utilization detection model for detecting the abnormal electricity utilization data by using the training electricity utilization data samples and the abnormal electricity utilization data samples.
Optionally, the abnormal electricity utilization detection model is a depth bidirectional LSTM model or a depth bidirectional GRU model.
Optionally, the apparatus further comprises:
the acquisition module is used for acquiring the original power utilization data from a power grid in real time;
the preprocessing module is used for preprocessing the original electricity utilization data to obtain a real-time electricity utilization data sample;
and the detection module is used for inputting the real-time electricity utilization data samples into the abnormal electricity utilization detection model to obtain a normal electricity utilization data result or an abnormal electricity utilization data result.
As can be seen from the above, according to the abnormal electricity consumption detection method and apparatus provided by the present invention, the original electricity consumption data is obtained from the power grid as the training electricity consumption data, the training electricity consumption data is preprocessed to obtain the training electricity consumption data sample, the abnormal electricity consumption data sample is constructed based on the training electricity consumption data sample, and the abnormal electricity consumption detection model for detecting the abnormal electricity consumption data is obtained by training using the training electricity consumption data sample and the abnormal electricity consumption data sample. The abnormal electricity utilization detection model is a deep learning model, a large number of data samples are not required to be provided for training, a relatively accurate electricity utilization data classification result can be obtained by using the abnormal electricity utilization detection model, the abnormal electricity utilization detection model can be applied to a power grid to realize an abnormal electricity utilization detection function, and loss caused by abnormal electricity utilization is reduced.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a schematic flow chart of a method according to an embodiment of the present invention;
FIG. 2 is a schematic flow chart of a method according to another embodiment of the present invention;
FIG. 3 is a schematic structural diagram of an LSTM unit according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of a GRU unit according to an embodiment of the present invention;
FIG. 5 is a schematic diagram of a deep bidirectional recurrent neural network model according to an embodiment of the present invention;
FIG. 6 is a schematic diagram of abnormal electricity usage data for a configuration of an embodiment of the present invention;
FIG. 7 is a block diagram of an apparatus according to an embodiment of the present invention;
fig. 8 is a block diagram of an electronic device according to an embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention more apparent, the present invention is described in further detail below with reference to specific embodiments and the accompanying drawings.
It is to be noted that technical terms or scientific terms used in the embodiments of the present invention should have the ordinary meanings as understood by those having ordinary skill in the art to which the present disclosure belongs, unless otherwise defined. The use of "first," "second," and similar terms in this disclosure is not intended to indicate any order, quantity, or importance, but rather is used to distinguish one element from another. The word "comprising" or "comprises", and the like, means that the element or item listed before the word covers the element or item listed after the word and its equivalents, but does not exclude other elements or items. The terms "connected" or "coupled" and the like are not restricted to physical or mechanical connections, but may include electrical connections, whether direct or indirect. "upper", "lower", "left", "right", and the like are used merely to indicate relative positional relationships, and when the absolute position of the object being described is changed, the relative positional relationships may also be changed accordingly.
In some implementations, the data analysis model can be used to predict whether the power usage data is abnormal power usage data. For example, whether the power consumption data is abnormal power consumption data can be detected according to input power consumption data based on classification, regression and clustering models, however, the several supervised learning models are obtained by training a large number of data samples, and the actual abnormal power consumption data is difficult to obtain, so that the models are difficult to apply to an actual power grid.
In order to solve the above problems, embodiments of the present invention provide an abnormal electricity usage detection method and apparatus, where abnormal electricity usage data is constructed based on acquired original electricity usage data, an abnormal electricity usage detection model of a deep learning framework is obtained by training using the acquired electricity usage data and the constructed abnormal electricity usage data, and whether the electricity usage data is abnormal electricity usage data is detected in real time by using the abnormal electricity usage detection model. The abnormal electricity utilization detection method can be suitable for realizing real-time detection and classification of electricity utilization data in a power grid.
FIG. 1 is a schematic flow chart of a method according to an embodiment of the present invention. As shown in the drawings, the abnormal electricity utilization detection method provided by the embodiment of the present invention includes:
s101: acquiring original power consumption data from a power grid as training power consumption data;
in this embodiment, the electric energy collection terminal in the power grid may be used to collect and acquire the original power consumption data, and the actually acquired original power consumption data is used as the training power consumption data to train the abnormal power consumption detection model. Wherein, the collected original electricity consumption data is an electricity consumption sequence arranged in time sequence.
S102: preprocessing the training electricity consumption data to obtain a training electricity consumption data sample;
in this embodiment, the acquired raw power consumption data is preprocessed to obtain a training power consumption data sample suitable for model training.
S103: constructing an abnormal electricity utilization data sample based on the training electricity utilization data sample;
in this embodiment, the acquired raw power consumption data is preprocessed to obtain a training power consumption data sample suitable for model training.
S104: and training to obtain an abnormal electricity utilization detection model for detecting the abnormal electricity utilization data by using the training electricity utilization data samples and the abnormal electricity utilization data samples.
In this embodiment, because the abnormal power consumption data is difficult to distinguish from the actually acquired original power consumption data, the abnormal power consumption detection model is obtained for training, and the abnormal power consumption data sample is constructed based on the training power consumption data sample. Then, the training is carried out by utilizing the training electricity utilization data samples and the constructed abnormal electricity utilization data samples to obtain an abnormal electricity utilization detection model, and subsequently, the power grid can directly utilize the abnormal electricity utilization detection model to detect the electricity utilization data obtained in real time so as to obtain the electricity utilization data which are normal electricity utilization data or abnormal electricity utilization data.
Fig. 2 is a schematic flow chart of a method according to another embodiment of the present invention, and as shown in the figure, the abnormal electricity consumption detection method according to the embodiment of the present invention further includes:
s201: acquiring original power consumption data from a power grid in real time;
s202: preprocessing original power consumption data to obtain a real-time power consumption data sample;
s203: and inputting the real-time electricity utilization data sample into the abnormal electricity utilization detection model to obtain a normal electricity utilization data result or an abnormal electricity utilization data result.
In this embodiment, the abnormal power consumption detection model obtained through training is deployed in a power grid, the original power consumption data acquired in real time by the power grid is preprocessed, the obtained real-time power consumption data sample is input into the power consumption detection model, the data sample is classified by the abnormal power consumption detection model, and the output classification result is a normal power consumption data result or an abnormal power consumption data result, so that the abnormal power consumption data can be identified and detected.
The method for detecting abnormal electricity according to the embodiment of the present invention will be described in detail with reference to specific examples.
In some embodiments, in the step S102, the training electricity data is preprocessed to obtain the training electricity data sample, and the method may be that missing value processing, smoothing processing, normalization processing, and feature extraction processing are sequentially performed on the training electricity data to obtain the training electricity data sample. Specifically, the method comprises the following steps:
if the training electricity consumption data is the electricity consumption data sequence matrix X ═ X arranged according to the time sequence1,x2,...,xT]T is the number of sampling points (also denoted time period), for the T (0) th not recorded<t<T +1) time samples (i.e., missing values) xt,xtIs epsilon of NaN and
Figure BDA0002336629490000051
NaN is an undefined or unrepresentable value, then the value x is missingtThe following can be obtained by numerical calculation according to the previous and later moments:
Figure BDA0002336629490000052
if xtE.g. NaN, and xt-1orxt+1E.g., NaN, then let xt=0。
An electrical data sequence X ' ═ X ' of an insertion loss value was obtained based on formula (1) '1,x′2,…,x′T]In order to reduce the influence caused by noise points, the electricity data sequence inserted with the missing value is smoothed by adopting a moving average, and the K moving average of the sequence in time t is as follows:
Figure BDA0002336629490000053
wherein, MAtIs x'tIs measured.
For the smoothed electricity consumption data sequence X ″ - [ X ″ ]1,x″2,…,x″T]In order to reduce the influence of the electricity consumption of different sampling points on the calculation, the electricity consumption data sequence after the smoothing treatment is normalized, and the calculation formula is as follows:
Figure BDA0002336629490000061
wherein max () and min () respectively calculate ith power consumption data X ″)iThe maximum value of (a) is,
Figure BDA0002336629490000062
is a normalized electricity consumption data sequence.
In this embodiment, the normalized power consumption data sequence may be directly used as a training power consumption data sample for model training, or a required training power consumption data sample may be constructed based on the normalized power consumption data sequence according to actual needs. The length of the electricity consumption data sequence as the training electricity consumption data sample is the same.
In some embodiments, in step S103, an abnormal electricity consumption data sample is constructed based on the training electricity consumption data sample, which may be divided into a first data sample and a second data sample; and constructing an abnormal electricity utilization data sample based on the first data sample. That is, based on the training electricity consumption data sample obtained after the preprocessing, the training electricity consumption data sample can be divided into a first data sample and a second data sample according to a certain proportion, and the abnormal electricity consumption data sample is constructed by using the first data sample.
In step S104, an abnormal electricity usage detection model is trained by using the structured abnormal electricity usage data sample and the divided second data sample. In other words, the divided second data sample is used as a normal electricity consumption data sample, and the normal electricity consumption data sample and the abnormal electricity consumption data sample are used to train the abnormal electricity consumption detection model. In the embodiment, in view of the fact that the abnormal electricity consumption data is difficult to be identified and extracted from the actual electricity consumption data, the abnormal electricity consumption data is constructed on the basis of the actual electricity consumption data, and the abnormal electricity consumption detection model is trained by using the constructed abnormal electricity consumption data and the actual electricity consumption data.
In this embodiment, the abnormal electricity consumption data sample includes a simulation of an electricity stealing data sample at all times and/or a simulation of an electricity stealing data sample at a specific time period.
In some embodiments, all time stealing data samples can be constructed in four forms as shown in equations (4), (5), (6), and (7):
h1(xt)=αxt,α=random(0.1,0.8) (4)
let the first data sample include the power consumption, x, within the T time periodtIs the sampling point at time T in the first data sample, and equation (4) represents that all sampling points in the first data sample are multiplied by the same random number between 0.1 and 0.8 to obtain the total time electricity stealing data sample within the time period T.
h2(xt)=ξtxtξt=random(0.1,0.8) (5)
Equation (5) represents that all sampling points in the first data sample are multiplied by different random numbers between 0.1 and 0.8 to obtain the total time electricity stealing data sample within the T time period.
h3(xt)=γtmean(x) γt=random(0.1,0.8) (6)
Equation (6) represents that the average of all sampling points in the first data sample is multiplied by a random number which is different from 0.1 to 0.8, and the total time stealing data sample in the T time period is obtained.
h4(xt)=βmean(x),β=random(0.1,0.8) (7)
Formula (7) shows that the average value of all sampling points in the first data sample is multiplied by the same random number between 0.1 and 0.8 to obtain a total time electricity stealing data sample within the T time period; in the power utilization scene, the abnormal power utilization data indicating that the power acquisition terminal is slowed down or tampered to steal power can be obtained.
In some embodiments, the partial-time electricity stealing data samples of equations (8), (9), and (10) may be constructed in two forms:
h5(xt)=δtxt(8)
wherein, deltatExpressed as:
Figure BDA0002336629490000071
wherein the content of the first and second substances,
Figure BDA0002336629490000072
tend=tstart+η;
Figure BDA0002336629490000073
Figure BDA0002336629490000074
is the minimum power consumption of 0The duration of time.
Formulas (8) to (9) show that the electric energy collection terminal is enabled to be in a partial time period (t) by means of abnormal meansstartTo tendTime period) during which power usage is not counted or uploaded.
h6(xt)=xT-t(10)
Equation (10) represents a partial time electricity stealing data sample for implementing electricity stealing according to the high and low selection time periods of the time-of-use electricity price.
Assuming that N electricity consumption records are provided, each electricity consumption record has T sampling points, and an electricity consumption record matrix X belongs to RN×T. The abnormal electricity utilization detection problem is a two-classification task, and each piece of electricity utilization is recorded Xi=[xi1,xi2,...,xiT](0 < i ≦ N) into a predefined category:
Figure BDA0002336629490000081
wherein, yiIs an electrographic sample XiThe anomaly electricity utilization flag value of (1).
In this embodiment, the abnormal electricity utilization detection model for detecting abnormal electricity utilization is a depth bidirectional LSTM model or a depth bidirectional GRU model, and the overall description of the abnormal electricity utilization detection model is as follows:
Figure BDA0002336629490000082
wherein, XiIs the input vector of the model, W, U, b are the parameters of the model,
Figure BDA0002336629490000083
is yiThe predicted value of (2).
In some embodiments, as shown in FIG. 3, the LSTM cells of the bi-directional LSTM model contain information x stored at time ttState of LSTM cell and input gate itForgetting door ftOutput gate otIs related to the state of each gateThe input vector is composed of an input part and a loop part, the forgetting gate controls the content which is abandoned from the last moment, the input gate controls which new information is stored, the output gate controls which part of the state of the output unit, and the loop part is updated by the state and enters the next iteration.
In this embodiment, the forgetting door ftInput door itAnd output gate otIs defined as follows:
ft=σ(Wfht+Ufxt+bf) (13)
it=σ(Wiht-1+Uixt+bi) (14)
ot=σ(Wοht-1+Uοxt+bο) (15)
the temporary cell state value at the current time
Figure BDA0002336629490000084
The calculation is as follows:
Figure BDA0002336629490000085
cell state value c at the present timetThe calculation is as follows:
Figure BDA0002336629490000086
hidden layer state h at current momenttComprises the following steps:
ht=ot⊙h(ct) (18)
where g and h are non-linear functions such as sigmoid or tanh. WiWfWοWzWeight matrices of input parts, U, of input gate, forgetting gate, output gate, cell state, respectivelyiUfUοUzIs a cyclic part of the states of the input gate, the forgetting gate, the output gate and the unit, bibfbobzIs a bias vector. Sigma denotes activation functionNumbers, such as sigmoid.
In some embodiments, as shown in fig. 4, the GRU unit of the bidirectional GRU model includes a reset gate rtAnd an update gate zt. Reset gate rtCan filter out irrelevant information of hidden layer and update door ztIt is possible to control how much information is transferred to the output gate, and the reset gate and the update gate together control how much information is updated to the current state. At time t, the new state of the GRU unit is:
Figure BDA0002336629490000091
as can be seen, the current state htFrom past state ht-1And candidate states
Figure BDA0002336629490000092
The calculation is carried out jointly by means of linear interpolation. Updating the door ztControl how much past and new information is retained, update gate ztThe updating method comprises the following steps:
zt=σ(Wzxt+Uzht-1+bz) (20)
wherein x istIs the sequence vector at time t, candidate state
Figure BDA0002336629490000093
In a similar manner:
Figure BDA0002336629490000094
wherein, the door r is updatedtControlling the information of the past state to the candidate state if the gate r is updatedtIf 0, it forgets the past state, and the updating method of the reset gate is as follows:
rt=σ(Wrxt+Urht-1+br) (22)
wherein, WzWhWrUzUhUrbzbrbhRespectively, are model parameters, and σ is the activation function.
The deep bidirectional recurrent neural network model is formed by stacking a plurality of bidirectional recurrent neural networks (bidirectional LSTM models or bidirectional GRU models).
As shown in fig. 5, in the embodiment of the present invention, the abnormal electricity usage detection model is a depth bidirectional versus depth bidirectional LSTM model or a depth bidirectional GRU model.
For the L-layer bidirectional model, the electricity data sample X is inputiLayer I (0)<l<The output of each unit of L +1) is:
Figure BDA0002336629490000095
Figure BDA0002336629490000096
hidden forward state
Figure BDA0002336629490000097
And backward hidden layer state
Figure BDA0002336629490000098
Splicing to obtain hidden layer state
Figure BDA0002336629490000099
Figure BDA00023366294900000910
When l is equal to 0, the ratio of the total of the two,
Figure BDA0002336629490000101
xitfor electricity consumption data sample XiThe amount of electricity used at the middle time t,
Figure BDA0002336629490000102
for the feedforward layer of the LSTM or GRU model, the feedforward layer is derived from the sequence XiX ofi1Read to xiT
Figure BDA0002336629490000103
For the feedback layer of the LSTM model or GRU model, from xiTRead to xi1
In this embodiment, the output of the last time step T of the last layer L is used as the input of the classifier, and the order:
Figure BDA0002336629490000104
g output by the deep bidirectional circulation neural network model is high-level characteristics of the electricity utilization data, and the high-level characteristics are input into a classifier for classification to obtain a classification result of normal electricity utilization data or abnormal electricity utilization data. In this embodiment, the classifier is:
Figure BDA0002336629490000105
wherein
Figure BDA0002336629490000106
For the ith electricity data sample XiThe predicted classification result of (1).
In this embodiment, dropout is used in the model training process to prevent overfitting and improve the generalization capability of the model, and dropout randomly discards certain hidden layer units with probability p. Defining dropout as the multiplication of elements of high-level features g and r, wherein r is a vector of Bernoulli random variables with probability p, and obtaining a classifier as follows:
Figure BDA0002336629490000107
optionally, in a specific embodiment, the training parameters of the abnormal electricity usage detection model are that the RNN hidden layer size is 128, the depth L is 4, and the dropout probability p is 0.5. The training phase, batchSize is set to 256, and the learning rate is 0.001.
Optionally, Adam is used for training the abnormal electricity utilization detection model. In the training process, the selected loss function is as follows:
Figure BDA0002336629490000108
in a specific embodiment, original power consumption data of 1000 users for 535 days are obtained, the sampling frequency per day is 30 minutes, the number of sampling points per day is 48, power consumption data samples are obtained by preprocessing the original power consumption data, 20% of samples are extracted from the power consumption data samples to construct abnormal power consumption data samples, a training user data sample, a verification user data sample and a test user data sample are divided from data samples mixed by the constructed abnormal power consumption data samples and the rest 80% of user data samples according to the ratio of 6:2:2, an abnormal power consumption detection model is obtained by training the training user data samples, the trained abnormal power consumption detection model is evaluated by the test user data samples, and the over-parameters are determined by the verification user data samples to avoid overfitting.
Meanwhile, in this embodiment, two existing classifiers and various RNN models, including a single-layer unidirectional RNN model, are based on a Support Vector Machine (SVM) classifier and an xgboost (extreme gradientboosting) classifier: LSTM and GRU, single-layer bidirectional RNN model: BilSTM and BiGRU, and an abnormal electricity utilization detection model of the embodiment of the invention, namely a deep bidirectional RNN model: DBLSTM and DBGRU respectively carry out detection classification on the test electricity data samples, and the table 1 shows the classification result comparison result:
Methods Acc P R F1
SVM 0.8700 0.7459 0.3398 0.4669
XGBoost 0.9027 0.8697 0.4915 0.6281
LSTM 0.9379 0.8782 0.7296 0.7970
GRU 0.9401 0.9065 0.7158 0.7999
BiLSTM 0.9394 0.9161 0.7016 0.7946
BiGRU 0.9442 0.9150 0.7345 0.8149
DBLSTM 0.9699 0.9586 0.8556 0.9042
DBGRU 0.9744 0.9570 0.9974 0.9209
TABLE 1
Where acc (accuracy) is the accuracy of the model, p (precision) is the precision of the model, r (recall) is the recall of the model, and F1 is the harmonic mean of the accuracy and recall. As can be seen from the data in table 1, compared with the existing classification model, the model based on the RNN achieves the best effect, and the classification result of the abnormal electricity consumption detection model in the embodiment of the present invention is more accurate by stacking the multiple layers of hidden units on the basis of the bidirectional model.
It should be noted that the method of the embodiment of the present invention may be executed by a single device, such as a computer or a server. The method of the embodiment can also be applied to a distributed scene and completed by the mutual cooperation of a plurality of devices. In the case of such a distributed scenario, one of the multiple devices may only perform one or more steps of the method according to the embodiment of the present invention, and the multiple devices interact with each other to complete the method.
FIG. 7 is a block diagram of an apparatus according to an embodiment of the present invention. As shown in the drawings, the abnormal electricity utilization detection device provided by the embodiment of the invention comprises;
the acquisition module is used for acquiring original power consumption data from a power grid as training power consumption data;
the preprocessing module is used for preprocessing the training electricity consumption data to obtain a training electricity consumption data sample;
the construction module is used for constructing an abnormal electricity utilization data sample based on the training electricity utilization data sample;
and the training module is used for training to obtain an abnormal electricity utilization detection model for detecting the abnormal electricity utilization data by utilizing the training electricity utilization data samples and the abnormal electricity utilization data samples.
Optionally, the abnormal electricity utilization detection model is a deep bidirectional LSTM model or a bidirectional GRU model.
In this embodiment, the abnormal electricity consumption detection device further includes:
the acquisition module is used for acquiring original power utilization data from a power grid in real time;
the preprocessing module is used for preprocessing the original electricity utilization data to obtain a real-time electricity utilization data sample;
and the detection module is used for inputting the real-time electricity utilization data samples into the abnormal electricity utilization detection model to obtain a normal electricity utilization data result or an abnormal electricity utilization data result.
The apparatus of the foregoing embodiment is used to implement the corresponding method in the foregoing embodiment, and has the beneficial effects of the corresponding method embodiment, which are not described herein again.
Fig. 8 is a schematic diagram illustrating a more specific hardware structure of an electronic device according to this embodiment, where the electronic device may include: a processor 1010, a memory 1020, an input/output interface 1030, a communication interface 1040, and a bus 1050. Wherein the processor 1010, memory 1020, input/output interface 1030, and communication interface 1040 are communicatively coupled to each other within the device via bus 1050.
The processor 1010 may be implemented by a general-purpose CPU (Central Processing Unit), a microprocessor, an Application Specific Integrated Circuit (ASIC), or one or more Integrated circuits, and is configured to execute related programs to implement the technical solutions provided in the embodiments of the present disclosure.
The Memory 1020 may be implemented in the form of a ROM (Read Only Memory), a RAM (Random access Memory), a static storage device, a dynamic storage device, or the like. The memory 1020 may store an operating system and other application programs, and when the technical solution provided by the embodiments of the present specification is implemented by software or firmware, the relevant program codes are stored in the memory 1020 and called to be executed by the processor 1010.
The input/output interface 1030 is used for connecting an input/output module to input and output information. The i/o module may be configured as a component in a device (not shown) or may be external to the device to provide a corresponding function. The input devices may include a keyboard, a mouse, a touch screen, a microphone, various sensors, etc., and the output devices may include a display, a speaker, a vibrator, an indicator light, etc.
The communication interface 1040 is used for connecting a communication module (not shown in the drawings) to implement communication interaction between the present apparatus and other apparatuses. The communication module can realize communication in a wired mode (such as USB, network cable and the like) and also can realize communication in a wireless mode (such as mobile network, WIFI, Bluetooth and the like).
Bus 1050 includes a path that transfers information between various components of the device, such as processor 1010, memory 1020, input/output interface 1030, and communication interface 1040.
It should be noted that although the above-mentioned device only shows the processor 1010, the memory 1020, the input/output interface 1030, the communication interface 1040 and the bus 1050, in a specific implementation, the device may also include other components necessary for normal operation. In addition, those skilled in the art will appreciate that the above-described apparatus may also include only those components necessary to implement the embodiments of the present description, and not necessarily all of the components shown in the figures.
Computer-readable media of the present embodiments, including both non-transitory and non-transitory, removable and non-removable media, may implement information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Discs (DVD) or other optical storage, magnetic cassettes, magnetic tape magnetic disk storage or other magnetic storage devices, or any other non-transmission medium that can be used to store information that can be accessed by a computing device.
Those of ordinary skill in the art will understand that: the discussion of any embodiment above is meant to be exemplary only, and is not intended to intimate that the scope of the disclosure, including the claims, is limited to these examples; within the idea of the invention, also features in the above embodiments or in different embodiments may be combined, steps may be implemented in any order, and there are many other variations of the different aspects of the invention as described above, which are not provided in detail for the sake of brevity.
In addition, well known power/ground connections to Integrated Circuit (IC) chips and other components may or may not be shown within the provided figures for simplicity of illustration and discussion, and so as not to obscure the invention. Furthermore, devices may be shown in block diagram form in order to avoid obscuring the invention, and also in view of the fact that specifics with respect to implementation of such block diagram devices are highly dependent upon the platform within which the present invention is to be implemented (i.e., specifics should be well within purview of one skilled in the art). Where specific details (e.g., circuits) are set forth in order to describe example embodiments of the invention, it should be apparent to one skilled in the art that the invention can be practiced without, or with variation of, these specific details. Accordingly, the description is to be regarded as illustrative instead of restrictive.
While the present invention has been described in conjunction with specific embodiments thereof, many alternatives, modifications, and variations of these embodiments will be apparent to those of ordinary skill in the art in light of the foregoing description. For example, other memory architectures (e.g., dynamic ram (dram)) may use the discussed embodiments.
The embodiments of the invention are intended to embrace all such alternatives, modifications and variances that fall within the broad scope of the appended claims. Therefore, any omissions, modifications, substitutions, improvements and the like that may be made without departing from the spirit and principles of the invention are intended to be included within the scope of the invention.

Claims (10)

1. An abnormal electricity usage detection method, characterized by comprising:
acquiring original power consumption data from a power grid as training power consumption data;
preprocessing the training electricity consumption data to obtain a training electricity consumption data sample;
constructing an abnormal electricity consumption data sample based on the training electricity consumption data sample;
and training to obtain an abnormal electricity utilization detection model for detecting abnormal electricity utilization data by using the training electricity utilization data samples and the abnormal electricity utilization data samples.
2. The method of claim 1, wherein the abnormal electricity usage detection model is a depth bi-directional LSTM model or a depth bi-directional GRU model.
3. The method of claim 1, wherein the abnormal electricity data samples comprise simulated total time electricity stealing data samples and/or simulated specific time period electricity stealing data samples.
4. The method of claim 1, wherein constructing abnormal electricity data samples based on the training electricity data samples comprises:
dividing the training electricity consumption data sample into a first data sample and a second data sample;
and constructing the abnormal electricity utilization data sample based on the first data sample.
5. The method according to claim 4, wherein training a power consumption abnormality detection model for detecting power consumption abnormality data using the training power consumption data samples and the power consumption abnormality data samples comprises:
and training to obtain the abnormal electricity utilization detection model by using the abnormal electricity utilization data sample and the second data sample.
6. The method of claim 1, wherein preprocessing the training electricity data to obtain training electricity data samples comprises:
and sequentially carrying out missing value processing, smoothing processing, normalization processing and feature extraction processing on the training electricity consumption data to obtain the training electricity consumption data sample.
7. The method of claim 1, further comprising:
acquiring the original power utilization data from a power grid in real time;
preprocessing the original electricity utilization data to obtain a real-time electricity utilization data sample;
and inputting the real-time electricity consumption data sample into the abnormal electricity consumption detection model to obtain a normal electricity consumption data result or an abnormal electricity consumption data result.
8. An abnormal electricity consumption detection device, comprising:
the acquisition module is used for acquiring original power consumption data from a power grid as training power consumption data;
the preprocessing module is used for preprocessing the training electricity consumption data to obtain a training electricity consumption data sample;
the construction module is used for constructing an abnormal electricity utilization data sample based on the training electricity utilization data sample;
and the training module is used for training to obtain an abnormal electricity utilization detection model for detecting the abnormal electricity utilization data by using the training electricity utilization data samples and the abnormal electricity utilization data samples.
9. The apparatus of claim 8, wherein the abnormal power usage detection model is a depth bi-directional LSTM model or a depth bi-directional GRU model.
10. The apparatus of claim 8, further comprising:
the acquisition module is used for acquiring the original power utilization data from a power grid in real time;
the preprocessing module is used for preprocessing the original electricity utilization data to obtain a real-time electricity utilization data sample;
and the detection module is used for inputting the real-time electricity utilization data samples into the abnormal electricity utilization detection model to obtain a normal electricity utilization data result or an abnormal electricity utilization data result.
CN201911358731.2A 2019-12-25 2019-12-25 Abnormal electricity utilization detection method and device Pending CN111223006A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911358731.2A CN111223006A (en) 2019-12-25 2019-12-25 Abnormal electricity utilization detection method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911358731.2A CN111223006A (en) 2019-12-25 2019-12-25 Abnormal electricity utilization detection method and device

Publications (1)

Publication Number Publication Date
CN111223006A true CN111223006A (en) 2020-06-02

Family

ID=70829203

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911358731.2A Pending CN111223006A (en) 2019-12-25 2019-12-25 Abnormal electricity utilization detection method and device

Country Status (1)

Country Link
CN (1) CN111223006A (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111738364A (en) * 2020-08-05 2020-10-02 国网江西省电力有限公司供电服务管理中心 Electricity stealing detection method based on combination of user load and electricity consumption parameter
CN112398226A (en) * 2020-11-13 2021-02-23 国网山东省电力公司泰安供电公司 Power supply system electricity stealing prevention method, system, terminal and storage medium
CN113033089A (en) * 2021-03-23 2021-06-25 中国联合网络通信集团有限公司 Method and device for identifying abnormal power consumption user
CN113191409A (en) * 2021-04-20 2021-07-30 国网江苏省电力有限公司营销服务中心 Method for detecting abnormal electricity consumption behaviors of residents through tag data expansion and deep learning
CN113449795A (en) * 2021-06-29 2021-09-28 国网北京市电力公司 Power utilization data processing method and device and electronic equipment
CN114034969A (en) * 2021-10-25 2022-02-11 浙江万胜智能科技股份有限公司 Energy controller current loop event generation method based on correction algorithm
CN114841268A (en) * 2022-05-06 2022-08-02 国网江苏省电力有限公司营销服务中心 Abnormal power customer identification method based on Transformer and LSTM fusion algorithm
CN116052848A (en) * 2023-04-03 2023-05-02 吉林大学 Data coding method and system for medical imaging quality control

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103353895A (en) * 2013-07-22 2013-10-16 广西电网公司电力科学研究院 Pre-processing method of power distribution network line loss data
US20160034813A1 (en) * 2014-07-29 2016-02-04 National Chiao Tung University Method for counting number of people based on appliance usages and monitoring system using the same
CN109446193A (en) * 2018-11-13 2019-03-08 国网宁夏电力有限公司电力科学研究院 It opposes electricity-stealing model generating method and device
CN109583680A (en) * 2018-09-30 2019-04-05 国网浙江长兴县供电有限公司 A kind of stealing discrimination method based on support vector machines

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103353895A (en) * 2013-07-22 2013-10-16 广西电网公司电力科学研究院 Pre-processing method of power distribution network line loss data
US20160034813A1 (en) * 2014-07-29 2016-02-04 National Chiao Tung University Method for counting number of people based on appliance usages and monitoring system using the same
CN109583680A (en) * 2018-09-30 2019-04-05 国网浙江长兴县供电有限公司 A kind of stealing discrimination method based on support vector machines
CN109446193A (en) * 2018-11-13 2019-03-08 国网宁夏电力有限公司电力科学研究院 It opposes electricity-stealing model generating method and device

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111738364A (en) * 2020-08-05 2020-10-02 国网江西省电力有限公司供电服务管理中心 Electricity stealing detection method based on combination of user load and electricity consumption parameter
CN112398226A (en) * 2020-11-13 2021-02-23 国网山东省电力公司泰安供电公司 Power supply system electricity stealing prevention method, system, terminal and storage medium
CN113033089A (en) * 2021-03-23 2021-06-25 中国联合网络通信集团有限公司 Method and device for identifying abnormal power consumption user
CN113033089B (en) * 2021-03-23 2023-07-14 中国联合网络通信集团有限公司 Method and device for identifying abnormal electricity consumption user
CN113191409A (en) * 2021-04-20 2021-07-30 国网江苏省电力有限公司营销服务中心 Method for detecting abnormal electricity consumption behaviors of residents through tag data expansion and deep learning
CN113449795A (en) * 2021-06-29 2021-09-28 国网北京市电力公司 Power utilization data processing method and device and electronic equipment
CN114034969A (en) * 2021-10-25 2022-02-11 浙江万胜智能科技股份有限公司 Energy controller current loop event generation method based on correction algorithm
CN114841268A (en) * 2022-05-06 2022-08-02 国网江苏省电力有限公司营销服务中心 Abnormal power customer identification method based on Transformer and LSTM fusion algorithm
CN116052848A (en) * 2023-04-03 2023-05-02 吉林大学 Data coding method and system for medical imaging quality control

Similar Documents

Publication Publication Date Title
CN111223006A (en) Abnormal electricity utilization detection method and device
CN108563548B (en) Abnormality detection method and apparatus
Raju et al. IOT based online load forecasting using machine learning algorithms
CN107506868B (en) Method and device for predicting short-time power load
CN107358247B (en) Method and device for determining lost user
CN107633254A (en) Establish device, method and the computer-readable recording medium of forecast model
KR102531593B1 (en) Method and apparatus, device and readable storage medium for predicting power consumption
Pozo et al. Supercapacitor electro-mathematical and machine learning modelling for low power applications
CN111144451B (en) Training method, device and equipment for image classification model
CN110069545A (en) A kind of behavioral data appraisal procedure and device
CN111369258A (en) Entity object type prediction method, device and equipment
CN115660233A (en) Photovoltaic power prediction method and device, electronic equipment and storage medium
Liu et al. Short‐term load forecasting based on LSTNet in power system
Mu et al. Online semiparametric identification of Lithium-Ion batteries using the wavelet-based partially linear battery model
CN116707331B (en) Inverter output voltage high-precision adjusting method and system based on model prediction
CN107728772B (en) Application processing method and device, storage medium and electronic equipment
CN116205382B (en) Prediction method and prediction device for electricity consumption, electronic device and electronic equipment
CN115879378B (en) Training method and device for expansion force prediction model of battery cell
CN111798263A (en) Transaction trend prediction method and device
CN114448661B (en) Method for detecting slow denial of service attack and related equipment
CN116029425A (en) Method, device and computer equipment for predicting fan output climbing event
Khetarpal et al. Power quality disturbance signal segmentation and classification based on modified BI‐LSTM with double attention mechanism
CN114971736A (en) Power metering material demand prediction method and device, electronic equipment and storage medium
CN113610174A (en) Power grid host load prediction method, equipment and medium based on Phik feature selection
CN113011748A (en) Recommendation effect evaluation method and device, electronic equipment and readable storage medium

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20200602

RJ01 Rejection of invention patent application after publication