Electricity stealing behavior detection method and device, computer device, readable storage medium and program product

CN120687793BActive Publication Date: 2026-09-18ELECTRIC POWER RES INST CHINA SOUTHERN POWER GRID CO LTD
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202511068418.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-07-31
Publication Date
2026-09-18
Estimated Expiration
2045-07-31

AI Technical Summary

Technical Problem

[0003]在现有技术中,往往是基于人工稽查和电气规则判别的窃电检测方法对窃电行为进行检测,但是,这种方法的检测精度较低

Benefits of technology

[0039] Fourthly, this application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program thereon, which, when executed by a processor, implements the steps of the methods in any of the above embodiments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120687793B_ABST
    Figure CN120687793B_ABST
Patent Text Reader

Abstract

The application relates to an electricity stealing behavior detection method and device, computer equipment, a readable storage medium and a program product. The method comprises the following steps: acquiring a preset relationship function corresponding to a preset electricity stealing characteristic, and acquiring a normal load sequence of a normal user; based on the normal load sequence, the preset relationship function, a historical detection period and a trained electricity stealing data optimization model, a target electricity stealing load sequence is output; for any one of the normal load sequence and the target electricity stealing load sequence, the load sequence is determined as an initial load sequence, the initial load sequence is linearly fitted, and a fitting error is obtained; the initial load sequence is segmented to obtain a plurality of target load sequences, and an electricity stealing detection model is trained; and based on a to-be-detected load sequence and the trained electricity stealing detection model, an electricity stealing period of a to-be-detected user is obtained. The method provided by the application can improve the detection accuracy of detecting electricity stealing behavior.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of electricity theft detection technology, and in particular to a method, apparatus, computer equipment, readable storage medium, and program product for detecting electricity theft. Background Technology

[0002] Electricity theft refers to the act of users illegally tampering with electricity meters, transformers, and other power grid metering devices using specific technologies and equipment, resulting in a reading lower than the actual amount of electricity consumed. Electricity theft not only causes direct economic losses to power grid companies and disrupts the normal electricity market order, but may also affect the safe and stable operation of the power grid. Therefore, detecting electricity theft is an essential part of any monitoring process.

[0003] In existing technologies, electricity theft detection methods are often based on manual inspection and electrical rule judgment. However, the detection accuracy of this method is low. Summary of the Invention

[0004] Therefore, it is necessary to provide a method, device, computer equipment, readable storage medium, and program product for detecting electricity theft that can improve the accuracy of electricity theft detection, in response to the above-mentioned technical problems.

[0005] Firstly, this application provides a method for detecting electricity theft, the method comprising:

[0006] The system obtains preset relational functions corresponding to various preset electricity theft characteristics, and obtains the normal load sequence of normal users who have not engaged in electricity theft during the historical detection period. Among them, the electricity theft characteristics represent the form of influence of electricity theft behavior on the load data of electricity theft users, and the relational functions represent the relationship between the normal load data when the user has not engaged in electricity theft and the abnormal load data when the user has engaged in electricity theft.

[0007] For any preset electricity theft characteristic, the normal load sequence is input into the preset relation function corresponding to the preset electricity theft characteristic, and the initial electricity theft load sequence corresponding to the preset electricity theft characteristic is output. The initial electricity theft load sequence and the historical detection period are input into the trained electricity theft data optimization model, and the target electricity theft load sequence corresponding to the preset electricity theft characteristic is output.

[0008] For any one of the normal load sequence and the target electricity theft load sequence, the load sequence is determined as the initial load sequence, and the initial load sequence is linearly fitted based on the least squares method to obtain the fitting error;

[0009] Based on the fitting error and the preset error threshold, the initial load sequence is segmented to obtain multiple target load sequences;

[0010] Based on the target load sequence, the time period corresponding to the target load sequence, and the corresponding electricity theft identifier of the target load sequence, the electricity theft detection model is trained to obtain the trained electricity theft detection model; wherein, the electricity theft identifier indicates whether the load data in the corresponding load sequence is electricity theft load data;

[0011] Obtain the load sequence of the user to be detected, input the load sequence to be detected into the trained electricity theft detection model, and output the electricity theft period of the user to be detected.

[0012] In one embodiment, the step of inputting the initial electricity theft load sequence and the historical detection period into the trained electricity theft data optimization model, and outputting the target electricity theft load sequence corresponding to the preset electricity theft characteristics, includes:

[0013] Based on a preset noise addition step size, Gaussian noise is gradually added to the initial electricity theft load sequence to obtain an intermediate electricity theft load sequence.

[0014] The intermediate electricity theft load sequence and the historical detection period are input into the trained electricity theft data optimization model, and the target electricity theft load sequence is output.

[0015] In one embodiment, the step of segmenting the initial load sequence based on the fitting error and a preset error threshold to obtain multiple target load sequences includes:

[0016] For any given initial load sequence, if the fitting error is greater than the preset error threshold, the initial load sequence is divided into two new initial load sequences.

[0017] For any new initial load sequence, return to the step of linearly fitting the initial load sequence based on the least squares method and obtaining the fitting error, and continue to execute until the fitting error of all initial load sequences is not greater than the preset error threshold.

[0018] If the fitting error is not greater than the preset error threshold, the initial load sequence is determined as the first intermediate load sequence;

[0019] Based on preset probability values ​​and preset mask values, multiple target load sequences are determined from the first intermediate load sequence.

[0020] In one embodiment, determining multiple target load sequences from the first intermediate load sequence based on a preset probability value and a preset mask value includes:

[0021] Based on the preset probability value, at least one second intermediate load sequence is randomly determined from the first intermediate load sequence, and the product between the second intermediate load sequence and the preset mask value is determined as the third intermediate load sequence;

[0022] The first intermediate load sequence and the third intermediate load sequence, which were not identified as the second intermediate load sequence, are identified as the target load sequence.

[0023] In one embodiment, the training process for the electricity theft data optimization model includes:

[0024] Obtain the historical electricity theft type, historical electricity theft period, historical electricity theft characteristics, and first historical electricity theft load sequence of electricity theft users within the historical detection period;

[0025] For the remaining time periods in the historical detection period excluding the historical electricity theft period, at least one historical non-electricity theft period with the same duration as the historical electricity theft period is determined from the remaining time periods, and the historical non-electricity theft load sequence of the electricity theft user in the historical non-electricity theft period is obtained;

[0026] Obtain the historical relational function corresponding to the historical electricity theft characteristics, input the historical non-electricity theft load sequence into the historical relational function, and output the second historical electricity theft load sequence;

[0027] The electricity theft data optimization model is trained based on the historical electricity theft types, the historical electricity theft periods, the first historical electricity theft load sequence, and the second historical electricity theft load sequence.

[0028] In one embodiment, training the electricity theft data optimization model based on the historical electricity theft type, the historical electricity theft period, the first historical electricity theft load sequence, and the second historical electricity theft load sequence includes:

[0029] Based on the preset noise addition step size, Gaussian noise is gradually added to the second historical electricity theft load sequence to obtain the third historical electricity theft load sequence;

[0030] The historical electricity theft type, the historical electricity theft period, the first historical electricity theft load sequence, and the third historical electricity theft load sequence are input into the electricity theft data optimization model to obtain the trained electricity theft data optimization model.

[0031] Secondly, this application also provides a device for detecting electricity theft, the device comprising:

[0032] The first acquisition module is used to acquire preset relational functions corresponding to various preset electricity theft characteristics, and to acquire the normal load sequence of normal users who have not engaged in electricity theft during the historical detection period; wherein, the electricity theft characteristics represent the form of influence of electricity theft behavior on the load data of electricity theft users, and the relational function represents the relationship between the normal load data when the user has not engaged in electricity theft and the abnormal load data when the user has engaged in electricity theft.

[0033] The input module is used to input the normal load sequence into the preset relation function corresponding to the preset electricity theft characteristic for any preset electricity theft characteristic, output the initial electricity theft load sequence corresponding to the preset electricity theft characteristic, and input the initial electricity theft load sequence and the historical detection period into the trained electricity theft data optimization model to output the target electricity theft load sequence corresponding to the preset electricity theft characteristic.

[0034] The determination module is used to determine the load sequence as the initial load sequence for any one of the normal load sequence and the target electricity theft load sequence, and to perform linear fitting on the initial load sequence based on the least squares method to obtain the fitting error;

[0035] The segmentation module is used to segment the initial load sequence based on the fitting error and a preset error threshold to obtain multiple target load sequences;

[0036] The training module is used to train the electricity theft detection model based on the target load sequence, the time period corresponding to the target load sequence, and the corresponding electricity theft identifier of the target load sequence, to obtain the trained electricity theft detection model; wherein, the electricity theft identifier indicates whether the load data in the corresponding load sequence is electricity theft load data;

[0037] The second acquisition module is used to acquire the load sequence of the user to be detected, input the load sequence to be detected into the trained electricity theft detection model, and output the electricity theft period of the user to be detected.

[0038] Thirdly, this application also provides a computer device. The computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the steps of the methods in any of the above embodiments.

[0039] Fourthly, this application also provides a computer-readable storage medium. The computer-readable storage medium stores a computer program thereon, which, when executed by a processor, implements the steps of the methods in any of the above embodiments.

[0040] Fifthly, this application also provides a computer program product. The computer program product includes a computer program that, when executed by a processor, implements the steps of the methods in any of the above embodiments.

[0041] The aforementioned electricity theft detection method, device, computer equipment, readable storage medium, and program product acquire preset relational functions corresponding to various preset electricity theft characteristics, and acquire normal load sequences of normal users who have not engaged in electricity theft during historical detection periods; for any preset electricity theft characteristic, the normal load sequence is input into the preset relational function corresponding to the preset electricity theft characteristic, outputting an initial electricity theft load sequence corresponding to the preset electricity theft characteristic; the initial electricity theft load sequence and the historical detection period are input into a trained electricity theft data optimization model, outputting a target electricity theft load sequence corresponding to the preset electricity theft characteristic; and the normal load sequence and the target electricity theft... The method involves determining any load sequence from the load sequence as the initial load sequence, and performing a linear fit on the initial load sequence using the least squares method to obtain the fitting error. Based on the fitting error and a preset error threshold, the initial load sequence is segmented to obtain multiple target load sequences. A power theft detection model is trained based on the target load sequences, the corresponding time periods, and the corresponding power theft identifiers for the target load sequences, resulting in a trained power theft detection model. The method then acquires the target load sequence for the user to be detected, inputs it into the trained power theft detection model, and outputs the power theft time period for the user to be detected. The method provided in this application can improve the detection accuracy of power theft. Attached Figure Description

[0042] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0043] Figure 1 This is a flowchart illustrating a method for detecting electricity theft in one embodiment;

[0044] Figure 2 This is a flowchart illustrating a method for outputting a target electricity theft load sequence in one embodiment;

[0045] Figure 3 This is a structural block diagram of an electricity theft detection device in one embodiment;

[0046] Figure 4 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation

[0047] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.

[0048] It should be noted that the terms "first," "second," etc., used in this application can be used to describe various elements, but these elements are not limited by these terms. These terms are only used to distinguish the first element from the second element. The terms "comprising" and "having," and any variations thereof, used in this application, are intended to cover non-exclusive inclusion. The term "multiple" used in this application refers to two or more. The term "and / or" used in this application refers to one of the embodiments, or any combination of multiple embodiments.

[0049] In one embodiment, such as Figure 1 As shown, a method for detecting electricity theft is provided. This embodiment illustrates the method applied to a terminal, but it is understood that the method can also be applied to a server, or to a system including both a terminal and a server, and implemented through interaction between the terminal and the server. In this embodiment, the method includes the following steps:

[0050] S102. Obtain the preset relational functions corresponding to various preset electricity theft characteristics, and obtain the normal load sequence of normal users who have not engaged in electricity theft during the historical detection period; wherein, the electricity theft characteristics represent the form of influence of electricity theft behavior on the load data of electricity theft users, and the relational functions represent the relationship between the normal load data when the user has not engaged in electricity theft and the abnormal load data when the user has engaged in electricity theft.

[0051] Among them, the load sequence refers to the sequence of users' electricity load data arranged in chronological order over a period of time.

[0052] Optionally, user load sequences can be collected over multiple sampling periods within a historical detection period. For example, the historical detection period can be 14 days from the current time point, and the sampling period can be 1 hour.

[0053] Optionally, the relational function may be, but is not limited to, a scaling function, a peak-shaving function, a downsizing function, an interval zeroing function, a random reduction function, or a peak-shifting function.

[0054] Optionally, the parameter information required by the proportional reduction function is the electricity theft ratio k, and its formula is described as follows:

[0055]

[0056] In the formula, P(t) and These represent normal load data when the user has not engaged in electricity theft and abnormal load data when the user has engaged in electricity theft, respectively. This represents the set of time periods during which a user steals electricity.

[0057] Optionally, the required parameter information for the peak-shaving function is the maximum load threshold P. max Its formula is described as follows:

[0058]

[0059] Optionally, the parameter information required by the down-adjustment function is the down-adjustment load amount. Its formula is described as follows:

[0060]

[0061] Optionally, the formula for the interval zeroing function is described as follows:

[0062]

[0063] Optionally, the parameter information required by the random reduction function is the reduction amount for each time period. Its formula is described as follows:

[0064]

[0065] Optionally, the parameter information required for the peak shifting method is the phase shift. Its formula is described as follows:

[0066]

[0067] S104. For any preset electricity theft characteristic, input the normal load sequence into the preset relation function corresponding to the preset electricity theft characteristic, output the initial electricity theft load sequence corresponding to the preset electricity theft characteristic, and input the initial electricity theft load sequence and the historical detection period into the trained electricity theft data optimization model, output the target electricity theft load sequence corresponding to the preset electricity theft characteristic.

[0068] Among them, the electricity theft data optimization model is used to process the electricity theft load sequence generated by the relation function into a load sequence that is closer to the real electricity theft load sequence; the electricity theft data optimization model can be, but is not limited to, a neural network model with an encoder-decoder architecture such as a one-dimensional U-Net (1D-UNet) or a score-based generative modeling network (ScoreNet).

[0069] S106. For any load sequence among the normal load sequence and the target electricity theft load sequence, determine the load sequence as the initial load sequence, and perform linear fitting on the initial load sequence based on the least squares method to obtain the fitting error.

[0070] Alternatively, a top-down approach can be adopted, using the least squares method to perform linear fitting on each load sequence of the sample, and the fitting error can be calculated. :

[0071]

[0072] In the formula, For sequence length, This represents the results of linear fitting of the sequence.

[0073] S108. Based on the fitting error and the preset error threshold, the initial load sequence is segmented to obtain multiple target load sequences.

[0074] Optionally, if the fitting error is not greater than a preset error threshold, the corresponding initial load sequence may not be segmented; if the fitting error is greater than the preset error threshold, an optimal segmentation point may be found in the corresponding initial load sequence, and the initial load sequence may be segmented into two segments based on the principle that the sum of the fitting errors of the two segments is minimized.

[0075] S110. Based on the target load sequence, the time period corresponding to the target load sequence, and the corresponding electricity theft identifier of the target load sequence, the electricity theft detection model is trained to obtain the trained electricity theft detection model; wherein, the electricity theft identifier indicates whether the load data in the corresponding load sequence is electricity theft load data.

[0076] Among them, the electricity theft detection model is used to detect the corresponding time period of electricity theft behavior; the electricity theft detection model can be, but is not limited to, a traditional machine learning model or other time series neural network model.

[0077] Optionally, the target load sequence can be divided into a training set, a validation set, and a test set according to a preset ratio, and the electricity theft detection model can be trained, validated, and tested based on the training set, validation set, and test set, respectively.

[0078] Optionally, the electricity theft detection model is first trained based on the training set data. If the model does not improve its accuracy in the validation set for K consecutive rounds, training is stopped, and the model performance is tested using the test set.

[0079] S112. Obtain the load sequence of the user to be detected, input the load sequence to be detected into the trained electricity theft detection model, and output the electricity theft period of the user to be detected.

[0080] Optionally, the least squares method is used to segment the load sequence to be detected. If the number of all load sequences to be detected after segmentation is K, each number is selected sequentially from 1, 2, 3...K in ascending order. The selected number is used as the number n of load sequences to be detected for masking operation. The load sequences to be detected are masked according to the number n, and the load sequences to be detected after the masking operation are input into the electricity theft detection model. The electricity theft detection model will traverse the input load sequences to be detected until all electricity theft periods corresponding to the load sequences to be detected are identified.

[0081] In the above-mentioned electricity theft detection method, preset relational functions corresponding to various preset electricity theft characteristics are obtained, and normal load sequences of normal users who have not engaged in electricity theft during historical detection periods are obtained. For any preset electricity theft characteristic, the normal load sequence is input into the preset relational function corresponding to the preset electricity theft characteristic, and the initial electricity theft load sequence corresponding to the preset electricity theft characteristic is output. The initial electricity theft load sequence and the historical detection period are input into the trained electricity theft data optimization model, and the target electricity theft load sequence corresponding to the preset electricity theft characteristic is output. For any load sequence among the normal load sequence and the target electricity theft load sequence, the load sequence is determined as the initial load sequence, and the initial load sequence is linearly fitted based on the least squares method to obtain the fitting error. Based on the fitting error and a preset error threshold, the initial load sequence is segmented to obtain multiple target load sequences. Based on the target load sequence, the time period corresponding to the target load sequence, and the electricity theft identifier corresponding to the target load sequence, the electricity theft detection model is trained to obtain the trained electricity theft detection model. The load sequence to be detected of the user to be detected is obtained, the load sequence to be detected is input into the trained electricity theft detection model, and the electricity theft time period of the user to be detected is output. The method provided in this application can improve the detection accuracy of electricity theft.

[0082] In some embodiments, such as Figure 2 As shown, the initial electricity theft load sequence and historical detection periods are input into the trained electricity theft data optimization model, which outputs a target electricity theft load sequence corresponding to the preset electricity theft characteristics, including:

[0083] S202. Based on the preset noise addition step size, Gaussian noise is gradually added to the initial electricity theft load sequence to obtain the intermediate electricity theft load sequence.

[0084] S204. Input the intermediate electricity theft load sequence and historical detection period into the trained electricity theft data optimization model, and output the target electricity theft load sequence.

[0085] Optionally, according to a pre-designed list of noise intensities. Gradually towards the initial electricity theft load sequence Add noise, where n is the noise addition step size. Let Then the intermediate electricity theft load sequence at the nth noise step size It can be written as:

[0086]

[0087] In the formula, The Gaussian noise added in step n, This refers to the Gaussian noise added throughout the entire noise generation process.

[0088] In this embodiment, by gradually adding Gaussian noise to the initial electricity theft load sequence, the final target electricity theft load sequence can be made closer to the real electricity theft load sequence.

[0089] In some embodiments, the initial load sequence is segmented based on the fitting error and a preset error threshold to obtain multiple target load sequences, including: for any initial load sequence, if the fitting error is greater than the preset error threshold, the initial load sequence is segmented into two new initial load sequences; for any new initial load sequence, the step of performing linear fitting on the initial load sequence based on the least squares method to obtain the fitting error is returned, and the process continues until the fitting error of all initial load sequences is not greater than the preset error threshold; if the fitting error is not greater than the preset error threshold, the initial load sequence is determined as the first intermediate load sequence; and multiple target load sequences are determined from the first intermediate load sequence based on a preset probability value and a preset mask value.

[0090] The mask value is a specific numerical value or binary pattern used to mark or filter data in a masking operation. Its core function is to selectively mask or retain certain parts of the data.

[0091] In this embodiment, the initial load sequence is segmented by comparing the fitting error with a preset error threshold, and the target load sequence is obtained based on the segmentation result, making the obtained target load sequence more accurate.

[0092] In some embodiments, determining multiple target load sequences from a first intermediate load sequence based on a preset probability value and a preset mask value includes: randomly determining at least one second intermediate load sequence from the first intermediate load sequence based on the preset probability value, and determining the product between the second intermediate load sequence and the preset mask value as a third intermediate load sequence; and determining the first intermediate load sequence and the third intermediate load sequence that were not determined as second intermediate load sequences as target load sequences.

[0093] Optionally, the preset mask value may, but is not limited to, be a negative maximum value, used to make the weight of the third intermediate load sequence in the electricity theft detection model zero.

[0094] In this embodiment, the target load sequence is obtained based on a preset probability value and a preset mask value, making the obtained target load sequence more accurate.

[0095] In some embodiments, the training process of the electricity theft data optimization model includes: acquiring the historical electricity theft type, historical electricity theft period, historical electricity theft characteristics, and a first historical electricity theft load sequence of the electricity theft user within a historical detection period; for the remaining periods in the historical detection period excluding the historical electricity theft periods, determining at least one historical non-electricity theft period with the same duration as the historical electricity theft period from the remaining periods, and acquiring the historical non-electricity theft load sequence of the electricity theft user within the historical non-electricity theft period; acquiring the historical relation function corresponding to the historical electricity theft characteristics, inputting the historical non-electricity theft load sequence into the historical relation function, and outputting a second historical electricity theft load sequence; and training the electricity theft data optimization model based on the historical electricity theft type, historical electricity theft period, first historical electricity theft load sequence, and second historical electricity theft load sequence.

[0096] Optionally, the types of electricity theft may include, but are not limited to, undervoltage theft, undercurrent theft, phase shifting theft, modification theft, meter rewiring theft, and other methods of electricity theft.

[0097] In this embodiment, the electricity theft data optimization model is trained based on historical electricity theft types, historical electricity theft periods, the first historical electricity theft load sequence, and the second historical electricity theft load sequence, so that the optimization accuracy of the trained electricity theft data optimization model is higher.

[0098] In some embodiments, training an electricity theft data optimization model based on historical electricity theft types, historical electricity theft periods, a first historical electricity theft load sequence, and a second historical electricity theft load sequence includes: gradually adding Gaussian noise to the second historical electricity theft load sequence based on a preset noise addition step size to obtain a third historical electricity theft load sequence; and inputting the historical electricity theft types, historical electricity theft periods, the first historical electricity theft load sequence, and the third historical electricity theft load sequence into the electricity theft data optimization model to obtain the trained electricity theft data optimization model.

[0099] Optionally, the loss function of the electricity theft data optimization model is shown in the following equation:

[0100]

[0101] In the formula, Man-made noise, This represents the difference between the electricity theft data obtained through the relational function and the actual electricity theft data. The input sequence for the electricity theft data optimization model is: The output of the electricity theft data optimization model when the step size is n.

[0102] After model training is completed, highly realistic electricity theft data is obtained. It can be calculated using the following formula:

[0103]

[0104] In this embodiment, the historical electricity theft types, historical electricity theft periods, the first historical electricity theft load sequence, and the third historical electricity theft load sequence are input into the electricity theft data optimization model, and the trained electricity theft data optimization model is output, so that the optimization accuracy of the trained electricity theft data optimization model is higher.

[0105] In one embodiment, another method for detecting electricity theft is provided, which includes the following:

[0106] Extract electricity load data samples of normal users and electricity load data samples of electricity thieves in the electricity theft detection area, determine information such as the type of electricity theft, the time period of electricity theft, and the characteristics of electricity theft in the extracted electricity theft samples, and use the formula method to generate rough simulation data of the corresponding electricity theft samples.

[0107] Gaussian noise is gradually added to the generated coarse simulation data samples to destroy their load characteristic information. A data generation model for electricity theft is constructed and trained so that the model can recover the real electricity theft load data from the noisy data. User electricity theft information parameters are randomly set, and an equal amount of electricity theft simulation data is generated for each type of electricity theft using a formula method. After artificial noise addition, the data is input into the electricity theft data generation model to obtain electricity theft samples with high simulation accuracy.

[0108] The extracted real samples and generated simulated samples are merged, and the optimal number and position of segments in the load sequence of the electricity theft sample are determined using a piecewise linear fitting method. After feature enhancement, the samples are proportionally divided into training, validation, and test sets and then input into the electricity theft detection model for training and testing. After training, the load data of the user to be detected can be input into the electricity theft detection model to identify the user's electricity theft behavior.

[0109] After segmenting and identifying the electricity theft sample sequence, each sequence segment is randomly masked and input into the electricity theft detection model to determine the longest segment combination in which the user has engaged in electricity theft, which is then used as the electricity theft time interval for that user sample.

[0110] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages in other steps. It is understood that the steps in different embodiments can be freely combined as needed, and all non-contradictory solutions formed by such combinations are within the scope of protection of this application.

[0111] Based on the same inventive concept, this application also provides an electricity theft detection device for implementing the electricity theft detection method described above. The solution provided by this device is similar to the solution described in the above method; therefore, the specific limitations in one or more embodiments of the electricity theft detection device provided below can be found in the limitations of the electricity theft detection method described above, and will not be repeated here.

[0112] In one exemplary embodiment, such as Figure 3 As shown, an electricity theft detection device 300 is provided, comprising: a first acquisition module 301, an input module 302, a determination module 303, a segmentation module 304, a training module 305, and a second acquisition module 306, wherein:

[0113] The first acquisition module 301 is used to acquire preset relational functions corresponding to various preset electricity theft characteristics, and to acquire the normal load sequence of normal users who have not engaged in electricity theft during the historical detection period; wherein, the electricity theft characteristics represent the form of influence of electricity theft behavior on the load data of electricity theft users, and the relational functions represent the relationship between the normal load data when the user has not engaged in electricity theft and the abnormal load data when the user has engaged in electricity theft.

[0114] The input module 302 is used to input the normal load sequence into the preset relation function corresponding to the preset electricity theft characteristic for any preset electricity theft characteristic, output the initial electricity theft load sequence corresponding to the preset electricity theft characteristic, and input the initial electricity theft load sequence and the historical detection period into the trained electricity theft data optimization model to output the target electricity theft load sequence corresponding to the preset electricity theft characteristic.

[0115] The determination module 303 is used to determine the load sequence as the initial load sequence for any one of the normal load sequence and the target electricity theft load sequence, and to perform linear fitting on the initial load sequence based on the least squares method to obtain the fitting error.

[0116] The segmentation module 304 is used to segment the initial load sequence based on the fitting error and a preset error threshold to obtain multiple target load sequences.

[0117] The training module 305 is used to train the electricity theft detection model based on the target load sequence, the time period corresponding to the target load sequence, and the electricity theft identifier corresponding to the target load sequence, to obtain the trained electricity theft detection model; wherein, the electricity theft identifier indicates whether the load data in the corresponding load sequence is electricity theft load data.

[0118] The second acquisition module 306 is used to acquire the load sequence of the user to be detected, input the load sequence to be detected into the trained electricity theft detection model, and output the electricity theft period of the user to be detected.

[0119] In some embodiments, the input module 302 is further configured to gradually add Gaussian noise to the initial electricity theft load sequence based on a preset noise addition step size to obtain an intermediate electricity theft load sequence; input the intermediate electricity theft load sequence and the historical detection period into the trained electricity theft data optimization model, and output the target electricity theft load sequence.

[0120] In some embodiments, the segmentation module 304 is further configured to, for any initial load sequence, divide the initial load sequence into two new initial load sequences if the fitting error is greater than the preset error threshold; for any new initial load sequence, return to the step of linearly fitting the initial load sequence based on the least squares method to obtain the fitting error, and continue to execute until the fitting error of all initial load sequences is not greater than the preset error threshold; if the fitting error is not greater than the preset error threshold, determine the initial load sequence as the first intermediate load sequence; and determine multiple target load sequences from the first intermediate load sequence based on a preset probability value and a preset mask value.

[0121] In some embodiments, the segmentation module 304 is further configured to randomly determine at least one second intermediate load sequence from the first intermediate load sequence based on the preset probability value, and determine the product between the second intermediate load sequence and the preset mask value as a third intermediate load sequence; and determine the first intermediate load sequence that is not determined as the second intermediate load sequence and the third intermediate load sequence as the target load sequence.

[0122] In some embodiments, the electricity theft detection device 300 is specifically configured to acquire, within a historical detection period, the historical electricity theft type, historical electricity theft period, historical electricity theft characteristics, and a first historical electricity theft load sequence of the electricity theft user; for the remaining periods in the historical detection period excluding the historical electricity theft periods, determine at least one historical non-electricity theft period with the same duration as the historical electricity theft period from the remaining periods, and acquire the historical non-electricity theft load sequence of the electricity theft user within the historical non-electricity theft period; acquire the historical relational function corresponding to the historical electricity theft characteristics, input the historical non-electricity theft load sequence into the historical relational function, and output a second historical electricity theft load sequence; and train the electricity theft data optimization model based on the historical electricity theft type, the historical electricity theft period, the first historical electricity theft load sequence, and the second historical electricity theft load sequence.

[0123] In some embodiments, the electricity theft detection device 300 is further configured to train the electricity theft data optimization model based on the historical electricity theft type, the historical electricity theft period, the first historical electricity theft load sequence, and the second historical electricity theft load sequence, including: gradually adding Gaussian noise to the second historical electricity theft load sequence based on the preset noise addition step size to obtain a third historical electricity theft load sequence; and inputting the historical electricity theft type, the historical electricity theft period, the first historical electricity theft load sequence, and the third historical electricity theft load sequence into the electricity theft data optimization model to obtain the trained electricity theft data optimization model.

[0124] Each module in the aforementioned electricity theft detection device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of a computer device in hardware form or independent of it, or stored in the memory of the computer device in software form, so that the processor can call and execute the corresponding operations of each module.

[0125] In one exemplary embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 4As shown, the computer device includes a processor, memory, input / output interface, communication interface, display unit, and input device. The processor, memory, and input / output interface are connected via a system bus, and the communication interface, display unit, and input device are also connected to the system bus via the input / output interface. The processor provides computing and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage media. The input / output interface is used for exchanging information between the processor and external devices. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, Near Field Communication (NFC), or other technologies. When executed by the processor, the computer program implements a method for detecting electricity theft.

[0126] Those skilled in the art will understand that Figure 4 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0127] In one embodiment, a computer device is also provided, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above method embodiments.

[0128] In one embodiment, a computer-readable storage medium is provided having a computer program stored thereon that, when executed by a processor, implements the steps in the above method embodiments.

[0129] In one embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above method embodiments.

[0130] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.

[0131] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.

[0132] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this application.

[0133] The embodiments described above are merely illustrative of several implementation methods of this application, and while the descriptions are specific and detailed, they should not be construed as limiting the scope of this patent application. It should be noted that those skilled in the art can make various modifications and improvements without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.

Claims

1. A power stealing behavior detection method, characterized in that, The method includes: The system obtains preset relational functions corresponding to various preset electricity theft characteristics, and obtains the normal load sequence of normal users who have not engaged in electricity theft during the historical detection period. Among them, the electricity theft characteristics represent the form of influence of electricity theft behavior on the load data of electricity theft users, and the relational functions represent the relationship between the normal load data when the user has not engaged in electricity theft and the abnormal load data when the user has engaged in electricity theft. For any preset electricity theft characteristic, the normal load sequence is input to the preset relation function corresponding to the preset electricity theft characteristic, and the initial electricity theft load sequence corresponding to the preset electricity theft characteristic is output. Based on a preset noise addition step size, Gaussian noise is gradually added to the initial electricity theft load sequence to obtain an intermediate electricity theft load sequence. The intermediate electricity theft load sequence and the historical detection period are input into the trained electricity theft data optimization model, and the target electricity theft load sequence is output. For any one of the normal load sequence and the target electricity theft load sequence, the load sequence is determined as the initial load sequence, and the initial load sequence is linearly fitted based on the least squares method to obtain the fitting error; For any given initial load sequence, if the fitting error is greater than a preset error threshold, the initial load sequence is divided into two new initial load sequences. For any new initial load sequence, return to the step of linearly fitting the initial load sequence based on the least squares method and obtaining the fitting error, and continue to execute until the fitting error of all initial load sequences is not greater than the preset error threshold. If the fitting error is not greater than the preset error threshold, the initial load sequence is determined as the first intermediate load sequence; Based on preset probability values ​​and preset mask values, multiple target load sequences are determined from the first intermediate load sequence; Based on the target load sequence, the time period corresponding to the target load sequence, and the corresponding electricity theft identifier of the target load sequence, the electricity theft detection model is trained to obtain the trained electricity theft detection model; wherein, the electricity theft identifier indicates whether the load data in the corresponding load sequence is electricity theft load data; Obtain the load sequence of the user to be detected, input the load sequence to be detected into the trained electricity theft detection model, and output the electricity theft period of the user to be detected.

2. The method of claim 1, wherein, The step of determining multiple target load sequences from the first intermediate load sequence based on preset probability values ​​and preset mask values ​​includes: Based on the preset probability value, at least one second intermediate load sequence is randomly determined from the first intermediate load sequence, and the product between the second intermediate load sequence and the preset mask value is determined as the third intermediate load sequence; The first intermediate load sequence and the third intermediate load sequence, which were not identified as the second intermediate load sequence, are identified as the target load sequence.

3. The method of claim 1, wherein, The training process for the electricity theft data optimization model includes: Obtain the historical electricity theft type, historical electricity theft period, historical electricity theft characteristics, and first historical electricity theft load sequence of electricity theft users within the historical detection period; For the remaining time periods in the historical detection period excluding the historical electricity theft period, at least one historical non-electricity theft period with the same duration as the historical electricity theft period is determined from the remaining time periods, and the historical non-electricity theft load sequence of the electricity theft user in the historical non-electricity theft period is obtained; Obtain the historical relational function corresponding to the historical electricity theft characteristics, input the historical non-electricity theft load sequence into the historical relational function, and output the second historical electricity theft load sequence; The electricity theft data optimization model is trained based on the historical electricity theft types, the historical electricity theft periods, the first historical electricity theft load sequence, and the second historical electricity theft load sequence.

4. The method of claim 3, wherein, The step of training the electricity theft data optimization model based on the historical electricity theft types, the historical electricity theft periods, the first historical electricity theft load sequence, and the second historical electricity theft load sequence includes: Based on a preset noise addition step size, Gaussian noise is gradually added to the second historical electricity theft load sequence to obtain the third historical electricity theft load sequence. The historical electricity theft type, the historical electricity theft period, the first historical electricity theft load sequence, and the third historical electricity theft load sequence are input into the electricity theft data optimization model to obtain the trained electricity theft data optimization model.

5. An electricity theft behavior detection apparatus, characterized by, The device includes: The first acquisition module is used to acquire preset relational functions corresponding to various preset electricity theft characteristics, and to acquire the normal load sequence of normal users who have not engaged in electricity theft during the historical detection period; wherein, the electricity theft characteristics represent the form of influence of electricity theft behavior on the load data of electricity theft users, and the relational function represents the relationship between the normal load data when the user has not engaged in electricity theft and the abnormal load data when the user has engaged in electricity theft. The input module is used to input the normal load sequence into a preset relational function corresponding to any preset electricity theft characteristic, output an initial electricity theft load sequence corresponding to the preset electricity theft characteristic, and gradually add Gaussian noise to the initial electricity theft load sequence based on a preset noise addition step size to obtain an intermediate electricity theft load sequence; input the intermediate electricity theft load sequence and the historical detection period into the trained electricity theft data optimization model, and output a target electricity theft load sequence; The determination module is used to determine the load sequence as the initial load sequence for any one of the normal load sequence and the target electricity theft load sequence, and to perform linear fitting on the initial load sequence based on the least squares method to obtain the fitting error; The segmentation module is used to, for any given initial load sequence, divide the initial load sequence into two new initial load sequences if the fitting error is greater than a preset error threshold; for any new initial load sequence, return to the step of performing linear fitting on the initial load sequence based on the least squares method to obtain the fitting error, and continue execution until the fitting error of all initial load sequences is not greater than the preset error threshold; if the fitting error is not greater than the preset error threshold, determine the initial load sequence as the first intermediate load sequence; and determine multiple target load sequences from the first intermediate load sequence based on a preset probability value and a preset mask value. The training module is used to train the electricity theft detection model based on the target load sequence, the time period corresponding to the target load sequence, and the corresponding electricity theft identifier of the target load sequence, to obtain the trained electricity theft detection model; wherein, the electricity theft identifier indicates whether the load data in the corresponding load sequence is electricity theft load data; The second acquisition module is used to acquire the load sequence of the user to be detected, input the load sequence to be detected into the trained electricity theft detection model, and output the electricity theft period of the user to be detected. 6.A computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the computer device is configured to perform the method according to any one of claims 1-5 when the computer program is executed by the processor. When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 4.

7. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 4.

8. A computer program product, comprising a computer program, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 4.

Citation Information

Patent Citations

  • Transform neural network-based electricity larceny detection method and device

    CN115018512A

  • Electricity stealing detection method, device, equipment, medium and program product

    CN115982598A