Electricity theft identification method, system, terminal device and storage medium

This method for identifying electricity theft by reducing the dimensionality of historical electricity consumption data and optimizing network parameters solves the problem of insufficient accuracy in existing technologies for identifying electricity theft, and achieves efficient and low-cost electricity theft monitoring.

CN113591613BActive Publication Date: 2025-02-28GUANGDONG POWER GRID CO LTD +1
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202110791524.7
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-07-13
Publication Date
2025-02-28
Estimated Expiration
2041-07-13

AI Technical Summary

Technical Problem

Existing methods for identifying electricity theft have limitations and are not accurate enough. In particular, the DBN algorithm is limited in speed for data input processing and its parameters are not optimal, which cannot meet the actual regulatory needs.

Method used

By collecting historical electricity consumption data, the PCA algorithm is used for dimensionality reduction, the ant colony algorithm is combined to optimize the network parameters of the DBN model, and the LASSO algorithm is used for sparsification weighting. The ROC curve is then output to determine the anomaly detection threshold.

Benefits of technology

It improves the accuracy of electricity theft detection, enhances the security and reliability of the power supply system, and is low in cost and highly applicable.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 00000000_0000_ABST
    Figure 00000000_0000_ABST
Patent Text Reader

Abstract

The present invention discloses a method, system, terminal device and storage medium for identifying electricity theft behavior. The method includes: collecting historical electricity consumption data of a user to be tested, dividing the historical electricity consumption data into a first training sample and a test sample according to a first preset ratio; performing dimensionality reduction processing on the first training sample, using the training sample after dimensionality reduction to train a DBN model, and obtaining a target DBN model and a first output result; weighting the first output result to obtain an abnormality detection threshold; inputting the test sample into the target DBN model to obtain a second output result, and using the value to determine a target detection value of the electricity consumption behavior of the user to be tested; judging whether the target detection value is greater than the abnormality detection threshold; if so, the current electricity consumption behavior of the user to be tested is normal, otherwise it is abnormal. The present invention can improve the accuracy of identifying the user's electricity theft behavior, thereby enhancing the safety and reliability of the power supply system, and has the advantages of low cost, high accuracy and strong applicability.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of electricity theft detection, and in particular to an electricity theft identification method, system, terminal equipment and storage medium. Background Art

[0002] With the substantial increase in electricity consumption, various types of electricity theft have become increasingly serious, and the main body of electricity theft has evolved from private organizations to enterprises and institutions. There are several traditional methods for identifying electricity theft. One is to use physical methods to optimize the structure of the meter box and change the material of the meter box to weaken the interference caused by high-frequency signals and strong magnetic signals. However, this method has limited effect in improving power loss, and the level of electricity theft prevention and management has not been effectively improved. Another method is to supervise electricity consumption through anti-theft devices, but this method can only play a preventive role and cannot effectively analyze electricity theft.

[0003] In order to further strengthen the supervision of electricity theft, the existing technology has introduced a new detection technology, namely DBN-based network intrusion detection technology, which uses a single deep belief network DBN algorithm to perform data fitting detection. Although the DBN algorithm has powerful training capabilities, it does not consider whether the processing speed is limited and whether the parameters required for its own training have reached the optimal state in terms of data input processing, so the reliability of the training results cannot be guaranteed. Therefore, the use of a single DBN algorithm cannot meet the actual supervision needs of electricity theft. Summary of the invention

[0004] The purpose of the present invention is to provide a method, system, terminal device and storage medium for identifying electricity theft, so as to solve the technical problems that the existing methods for identifying electricity theft have strong limitations and the identification results are not accurate enough.

[0005] In order to overcome the above defects in the prior art, the present invention provides a method for identifying electricity theft, comprising:

[0006] Collecting historical electricity usage data of the user to be tested, and dividing the historical electricity usage data into a first training sample and a test sample according to a first preset ratio;

[0007] Performing dimensionality reduction processing on the first training sample, and using the dimensionality-reduced training sample to train the DBN model to obtain a target DBN model and a first output result;

[0008] Weighting the first output result to obtain an anomaly detection threshold;

[0009] Inputting the test sample into the target DBN model to obtain a second output result, and using the second output result to determine a target detection value of the power consumption behavior of the user to be tested;

[0010] Determine whether the target detection value is greater than the abnormal detection threshold; if so, the current power consumption behavior of the user to be tested is normal; if not, the current power consumption behavior of the user to be tested is abnormal.

[0011] Furthermore, the DBN model is trained using the training samples after dimensionality reduction to obtain a target DBN model, including:

[0012] Using a sampling algorithm to extract a second preset ratio of samples from the training samples after dimensionality reduction as second training samples, and using the remaining training samples after dimensionality reduction as third training samples;

[0013] Inputting the second training sample into a plurality of first DBN models for unsupervised pre-training to obtain a plurality of second DBN models and corresponding network parameters;

[0014] According to the plurality of second DBN models, the third training sample is input into any one of the second DBN models for fine-tuning, and the target DBN model is determined using the fine-tuned network parameters.

[0015] Furthermore, before inputting the second training samples into a plurality of first DBN models for unsupervised pre-training, the method further includes:

[0016] The AG algorithm is used to globally optimize the network parameters of the original DBN model, and the optimization results are used as the network parameters of the first DBN model.

[0017] Furthermore, the first output result includes: an output result after the second training sample is input into a plurality of first DBN models, and an output result after the third training sample is input into any one of the second DBN models.

[0018] Furthermore, LASSO is used to perform sparse weighted processing on the first output result to obtain an anomaly detection threshold.

[0019] Furthermore, the PCA algorithm is used to perform dimensionality reduction processing on the first training samples.

[0020] Furthermore, the step of using the second output result to determine a target detection value of the power consumption behavior of the user to be tested includes:

[0021] Calculating the detection rate and false detection rate of the second output result;

[0022] A ROC curve is established with the detection rate as the horizontal coordinate and the false positive rate as the vertical coordinate, and the point closest to the coordinate (0, 1) is taken as the target detection value.

[0023] The present invention also provides a system for identifying electricity theft, comprising:

[0024] A data acquisition unit, configured to collect historical electricity usage data of the user to be tested, and divide the historical electricity usage data into a first training sample and a test sample according to a first preset ratio;

[0025] A pre-training unit, configured to perform dimensionality reduction processing on the first training sample, and train the DBN model using the dimensionality-reduced training sample to obtain a target DBN model and a first output result;

[0026] A weighted processing unit, used for weighting the first output result to obtain an abnormality detection threshold;

[0027] a target detection value determination unit, configured to input the test sample into the target DBN model to obtain a second output result, and determine a target detection value of the power consumption behavior of the user to be tested by using the second output result;

[0028] The power usage behavior judgment unit is used to judge whether the target detection value is greater than the abnormal detection threshold; if so, the power usage behavior of the current user to be tested is normal; if not, the power usage behavior of the current user to be tested is abnormal.

[0029] The present invention also provides a terminal device, comprising: a processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor implements the electricity theft behavior identification method as described in any one of the above items when executing the computer program.

[0030] The present invention also provides a computer-readable storage medium on which a computer program is stored. The computer program is executed by a processor to implement the method for identifying electricity theft as described in any one of the above items.

[0031] Compared with the prior art, the beneficial effects of the present invention are:

[0032] The present invention uses the PCA algorithm to reduce the dimension of the training samples to reduce the computational difficulty for subsequent training; uses the DBN model to perform unsupervised training on the reduced-dimensional data, and uses the AG algorithm to provide the optimal network parameters for the DBN to meet the training needs of the DBN network, so as to output the best abnormal detection threshold of the user to be tested; finally, simulates dynamic detection of the sample to be tested to output an intuitive ROC curve, and determines whether the relationship between the target detection value and the abnormal detection threshold of the user to be tested conforms to normal electricity consumption behavior. The present invention can improve the accuracy of identifying the user's electricity theft behavior, thereby enhancing the safety and reliability of the power supply system, and has the advantages of low cost, high accuracy and strong applicability. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] In order to more clearly illustrate the technical solution of the present invention, the drawings required for use in the implementation mode will be briefly introduced below. Obviously, the drawings described below are only some implementation modes of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0034] Figure 1 It is a flowchart of a method for identifying electricity theft provided by a certain embodiment of the present invention;

[0035] Figure 2 It is a structural diagram of a system for identifying electricity theft provided by an embodiment of the present invention;

[0036] Figure 3 It is a schematic diagram of the structure of a terminal device provided by a certain embodiment of the present invention. DETAILED DESCRIPTION

[0037] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.

[0038] It should be understood that the step numbers used in this article are only for the convenience of description and are not intended to limit the order in which the steps are executed.

[0039] It should be understood that the terms used in the present specification are only for the purpose of describing specific embodiments and are not intended to limit the present invention. As used in the present specification and the appended claims, unless the context clearly indicates otherwise, the singular forms "a", "an" and "the" are intended to include plural forms.

[0040] The terms “include” and “comprising” indicate the presence of described features, integers, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integers, steps, operations, elements, components and / or combinations thereof.

[0041] The term "and / or" means and includes any and all possible combinations of one or more of the associated listed items.

[0042] First aspect:

[0043] See also Figure 1 A method for identifying electricity theft behavior is provided in an embodiment of the present invention, comprising the following steps:

[0044] S10: Collect historical electricity usage data of the user to be tested, and divide the historical electricity usage data into a first training sample and a test sample according to a first preset ratio.

[0045] In this step, the hourly electricity consumption data of the user to be tested within a preset time range (the past year) is first collected as original reference data, as historical electricity consumption data; it should be noted that the electricity consumption data for the past year is only a preferred method of data collection in this embodiment. In actual applications, data from other time ranges can be selected as needed, and no restrictions are made here.

[0046] Further, after obtaining the historical electricity consumption data, the historical electricity consumption data is divided into a first training sample and a test sample according to a first preset ratio, and the first preset ratio can usually be set to 7:3 or 8:2. Similarly, in practical applications, other ratios can be selected as the first preset ratio according to environmental requirements, and no limitation is made here.

[0047] Specifically, the first training sample in this embodiment is set to X R , the test sample is set to X J Then, for the first training sample X R According to certain rules, the scale is divided to obtain the first classified training sample: for example, for the first training sample X R The electricity consumption data of the users included in the data are divided according to the time scale of 30 consecutive days to obtain X J =(x1, x2, ..., x 720 ),

[0048] S20, performing dimensionality reduction processing on the first training sample, and using the dimensionality-reduced training sample to train the DBN model to obtain a target DBN model and a first output result;

[0049] In this step, based on the training sample X obtained in step S10, J , for the training sample X J Dimensionality reduction is performed to obtain higher quality training samples, and then the DBN model is trained with the higher quality samples. It should be noted that the DBN model is a deep belief network model, and each hidden layer of the model represents an intermediate representation of the input pattern. Each neuron represents a feature of the input data, and the connection relationship between neurons represents the connection between these features. The combination of these features and connection relationships constitutes an abstract representation of the input data. Among them, the DBN model extracts and reconstructs features layer by layer. The higher the number of layers, the fewer the number of neuron nodes in the hidden layer, and the simpler the representation of the input pattern. Therefore, this method can simplify a complex input pattern and finally obtain a simple output.

[0050] In one embodiment, the dimensionality reduction processing of the first training sample is performed using a principal component analysis algorithm, i.e., a PCA algorithm. It should be noted that the PCA algorithm is a commonly used data analysis method. PCA transforms the original data into a set of linearly independent representations of each dimension through linear transformation, which can be used to extract the main characteristic components of the data and is often used for dimensionality reduction of high-dimensional data.

[0051] Specifically, the dimensionality reduction process using the PCA algorithm includes the following steps:

[0052] 1.1) Calculate the n-dimensional sample X J The projected data variance σ 2 , get sample X J Degree of dispersion:

[0053]

[0054] Where v is the projection unit vector, v T is the transposed vector of v, and N is the number of samples.

[0055] make Then we have:

[0056] σ 2 =v T C X v

[0057] 1.2) Modeling the optimization problem of PCA dimensionality reduction:

[0058]

[0059] 1.3) Using the Lagrange equation to solve the optimal value, we get:

[0060] f(v,λ)=v T C X v-λ(‖v‖-1)=v T C X v-λ(v T v-1)

[0061] Where λ is the Lagrange multiplier.

[0062] Differentiate f(v,λ) and we get:

[0063]

[0064] Therefore, maxσ 2 =max v T C X v = max v T λv=maxλ

[0065] Calculate the projection data pair X J Contribution rate r:

[0066]

[0067] When r tends to 1, it means that there are k (k ≤ n) groups of projection data that can fully represent the original sample data, that is, through PCA on X J After dimensionality reduction, we get X F =(x f1 , x f2 , …, x fk ).

[0068] Furthermore, in this embodiment, the DBN model is trained using the dimensionally reduced training samples to obtain a target DBN model and a first output result.

[0069] In one embodiment, the step of training the DBN model using the dimensionally reduced training samples to obtain the target DBN model includes:

[0070] 2.1) Using a sampling algorithm, extract a second preset ratio of samples from the training samples after dimensionality reduction as the second training samples, and use the remaining training samples after dimensionality reduction as the third training samples.

[0071] Among them, the Sampling algorithm is used to obtain R A small number of samples are cyclically drawn according to the second preset ratio to obtain

[0072] 2.2) Inputting the second training samples into multiple first DBN models for unsupervised pre-training to obtain multiple second DBN models and corresponding network parameters.

[0073] In one embodiment, before inputting the second training sample into a plurality of first DBN models for unsupervised pre-training, the method further includes:

[0074] The AG algorithm is used to globally optimize the network parameters of the original DBN model, and the optimization results are used as the network parameters of the first DBN model.

[0075] It should be noted that the ant colony algorithm (AG) is a simulation optimization algorithm that simulates the foraging behavior of ants. Its basic principles include: a) ants release pheromones on the path; b) when encountering an intersection that they have not walked through, they randomly choose a path to walk. At the same time, they release pheromones related to the length of the path; c) the pheromone concentration is inversely proportional to the length of the path. When the subsequent ants encounter the intersection again, they choose the path with a higher pheromone concentration; d) the pheromone concentration on the optimal path becomes larger and larger; e) Finally, the ant colony finds the optimal foraging path.

[0076] Specifically, the process of global optimization by the AG algorithm in this embodiment includes:

[0077] A) Calculate the change probability of the network parameter θ of the original DBN model at a certain moment:

[0078]

[0079] Where n∈J S (m), J S (m) is the set composed of the changing trend of network parameters θ, τ mn (t) is the pheromone concentration in the changing trend, γ mn (t) is the heuristic information, that is, the information of the original network parameter θ, α is the heuristic factor of the pheromone concentration, β is the expected value of the heuristic factor, m and n are the starting and ending points of the change respectively, and s is the parameter value in the network parameter θ.

[0080] B) Update the pheromone concentration and calculate the probability of change after the update:

[0081] τ mn (t+1)=(1-ρ)τ mn (t)+Δτ mn (t)

[0082] In the formula, Δτ mn (t) is the pheromone increment value, is the residual pheromone value, Q is the pheromone intensity value, L s is the length of the changing path, and ρ is the pheromone volatilization factor.

[0083] C) The probability of change of the network parameter θ after the update When it is less than or equal to the preset threshold, the pheromone concentration at this time is taken as the optimal result A1 of the network parameters. ij is the weight, representing the relationship between the input layer and the hidden layer in the DBN model, b i is the bias vector of the input layer, c j is the bias vector of the hidden layer.

[0084] Further, step 2.2) is performed, that is, the second training sample is input into multiple first DBN models for unsupervised pre-training to obtain multiple second DBN models and corresponding network parameters.

[0085] Specifically, in step 2.2), the parameter values ​​in the first DBN model are set as follows: the number of neurons in the input layer is 40, the number of neurons in the first hidden layer is 50, the number of neurons in the second hidden layer is 20, the number of neurons in the output layer is 1, the learning rate is 0.3, the momentum term is 0.3, the batch size is 10, the number of iterations is 20, and the target error value is 0.0001.

[0086] Then, the initial training samples are normalized and the processed samples are input into the first DBN model to be trained to obtain the output result. Specifically, the normalization process is:

[0087]

[0088] In the formula, X is the normalized value, x min is the minimum value of the sample data, x max is the maximum value of the sample data, and x is the initial data.

[0089] Further, according to the output result, the error of the output result of the trained first DBN model is calculated;

[0090]

[0091] Then, use the error value E to adjust the weight w ij To make corrections:

[0092]

[0093] Where η is the learning rate.

[0094] Finally, using the corrected w ij Adjust b i 、c j , output the trained network parameter A2. That is, the network parameter of the second DBN model is A2.

[0095] 2.3) According to the plurality of second DBN models, the third training sample is input into any one of the second DBN models for fine-tuning, and the target DBN model is determined using the fine-tuned network parameters.

[0096] Specifically, the mth second DBN model is selected from the n second DBN models. is a training sample, and the network parameter A2 in the mth second DBN model is fine-tuned to A3.

[0097] It should be noted that, in this embodiment, a first output result needs to be obtained, and the first output result is the output result after the second training sample is input into a plurality of first DBN models, and the output result after the third training sample is input into any second DBN model. That is, the first DBN model and the second DBN model perform the training sample X R The output value Y=(y ij ) k×n .

[0098] S30: Weight the first output result to obtain an abnormality detection threshold.

[0099] In this step, LASSO is mainly used to sparse the weak classifier to obtain the external weight β = {β1, β2, ..., β n}, weight the weak classifiers and obtain the model output by As the anomaly detection threshold of the model for a single time point of the i-th user to be tested.

[0100] In one embodiment, step S30 further includes the following sub-steps:

[0101] 3.1) Use LASSO to sparse the weak classifier and obtain the external weights;

[0102] The calculation formula of the LASSO algorithm is:

[0103]

[0104] In the formula, β j is the external weight of the jth weak classifier, λ∈[0,+∞) is the penalty factor, l i is the label of the i-th training sample.

[0105] 3.2) Using the external weights to weight the output values ​​of the weak classifiers.

[0106] Specifically, the external weights of the weak classifier are obtained as follows: β = {β1, β2, ..., β n}, weight the output of each weak classifier to obtain the model output

[0107] S40, inputting the test sample into the target DBN model to obtain a second output result, and using the second output result to determine a target detection value of the power consumption behavior of the user to be tested;

[0108] Specifically, firstly, the test sample X T Used to simulate dynamic detection, using the second output result and sample label L TDraw the ROC curve of the model for the second output result; secondly, obtain the best critical point on the ROC curve, and use the point as the target detection value for determining the power consumption behavior of the user to be tested.

[0109] Specifically, step S40 includes the following sub-steps:

[0110] 4.1) Calculating the detection rate and false detection rate of the second output result;

[0111] It should be noted that if the target detection value is too low, it will tend to judge the power consumption data as abnormal, resulting in an increase in the false detection rate; if the target detection value is too high, it will tend to judge the power consumption data as normal, resulting in a decrease in the detection rate. The selection of the target detection value will determine the quality of the power theft detection.

[0112] Specifically, the calculation formula for the detection rate is:

[0113] T PR =T P / (T P +F N )

[0114] Where, T P is the number of samples of abnormal power consumption data detected as abnormal, F N The abnormal electricity consumption data is the number of samples detected as normal.

[0115] The formula for calculating the false positive rate is:

[0116] F PR =F P / (F P +T N )

[0117] In the formula, F P is the number of samples of normal power consumption data detected as abnormal, T N The normal electricity consumption data is the number of samples detected as normal.

[0118] 4.2) Establish a ROC curve with the detection rate as the horizontal coordinate and the false positive rate as the vertical coordinate, and take the point closest to the coordinate (0,1) as the target detection value.

[0119] Take the test sample X T The detection rate of the test results is the horizontal axis, and the test sample X T The false positive rate of the detection result is used as the ordinate to establish the ROC curve, and the point (0,1) is defined as the perfect detection point. The point closest to the point (0,1) on the ROC curve is selected, and the detection result corresponding to the point is used as the target detection value y0.

[0120] S50, determining whether the target detection value is greater than the abnormal detection threshold; if so, the current power consumption behavior of the user to be tested is normal; if not, the current power consumption behavior of the user to be tested is abnormal.

[0121] In this step, it is determined whether the target detection value y0 is greater than the abnormal detection threshold of the i-th user to be tested; if so, the power usage behavior of the i-th user to be tested is determined to be normal; if not, the power usage behavior of the i-th user is determined to be abnormal.

[0122] The method for identifying electricity theft provided in the embodiment of the present invention reduces the dimensionality of training samples by using the principal component analysis algorithm PCA to reduce the computational difficulty for subsequent training; provides optimal network parameters for DBN by using the ant colony algorithm AG to output the best abnormal detection threshold of the user to be tested; finally, simulates dynamic detection of the sample to be tested to output an intuitive ROC curve, thereby accurately judging the user's electricity consumption behavior. The embodiment of the present invention can improve the accuracy of identifying the user's electricity theft behavior, enhance the safety and reliability of the power supply system, and is not only low-cost but also highly applicable.

[0123] Second aspect:

[0124] See also Figure 2 In one embodiment of the present invention, a system for identifying electricity theft is provided, comprising:

[0125] The data acquisition unit 01 is used to collect historical electricity consumption data of the user to be tested, and divide the historical electricity consumption data into a first training sample and a test sample according to a first preset ratio;

[0126] A pre-training unit 02 is used to perform dimensionality reduction processing on the first training sample, and use the training sample after dimensionality reduction to train the DBN model to obtain a target DBN model and a first output result;

[0127] A weighted processing unit 03, used to weight the first output result to obtain an abnormality detection threshold;

[0128] A target detection value determination unit 04 is used to input the test sample into the target DBN model to obtain a second output result, and use the second output result to determine a target detection value of the power consumption behavior of the user to be tested;

[0129] The power consumption behavior judgment unit 05 is used to judge whether the target detection value is greater than the abnormal detection threshold; if so, the power consumption behavior of the current user to be tested is normal; if not, the power consumption behavior of the current user to be tested is abnormal.

[0130] The electricity theft behavior identification system provided by the embodiment of the present invention is used to execute the electricity theft behavior identification method as described in the first aspect. The method uses the principal component analysis algorithm PCA to perform dimensionality reduction processing on the training samples to reduce the computational difficulty for subsequent training; uses the ant colony algorithm AG to provide the optimal network parameters for DBN to output the best abnormal detection threshold of the user to be tested; finally, simulates dynamic detection of the sample to be tested to output an intuitive ROC curve, so as to accurately judge the user's electricity consumption behavior. The embodiment of the present invention can improve the accuracy of user electricity theft behavior identification, enhance the safety and reliability of the power supply system, and is not only low-cost but also highly applicable.

[0131] The third aspect

[0132] See also Figure 3 , a certain embodiment of the present invention further provides a terminal device, the terminal device comprising:

[0133] processor, memory, and bus;

[0134] The bus is used to connect the processor and the memory;

[0135] The memory is used to store operation instructions;

[0136] The processor is used to call the operation instruction, and the executable instruction enables the processor to perform the operation corresponding to the electricity theft behavior identification method shown in the first aspect of the present application.

[0137] In an optional embodiment, a terminal device is provided, such as Figure 3 As shown, Figure 3 The terminal device shown includes: a processor 001 and a memory 003. The processor 001 and the memory 003 are connected, such as through a bus 002. Optionally, the terminal device may also include a transceiver 004. It should be noted that in actual applications, the transceiver 004 is not limited to one, and the structure of the terminal device does not constitute a limitation on the embodiments of the present application.

[0138] Processor 001 may be a CPU, a general-purpose processor, a DSP, an ASIC, an FPGA or other programmable logic device, a transistor logic device, a hardware component or any combination thereof. It may implement or execute various exemplary logic blocks, modules and circuits described in conjunction with the disclosure of this application. Processor 001 may also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, etc.

[0139] The bus 002 may include a path to transmit information between the above components. The bus 002 may be a PCI bus or an EISA bus, etc. The bus 002 may be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 3 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.

[0140] The memory 003 may be a ROM or other type of static storage device that can store static information and instructions, a RAM or other type of dynamic storage device that can store information and instructions, or an EEPROM, a CD-ROM or other optical disk storage, an optical disk storage (including a compressed optical disk, a laser disk, an optical disk, a digital versatile disk, a Blu-ray disk, etc.), a magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store the desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited thereto.

[0141] The memory 003 is used to store application code for executing the solution of the present application, and the execution is controlled by the processor 001. The processor 001 is used to execute the application code stored in the memory 003 to implement the content shown in any of the above method embodiments.

[0142] Among them, terminal devices include but are not limited to: mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (personal digital assistants), PADs (tablet computers), PMPs (portable multimedia players), vehicle-mounted terminals (such as vehicle-mounted navigation terminals), etc., and fixed terminals such as digital TVs, desktop computers, etc.

[0143] Another embodiment of the present application provides a computer-readable storage medium, on which a computer program is stored. When the computer-readable storage medium is run on a computer, the computer can execute the corresponding content in the aforementioned method embodiment.

[0144] The above is a preferred embodiment of the present invention. It should be pointed out that a person skilled in the art can make several improvements and modifications without departing from the principle of the present invention. These improvements and modifications are also considered to be within the scope of protection of the present invention.

Claims

1. A method for identifying electricity theft, characterized in that: include: Collecting historical electricity usage data of the user to be tested, and dividing the historical electricity usage data into a first training sample and a test sample according to a first preset ratio; Performing dimensionality reduction processing on the first training sample, and using the dimensionality-reduced training sample to train the DBN model to obtain a target DBN model and a first output result; Weighting the first output result to obtain an anomaly detection threshold; Inputting the test sample into the target DBN model to obtain a second output result, and using the second output result to determine a target detection value of the power consumption behavior of the user to be tested; Determining whether the target detection value is greater than the abnormality detection threshold; If yes, the current electricity consumption behavior of the user to be tested is normal; If not, the current power consumption behavior of the user to be tested is abnormal; The method of training the DBN model using the dimensionally reduced training samples to obtain the target DBN model includes: Using a sampling algorithm to extract a second preset ratio of samples from the training samples after dimensionality reduction as second training samples, and using the remaining training samples after dimensionality reduction as third training samples; Inputting the second training sample into a plurality of first DBN models for unsupervised pre-training to obtain a plurality of second DBN models and corresponding network parameters; According to the plurality of second DBN models, inputting the third training sample into any one of the second DBN models for fine-tuning, and determining a target DBN model using the fine-tuned network parameters; Before inputting the second training sample into a plurality of first DBN models for unsupervised pre-training, the method further includes: The AG algorithm is used to globally optimize the network parameters of the original DBN model, and the optimization results are used as the network parameters of the first DBN model, including: Calculating a first change probability of the network parameters of the original DBN model at a certain moment; The pheromone concentration is updated, and the updated second change probability is calculated; When the second change probability of the updated network parameter is less than or equal to a preset threshold, the pheromone concentration at this time is taken as the optimal result of the network parameter; The first output result includes: the output result after the second training sample is input into a plurality of first DBN models, and the output result after the third training sample is input into any one of the second DBN models; The method of using the second output result to determine a target detection value of the power usage behavior of the user to be tested includes: Calculating the detection rate and false detection rate of the second output result; The calculation formula of the detection rate is: T PR =T P / (T P +F N ) Where, T P is the number of samples of abnormal power consumption data detected as abnormal, F N The number of samples where abnormal power consumption data is detected as normal; The calculation formula of the false detection rate is: F PR =F P / (F P +T N ) In the formula, F P is the number of samples of normal power consumption data detected as abnormal, T N The normal electricity consumption data is the number of samples detected as normal; A ROC curve is established with the detection rate as the horizontal coordinate and the false positive rate as the vertical coordinate, and the point closest to the coordinate (0, 1) is taken as the target detection value.

2. The method for identifying electricity theft according to claim 1, characterized in that: The first output result is subjected to sparse weighting processing by using LASSO to obtain an anomaly detection threshold.

3. The method for identifying electricity theft according to claim 1, characterized in that: The PCA algorithm is used to perform dimensionality reduction processing on the first training samples.

4. A system for identifying electricity theft, characterized in that: include: A data acquisition unit, configured to collect historical electricity usage data of the user to be tested, and divide the historical electricity usage data into a first training sample and a test sample according to a first preset ratio; A pre-training unit, configured to perform dimensionality reduction processing on the first training sample, and train the DBN model using the dimensionality-reduced training sample to obtain a target DBN model and a first output result; A weighted processing unit, used for weighting the first output result to obtain an abnormality detection threshold; a target detection value determination unit, configured to input the test sample into the target DBN model to obtain a second output result, and determine a target detection value of the power consumption behavior of the user to be tested by using the second output result; A power consumption behavior judgment unit, used to judge whether the target detection value is greater than the abnormal detection threshold; If yes, the current electricity consumption behavior of the user to be tested is normal; If not, the current power consumption behavior of the user to be tested is abnormal; The method of training the DBN model using the dimensionally reduced training samples to obtain the target DBN model includes: Using a sampling algorithm to extract a second preset ratio of samples from the training samples after dimensionality reduction as second training samples, and using the remaining training samples after dimensionality reduction as third training samples; Inputting the second training sample into a plurality of first DBN models for unsupervised pre-training to obtain a plurality of second DBN models and corresponding network parameters; According to the plurality of second DBN models, inputting the third training sample into any one of the second DBN models for fine-tuning, and determining a target DBN model using the fine-tuned network parameters; Before inputting the second training sample into a plurality of first DBN models for unsupervised pre-training, the method further includes: The AG algorithm is used to globally optimize the network parameters of the original DBN model, and the optimization results are used as the network parameters of the first DBN model, including: Calculating a first change probability of the network parameters of the original DBN model at a certain moment; The pheromone concentration is updated, and the updated second change probability is calculated; When the second change probability of the updated network parameter is less than or equal to a preset threshold, the pheromone concentration at this time is taken as the optimal result of the network parameter; The first output result includes: the output result after the second training sample is input into a plurality of first DBN models, and the output result after the third training sample is input into any one of the second DBN models; The method of using the second output result to determine a target detection value of the power usage behavior of the user to be tested includes: Calculating the detection rate and false detection rate of the second output result; The calculation formula of the detection rate is: T PR =T P / (T P +F N ) Where, T P is the number of samples of abnormal power consumption data detected as abnormal, F N The number of samples where abnormal power consumption data is detected as normal; The calculation formula of the false detection rate is: F PR =F P / (F P +T N ) In the formula, F P is the number of samples of normal power consumption data detected as abnormal, T N The normal electricity consumption data is the number of samples detected as normal; A ROC curve is established with the detection rate as the horizontal coordinate and the false positive rate as the vertical coordinate, and the point closest to the coordinate (0, 1) is taken as the target detection value.

5. A terminal device, characterized in that: include: A processor, a memory, and a computer program stored in the memory and configured to be executed by the processor, wherein the processor implements the method for identifying electricity theft according to any one of claims 1 to 3 when executing the computer program.

6. A computer-readable storage medium having a computer program stored thereon, characterized in that: The computer program is executed by a processor to implement the method for identifying electricity theft as described in any one of claims 1 to 3.

Citation Information

Patent Citations

  • Electricity stealing behavior detection method based on BP neural network

    CN112836738A