Method and system for constructing abnormal electricity utilization detection model

By cleaning, feature derivation and fuzzy clustering algorithm processing of user power consumption data, an abnormal power consumption detection model is constructed, which solves the problems of low detection efficiency and poor accuracy in the existing technology, and achieves efficient identification and detection of abnormal power consumption. recover.

CN118535944APending Publication Date: 2024-08-23STATE GRID HUBEI MARKETING SERVICE CENT (MEASUREMENT CENT)
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202410750434.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-12
Publication Date
2024-08-23

AI Technical Summary

Technical Problem

Abnormal power consumption detection in the existing technology has low efficiency and poor accuracy, making it difficult to recover losses for power supply companies and sanction power thieves.

Method used

By obtaining user power consumption data, cleaning, feature derivation, imbalanced data processing and evaluation screening are performed, and a fuzzy clustering algorithm is used to build an abnormal power usage detection model to identify abnormal power usage behavior.

Benefits of technology

It improves the efficiency and accuracy of abnormal power consumption detection, helping power supply companies to effectively recover losses and punish power thieves.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118535944A
    Figure CN118535944A
Patent Text Reader

Abstract

The method for constructing the abnormal electricity utilization detection model comprises the following steps: acquiring electricity utilization data of a user, and cleaning the electricity utilization data of the user; performing feature derivation on the cleaned power consumption data according to a first preset rule; performing unbalanced data processing on the power consumption data after the feature derivation according to a second preset rule; according to a third preset rule, evaluating and screening the power utilization characteristics after unbalanced data processing; and according to the evaluated and screened power consumption characteristics, constructing an abnormal power consumption detection model by adopting a fuzzy clustering algorithm to obtain an abnormal power consumption result. The problems that in the prior art, abnormal electricity consumption evidence obtaining is difficult, electricity consumption metering is difficult, and great difficulty is brought to loss recovery of power supply enterprises and cutting of electricity stealers are solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of power detection, and in particular to a method and system for constructing an abnormal power consumption detection model. Background Art

[0002] At present, the detection of abnormal power consumption mainly relies on methods such as manual analysis and power mutation threshold comparison. However, these methods have problems such as low efficiency and poor accuracy. At the same time, due to the particularity of electric energy, it is difficult to obtain evidence of abnormal power consumption and difficult to measure power consumption, which brings great difficulties to the loss recovery of power supply companies and the punishment of power thieves. Therefore, the development of an efficient and accurate abnormal power consumption detection model is of great significance to the stable operation of the power system and the safety of users' power consumption. Summary of the invention

[0003] In view of the above problems, the present invention is proposed to provide a method and system for constructing an abnormal power consumption detection model that overcomes the above problems or at least partially solves the above problems.

[0004] In order to solve the above technical problems, the embodiments of the present application disclose the following technical solutions: In a first aspect, an embodiment of the present invention discloses a method for constructing an abnormal power consumption detection model, comprising: S100. Obtaining user electricity usage data, and cleaning the user electricity usage data; S200. Deriving features from the cleaned electricity consumption data according to a first preset rule; S300. Perform unbalanced data processing on the power consumption data derived from the feature according to the second preset rule; S400. Evaluate and screen the power consumption characteristics after the unbalanced data processing according to the third preset rule; S500. Based on the evaluated and screened electricity consumption characteristics, a fuzzy clustering algorithm is used to construct an abnormal electricity consumption detection model to obtain abnormal electricity consumption results.

[0005] Furthermore, in S100, user electricity usage data is obtained, and the user electricity usage data at least includes: Basic information of users: obtain the user's electricity category, urban and rural category, industry classification, power supply voltage, power supply date, operating capacity, bill type, and basic indicators of user status from the cloud platform electricity user information table; User power consumption; obtain power log data from the user's power meter, including at least the total forward active power, the forward active power values ​​in the peak, flat and valley time periods, user ID, date, and basic indicators of power consumption status; User load; obtain basic indicators such as phase A current, phase B current, phase C current, neutral line current, phase A voltage, phase B voltage, phase C voltage, power factor, user ID, and date from the load table; User exception records; obtain exception time, exception type, and user ID basic indicators from user exception records; Power outage record: Get the power outage time and area ID from the power outage matching table, associate users according to the area ID, and match the user's power outage information; Substation line loss: Get the corresponding power supply, power consumption, line loss and line loss rate data of the substation from the substation line loss table.

[0006] Furthermore, in S100, the user electricity usage data is cleaned, and a specific cleaning method at least includes: processing missing data in the user electricity usage data, processing abnormal values ​​in the user electricity usage data, and standardizing the user electricity usage data.

[0007] Furthermore, in S200, feature derivation is performed on the cleaned power usage data according to a first preset rule, and the first preset rule includes: S201. Perform preliminary derivation on the cleaned electricity consumption data, and perform internal and external pull-up and ranking feature derivation according to time and industry dimensions; among them, the basic information of users, the preliminary derived features at least include the basic features of electricity consumption category, urban and rural category, industry classification, power supply voltage, power supply date, operating capacity, bill type, user status, number of months since power supply, and number of months since household establishment; user electricity, based on the user's daily electricity data, construct the basic features of monthly total electricity consumption, mean, standard deviation, and coefficient of variation; user load: based on the daily three-phase current, voltage and power data, construct the basic features of monthly current, voltage and power mean, standard deviation, and coefficient of variation; user abnormality records, the number of abnormality types in the current month is counted, at least including the basic features of power meter abnormality, voltage abnormality, current abnormality, power meter cover opening, the number of days between the most recent abnormality, and the number of days between the earliest abnormality; power outage records, based on the power outage matching table, construct the basic features of the number of power outages in the current month, the total number of historical power outages, and the number of days between the most recent power outage; S202. Perform secondary derivation on the initially derived electricity consumption data, perform secondary derivation on the basic features of user basic information, user electricity consumption, user load, user abnormal records and power outage records, by grouping and adding the dimension of time; at least including: the maximum / minimum / average / standard deviation of user electricity consumption within the preset time; the number of months in which the user's electricity consumption has continuously increased / decreased within the preset time, and the number of months in which the user's electricity consumption ranking in the area where the user is located has continuously increased / decreased within the preset time.

[0008] Furthermore, in S300, unbalanced data processing is performed on the power consumption data derived from the features according to a second preset rule, and the second preset rule includes: S301. Divide the power consumption data derived from the features into minority class samples and majority class samples. For each minority class sample, calculate the distance between it and all other minority class samples, and find its K nearest neighbors. S302. Randomly select a sample from the K nearest neighbors and calculate the difference between the sample and the current sample; S303. Generate a new synthetic sample according to the difference ratio, wherein the sample is located on the line between the two samples; S304. Repeat S301-S303 to generate a specified number of synthetic samples.

[0009] Furthermore, in S400, the power consumption characteristics after the imbalance data processing are evaluated and screened according to a third preset rule, and the third preset rule includes: S401. Perform a preliminary screening of electricity consumption features, evaluate each feature from a given feature set according to a predefined scoring function, and select the K features with the highest scores as the final feature subset, wherein the scoring function uses an F test to calculate the score of each feature and select the preset most relevant features; S402. Draw a density curve for screening. Use the feature set after preliminary screening to draw the density distribution curve of positive and negative samples for each feature, and screen out the features that can clearly distinguish between positive and negative samples.

[0010] Furthermore, in S500, based on the evaluated and screened power consumption characteristics, a fuzzy clustering algorithm is used to construct an abnormal power consumption detection model to obtain abnormal power consumption results; the specific method includes: S501. Initialize cluster centers: determine the number of clusters, take m data points as initial cluster centers, and determine the number of iterations; S502. Initialize the membership degree U: randomly select a value (0, 1) for the membership degree U to complete data initialization; S503. Calculate the membership matrix: Calculate the membership of each data point to each cluster center according to the current cluster center ; S504. Update cluster centers: update the locations of cluster centers according to the membership matrix; S505. Determine whether convergence has occurred: Determine whether the change in the cluster center is less than a set threshold or satisfies a set limit on the number of iterations. If so, stop the iteration, otherwise return to S503; S506. Output clustering results: assign each data point to the final determined cluster center to obtain the final fuzzy clustering result.

[0011] In a second aspect, an embodiment of the present invention discloses a system for constructing an abnormal power consumption detection model, including: a power consumption data acquisition and cleaning unit, a power consumption data feature derivation unit, a power consumption data imbalance processing unit, a power consumption feature evaluation and screening unit, and an abnormal power consumption result display unit; An electricity usage data acquisition and cleaning unit, used to acquire user electricity usage data and clean the user electricity usage data; An electricity consumption data feature derivation unit, used to derive features from the cleaned electricity consumption data according to a first preset rule; An electricity consumption data imbalance processing unit, used for performing imbalance data processing on the electricity consumption data derived from the features according to a second preset rule; An electricity consumption characteristic evaluation and screening unit, used for evaluating and screening the electricity consumption characteristic after the imbalance data is processed according to a third preset rule; The abnormal power consumption result display unit is used to construct an abnormal power consumption detection model based on the evaluated and screened power consumption characteristics and obtain the abnormal power consumption results by using a fuzzy clustering algorithm.

[0012] In a third aspect, an embodiment of the present invention discloses an electronic device, including: one or more processors; A memory for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the model building method.

[0013] The beneficial effects of the above technical solution provided by the embodiment of the present invention include at least: The present invention discloses a method for constructing an abnormal power consumption detection model, comprising: obtaining user power consumption data, cleaning the user power consumption data; deriving features of the cleaned power consumption data according to a first preset rule; performing unbalanced data processing on the power consumption data after feature derivation according to a second preset rule; evaluating and screening the power consumption features after unbalanced data processing according to a third preset rule; and constructing an abnormal power consumption detection model based on the evaluated and screened power consumption features using a fuzzy clustering algorithm to obtain abnormal power consumption results. The present invention solves the problems of the prior art, such as the difficulty in obtaining evidence of abnormal power consumption, the difficulty in measuring power consumption, and the great difficulty in recovering losses for power supply companies and punishing power thieves.

[0014] The technical solution of the present invention is further described in detail below through the accompanying drawings and embodiments. BRIEF DESCRIPTION OF THE DRAWINGS

[0015] The accompanying drawings are used to provide a further understanding of the present invention and constitute a part of the specification. Together with the embodiments of the present invention, they are used to explain the present invention and do not constitute a limitation of the present invention. In the accompanying drawings: Figure 1 This is a flow chart of a method for constructing an abnormal power consumption detection model in Embodiment 1 of the present invention; Figure 2 This is a schematic diagram of the structure of an electronic device in Example 3 of the present invention. DETAILED DESCRIPTION

[0016] The exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although the exemplary embodiments of the present disclosure are shown in the accompanying drawings, it should be understood that the present disclosure can be implemented in various forms and should not be limited by the embodiments set forth herein. On the contrary, these embodiments are provided to enable a more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.

[0017] In order to solve the problems existing in the prior art, an embodiment of the present invention provides a method and system for constructing an abnormal power consumption detection model.

[0018] Embodiment 1: The present invention discloses a method for constructing an abnormal power consumption detection model, comprising: S100. Obtain user electricity usage data and clean the user electricity usage data; specifically, extract low-voltage user electricity usage logs from the power grid big data platform. This model is only used to identify electricity theft by users with ordinary electricity usage. Therefore, it is necessary to filter out users with special electricity usage such as street lamps, agricultural production, and agricultural irrigation.

[0019] Since users have relatively stable work and rest schedules on weekdays, which are basically cyclical behaviors, their electricity consumption behavior presents a cyclical waveform and is relatively stable; however, on weekends and special holidays, users' behaviors are affected by accidental times such as travel and shopping, family gatherings, and entertainment activities, and the user's electricity consumption curve will fluctuate accidentally and be relatively disordered. Therefore, after filtering out users with special electricity consumption characteristics, the electricity consumption logs on weekends and special holidays are filtered to prevent the large fluctuations in the user's electricity consumption curve caused by special electricity consumption behaviors from interfering with the model results, and to ensure the scientificity and stability of the model.

[0020] In S100 of this embodiment, user power usage data is obtained, and the user power usage data at least includes: Basic information of users: obtain the user's electricity category, urban and rural category, industry classification, power supply voltage, power supply date, operating capacity, bill type, and basic indicators of user status from the cloud platform electricity user information table; User power consumption; obtain power log data from the user's power meter, including at least the total forward active power, the forward active power values ​​in the peak, flat and valley time periods, user ID, date, and basic indicators of power consumption status; User load; obtain basic indicators such as phase A current, phase B current, phase C current, neutral current, phase A voltage, phase B voltage, phase C voltage, power factor, user ID, and date from the load table; User exception records; obtain exception time, exception type, and user ID basic indicators from user exception records; Power outage record: Get the power outage time and area ID from the power outage matching table, associate users according to the area ID, and match the user's power outage information; Substation line loss: Get the corresponding power supply, power consumption, line loss and line loss rate data of the substation from the substation line loss table.

[0021] In S100 of this embodiment, the user electricity usage data is cleaned, and a specific cleaning method at least includes: processing missing data in the user electricity usage data, processing abnormal values ​​in the user electricity usage data, and standardizing the user electricity usage data.

[0022] Specifically, in this embodiment, for missing data, the processing method of missing data is considered according to the business meaning. For example, a family user went out for a trip for a period of time, and the family did not use electricity, so the data was displayed as missing. In this case, 0 is used to replace the missing value. If the missing value itself has important meaning, it is treated as a separate category and replaced with a discrete value, such as -999. For missing ratios higher than 80%, direct deletion is used. For ratios lower than this, interpolation is used to fill in missing data. The interpolation methods used in this article include the average method and the random forest interpolation method.

[0023] In this embodiment, an outlier refers to a data point that is significantly different from other observed values. The purpose of processing outliers is to ensure the accuracy and reliability of the data and avoid affecting the model. When processing outliers, it is necessary to select an appropriate method based on the specific problem and the characteristics of the data. At the same time, it should be noted that outliers may be real data and may contain useful information, so it is necessary to comprehensively consider the rationality of the processing strategy and the impact on the model.

[0024] This embodiment uses outlier deletion and outlier completion: For extreme outliers with a small amount of data, or constants that seriously deviate from the normal data distribution, it may be caused by data collection errors or equipment metering anomalies. In this case, the outliers are directly deleted to improve the accuracy of the model. Before deleting outliers, carefully analyze the properties of the data and outliers to ensure that the deleted outliers are reasonable and will not have an adverse effect on data analysis and model building. For example, extremely abnormal current, voltage and other data caused by metering anomalies are processed by deleting outliers. Replace outliers: Use statistical methods such as mean, median or mode to replace outliers. The choice of this method depends on the distribution and characteristics of the data. In addition, modeling interpolation methods such as linear interpolation or polynomial interpolation are used to replace outliers for data such as electricity consumption.

[0025] In this embodiment, in order to eliminate the dimensional differences of each feature, the features need to be normalized. This article uses standard deviation normalization (z-score normalization) for normalization. The specific formula is as follows: ; Where u is the mean, σ is the standard deviation, and the processed data conforms to the standard normal distribution. After the original data is processed by data standardization, each indicator is at the same order of magnitude, which is suitable for comprehensive comparative evaluation.

[0026] S200. Perform feature derivation on the cleaned electricity consumption data according to the first preset rule; specifically, there may be some implicit patterns and regularities in the original electricity data, and these patterns and regularities can be converted into features that can be understood by the machine learning algorithm through feature derivation. Feature derivation can help the machine learning algorithm better distinguish different samples and improve the prediction performance and generalization ability of the model. At the same time, feature derivation can also help us discover hidden relationships and trends in the data and provide deeper data analysis and insights. Therefore, feature derivation is an important part of machine learning and data analysis. The feature construction in this article mainly includes primary derivation and secondary derivation.

[0027] In S200 of this embodiment, feature derivation is performed on the cleaned power usage data according to a first preset rule, where the first preset rule includes: S201. Perform preliminary derivation on the cleaned electricity consumption data, and perform internal and external pull-up and ranking feature derivation according to time and industry dimensions; among them, the basic information of users, the preliminary derived features at least include the basic features of electricity consumption category, urban and rural category, industry classification, power supply voltage, power supply date, operating capacity, bill type, user status, number of months since power supply, and number of months since household establishment; user electricity, based on the user's daily electricity data, construct the basic features of monthly total electricity consumption, mean, standard deviation, and coefficient of variation; user load: based on the daily three-phase current, voltage and power data, construct the basic features of monthly current, voltage and power mean, standard deviation, and coefficient of variation; user abnormality records, the number of abnormality types in the current month is counted, at least including the basic features of power meter abnormality, voltage abnormality, current abnormality, power meter cover opening, the number of days between the most recent abnormality, and the number of days between the earliest abnormality; power outage records, based on the power outage matching table, construct the basic features of the number of power outages in the current month, the total number of historical power outages, and the number of days between the most recent power outage; S202. Perform secondary derivation on the initially derived electricity consumption data, perform secondary derivation on the basic features of user basic information, user electricity consumption, user load, user abnormal records and power outage records, by grouping and adding the dimension of time; at least including: the maximum / minimum / average / standard deviation of user electricity consumption within the preset time; the number of months in which the user's electricity consumption has continuously increased / decreased within the preset time, and the number of months in which the user's electricity consumption ranking in the area where the user is located has continuously increased / decreased within the preset time.

[0028] S300. Perform unbalanced data processing on the electricity consumption data after feature derivation according to the second preset rule; in actual situations, the number of users with abnormal electricity consumption is far less than the number of normal users, that is, the positive samples and negative samples constitute an unbalanced data set. For unbalanced data sets, intelligent algorithms tend to favor positive samples during training and ignore the important information contained in negative samples, which reduces the detection performance of each method. For unbalanced data sets, certain methods need to be used for unbalanced data processing. Improving the imbalance of the data set by reconstructing or optimizing the data plays an indispensable role in improving the efficiency and accuracy of the algorithm. This paper adopts the SMOTE oversampling technology to oversample the positive samples in the training set so that the ratio of positive and negative samples in the final training set reaches 1:1.

[0029] SMOTE (Synthetic Minority Over-sampling Technique) is a machine learning method for processing imbalanced datasets. In an imbalanced dataset, the number of samples in one category is significantly less than that in other categories. SMOTE balances the dataset by synthesizing new minority class samples to achieve sample balance, thereby improving the performance of the machine learning algorithm.

[0030] Through SMOTE oversampling, the model can better learn the characteristics of minority categories, thereby improving the generalization ability and accuracy of the model. In addition, the SMOTE oversampling method can also reduce the overfitting tendency of the model, thereby improving the performance of the machine learning algorithm.

[0031] In S300 of this embodiment, unbalanced data processing is performed on the power consumption data derived from the features according to a second preset rule, and the second preset rule includes: S301. Divide the power consumption data derived from the features into minority class samples and majority class samples. For each minority class sample, calculate the distance between it and all other minority class samples, and find its K nearest neighbors. S302. Randomly select a sample from the K nearest neighbors and calculate the difference between the sample and the current sample; S303. Generate a new synthetic sample according to the difference ratio, wherein the sample is located on the line between the two samples; S304. Repeat S301-S303 to generate a specified number of synthetic samples.

[0032] S400. Evaluate and screen the electricity consumption features after unbalanced data processing according to the third preset rule; in this embodiment, from a given feature set, each feature is evaluated according to a predefined scoring function, and the K features with the highest scores are selected as the final feature subset. This embodiment is used to solve problems such as excessive feature dimensions, redundant features or noise features. By selecting the most relevant features, the performance of the model can be improved, overfitting can be reduced, and the speed of training and prediction can be accelerated. In this embodiment, the score of each feature is calculated by using a feature selection method, and the scoring function uses an F test to select the 20 most relevant features.

[0033] In S400 of this embodiment, the power consumption characteristics after the unbalanced data processing are evaluated and screened according to the third preset rule, and the third preset rule includes: S401. Perform a preliminary screening of electricity consumption features, evaluate each feature from a given feature set according to a predefined scoring function, and select the K features with the highest scores as the final feature subset, wherein the scoring function uses an F test to calculate the score of each feature and select the preset most relevant features; S402. Draw a density curve for screening. Use the feature set after preliminary screening to draw the density distribution curve of positive and negative samples for each feature, and screen out the features that can clearly distinguish between positive and negative samples.

[0034] Specifically, using the training set data that has been oversampled by SMOTE, the density distribution curve of positive and negative samples is drawn for each feature, and the features that can clearly distinguish positive and negative samples are screened out.

[0035] S500. Based on the evaluated and screened electricity consumption characteristics, a fuzzy clustering algorithm is used to construct an abnormal electricity consumption detection model to obtain abnormal electricity consumption results.

[0036] In S500 of this embodiment, based on the evaluated and screened power consumption characteristics, a fuzzy clustering algorithm is used to construct an abnormal power consumption detection model to obtain abnormal power consumption results; the specific method includes: S501. Initialize cluster centers: determine the number of clusters, take m data points as initial cluster centers, and determine the number of iterations; S502. Initialize the membership degree U: randomly select a value (0, 1) for the membership degree U to complete data initialization; S503. Calculate the membership matrix: Calculate the membership of each data point to each cluster center according to the current cluster center ; S504. Update cluster centers: update the locations of cluster centers according to the membership matrix; S505. Determine whether convergence has occurred: Determine whether the change in the cluster center is less than a set threshold or satisfies a set limit on the number of iterations. If so, stop the iteration, otherwise return to S503; S506. Output clustering results: assign each data point to the final determined cluster center to obtain the final fuzzy clustering result.

[0037] The present embodiment discloses a method for constructing an abnormal power consumption detection model, including: obtaining user power consumption data, cleaning the user power consumption data; deriving features of the cleaned power consumption data according to a first preset rule; performing unbalanced data processing on the power consumption data after feature derivation according to a second preset rule; evaluating and screening the power consumption features after unbalanced data processing according to a third preset rule; and constructing an abnormal power consumption detection model based on the evaluated and screened power consumption features using a fuzzy clustering algorithm to obtain abnormal power consumption results. The present invention solves the problems of the prior art, such as the difficulty in obtaining evidence of abnormal power consumption, the difficulty in measuring power consumption, and the great difficulty in recovering losses for power supply companies and punishing power thieves.

[0038] Embodiment 2: Based on the same inventive concept, the embodiment of the present disclosure further provides a system for constructing an abnormal power consumption detection model, including: a power consumption data acquisition and cleaning unit, a power consumption data feature derivation unit, a power consumption data imbalance processing unit, a power consumption feature evaluation and screening unit, and an abnormal power consumption result display unit; An electricity usage data acquisition and cleaning unit, used to acquire user electricity usage data and clean the user electricity usage data; An electricity consumption data feature derivation unit, used to derive features from the cleaned electricity consumption data according to a first preset rule; An electricity consumption data imbalance processing unit, used for performing imbalance data processing on the electricity consumption data derived from the features according to a second preset rule; An electricity consumption characteristic evaluation and screening unit, used for evaluating and screening the electricity consumption characteristic after the imbalance data is processed according to a third preset rule; The abnormal power consumption result display unit is used to construct an abnormal power consumption detection model based on the evaluated and screened power consumption characteristics and obtain the abnormal power consumption results by using a fuzzy clustering algorithm.

[0039] Among them, the electricity consumption data acquisition and cleaning unit, the electricity consumption data feature derivation unit, the electricity consumption data imbalance processing unit, the electricity consumption feature evaluation and screening unit and the abnormal electricity consumption result display unit; the specific working method has been described in Example 1, and will not be repeated in this embodiment.

[0040] Embodiment 3: Based on the same inventive concept, the embodiment of the present disclosure also provides an electronic device. Figure 2 FIG. 1 is a schematic diagram of the structure of an electronic device according to an embodiment of the present disclosure. Figure 2 As shown, an embodiment of the present disclosure provides an electronic device including: one or more processors 101, a memory 102, and one or more I / O interfaces 103. The memory 102 stores one or more programs, and when the one or more programs are executed by the one or more processors, the one or more processors implement any optimization method in the above embodiments; the one or more I / O interfaces 103 are connected between the processor and the memory, and are configured to implement information interaction between the processor and the memory.

[0041] Among them, the processor 101 is a device with data processing capabilities, including but not limited to a central processing unit (CPU), etc.; the memory 102 is a device with data storage capabilities, including but not limited to random access memory (RAM, more specifically SDRAM, DDR, etc.), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory (FLASH); the I / O interface (read-write interface) 103 is connected between the processor 101 and the memory 102, and can realize information interaction between the processor 101 and the memory 102, including but not limited to a data bus (Bus), etc.

[0042] In some embodiments, the processor 101 , the memory 102 , and the I / O interface 103 are connected to each other via a bus 104 , and further connected to other components of the computing device.

[0043] In some embodiments, the one or more processors 101 include a field programmable gate array.

[0044] According to an embodiment of the present disclosure, a computer-readable medium is further provided, wherein a computer program is stored on the computer-readable medium, wherein when the program is executed by a processor, the steps in any optimization method in the above-mentioned embodiment are implemented.

[0045] It should be understood that the specific order or hierarchy of steps in the disclosed process is an example of an exemplary method. Based on design preferences, it should be understood that the specific order or hierarchy of steps in the process can be rearranged without departing from the scope of protection of the present disclosure. The attached method claims present the elements of the various steps in an exemplary order and are not intended to be limited to the specific order or hierarchy described.

[0046] In the above detailed description, various features are grouped together in a single embodiment to simplify the disclosure. This method of disclosure should not be interpreted as reflecting an intention that the embodiments of the claimed subject matter require more features than are clearly stated in each claim. On the contrary, as reflected in the appended claims, the invention is in a state of having less than all the features of the disclosed individual embodiments. Therefore, the appended claims are hereby expressly incorporated into the detailed description, with each claim standing on its own as a separate preferred embodiment of the invention.

[0047] Those skilled in the art will also appreciate that the various illustrative logic blocks, modules, circuits, and algorithmic steps described in conjunction with the embodiments herein can all be implemented as electronic hardware, computer software, or a combination thereof. In order to clearly illustrate the interchangeability between hardware and software, various illustrative components, blocks, modules, circuits, and steps are generally described above around their functions. Whether such functions are implemented as hardware or software depends on specific applications and the design constraints imposed on the entire system. A skilled person can implement the described functions in an alternative manner for each specific application, but such implementation decisions should not be interpreted as departing from the scope of protection of the present disclosure.

[0048] The steps of the method or algorithm described in conjunction with the embodiments herein may be directly embodied as hardware, a software module executed by a processor, or a combination thereof. The software module may be located in a RAM memory, a flash memory, a ROM memory, an EPROM memory, an EEPROM memory, a register, a hard disk, a mobile disk, a CD-ROM, or any other form of storage medium well known in the art. An exemplary storage medium is connected to the processor so that the processor can read information from the storage medium and can write information to the storage medium. Of course, the storage medium may also be an integral part of the processor. The processor and the storage medium may be located in an ASIC. The ASIC may be located in a user terminal. Of course, the processor and the storage medium may also be present in a user terminal as discrete components.

[0049] For software implementation, the techniques described in this application can be implemented with modules (e.g., procedures, functions, etc.) that perform the functions described in this application. These software codes can be stored in a memory unit and executed by a processor. The memory unit can be implemented within the processor or outside the processor. In the latter case, it is coupled to the processor in a communication manner via various means, which are well known in the art.

[0050] The above description includes examples of one or more embodiments. Of course, it is impossible to describe all possible combinations of components or methods for the purpose of describing the above embodiments, but it should be recognized by those skilled in the art that the various embodiments may be further combined and arranged. Therefore, the embodiments described herein are intended to cover all such changes, modifications and variations that fall within the scope of protection of the appended claims. In addition, with respect to the term "comprising" used in the specification or claims, the word is covered in a manner similar to the term "including", just as "including," is explained as a transitional word in the claims. In addition, any term "or" used in the specification of the claims is intended to mean "non-exclusive or".

Claims

1. A method for constructing an abnormal power consumption detection model, characterized in that: include: S100. Obtaining user electricity usage data, and cleaning the user electricity usage data; S200. Deriving features from the cleaned electricity consumption data according to a first preset rule; In S200, feature derivation is performed on the cleaned power usage data according to a first preset rule, where the first preset rule includes: S201. Perform preliminary derivation on the cleaned electricity consumption data, and perform internal and external pull-up and ranking feature derivation according to time and industry dimensions; among them, the basic information of users, the preliminary derived features at least include the basic features of electricity consumption category, urban and rural category, industry classification, power supply voltage, power supply date, operating capacity, bill type, user status, number of months since power supply, and number of months since household establishment; user electricity, based on the user's daily electricity data, construct the basic features of monthly total electricity consumption, mean, standard deviation, and coefficient of variation; user load: based on the daily three-phase current, voltage and power data, construct the basic features of monthly current, voltage and power mean, standard deviation, and coefficient of variation; user abnormality records, the number of abnormality types in the current month is counted, at least including the basic features of power meter abnormality, voltage abnormality, current abnormality, power meter cover opening, the number of days between the most recent abnormality, and the number of days between the earliest abnormality; power outage records, based on the power outage matching table, construct the basic features of the number of power outages in the current month, the total number of historical power outages, and the number of days between the most recent power outage; S202. Perform secondary derivation on the initially derived power consumption data, perform secondary derivation on the basic features of user basic information, user power consumption, user load, user abnormal records and power outage records, by grouping and adding the dimension of time; at least including: the maximum / minimum / average / standard deviation of user power consumption within a preset time; the number of months in which the power consumption of the user has continuously increased / decreased within the preset time, and the number of months in which the power consumption of the user has continuously increased / decreased in the ranking of the area in which the power consumption has been located within the preset time; S300. Perform unbalanced data processing on the power consumption data derived from the feature according to the second preset rule; In S300, perform unbalanced data processing on the power consumption data derived from the feature according to the second preset rule, wherein the second preset rule includes: S301. Divide the power consumption data derived from the features into minority class samples and majority class samples. For each minority class sample, calculate the distance between it and all other minority class samples, and find its K nearest neighbors. S302. Randomly select a sample from the K nearest neighbors and calculate the difference between the sample and the current sample; S303. Generate a new synthetic sample according to the difference ratio, wherein the sample is located on the line between the two samples; S304. Repeat S301-S303 to generate a specified number of synthetic samples; S400. Evaluate and filter the power consumption characteristics after the unbalanced data is processed according to the third preset rule; In S400, the power consumption characteristics after the unbalanced data is processed are evaluated and filtered according to the third preset rule, and the third preset rule includes: S401. Perform a preliminary screening of electricity consumption features, evaluate each feature from a given feature set according to a predefined scoring function, and select the K features with the highest scores as the final feature subset, wherein the scoring function uses an F test to calculate the score of each feature and select the preset most relevant features; S402. Draw a density curve for screening. Use the feature set after preliminary screening to draw a density distribution curve of positive and negative samples for each feature, and screen out features that can clearly distinguish positive and negative samples; S500. Based on the evaluated and screened electricity consumption characteristics, a fuzzy clustering algorithm is used to construct an abnormal electricity consumption detection model to obtain abnormal electricity consumption results.

2. The method for constructing an abnormal power consumption detection model according to claim 1, characterized in that: In S100, user electricity usage data is obtained, and the user electricity usage data at least includes: Basic user information: obtain the user's electricity category, urban and rural category, industry classification, power supply voltage, power supply date, operating capacity, bill type, and basic user status indicators from the cloud platform electricity user information table; User power consumption; obtain power log data from the user's power meter, including at least the total forward active power, the forward active power values ​​in the peak, flat and valley time periods, user ID, date, and basic indicators of power consumption status; User load; obtain basic indicators such as phase A current, phase B current, phase C current, neutral current, phase A voltage, phase B voltage, phase C voltage, power factor, user ID, and date from the load table; User exception records; obtain exception time, exception type, and user ID basic indicators from user exception records; Power outage record: Get the power outage time and area ID from the power outage matching table, associate users according to the area ID, and match the user's power outage information; Substation line loss: Get the corresponding power supply, power consumption, line loss and line loss rate data of the substation from the substation line loss table.

3. The method for constructing an abnormal power consumption detection model according to claim 1, characterized in that: In S100, the user electricity usage data is cleaned, and a specific cleaning method at least includes: processing missing data in the user electricity usage data, processing abnormal values ​​in the user electricity usage data, and standardizing the user electricity usage data.

4. The method for constructing an abnormal power consumption detection model according to claim 1, characterized in that: In S500, based on the evaluated and screened power consumption characteristics, a fuzzy clustering algorithm is used to construct an abnormal power consumption detection model to obtain abnormal power consumption results; the specific method includes: S501. Initialize cluster centers: determine the number of clusters, take m data points as initial cluster centers, and determine the number of iterations; S502. Initialize the membership degree U: randomly select a value (0, 1) for the membership degree U to complete data initialization; S503. Calculate the membership matrix: Calculate the membership of each data point to each cluster center according to the current cluster center ; S504. Update cluster centers: update the locations of cluster centers according to the membership matrix; S505. Determine whether convergence has occurred: Determine whether the change in the cluster center is less than a set threshold or satisfies a set limit on the number of iterations. If so, stop the iteration; otherwise, return to S503; S506. Output clustering results: assign each data point to the final determined cluster center to obtain the final fuzzy clustering result.

5. A system for constructing an abnormal power consumption detection model, characterized in that: include: Power consumption data acquisition and cleaning unit, power consumption data feature derivation unit, power consumption data imbalance processing unit, power consumption feature evaluation and screening unit and abnormal power consumption result display unit; An electricity usage data acquisition and cleaning unit, used to acquire user electricity usage data and clean the user electricity usage data; An electricity consumption data feature derivation unit, used to derive features from the cleaned electricity consumption data according to a first preset rule; An electricity consumption data imbalance processing unit, used for performing imbalance data processing on the electricity consumption data derived from the features according to a second preset rule; An electricity consumption characteristic evaluation and screening unit, used for evaluating and screening the electricity consumption characteristic after the imbalance data is processed according to a third preset rule; The abnormal power consumption result display unit is used to construct an abnormal power consumption detection model based on the evaluated and screened power consumption characteristics and obtain the abnormal power consumption results by using a fuzzy clustering algorithm.

6. A system for constructing an abnormal power consumption detection model as claimed in claim 5, characterized in that: An electricity consumption data feature derivation unit, used to derive features from the cleaned electricity consumption data according to a first preset rule; The first preset rule includes: S201. Perform preliminary derivation on the cleaned electricity consumption data, and perform internal and external pull-up and ranking feature derivation according to time and industry dimensions; among them, the basic information of users, the preliminary derived features at least include the basic features of electricity consumption category, urban and rural category, industry classification, power supply voltage, power supply date, operating capacity, bill type, user status, number of months since power supply, and number of months since household establishment; user electricity, based on the user's daily electricity data, construct the basic features of monthly total electricity consumption, mean, standard deviation, and coefficient of variation; user load: based on the daily three-phase current, voltage and power data, construct the basic features of monthly current, voltage and power mean, standard deviation, and coefficient of variation; user abnormality records, the number of abnormality types in the current month is counted, at least including the basic features of power meter abnormality, voltage abnormality, current abnormality, power meter cover opening, the number of days between the most recent abnormality, and the number of days between the earliest abnormality; power outage records, based on the power outage matching table, construct the basic features of the number of power outages in the current month, the total number of historical power outages, and the number of days between the most recent power outage; S202. Perform secondary derivation on the initially derived electricity consumption data, perform secondary derivation on the basic features of user basic information, user electricity consumption, user load, user abnormal records and power outage records, by grouping and adding the dimension of time; at least including: the maximum / minimum / average / standard deviation of user electricity consumption within the preset time; the number of months in which the user's electricity consumption has continuously increased / decreased within the preset time, and the number of months in which the user's electricity consumption ranking in the area where the user is located has continuously increased / decreased within the preset time.

7. An electronic device comprising: one or more processors; A memory for storing one or more programs; When the one or more programs are executed by the one or more processors, the one or more processors implement the model building method described in claims 1-7.

Citation Information

Patent Citations

  • Power consumer electricity consumption anomaly detection method based on machine learning

    CN111695639A

  • Network anomaly detection method based on variable neighborhood algorithm and fuzzy clustering

    CN112422546A

  • Automatic modeling system for data imbalance

    CN113177642A

  • Vehicle accident risk prediction model based on adaboost-so in vanets

    WO2020093701A1