CN111967512A - Abnormal electricity utilization detection method, system and storage medium - Google Patents

Abnormal electricity utilization detection method, system and storage medium Download PDF

Info

Publication number
CN111967512A
CN111967512A CN202010787989.0A CN202010787989A CN111967512A CN 111967512 A CN111967512 A CN 111967512A CN 202010787989 A CN202010787989 A CN 202010787989A CN 111967512 A CN111967512 A CN 111967512A
Authority
CN
China
Prior art keywords
data
abnormal
abnormal electricity
electricity consumption
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.)
Granted
Application number
CN202010787989.0A
Other languages
Chinese (zh)
Other versions
CN111967512B (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.)
State Grid Corp of China SGCC
Electric Power Research Institute of State Grid Jiangsu Electric Power Co Ltd
Original Assignee
State Grid Corp of China SGCC
Electric Power Research Institute of State Grid Jiangsu 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, Electric Power Research Institute of State Grid Jiangsu Electric Power Co Ltd filed Critical State Grid Corp of China SGCC
Priority to CN202010787989.0A priority Critical patent/CN111967512B/en
Publication of CN111967512A publication Critical patent/CN111967512A/en
Application granted granted Critical
Publication of CN111967512B publication Critical patent/CN111967512B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/241Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01RMEASURING ELECTRIC VARIABLES; MEASURING MAGNETIC VARIABLES
    • G01R11/00Electromechanical arrangements for measuring time integral of electric power or current, e.g. of consumption
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01RMEASURING ELECTRIC VARIABLES; MEASURING MAGNETIC VARIABLES
    • G01R19/00Arrangements for measuring currents or voltages or for indicating presence or sign thereof
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01RMEASURING ELECTRIC VARIABLES; MEASURING MAGNETIC VARIABLES
    • G01R21/00Arrangements for measuring electric power or power factor
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01RMEASURING ELECTRIC VARIABLES; MEASURING MAGNETIC VARIABLES
    • G01R21/00Arrangements for measuring electric power or power factor
    • G01R21/001Measuring real or reactive component; Measuring apparent energy
    • G01R21/002Measuring real component
    • GPHYSICS
    • G01MEASURING; TESTING
    • G01RMEASURING ELECTRIC VARIABLES; MEASURING MAGNETIC VARIABLES
    • G01R31/00Arrangements for testing electric properties; Arrangements for locating electric faults; Arrangements for electrical testing characterised by what is being tested not provided for elsewhere
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/241Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches
    • G06F18/2415Classification techniques relating to the classification model, e.g. parametric or non-parametric approaches based on parametric or probabilistic models, e.g. based on likelihood ratio or false acceptance rate versus a false rejection rate
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F18/00Pattern recognition
    • G06F18/20Analysing
    • G06F18/24Classification techniques
    • G06F18/243Classification techniques relating to the number of classes
    • G06F18/2433Single-class perspective, e.g. one-against-all classification; Novelty detection; Outlier detection
    • 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/04Architecture, e.g. interconnection topology
    • G06N3/047Probabilistic or stochastic 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/048Activation functions
    • 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
    • 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)
  • Physics & Mathematics (AREA)
  • Theoretical Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Life Sciences & Earth Sciences (AREA)
  • Artificial Intelligence (AREA)
  • General Engineering & Computer Science (AREA)
  • Evolutionary Computation (AREA)
  • Biomedical Technology (AREA)
  • Mathematical Physics (AREA)
  • General Health & Medical Sciences (AREA)
  • Molecular Biology (AREA)
  • Computing Systems (AREA)
  • Biophysics (AREA)
  • Health & Medical Sciences (AREA)
  • Computational Linguistics (AREA)
  • Software Systems (AREA)
  • Bioinformatics & Cheminformatics (AREA)
  • Bioinformatics & Computational Biology (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Evolutionary Biology (AREA)
  • Probability & Statistics with Applications (AREA)
  • Power Engineering (AREA)
  • Management, Administration, Business Operations System, And Electronic Commerce (AREA)

Abstract

本发明公开了一种异常用电检测方法、系统和存储介质,属于智能电网异常用电行为识别技术领域。该异常用电检测方法包括如下步骤:获取待检测的智能电表数据;将智能电表数据转换为多时间序列数据;将多时间序列数据输入训练好的异常用电检测模型,获得预测的用电类型标签;将预测的用电类型标签中概率最大的用电类型作为待检测的智能电表数据的异常用电检测结果。本发明能够充分、全面地利用用电大数据,深入挖掘异常用电行为的高级特征,提高异常用电检测的泛化性能、降低误判比例,高效、准确地检测异常用电。

Figure 202010787989

The invention discloses a method, a system and a storage medium for detecting abnormal power consumption, and belongs to the technical field of abnormal power consumption behavior identification of a smart grid. The abnormal electricity consumption detection method includes the following steps: acquiring smart meter data to be detected; converting the smart electricity meter data into multi-time-series data; inputting the multi-time-series data into the trained abnormal electricity consumption detection model to obtain the predicted electricity consumption type Label; take the electricity consumption type with the highest probability among the predicted electricity consumption type labels as the abnormal electricity consumption detection result of the smart meter data to be detected. The invention can fully and comprehensively utilize the big data of electricity consumption, deeply mine the advanced features of abnormal electricity consumption behavior, improve the generalization performance of abnormal electricity consumption detection, reduce the proportion of misjudgment, and detect abnormal electricity consumption efficiently and accurately.

Figure 202010787989

Description

一种异常用电检测方法、系统和存储介质A kind of abnormal power consumption detection method, system and storage medium

技术领域technical field

本发明涉及一种异常用电检测方法、系统和存储介质,属于智能电网异常用电行为识别技术领域。The invention relates to an abnormal power consumption detection method, system and storage medium, and belongs to the technical field of abnormal power consumption behavior identification of a smart grid.

背景技术Background technique

长期以来,由于窃电、电表故障和安装错误等异常用电给电网运营商每年带来巨额的经济损失。而且,由于采集到的用电数据存在巨大误差,还会影响电网的调度与管理,以及运行安全。因此,异常用电检测是智能电网运维过程中安全用电的重要支撑之一,具有非常重要的意义。通过对用电行为正常与否的甄别,既可以即使追补因为异常用电导致的少计量的电费。此外,还可以校正失真的用电数据,提高电网数据质量,为更广泛的电力大数据分析提供保障。目前,包括我国在内的世界主要国家的工商业用户在全社会用电量中占有非常大的比例,在我国该比例已超过80%,因此在工商业用户中检测异常用电显得尤为重要。For a long time, abnormal electricity consumption such as electricity theft, meter failure and installation error has brought huge economic losses to grid operators every year. Moreover, due to the huge errors in the collected power consumption data, it will also affect the scheduling and management of the power grid, as well as the operation safety. Therefore, abnormal power consumption detection is one of the important supports for safe power consumption in the process of smart grid operation and maintenance, which is of great significance. By identifying whether the electricity consumption is normal or not, it is possible to make up for the under-metered electricity bill caused by abnormal electricity consumption. In addition, it can also correct the distorted power consumption data, improve the quality of power grid data, and provide guarantee for a wider range of power big data analysis. At present, industrial and commercial users in major countries in the world, including my country, account for a very large proportion of electricity consumption in the whole society. In my country, the proportion has exceeded 80%. Therefore, it is particularly important to detect abnormal electricity consumption among industrial and commercial users.

越来越多的研究人员热衷基于大数据分析的方法,借助统计学、数据挖掘、机器学习等技术手段查找异常用电行为。相比基于硬件的解决方案,此类方法具有效率高、检测速度快等优势;并且,随着电力部门积累的智能电表数据越来越多,此类方法逐渐成为主流。基于数据分析的异常用电检测方法,主要依赖人工特征建模加判别算法设计的实施模式;特别是特征模型的性能,直接决定了检测方法的优劣。常常因为特征模型的泛化能力不足,导致大量误报。目前,人工特征建模的不足具体表现在如下几个方面:More and more researchers are keen on methods based on big data analysis, using statistics, data mining, machine learning and other technical means to find abnormal electricity consumption behavior. Compared with hardware-based solutions, such methods have the advantages of high efficiency and fast detection speed; and as the power sector accumulates more and more smart meter data, such methods are gradually becoming mainstream. The abnormal power consumption detection method based on data analysis mainly relies on the implementation mode of artificial feature modeling and discriminative algorithm design; especially the performance of the feature model directly determines the pros and cons of the detection method. Often due to the insufficient generalization ability of the feature model, a large number of false positives are caused. At present, the shortcomings of artificial feature modeling are embodied in the following aspects:

1)异常用电行为的数据现象具有极大的多样性,并且,智能电表数据规模异常庞大,人工设计数据特征时,根本无法遍历所有可能的数据现象。人工设计的数据特征往往基于少量数据,从而导致检测模型的准确性随时间逐渐退化;1) The data phenomena of abnormal electricity consumption behavior are extremely diverse, and the data scale of smart meters is extremely large. When manually designing data features, it is impossible to traverse all possible data phenomena. The artificially designed data features are often based on a small amount of data, which leads to the gradual degradation of the accuracy of the detection model over time;

2)异常用电的数据特征是多方面的,既有短期特征,也有长期特征;既有局部特征,也有全局特征;人工很难在短时间内,徒手设计出性能优异特征模型;2) The data characteristics of abnormal electricity consumption are multifaceted, including both short-term and long-term characteristics; both local and global characteristics; it is difficult to manually design a feature model with excellent performance in a short period of time;

3)智能电表数据中蕴含了大量各类噪声,将干扰人类专家进行数据分析与特征建模;3) The smart meter data contains a large amount of various types of noise, which will interfere with human experts for data analysis and feature modeling;

4)人工设计的数据特征往往具有较强的局限性,直接受人类专家的技术水平和经验等相关,导致特征模型主观性强,可伸缩性差,无法满足应用要求。4) The artificially designed data features often have strong limitations, which are directly related to the technical level and experience of human experts, resulting in strong subjectivity and poor scalability of the feature model, which cannot meet the application requirements.

由此可见,传统的异常用电检测方法已经无法满足智能电网的运维与发展需求。如何充分利用用电大数据,深入挖掘异常用电行为的高级特征,高效、准确地检测异常用电,成为智能电网发展的主要趋势。It can be seen that the traditional abnormal power consumption detection methods have been unable to meet the operation, maintenance and development needs of smart grids. How to make full use of electricity consumption big data, deeply mine the advanced characteristics of abnormal electricity consumption behavior, and efficiently and accurately detect abnormal electricity consumption has become the main trend of smart grid development.

发明内容SUMMARY OF THE INVENTION

本发明的目的在于克服现有技术中的不足,提供一种异常用电检测方法、系统和存储介质,能够充分、全面地利用用电大数据,深入挖掘异常用电行为的高级特征,提高异常用电检测的泛化性能、降低误判比例,高效、准确地检测异常用电。The purpose of the present invention is to overcome the deficiencies in the prior art, and to provide a method, system and storage medium for detecting abnormal electricity consumption, which can fully and comprehensively utilize the big data of electricity consumption, deeply mine the advanced features of abnormal electricity consumption behavior, and improve the abnormality of electricity consumption. The generalization performance of electricity detection, reducing the proportion of misjudgments, and detecting abnormal electricity efficiently and accurately.

为达到上述目的,本发明是采用下述技术方案实现的:To achieve the above object, the present invention adopts the following technical solutions to realize:

第一方面:first:

一种异常用电检测方法,所述异常用电检测方法包括如下步骤:A method for detecting abnormal electricity consumption, the method for detecting abnormal electricity consumption comprises the following steps:

获取待检测的智能电表数据;Obtain the data of the smart meter to be detected;

将智能电表数据转换为多时间序列数据;Convert smart meter data to multi-time series data;

将多时间序列数据输入训练好的异常用电检测模型,获得预测的用电类型标签;Input the multi-time series data into the trained abnormal electricity consumption detection model to obtain the predicted electricity consumption type label;

将预测的用电类型标签中概率最大的用电类型作为待检测的智能电表数据的异常用电检测结果。The electricity consumption type with the highest probability in the predicted electricity consumption type label is used as the abnormal electricity consumption detection result of the smart meter data to be detected.

进一步的,将智能电表数据转换为多时间序列数据的方法包括如下步骤:Further, the method for converting smart meter data into multi-time series data includes the following steps:

将智能电表数据转换为多时间序列数据的形式,构造并附加数据质量序列和日期类型序列;Convert smart meter data into the form of multi-time series data, construct and append data quality series and date type series;

对于所获取序列数据填充缺失数据并按照自然周分割,构造为多时间序列数据;Fill in the missing data for the acquired sequence data and divide it according to the natural week, and construct it as multi-time series data;

对多时间序列数据进行独立的数据归一化处理。Independent data normalization for multiple time series data.

进一步的,构造数据质量序列的方法包括如下步骤:Further, the method for constructing the data quality sequence includes the following steps:

根据时间戳统计智能电表数据的缺失个数,并对统计到的缺失个数赋予对应的时间戳,构造数据质量序列。The number of missing smart meter data is counted according to the timestamp, and the corresponding timestamp is assigned to the counted missing number to construct a data quality sequence.

进一步的,构造日期类型序列的方法包括如下步骤:Further, the method for constructing a date type sequence includes the following steps:

根据每一个自然天的工作日或节假日属性,给予自然天每个小时一个的日期类型数据,构造日期类型序列。According to the working day or holiday attribute of each natural day, one date type data is given for each hour of the natural day, and a date type sequence is constructed.

进一步的,数据归一化处理采用以下分类归一化的方式;Further, the data normalization processing adopts the following classification normalization methods;

电压数据的归一化方式如下:The voltage data is normalized as follows:

Figure BDA0002622717350000031
Figure BDA0002622717350000031

电流数据的归一化方式如下:The current data is normalized as follows:

Figure BDA0002622717350000041
Figure BDA0002622717350000041

总有功功率的归一化方式如下:The total active power is normalized as follows:

Figure BDA0002622717350000042
Figure BDA0002622717350000042

数据质量的归一化方式如下:Data quality is normalized as follows:

Figure BDA0002622717350000043
Figure BDA0002622717350000043

进一步的,异常用电检测模型的训练方法包括如下步骤:Further, the training method of the abnormal electricity consumption detection model includes the following steps:

获取正常用电和异常用电案例的智能电表数据,将智能电表数据转换为多时间序列数据样本;Obtain smart meter data of normal and abnormal electricity consumption cases, and convert smart meter data into multi-time series data samples;

对多时间序列数据样本进行用电类型标签的标定,并划分为训练样本集和验证样本集;The multi-time series data samples are calibrated by electricity type labels, and divided into training sample sets and verification sample sets;

从训练样本集中随机采样一批数据样本,输入深度混合神经网络,计算损失并优化深度混合神经网络参数;Randomly sample a batch of data samples from the training sample set, input them into the deep hybrid neural network, calculate the loss and optimize the parameters of the deep hybrid neural network;

利用参数优化的深度混合神经网络遍历整个训练样本集,完成一轮训练;Use the parameter-optimized deep hybrid neural network to traverse the entire training sample set to complete a round of training;

每一轮训练结束后,利用验证样本集对深度混合神经网络的训练效果进行评估,并保存异常用电检测模型快照;After each round of training, use the verification sample set to evaluate the training effect of the deep hybrid neural network, and save a snapshot of the abnormal electricity consumption detection model;

重复训练以达到预先设定的轮数,使深度混合神经网络的损失趋于平稳,并结束训练;Repeat the training to reach a preset number of epochs, make the loss of the deep hybrid neural network level off, and end the training;

根据每一轮训练后的评估结果,确定训练好的异常用电检测模型。According to the evaluation results after each round of training, the trained abnormal electricity consumption detection model is determined.

进一步的,所述用电类型标签的获取方法包括如下步骤:Further, the method for obtaining the electricity consumption type label includes the following steps:

提取智能电表数据的局部特征;Extract local features of smart meter data;

提取智能电表数据的全局特征;Extract global features of smart meter data;

将局部特征和全局特征进行拼接合并,并转换为用电类型的标签。The local features and global features are concatenated and merged, and converted into labels of electricity consumption types.

进一步的,所述多时间序列数据的数据结构序列依次包括A相电压、B相电压、C相电压、A相电流、B相电流、C相电流、总有功功率、总功率因数、数据质量和日期类型。Further, the data structure sequence of the multi-time-series data sequentially includes A-phase voltage, B-phase voltage, C-phase voltage, A-phase current, B-phase current, C-phase current, total active power, total power factor, data quality and Date type.

第二方面:Second aspect:

一种异常用电检测系统,所述系统包括如下模块:An abnormal power consumption detection system, the system includes the following modules:

数据获取模块,用于获取待检测的智能电表数据;The data acquisition module is used to acquire the data of the smart meter to be detected;

数据转换模块,用于将智能电表数据转换为多时间序列数据;Data conversion module for converting smart meter data into multi-time series data;

异常用电检测模型,用于根据所输入的多时间序列数据获得预测的用电类型标签;The abnormal electricity consumption detection model is used to obtain the predicted electricity consumption type label according to the input multi-time series data;

检测输出模块,用于将预测的用电类型标签中概率最大的用电类型作为待检测的智能电表数据的异常用电检测结果。The detection output module is used for taking the electricity consumption type with the highest probability in the predicted electricity consumption type label as the abnormal electricity consumption detection result of the smart meter data to be detected.

进一步的,所述异常用电检测模型采用深度混合神经网络,所述深度混合神经网络包括局部特征网络、全局特征网络以及分类网络;Further, the abnormal power consumption detection model adopts a deep hybrid neural network, and the deep hybrid neural network includes a local feature network, a global feature network and a classification network;

所述局部特征网络,用于提取智能电表数据的局部特征;The local feature network is used to extract local features of smart meter data;

所述全局特征网络,用于提取智能电表数据的全局特征;The global feature network is used to extract global features of smart meter data;

所述分类网络,用于将局部特征和全局特征进行拼接合并,并转换为用电类型的标签。The classification network is used for splicing and merging local features and global features, and converting them into labels of electricity consumption types.

进一步的,所述局部特征网络包括多个级联的一维卷积模块和一个Flatten层;Further, the local feature network includes a plurality of cascaded one-dimensional convolution modules and a Flatten layer;

所述一维卷积模块,用于学习并抽取智能电表数据的局部特征;所述Flatten层,用于将一维卷积模块抽取的局部特征展开输出为一维向量;The one-dimensional convolution module is used to learn and extract the local features of the smart meter data; the Flatten layer is used to expand and output the local features extracted by the one-dimensional convolution module into a one-dimensional vector;

所述一维卷积模块包括一维卷积层和一维平均池化层;The one-dimensional convolution module includes a one-dimensional convolution layer and a one-dimensional average pooling layer;

所述一维卷积层,用于使输出时间轴维度与输入时间轴维度保持一致;The one-dimensional convolution layer is used to keep the output time axis dimension consistent with the input time axis dimension;

所述一维平均池化层,用于采用平均算子对输入时间轴维度在时间轴上进行降维。The one-dimensional average pooling layer is used to reduce the dimension of the input time axis on the time axis by using the averaging operator.

进一步的,所述全局特征网络包括一个Flatten层和多个级联的全连接层;Further, the global feature network includes a Flatten layer and multiple cascaded fully connected layers;

所述Flatten层,用于将多时间序列的智能电表数据展开为一维向量;The Flatten layer is used to expand the multi-time series smart meter data into a one-dimensional vector;

所述全连接层,用于从全局特征网络的Flatten层输出的一维向量中学习并抽取智能电表数据的全局特征。The fully connected layer is used to learn and extract the global features of the smart meter data from the one-dimensional vector output by the Flatten layer of the global feature network.

进一步的,所述分类网络包括一个拼接层和多个级联的全连接层;Further, the classification network includes a splicing layer and a plurality of cascaded fully connected layers;

所述拼接层,用于将局部特征网络和全局特征网络输出的局部特征和全局特征拼接为一个一维特征向量,并输入多个堆叠的全连接层;The splicing layer is used for splicing the local features and global features output by the local feature network and the global feature network into a one-dimensional feature vector, and inputting multiple stacked fully connected layers;

所述全连接层,用于计算、输出正常用电和异常用电的类型标签。The fully connected layer is used to calculate and output the type labels of normal power consumption and abnormal power consumption.

第三方面:The third aspect:

一种异常用电检测系统,包括处理器及存储介质;An abnormal power consumption detection system, comprising a processor and a storage medium;

所述存储介质用于存储指令;the storage medium is used for storing instructions;

所述处理器用于根据所述指令进行操作以执行根据第一方面的任一项异常用电检测方法的步骤。The processor is configured to operate according to the instructions to perform the steps of any one of the abnormal power usage detection methods according to the first aspect.

第四方面:Fourth aspect:

计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时实现第一方面的任一项异常用电检测方法的步骤。A computer-readable storage medium on which a computer program is stored, and when the program is executed by a processor, implements the steps of any one of the abnormal power usage detection methods of the first aspect.

与现有技术相比,本发明所达到的有益效果:Compared with the prior art, the beneficial effects achieved by the present invention:

本发明提供了一种基于深度混合神经网络的异常用电检测方法,通过学习智能电表数据的局部特征和全局特征,更加全面地提取用电行为的高级特征,从而准确地识别异常用电行为,能够更好地保证异常用电检测性能的长期稳定性,以及在不同应用场景下的泛化能力;The invention provides an abnormal electricity consumption detection method based on a deep hybrid neural network. By learning the local features and global characteristics of the smart meter data, the advanced features of the electricity consumption behavior are more comprehensively extracted, so as to accurately identify the abnormal electricity consumption behavior. It can better ensure the long-term stability of abnormal power consumption detection performance and the generalization ability in different application scenarios;

采用多时间序列数据,以自然周为单位时间跨度,可以更好地描述用户用电行为的周期性;通过补充日期类型和数据质量,进一步丰富了数据样本的信息量,从而减少数据缺失对异常用电识别的干扰,改善工作日与节假日动态调整对异常用电检测的影响,保障异常用电检测性能更加稳定,降低误判率,提高电力公司的运营效率。The use of multi-time series data, with natural weeks as the unit time span, can better describe the periodicity of users' electricity consumption behavior; by supplementing date types and data quality, the information content of data samples is further enriched, thereby reducing data missing to anomalies The interference of electricity consumption identification can improve the influence of dynamic adjustment of working days and holidays on abnormal electricity consumption detection, ensure that the abnormal electricity consumption detection performance is more stable, reduce the misjudgment rate, and improve the operation efficiency of power companies.

附图说明Description of drawings

图1是本发明一种实施例提供的异常用电检测方法的流程图;1 is a flowchart of a method for detecting abnormal power consumption provided by an embodiment of the present invention;

图2是本发明一种实施例提供的多时间序列数据的构造流程图;2 is a flow chart of the construction of multi-time series data provided by an embodiment of the present invention;

图3是本发明一种实施例提供的多时间序列数据的结构示意图;3 is a schematic structural diagram of multi-time series data provided by an embodiment of the present invention;

图4是本发明一种实施例提供的异常用电检测模型的训练流程图;Fig. 4 is the training flow chart of the abnormal electricity consumption detection model provided by an embodiment of the present invention;

图5是本发明一种实施例提供的获取用电类型标签的流程图;5 is a flowchart of obtaining a power consumption type label provided by an embodiment of the present invention;

图6是本发明一种实施例提供的异常用电检测系统的框架示意图;6 is a schematic diagram of a framework of an abnormal power consumption detection system provided by an embodiment of the present invention;

图7是本发明一种实施例提供的异常用电检测模型的框架示意图;7 is a schematic diagram of a framework of an abnormal power consumption detection model provided by an embodiment of the present invention;

图8是本发明一种实施例提供的深度混合神经网络的结构示意图。FIG. 8 is a schematic structural diagram of a deep hybrid neural network provided by an embodiment of the present invention.

具体实施方式Detailed ways

下面结合附图对本发明作进一步描述。以下实施例仅用于更加清楚地说明本发明的技术方案,而不能以此来限制本发明的保护范围。The present invention will be further described below in conjunction with the accompanying drawings. The following examples are only used to illustrate the technical solutions of the present invention more clearly, and cannot be used to limit the protection scope of the present invention.

实施例一:Example 1:

如图1所示,基于高效、准确地检测异常用电和智能电网运维与发展的需求,本发明实施例提供了一种异常用电检测方法,该方法包括如下步骤:As shown in FIG. 1 , based on the requirements of efficiently and accurately detecting abnormal power consumption and smart grid operation, maintenance and development, an embodiment of the present invention provides a method for detecting abnormal power consumption, which includes the following steps:

步骤101,获取待检测的智能电表数据;Step 101, acquiring smart meter data to be detected;

步骤102,将智能电表数据转换为多时间序列数据;Step 102, converting smart meter data into multi-time series data;

步骤103,将多时间序列数据输入训练好的异常用电检测模型,获得预测的用电类型标签;Step 103, input the multi-time series data into the trained abnormal electricity consumption detection model to obtain the predicted electricity consumption type label;

步骤104,将预测的用电类型标签中概率最大的用电类型识别作为待检测的智能电表数据的异常用电检测结果。Step 104 , identifying the electricity consumption type with the highest probability in the predicted electricity consumption type label as the abnormal electricity consumption detection result of the smart meter data to be detected.

现代智能电网采集海量的智能电表数据,这些数据具有规模大、纬度高、类型繁多等特点。针对智能电表数据特点,为了提高电网智能电表数据质量,本发明实施例提供了图2所示的一种多时间序列数据的构造方法,即将智能电表数据转换为多时间序列数据的方法,具体包括如下步骤:Modern smart grids collect massive amounts of smart meter data, which are characterized by large scale, high latitude, and various types. In view of the data characteristics of smart meters, in order to improve the data quality of smart meters in the power grid, the embodiment of the present invention provides a method for constructing multi-time series data as shown in FIG. Follow the steps below:

步骤201,获取智能电表数据,并将智能电表数据转换成包括A相电压、B相电压、C相电压、A相电流、B相电流、C相电流、总有功功率、总功率因数等8个时间序列的多时间序列数据;Step 201: Acquire smart meter data, and convert the smart meter data into eight items including A-phase voltage, B-phase voltage, C-phase voltage, A-phase current, B-phase current, C-phase current, total active power, and total power factor. Time series multi-time series data;

步骤202,统计每个时间戳对应的A相电压、B相电压、C相电压、A相电流、B相电流、C相电流、总有功功率、总功率因数中的缺失个数;其中,数据质量的数值,最低为0,代表数据完整;最高为8,代表数据全部缺失;Step 202: Count the number of missing items in the A-phase voltage, B-phase voltage, C-phase voltage, A-phase current, B-phase current, C-phase current, total active power, and total power factor corresponding to each time stamp; The value of quality, the lowest is 0, which means the data is complete; the highest is 8, which means that all data are missing;

步骤203,对步骤202统计到的缺失个数赋予对应的时间戳,构造数据质量序列;数据质量序列代表每一个时间戳对应的A相电压、B相电压、C相电压、A相电流、B相电流、C相电流、总有功功率和总功率因数等数据项中缺失的个数;Step 203, assign a corresponding time stamp to the missing number counted in step 202, and construct a data quality sequence; the data quality sequence represents the A-phase voltage, B-phase voltage, C-phase voltage, A-phase current, B-phase voltage corresponding to each time stamp The number of missing data items such as phase current, C-phase current, total active power and total power factor;

步骤204,根据每一各自然天的工作日或节假日属性,给予该天每个小时一个的日期类型数据,构造日期类型序列;日期类型数值为:工作日为0,节假日为1;其中,同一天的日期类型数据内容相同;Step 204: According to the attributes of working days or holidays of each natural day, one date type data per hour of the day is given, and a date type sequence is constructed; The date type data content of day is the same;

步骤205,将步骤203和步骤204构造出的数据质量序列和日期类型序列,按照时间戳附加到智能电表数据序列,使生成的新智能电表数据序列包括:A相电压、B相电压、C相电压、A相电流、B相电流、C相电流、总有功功率、总功率因数、数据质量和日期类型等10个时间序列;通过增加数据质量和日期类型,进一步丰富了数据样本的信息量,可以改善工作日与节假日动态调整对异常用电检测的影响;Step 205: Add the data quality sequence and date type sequence constructed in steps 203 and 204 to the smart meter data sequence according to the time stamp, so that the generated new smart meter data sequence includes: phase A voltage, phase B voltage, phase C 10 time series such as voltage, A-phase current, B-phase current, C-phase current, total active power, total power factor, data quality and date type; by adding data quality and date type, the information content of data samples is further enriched, It can improve the influence of dynamic adjustment of working days and holidays on the detection of abnormal electricity consumption;

步骤206,基于缺失值邻近的数据,利用线性插值法填充缺失的数据项,可以降低数据缺失对异常用电识别的干扰;In step 206, based on the data adjacent to the missing value, the missing data items are filled by the linear interpolation method, which can reduce the interference of the missing data on the identification of abnormal electricity consumption;

步骤207,按照自然周分割新的智能电表数据序列,形成以自然周为时间跨度的智能电表数据样本;以自然周为单位时间跨度,可以更好地描述用户用电行为的周期性;Step 207, dividing the new smart meter data sequence according to the natural week, to form a smart meter data sample with the natural week as the time span; with the natural week as the unit time span, the periodicity of the user's electricity consumption behavior can be better described;

步骤208,按照数据类型对智能电表数据样本进行归一化;其中,三相电压数据的归一化方式如下:Step 208 , normalize the smart meter data samples according to the data type; wherein, the normalization method of the three-phase voltage data is as follows:

Figure BDA0002622717350000091
Figure BDA0002622717350000091

其中,三相电流数据的归一化方式如下:Among them, the normalization method of the three-phase current data is as follows:

Figure BDA0002622717350000092
Figure BDA0002622717350000092

其中,总有功功率的归一化方式如下:Among them, the normalization of the total active power is as follows:

Figure BDA0002622717350000101
Figure BDA0002622717350000101

其中,总功率因数的标准范围已介于[0,1]之间,故无需归一化处理;Among them, the standard range of the total power factor is already between [0, 1], so there is no need for normalization;

其中,数据质量的归一化方式如下:Among them, the normalization method of data quality is as follows:

Figure BDA0002622717350000102
Figure BDA0002622717350000102

其中,日期类型数据的数值仅包括0和1,故无需归一化处理。Among them, the value of date type data only includes 0 and 1, so no normalization is required.

具体地,如图3所示,本发明实施例提供了的一种多通道时间序列数据结构,该数据结构包括:A相电压、B相电压、C相电压、A相电流、B相电流、C相电流、总有功功率、总功率因数、数据质量和日期类型等10个时间序列;其中,数据采集频率为1个数据/小时,且各个通道的时间戳是严格对齐的;通过补充日期类型和数据质量,进一步丰富了数据样本的信息量。Specifically, as shown in FIG. 3, an embodiment of the present invention provides a multi-channel time series data structure, the data structure includes: A-phase voltage, B-phase voltage, C-phase voltage, A-phase current, B-phase current, 10 time series such as C-phase current, total active power, total power factor, data quality and date type; among them, the data collection frequency is 1 data/hour, and the timestamps of each channel are strictly aligned; by supplementing the date type and data quality, further enriching the information of the data samples.

如图3所示,多通道时间序列按照如下顺序排列:A相电压、B相电压、C相电压、A相电流、B相电流、C相电流、总有功功率、总功率因数、数据质量和日期类型。其中,多通道时间序列数据样本结构的时间跨度为一个自然周,起于周一0点,止于周日23点。As shown in Figure 3, the multi-channel time series are arranged in the following order: A-phase voltage, B-phase voltage, C-phase voltage, A-phase current, B-phase current, C-phase current, total active power, total power factor, data quality and Date type. Among them, the time span of the multi-channel time series data sample structure is a natural week, starting at 0:00 on Monday and ending at 23:00 on Sunday.

具体地,如图4所示,为提高异常用电检测模型的稳定性和可靠性,本发明实施例提供了的一种异常用电检测模型的训练方法,具体包括如下步骤:Specifically, as shown in FIG. 4 , in order to improve the stability and reliability of the abnormal electricity consumption detection model, an embodiment of the present invention provides a training method for the abnormal electricity consumption detection model, which specifically includes the following steps:

步骤401,获取正常用电和异常用电案例的智能电表数据,按照图2所示的多时间序列数据构造方法,将获取的智能电表数据转换为多时间序列数据样本;Step 401: Acquire smart meter data of normal electricity consumption and abnormal electricity consumption cases, and convert the acquired smart electricity meter data into multi-time series data samples according to the multi-time-series data construction method shown in FIG. 2;

步骤402,根据多时间序列数据样本所属的用户用电类型,赋予多时间序列数据样本用电类型标签,其中,正常用电样本为0,异常用电样本为1;对所有标定了用电类型标签的多时间序列数据样本按照一定的比例划分为训练样本集和验证样本集;作为本发明的一种实施例,训练样本集和验证样本集的划分比例可为7比3;Step 402: Assign a label of the electricity consumption type to the multi-time-series data sample according to the user's electricity consumption type to which the multi-time-series data sample belongs, wherein the normal electricity consumption sample is 0, and the abnormal electricity consumption sample is 1; The labeled multi-time-series data samples are divided into a training sample set and a verification sample set according to a certain ratio; as an embodiment of the present invention, the division ratio of the training sample set and the verification sample set may be 7:3;

步骤403,从训练样本集中随机采样一批多时间序列数据样本,并获取样本数据及其类型标签,按照one-hot方式对标签进行编码,其中,作为本发明的一种实施例,随机采样的样本批大小可为200;Step 403: Randomly sample a batch of multi-time-series data samples from the training sample set, obtain sample data and their type labels, and encode the labels in a one-hot manner. The sample batch size can be 200;

步骤404,以多类别交叉熵为损失函数,采用Adam优化器计算混合神经网络各个参数的梯度,并按设定学习率,利用后向传播算法更新混合神经网络的参数,其中,作为本发明的一种实施例,学习率可设定为0.001;Step 404, using the multi-category cross entropy as the loss function, using the Adam optimizer to calculate the gradient of each parameter of the hybrid neural network, and using the back propagation algorithm to update the parameters of the hybrid neural network according to the set learning rate. In one embodiment, the learning rate can be set to 0.001;

步骤405,如果已遍历训练样本集中所有数据样本,执行步骤406,否则执行步骤403;Step 405, if all data samples in the training sample set have been traversed, go to Step 406, otherwise go to Step 403;

步骤406,用深度混合神经网络模型预测样本集中的所有样本的标签,并利用真实标签计算异常用电类别的AUC分数,对深度混合神经网络的训练效果进行评估;其中,AUC分数(Area Under ROC)的ROC(Receiver Operating Characteristic)为受试者工作特征曲线,是一种在不平衡数据集上验证分类器性能的流行方法;Step 406, use the deep hybrid neural network model to predict the labels of all samples in the sample set, and use the real labels to calculate the AUC score of the abnormal electricity consumption category, and evaluate the training effect of the deep hybrid neural network; wherein, the AUC score (Area Under ROC The ROC (Receiver Operating Characteristic) of ) is the receiver operating characteristic curve, which is a popular method to verify the performance of classifiers on imbalanced datasets;

步骤407,如果异常用电类别AUC分数为所有已完成训练轮次中最高,执行步骤408,否则执行步骤409;Step 407, if the abnormal power consumption category AUC score is the highest among all completed training rounds, go to step 408, otherwise go to step 409;

步骤408,保存深度混合神经网络模型为快照文件,如果快照文件已存在,则用最新的快照文件覆盖已存在的快照文件,继续执行步骤409;Step 408, save the deep hybrid neural network model as a snapshot file, if the snapshot file already exists, overwrite the existing snapshot file with the latest snapshot file, and proceed to step 409;

步骤409,如果训练轮数已达预设最大训练轮数,执行步骤410,否则执行步骤403,其中,作为本发明的一种实施例,最大训练轮数可选为50;In step 409, if the number of training rounds has reached the preset maximum number of training rounds, step 410 is performed, otherwise, step 403 is performed, wherein, as an embodiment of the present invention, the maximum number of training rounds can be selected as 50;

步骤410,结束训练,将保存的最优快照文件作为训练好的异常用电检测模型。Step 410: End the training, and use the saved optimal snapshot file as the trained abnormal electricity consumption detection model.

经训练好的异常用电检测模型通过学习智能电表数据的局部特征和全局特征,更加全面地提取用电行为的高级特征,具有较高的异常用电评价效率和较高的异常用电检测准确率,从而节约了大量的人力物力等资源。The trained abnormal electricity consumption detection model can extract the advanced features of electricity consumption behavior more comprehensively by learning the local and global features of smart meter data, and has higher abnormal electricity consumption evaluation efficiency and higher abnormal electricity consumption detection accuracy. rate, thereby saving a lot of human and material resources and other resources.

具体地,如图5所示,本发明实施例提供了一种用电类型标签的获取方法,具体包括如下步骤:Specifically, as shown in FIG. 5 , an embodiment of the present invention provides a method for obtaining a power consumption type label, which specifically includes the following steps:

步骤501,提取智能电表数据的局部特征;Step 501, extracting local features of smart meter data;

步骤502,提取智能电表数据的全局特征;Step 502, extracting global features of smart meter data;

步骤503,将局部特征和全局特征进行拼接合并,并转换为用电类型的标签。Step 503, splicing and merging the local features and the global features, and converting them into labels of electricity consumption types.

需要说明的是,用电类型标签获取过程中,对于智能电表数据的局部特征和全局特征的提取没有严格的先后顺序的限制,只要能够顺利提取相关特征即可。It should be noted that, in the process of obtaining electricity type labels, there is no strict sequence restriction on the extraction of local features and global features of smart meter data, as long as the relevant features can be successfully extracted.

由上可知,本发明实施例提供异常用电检测方法可以更加全面地提取用电行为的高级特征(局部特征和全局特征),能够降低数据缺失对异常用电识别的干扰,改善工作日与节假日动态调整对异常用电检测的影响,保障异常用电检测性能更加稳定,降低误判率,提高电力公司的运营效率以及在不同应用场景下的泛化能力。From the above, it can be seen that the abnormal power consumption detection method provided in the embodiment of the present invention can more comprehensively extract the advanced features (local features and global features) of the power consumption behavior, can reduce the interference of data missing on the identification of abnormal power consumption, and improve the working days and holidays. The impact of dynamic adjustment on abnormal power consumption detection ensures that the abnormal power consumption detection performance is more stable, reduces the misjudgment rate, and improves the operation efficiency of power companies and the generalization ability in different application scenarios.

实施例二:Embodiment 2:

如图6所示,本发明的实施例提供了一种异常用电检测系统,该异常用电检测系统,包括如下模块:As shown in FIG. 6 , an embodiment of the present invention provides an abnormal power consumption detection system, and the abnormal power consumption detection system includes the following modules:

数据获取模块,用于获取待检测的智能电表数据;The data acquisition module is used to acquire the data of the smart meter to be detected;

数据转换模块,用于将智能电表数据转换为多时间序列数据;Data conversion module for converting smart meter data into multi-time series data;

异常用电检测模型,用于根据所输入的多时间序列数据获得预测的用电类型标签;The abnormal electricity consumption detection model is used to obtain the predicted electricity consumption type label according to the input multi-time series data;

检测输出模块,用于将预测的用电类型标签中概率最大的用电类型作为待检测的智能电表数据的异常用电检测结果。The detection output module is used for taking the electricity consumption type with the highest probability in the predicted electricity consumption type label as the abnormal electricity consumption detection result of the smart meter data to be detected.

具体地,如图7和8所示,异常用电检测系统的异常用电检测模型采用深度混合神经网络,其中,深度混合神经网络包括局部特征网络、全局特征网络以及分类网络;Specifically, as shown in Figures 7 and 8, the abnormal power consumption detection model of the abnormal power consumption detection system adopts a deep hybrid neural network, wherein the deep hybrid neural network includes a local feature network, a global feature network and a classification network;

其中,局部特征网络用于提取智能电表数据的局部特征;全局特征网络用于提取智能电表数据的局部特征;分类网络用于将局部特征和全局特征进行拼接合并,并转换为用电类型的标签。Among them, the local feature network is used to extract the local features of the smart meter data; the global feature network is used to extract the local features of the smart meter data; the classification network is used to splicing and merging the local features and global features, and converting them into labels of electricity consumption types .

具体地,局部特征网络基于多个级联的一维卷积模块,沿时间轴处理智能电表数据,利用一维卷积单元的局部感受特性,学习并抽取智能电表数据的局部特征;输出前用Flatten层将一维卷积模块输出的局部特征展开为一维向量。其中,一维卷积模块包括一维卷积层和一维平均池化层,一维卷积层输出的时间轴维度与输入保持一致,一维平均池化层采用平均算子对输入在时间轴上进行降维。Specifically, the local feature network is based on multiple cascaded one-dimensional convolution modules, processes smart meter data along the time axis, and uses the local perception characteristics of one-dimensional convolution units to learn and extract local features of smart meter data; The Flatten layer expands the local features output by the one-dimensional convolution module into a one-dimensional vector. Among them, the one-dimensional convolution module includes a one-dimensional convolution layer and a one-dimensional average pooling layer. The time axis dimension of the output of the one-dimensional convolution layer is consistent with the input. dimensionality reduction on the axis.

如图8所示,在本实施例中,局部特征网络包含3个级联的1维卷积模块和一个Flatten层。其中,1维卷积模块1的1维卷积层-1的卷积核尺寸为1*5,滤波器数为16,1维平均池化层-1的池化核尺寸为1*4;1维卷积模块2的1维卷积层-2的卷积核尺寸为1*3,滤波器数为32,1维平均池化层-2的池化核尺寸为1*3;1维卷积模块3的1维卷积层-3的卷积核尺寸为1*3,滤波器数为64,1维平均池化层-3的池化核尺寸为1*2;并且3个1维卷积层的激活函数均为ReLU。As shown in Figure 8, in this embodiment, the local feature network includes three cascaded 1-D convolution modules and one Flatten layer. Among them, the size of the convolution kernel of the 1-dimensional convolution layer-1 of the 1-dimensional convolution module 1 is 1*5, the number of filters is 16, and the size of the pooling kernel of the 1-dimensional average pooling layer-1 is 1*4; The size of the convolution kernel of the 1D convolution layer-2 of the 1D convolution module 2 is 1*3, the number of filters is 32, and the size of the pooling kernel of the 1D average pooling layer-2 is 1*3; The convolution kernel size of the 1D convolution layer-3 of the convolution module 3 is 1*3, the number of filters is 64, and the pooling kernel size of the 1D average pooling layer-3 is 1*2; and three 1s The activation functions of the dimensional convolutional layers are all ReLUs.

具体地,全局特征网络包括一个Flatten层和多个级联的全连接层。首先由Flatten层将多时间序列的智能电表数据展开为一维向量,然后输入堆叠的全连接层,利用全连接层的每个神经元都与输入相连接的特性,学习并抽取智能电表数据的全局特征。Specifically, the global feature network includes a Flatten layer and multiple cascaded fully connected layers. First, the multi-time series smart meter data is expanded into a one-dimensional vector by the Flatten layer, and then input to the stacked fully connected layer, using the feature that each neuron of the fully connected layer is connected to the input, to learn and extract the smart meter data. global features.

如图8所示,在本实施例中,全局特征网络包含一个Flatten层和2个级联的全连接层。其中,全连接层-1的神经元个数均为1000和全连接层-2的神经元个数为500;并且2个全连接层的激活函数均为ReLU。As shown in FIG. 8 , in this embodiment, the global feature network includes one Flatten layer and two cascaded fully connected layers. Among them, the number of neurons in the fully connected layer-1 is 1000 and the number of neurons in the fully connected layer-2 is 500; and the activation functions of the two fully connected layers are ReLU.

具体地,分类网络由一个拼接层和和多个级联的全连接层组成。其中,拼接层将局部特征网络和全局特征网络输出的局部特征和全局特征拼接为一个更大的一维特征向量,然后输入多个堆叠的全连接层,最终计算、输出正常用电和异常用电的类型标签,以及获得各类型标签的概率。Specifically, the classification network consists of a concatenation layer and multiple cascaded fully connected layers. Among them, the splicing layer splices the local features and global features output by the local feature network and the global feature network into a larger one-dimensional feature vector, and then inputs multiple stacked fully connected layers, and finally calculates and outputs normal power consumption and abnormal power consumption. Type labels of electricity, and the probability of obtaining each type of label.

如图8所示,在本实施例中,分类网络包含一个拼接层和和2个级联的全连接层。其中,全连接层-3的神经元个数均为1000和全连接层-4的神经元个数为100。全连接层-3的激活函数为ReLU,全连接层-4的激活函数为Softmax。As shown in FIG. 8 , in this embodiment, the classification network includes a splicing layer and two cascaded fully connected layers. Among them, the number of neurons in the fully connected layer-3 is 1000 and the number of neurons in the fully connected layer-4 is 100. The activation function of the fully connected layer-3 is ReLU, and the activation function of the fully connected layer-4 is Softmax.

由上可知,除分类网络的最后一个全连接层的激活函数为Softmax函数外,其余所有网络的一维卷积层和全连接层的激活函数均为ReLU函数。It can be seen from the above that except the activation function of the last fully connected layer of the classification network is the Softmax function, the activation functions of the one-dimensional convolutional layer and the fully connected layer of all other networks are ReLU functions.

本发明实施例提供的异常用电检测系统及其异常用电检测模型能够学习智能电表数据的局部特征和全局特征,更加全面地提取用电行为的高级特征,从而准确地识别异常用电行为,能够更好地保证异常用电检测性能的长期稳定性,以及在不同应用场景下的泛化能力。The abnormal power consumption detection system and its abnormal power consumption detection model provided by the embodiments of the present invention can learn the local and global features of the smart meter data, and more comprehensively extract the high-level features of the power consumption behavior, so as to accurately identify the abnormal power consumption behavior. It can better ensure the long-term stability of abnormal power consumption detection performance and the generalization ability in different application scenarios.

实施例三:Embodiment three:

以下通过具体的实验实例,来对本发明提供的异常用电检测方法进行说明:The abnormal electricity detection method provided by the present invention is described below through specific experimental examples:

利用某省电力公司461个三相四线10kV用户的智能电表数据作为案例,进行了训练和验证。Using the smart meter data of 461 three-phase four-wire 10kV users in a provincial power company as a case, training and verification are carried out.

采用本发明提供的如图1的异常用电检测方法获取智能电表数据,并转换为多时间序列数据的形式;每个用户的数据采集频率均为96个采集点/天,每个数据采集点包括A相电压、B相电压、C相电压、A相电流、B相电流、C相电流、总有功功率、总功率因数等八项数据。The smart meter data is acquired by the abnormal power consumption detection method as shown in FIG. 1 provided by the present invention, and converted into the form of multi-time series data; the data collection frequency of each user is 96 collection points/day, and each data collection point Including A-phase voltage, B-phase voltage, C-phase voltage, A-phase current, B-phase current, C-phase current, total active power, total power factor and other eight data.

采用本发明提供的如图2的数据样本构造方法获得如图3所示的数据样本结构,对数据进行降采样,频率变为24个采集点/天,数据项不变;将所有用户的数据进行分割后,共获得51289个样本,其中35506个正常用电样本,15783个异常用电样本。The data sample structure shown in FIG. 3 is obtained by the data sample construction method as shown in FIG. 2 provided by the present invention, and the data is down-sampled, the frequency is changed to 24 collection points/day, and the data items are unchanged; After segmentation, a total of 51,289 samples were obtained, including 35,506 samples of normal power consumption and 15,783 samples of abnormal power consumption.

采用如图8所示深度混合神经网络的结构,按照如图4的训练方法进行检测模型训练,其中,训练的样本批大小为200个样本/批,学习率固定为0.001,优化器为Adam,训练轮次为50轮,从而获得训练好的异常用电检测模型。Using the structure of the deep hybrid neural network shown in Figure 8, the detection model is trained according to the training method shown in Figure 4. The training sample batch size is 200 samples/batch, the learning rate is fixed at 0.001, and the optimizer is Adam, The training round is 50 rounds, so as to obtain the trained abnormal electricity consumption detection model.

对本发明提供的如图7所示的异常用电检测模型进行了5折交叉验证,每一折的训练样本和测试样本分类别按正常用电类别和异常用电类别的80%和20%划分。本发明提供的异常用电检测模型的5折交叉验证性能如下表所示:Five-fold cross-validation is performed on the abnormal electricity consumption detection model provided by the present invention as shown in Figure 7, and the training samples and test samples of each fold are classified according to 80% and 20% of the normal electricity consumption category and the abnormal electricity consumption category. . The five-fold cross-validation performance of the abnormal power consumption detection model provided by the present invention is shown in the following table:

Figure BDA0002622717350000151
Figure BDA0002622717350000151

从上表的结果可知,采用实施例一的异常用电检测方法和实施例二的异常用电检测系统所进行的异常用电检测结果具有较好的异常用电识别准确率,且在5折交叉验证实验中表现出识别性能的稳定性,总体上获得了较好的效果。It can be seen from the results in the above table that the abnormal power consumption detection results using the abnormal power consumption detection method of the first embodiment and the abnormal power consumption detection system of the second embodiment have better abnormal power consumption identification accuracy, and the In the cross-validation experiments, the stability of the recognition performance is shown, and generally good results are obtained.

实施例四:Embodiment 4:

本发明实施例提供了一种异常用电检测系统,包括处理器及存储介质;An embodiment of the present invention provides an abnormal power consumption detection system, including a processor and a storage medium;

所述存储介质用于存储指令;the storage medium is used for storing instructions;

所述处理器用于根据所述指令进行操作以执行根据实施例一的任一项异常用电检测方法的步骤。The processor is configured to operate according to the instruction to execute the steps of any one of the abnormal power consumption detection methods according to Embodiment 1.

实施例五:Embodiment 5:

本发明实施例提供了一种计算机可读存储介质,其上存储有计算机程序,该程序被处理器执行时实现实施例一的任一项异常用电检测方法的步骤。An embodiment of the present invention provides a computer-readable storage medium on which a computer program is stored, and when the program is executed by a processor, implements the steps of any one of the abnormal power consumption detection methods of the first embodiment.

本领域内的技术人员应明白,本申请的实施例可提供为方法、系统、或计算机程序产品。因此,本申请可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本申请可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。As will be appreciated by those skilled in the art, the embodiments of the present application may be provided as a method, a system, or a computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.

本申请是参照根据本申请实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the present application. It will be understood that each flow and/or block in the flowchart illustrations and/or block diagrams, and combinations of flows and/or blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to the processor of a general purpose computer, special purpose computer, embedded processor or other programmable data processing device to produce a machine such that the instructions executed by the processor of the computer or other programmable data processing device produce Means for implementing the functions specified in a flow or flow of a flowchart and/or a block or blocks of a block diagram.

这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。These computer program instructions may also be stored in a computer readable memory capable of directing a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer readable memory result in an article of manufacture comprising instruction means, the instructions The apparatus implements the functions specified in the flow or flow of the flowcharts and/or the block or blocks of the block diagrams.

这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。These computer program instructions can also be loaded on a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer-implemented process such that The instructions provide steps for implementing the functions specified in the flow or blocks of the flowcharts and/or the block or blocks of the block diagrams.

以上所述仅是本发明的优选实施方式,应当指出,对于本技术领域的普通技术人员来说,在不脱离本发明技术原理的前提下,还可以做出若干改进和变形,这些改进和变形也应视为本发明的保护范围。The above are only the preferred embodiments of the present invention. It should be pointed out that for those skilled in the art, without departing from the technical principle of the present invention, several improvements and modifications can also be made. These improvements and modifications It should also be regarded as the protection scope of the present invention.

Claims (15)

1. An abnormal electricity consumption detection method, characterized by comprising the steps of:
acquiring data of the intelligent ammeter to be detected;
converting the data of the intelligent electric meter into multi-time sequence data;
inputting the multi-time sequence data into a trained abnormal electricity utilization detection model to obtain a predicted electricity utilization type label;
and taking the power utilization type with the highest probability in the predicted power utilization type labels as an abnormal power utilization detection result of the data of the intelligent electric meter to be detected.
2. The abnormal electricity utilization detection method according to claim 1, wherein the method for converting the smart meter data into the multi-time series data comprises the steps of:
converting the data of the intelligent electric meter into a multi-time sequence data form, and constructing and attaching a data quality sequence and a date type sequence;
filling missing data into the obtained sequence data, dividing the data according to a natural circumference, and constructing the data into multi-time sequence data;
and carrying out independent data normalization processing on the multi-time sequence data.
3. The abnormal electricity utilization detection method according to claim 2, wherein the method of constructing the data quality sequence comprises the steps of:
and counting the missing number of the data of the intelligent electric meter according to the time stamp, endowing the counted missing number with the corresponding time stamp, and constructing a data quality sequence.
4. The abnormal electricity usage detection method according to claim 2, wherein the method of constructing a date type sequence includes the steps of:
and according to the attribute of the working day or the holiday of each natural day, giving one-per-hour date type data to the natural day to construct a date type sequence.
5. The abnormal electricity utilization detection method according to claim 2, wherein the data normalization processing is performed in a classified normalization manner;
the voltage data were normalized as follows:
Figure FDA0002622717340000021
the current data were normalized as follows:
Figure FDA0002622717340000022
the normalization of the total active power is as follows:
Figure FDA0002622717340000023
the data quality was normalized as follows:
Figure FDA0002622717340000024
6. the abnormal electricity usage detection method according to claim 1, wherein the training method of the abnormal electricity usage detection model includes the steps of:
acquiring intelligent electric meter data of normal electricity utilization cases and abnormal electricity utilization cases, and converting the intelligent electric meter data into multi-time sequence data samples;
calibrating the electricity type label of the multi-time sequence data sample, and dividing the electricity type label into a training sample set and a verification sample set;
randomly sampling a batch of data samples from a training sample set, inputting the data samples into a deep hybrid neural network, calculating loss and optimizing parameters of the deep hybrid neural network;
traversing the whole training sample set by using a parameter optimized deep hybrid neural network to complete a round of training;
after each training round is finished, evaluating the training effect of the deep hybrid neural network by using the verification sample set, and storing the abnormal power utilization detection model snapshot;
repeating the training to reach the preset number of rounds, so that the loss of the deep hybrid neural network tends to be stable, and finishing the training;
and determining the trained abnormal electricity utilization detection model according to the evaluation result after each round of training.
7. The abnormal electricity usage detection method according to claim 1, wherein the electricity usage type tag acquisition method includes the steps of:
extracting local features of the data of the intelligent electric meter;
extracting global features of the data of the intelligent electric meter;
and splicing and combining the local features and the global features, and converting the local features and the global features into power utilization type labels.
8. The abnormal electricity usage detection method according to any one of claims 1 to 7, wherein the data structure sequence of the multi-time series data includes A-phase voltage, B-phase voltage, C-phase voltage, A-phase current, B-phase current, C-phase current, total active power, total power factor, data quality, and date type.
9. An abnormal electricity utilization detection system, characterized in that the system comprises the following modules:
the data acquisition module is used for acquiring data of the intelligent ammeter to be detected;
the data conversion module is used for converting the data of the intelligent electric meter into multi-time sequence data;
the abnormal electricity utilization detection model is used for obtaining a predicted electricity utilization type label according to the input multi-time sequence data;
and the detection output module is used for taking the electricity utilization type with the highest probability in the predicted electricity utilization type labels as an abnormal electricity utilization detection result of the data of the intelligent electric meter to be detected.
10. The abnormal electricity utilization detection system of claim 9, wherein the abnormal electricity utilization detection model employs a deep hybrid neural network, the deep hybrid neural network comprising a local feature network, a global feature network, and a classification network;
the local feature network is used for extracting local features of the data of the intelligent electric meter;
the global feature network is used for extracting global features of the data of the intelligent electric meter;
and the classification network is used for splicing and combining the local features and the global features and converting the local features and the global features into electricity utilization type labels.
11. The abnormal electricity utilization detection system according to claim 10, wherein the local feature network comprises a plurality of cascaded one-dimensional convolution modules and a Flatten layer;
the one-dimensional convolution module is used for learning and extracting local features of the data of the intelligent ammeter; the Flatten layer is used for expanding the local features extracted by the one-dimensional convolution module and outputting the local features as one-dimensional vectors;
the one-dimensional convolution module comprises a one-dimensional convolution layer and a one-dimensional average pooling layer;
the one-dimensional convolution layer is used for keeping the dimension of the output time axis consistent with the dimension of the input time axis;
and the one-dimensional average pooling layer is used for reducing the dimension of the input time axis on the time axis by adopting an average operator.
12. The abnormal electricity utilization detection system according to claim 10, wherein the global feature network comprises a scatter layer and a plurality of cascaded fully-connected layers;
the Flatten layer is used for unfolding the data of the intelligent electric meter with multiple time sequences into one-dimensional vectors;
and the full connection layer is used for learning and extracting the global features of the intelligent electric meter data from the one-dimensional vectors output by the Flatten layer of the global feature network.
13. The abnormal electricity usage detection system of claim 10, wherein the classification network includes a splice layer and a plurality of cascaded fully-connected layers;
the splicing layer is used for splicing the local features and the global features output by the local feature network and the global feature network into a one-dimensional feature vector and inputting the one-dimensional feature vector into a plurality of stacked full-connection layers;
and the full connection layer is used for calculating and outputting type labels of normal electricity utilization and abnormal electricity utilization.
14. An abnormal electricity utilization detection system is characterized by comprising a processor and a storage medium;
the storage medium is used for storing instructions;
the processor is configured to operate in accordance with the instructions to perform the steps of the method according to any one of claims 1 to 8.
15. Computer-readable storage medium, on which a computer program is stored which, when being executed by a processor, carries out the steps of the method according to any one of claims 1 to 8.
CN202010787989.0A 2020-08-07 2020-08-07 Abnormal electricity utilization detection method, system and storage medium Active CN111967512B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010787989.0A CN111967512B (en) 2020-08-07 2020-08-07 Abnormal electricity utilization detection method, system and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010787989.0A CN111967512B (en) 2020-08-07 2020-08-07 Abnormal electricity utilization detection method, system and storage medium

Publications (2)

Publication Number Publication Date
CN111967512A true CN111967512A (en) 2020-11-20
CN111967512B CN111967512B (en) 2022-08-19

Family

ID=73364876

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010787989.0A Active CN111967512B (en) 2020-08-07 2020-08-07 Abnormal electricity utilization detection method, system and storage medium

Country Status (1)

Country Link
CN (1) CN111967512B (en)

Cited By (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112200160A (en) * 2020-12-02 2021-01-08 成都信息工程大学 Direct-reading water meter reading recognition method based on deep learning
CN112633412A (en) * 2021-01-05 2021-04-09 南方电网深圳数字电网研究院有限公司 Abnormal electricity consumption detection method, equipment and storage medium
CN112798888A (en) * 2020-12-30 2021-05-14 中南大学 A non-invasive diagnosis method for faults of on-board electrical systems of unmanned trains
CN113011530A (en) * 2021-04-29 2021-06-22 国网新疆电力有限公司营销服务中心(资金集约中心、计量中心) Intelligent ammeter fault prediction method based on multi-classifier fusion
CN113033414A (en) * 2021-03-26 2021-06-25 深圳供电局有限公司 Power consumption data anomaly detection method and device, computer equipment and storage medium
CN113033089A (en) * 2021-03-23 2021-06-25 中国联合网络通信集团有限公司 Method and device for identifying abnormal power consumption user
CN113361608A (en) * 2021-06-08 2021-09-07 太原科技大学 Hidden electricity stealing detection method based on transverse pair bit sum and neural network
CN114240681A (en) * 2021-12-27 2022-03-25 杭州趣链科技有限公司 Abnormal behavior detection method, electronic device, and computer-readable storage medium
CN114295368A (en) * 2021-12-24 2022-04-08 江苏国科智能电气有限公司 Multi-channel fused wind power planetary gear box fault diagnosis method
CN114580467A (en) * 2022-02-22 2022-06-03 国网山东省电力公司信息通信公司 Power data anomaly detection method and system based on data enhancement and Tri-tracing
CN116150616A (en) * 2022-12-12 2023-05-23 东北电力大学 A method and system for abnormal electricity bill calculation
CN117313005A (en) * 2023-08-18 2023-12-29 北京智芯微电子科技有限公司 Abnormal data identification method, processing method, system, processor and storage medium
CN118656749A (en) * 2024-07-26 2024-09-17 东莞科达五金制品有限公司 Axis product database management method and system based on artificial intelligence

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108985330A (en) * 2018-06-13 2018-12-11 华中科技大学 A kind of autoencoder network and its training method abnormal use electric detection method and system
CN109034127A (en) * 2018-08-31 2018-12-18 中国电子科技集团公司第三十六研究所 A kind of frequency spectrum method for detecting abnormality, device and electronic equipment
CN110008276A (en) * 2019-04-26 2019-07-12 清湖光旭数据科技(北京)有限公司 A kind of method, device and equipment detecting ammeter exception

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108985330A (en) * 2018-06-13 2018-12-11 华中科技大学 A kind of autoencoder network and its training method abnormal use electric detection method and system
CN109034127A (en) * 2018-08-31 2018-12-18 中国电子科技集团公司第三十六研究所 A kind of frequency spectrum method for detecting abnormality, device and electronic equipment
CN110008276A (en) * 2019-04-26 2019-07-12 清湖光旭数据科技(北京)有限公司 A kind of method, device and equipment detecting ammeter exception

Cited By (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112200160A (en) * 2020-12-02 2021-01-08 成都信息工程大学 Direct-reading water meter reading recognition method based on deep learning
CN112798888A (en) * 2020-12-30 2021-05-14 中南大学 A non-invasive diagnosis method for faults of on-board electrical systems of unmanned trains
CN112798888B (en) * 2020-12-30 2021-12-17 中南大学 A non-invasive diagnosis method for faults of on-board electrical systems of unmanned trains
CN112633412B (en) * 2021-01-05 2024-05-14 南方电网数字平台科技(广东)有限公司 Abnormal electricity utilization detection method, abnormal electricity utilization detection equipment and storage medium
CN112633412A (en) * 2021-01-05 2021-04-09 南方电网深圳数字电网研究院有限公司 Abnormal electricity consumption detection method, equipment and storage medium
CN113033089A (en) * 2021-03-23 2021-06-25 中国联合网络通信集团有限公司 Method and device for identifying abnormal power consumption user
CN113033414A (en) * 2021-03-26 2021-06-25 深圳供电局有限公司 Power consumption data anomaly detection method and device, computer equipment and storage medium
CN113011530A (en) * 2021-04-29 2021-06-22 国网新疆电力有限公司营销服务中心(资金集约中心、计量中心) Intelligent ammeter fault prediction method based on multi-classifier fusion
CN113361608A (en) * 2021-06-08 2021-09-07 太原科技大学 Hidden electricity stealing detection method based on transverse pair bit sum and neural network
CN114295368A (en) * 2021-12-24 2022-04-08 江苏国科智能电气有限公司 Multi-channel fused wind power planetary gear box fault diagnosis method
CN114240681A (en) * 2021-12-27 2022-03-25 杭州趣链科技有限公司 Abnormal behavior detection method, electronic device, and computer-readable storage medium
CN114580467B (en) * 2022-02-22 2023-11-17 国网山东省电力公司信息通信公司 Power data anomaly detection method and system based on data augmentation and Tri-Training
CN114580467A (en) * 2022-02-22 2022-06-03 国网山东省电力公司信息通信公司 Power data anomaly detection method and system based on data enhancement and Tri-tracing
CN116150616A (en) * 2022-12-12 2023-05-23 东北电力大学 A method and system for abnormal electricity bill calculation
CN117313005A (en) * 2023-08-18 2023-12-29 北京智芯微电子科技有限公司 Abnormal data identification method, processing method, system, processor and storage medium
CN118656749A (en) * 2024-07-26 2024-09-17 东莞科达五金制品有限公司 Axis product database management method and system based on artificial intelligence
CN118656749B (en) * 2024-07-26 2025-01-21 东莞科达五金制品有限公司 Axis product database management method and system based on artificial intelligence

Also Published As

Publication number Publication date
CN111967512B (en) 2022-08-19

Similar Documents

Publication Publication Date Title
CN111967512B (en) Abnormal electricity utilization detection method, system and storage medium
CN109543943B (en) A power price inspection execution method based on big data deep learning
CN106845717B (en) An energy efficiency evaluation method based on multi-model fusion strategy
CN102880989B (en) A kind of wind power output time series modeling method
CN111177216B (en) Association rule generation method and device for comprehensive energy consumer behavior characteristics
CN112101420A (en) Abnormal electricity user identification method for Stacking integration algorithm under dissimilar model
CN115659191B (en) A method for generating typical light-load scene sets based on ensemble clustering and frequent item set tree
CN104992297A (en) Electricity fee collection risk assessment device based on big data platform clustering algorithm and method thereof
CN104182889B (en) A kind of history wind power output data processing and fluctuation discrimination method
CN117540317A (en) Distribution network abnormal line change relation identification method based on cosine similarity and isolated forest
CN118584237A (en) A distribution network fault location method and system in an imperfect communication scenario
CN102065449A (en) Method for predicting mobile communication telephone traffic based on clustered LS-SVM (Least Squares-Support Vector Machine)
CN115470970A (en) Electric quantity prediction method and system based on prophet-LightGBM combined model
CN114764599A (en) Sensitivity analysis method and system for single-phase earth fault of power distribution network
CN119227899A (en) Urban electricity consumption prediction method, system, device and storage medium integrating time-frequency characteristics
CN118779809A (en) A method and system for detecting abnormal power users in a power grid
CN118655406A (en) A method and device for synchronously identifying multi-channel power quality problems
CN112595918A (en) Low-voltage meter reading fault detection method and device
CN118095632A (en) Geospatial event distribution condition prediction method
CN103326396B (en) Method for testing wind power service capacity upper limit value of power system
CN117454203A (en) A topology identification method based on autoencoder dimensionality reduction and BIRCH clustering
CN113435494B (en) Abnormal power consumption identification method and simulation system for low-voltage residential users
CN109871998A (en) A method and device for predicting line loss rate of distribution network based on expert sample library
CN114066219A (en) Electricity stealing analysis method for intelligently identifying electricity utilization abnormal points under incidence matrix
CN118194055B (en) Charging pile power curve matching method

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