Electricity theft detection method based on comparative predictive coding and support vector data
By comparing the predictive encoding and support vector data, the long-term pattern characteristics of electricity consumption data are extracted and hyperspheric parameters are constructed, which solves the problems of low accuracy and high cost in the existing electricity theft detection methods, and achieves more efficient electricity theft user identification.
Patent Information
- Application Number
- CN202311037031.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-08-17
- Publication Date
- 2025-08-15
- Estimated Expiration
- 2043-08-17
AI Technical Summary
The existing power theft detection methods fail to fully consider user electricity usage behavior, resulting in low detection accuracy and high labor costs, especially when processing high-dimensional data and class imbalanced data sets.
Using the method of comparing predictive encoding and support vector data, a three-layer one-dimensional convolutional neural network extracts long-term pattern features of electricity consumption data, constructs positive and negative sample pairs and trains a support vector data description classifier, and uses hypersphere parameters to identify suspected users of electricity theft.
It improves the accuracy of detection of power-stealing users, reduces detection costs, and fully considers the user's electricity usage behavior, reducing misjudgment and mischecking.
Smart Images

Figure CN117056815B_ABST
Abstract
Description
Technical Field
[0001] The present invention belongs to the technical field of power grid line loss analysis, and in particular relates to a method for detecting electricity theft users based on comparative prediction coding and support vector data. Background Art
[0002] The power losses of power supply companies are divided into technical line losses and non-technical line losses. With the lean operation and management of the power grid, non-technical line losses are mainly caused by users stealing electricity. The behavior of electricity theft has developed from the early simple and crude to professional, large-scale and concealed, posing severe challenges to the lean operation and electricity safety of power supply companies.
[0003] Electricity theft can directly lead to an abnormal increase in line losses in transmission lines, causing problems such as transformer overload, power line overload and voltage imbalance, affecting the safe operation of the power system. Therefore, how to effectively prevent and control electricity theft has become an important issue that urgently needs to be addressed.
[0004] At present, methods such as machine learning and statistical analysis have gradually been applied to the field of electricity theft detection. Electricity theft detection based on statistical methods uses distribution state estimation based on user and transformer data or through verification estimation and editing (VEE) to improve data quality, and applies variance analysis to screen suspected electricity theft users. Some scholars have also found through statistical analysis that the electricity consumption behavior of electricity theft users does not have a periodic pattern, and use fully connected neural networks and convolutional neural networks to identify electricity theft users.
[0005] Machine learning applied to electricity theft detection can be divided into two methods: supervised learning and unsupervised learning. Supervised learning requires a large amount of user electricity usage data that has been audited on-site. This type of method uses support vector machines to detect electricity theft and combines it with fuzzy inference systems to improve detection accuracy. Anomaly detection using supervised learning usually uses classification models. This type of method can usually improve the accuracy of support vector machines by combining decision trees and K-nearest neighbor algorithms, and use adversarial learning to solve the imbalance problem of data sets. Since a large number of on-site inspections are time-consuming and labor-intensive to label data, researchers have proposed unsupervised learning, which does not rely on labeled data sets.
[0006] Although supervised learning has a higher accuracy rate in electricity theft detection than unsupervised learning, the labeled datasets required for supervised learning require extensive on-site inspections and are difficult to obtain. They are also susceptible to overfitting due to dataset constraints, resulting in poor performance on other datasets. Furthermore, classification-based electricity theft detection models must consider class imbalance when processing high-dimensional data.
[0007] The supervised learning electricity theft detection method extracts feature indicators through sudden drops in electricity consumption for electricity theft detection, which can be easily confused with sudden changes in electricity consumption caused by users' normal diversified electricity consumption behaviors; since users may be affected by factors such as seasons and orders, which may cause sudden changes in user electricity consumption models, relying solely on sudden changes in electricity consumption for detection while ignoring users' long-term electricity consumption patterns is prone to misjudgment.
[0008] In summary, most current electricity theft detection methods do not fully consider users' electricity usage behavior, require high labor costs, and have low detection accuracy. Summary of the Invention
[0009] The object of the present invention is to provide a method for detecting electricity theft users based on comparative predictive coding and support vector data, which has improved accuracy, reduced required costs, and fully considers the electricity usage behavior of users.
[0010] The method for detecting electricity theft users based on comparison of predictive coding and support vector data provided by the present invention includes the following steps:
[0011] S1 obtains the unit time electricity consumption data of each user under the inspection area, and establishes a unit time electricity consumption time series of each user under the unit time;
[0012] S2. Preprocess the power consumption time series established in step S1;
[0013] S3. Using the data preprocessed in step S2, a comparative coding prediction model is constructed to extract the long-term pattern characteristics representing the user's electricity consumption behavior in the time series of each user's unit time consumption in the substation area, and to construct positive and negative sample pairs;
[0014] S4. Using the long-term pattern features extracted in step S3, training the support vector data description classifier to determine the corresponding hypersphere parameters;
[0015] S5. Using the hypersphere parameters determined in step S4, the suspected electricity theft user is determined by comparing the electricity consumption time series of the user to be tested per unit time, thereby completing the detection of the electricity theft user;
[0016] The step S1 of obtaining the unit time electricity consumption data of each user in the area to be inspected and establishing the unit time electricity consumption time series of each user in the area to be inspected specifically includes:
[0017] Define the time series of power consumption per unit time of each user in the area to be inspected as X i ={X i1 ,X i2 ,…,X in}, i = 1, 2, ..., N, where n represents the number of elements in the time series; N represents the number of all users in the area to be inspected;
[0018] Determine the substation area to be inspected based on the line loss rate or line loss fluctuation rate of each substation area;
[0019] When determining the substation area to be inspected based on line loss rate, the power supply company shall make the decision based on the actual local conditions;
[0020] Obtain line loss rate data through the integrated power grid line loss platform;
[0021] Obtain the power loss per unit time of the substation and the power consumption per unit time of the user through the telecommunications collection system;
[0022] The unit time includes a specific time period; when the unit time is an hour or 60 minutes, the power consumption data of each user in the substation area includes hourly power consumption data, which can directly establish a time series of hourly power consumption of each user;
[0023] The preprocessing of the power consumption time series established in step S1 described in step S2 specifically includes:
[0024] Data preprocessing includes missing value processing and normalization processing, specifically including:
[0025] The following formula is used to describe the missing value processing process:
[0026]
[0027] Among them, f(x i ) represents the missing value calculation function; x i Indicates the value of the smart meter; x i-1 Represents x i The last electrical value of x i+1 Represents x i The next value represents a value; NaN represents a missing value;
[0028] The normalization process is described by the following formula:
[0029]
[0030] Among them, f(x i ) represents the normalized calculation function; x i represents the value of electricity in the electricity data sequence X; max{X} represents the maximum value in the electricity data sequence X; min{X} represents the minimum value in the electricity data sequence X;
[0031] Step S3 uses the data pre-processed in step S2 to build a comparative coding prediction model, extract the long-term pattern characteristics representing the user's electricity consumption behavior in the time series of each user's unit time consumption in the substation area, and construct positive and negative sample pairs, specifically including:
[0032] A three-layer one-dimensional convolutional neural network is used to extract the spatial features of electricity consumption data and transform the high-dimensional electricity consumption data sequence X i(t) Encoded as a latent representation Z i(t) ; Using Z i(t) The time series information of electricity consumption data at the previous moment is summarized through the gated recursive cycle unit layer to generate the state matrix C at the current moment i(t) ; Using C i(t) Predict the potential representation Z′ at time k i(t+k) , t represents the current moment in the time series;
[0033] Using a sequence selected from the same X i(t) Construct positive sample pair Z′ i(t+k) and Z i(t+k) , the positive sample pairs share the same long-term pattern information; using different sequences X i(t) and X j(t) Construct negative sample pair Z′ i(t+k) and Z j(t+k) , negative sample pairs do not share the same long-term information; through the above processing, positive and negative sample pairs for contrastive learning are constructed;
[0034] By optimizing the InfoNCE loss function, the discriminability of positive and negative sample pairs is enhanced. The following formula is used to describe the InfoNCE loss function:
[0035]
[0036] Among them, x i (t+k) represents the actual value of the input sequence after the prediction time k; c i (t) represents the context representation state matrix at the current moment t; E[·] represents the average loss of all input sequence data; X represents the high-dimensional electricity consumption data time series; x j (t+k) represents the actual value of another input sequence after the predicted time k; f k / ∑ X f k represents the predicted value of the comparison predictive coding model;
[0037] f k (x j (t+k),C i (t))=sin((t+k),Z′ i (t+k))
[0038] Among them, sin((t+k),Z′ i (t+k)) is calculated according to the following formula:
[0039]
[0040] in, represents a vector; ||·|| represents the L2 norm of a vector; · represents the dot product of two vectors;
[0041] The step S4 uses the long-term pattern features extracted in step S3 to train a support vector data description classifier and determine the corresponding hypersphere parameters, specifically including:
[0042] Define the center of the hypersphere as a and the radius as R;
[0043] Select as many normal power consumption data as possible to be located inside the hypersphere, and abnormal power consumption data to be located outside the hypersphere, and construct the hypersphere;
[0044] Define the user electricity consumption data as B = {b1, b2, ..., b n}; Map the original data B to the high-dimensional space, and the corresponding minimization loss function is as follows:
[0045] F(R,a)=R 2
[0046] The corresponding constraints are as follows:
[0047]
[0048]
[0049] Where ψ(·) represents a nonlinear function; i represents the subscript of a normal sample; l represents the subscript of an abnormal sample;
[0050] A relaxation factor is introduced to penalize samples in the training set whose distance from the sphere center is greater than a set value. At the same time, the penalty coefficient is set to balance the minimization of the hypersphere volume and the minimization of the model error. The objective function is calculated using the following formula to construct a hypersphere of user electricity consumption data:
[0051]
[0052]
[0053]
[0054] Among them, ξ i ,ξ l Both represent relaxation factors; C1 and C2 both represent penalty coefficients; It means arbitrary;
[0055] Combine the above constraints with the objective function and solve the objective function using the Lagrange multiplier method;
[0056] The weighted electricity consumption data extracted from the coding model is selected for comparative prediction to train the hypersphere constructed above, and the calculation formulas for the center and radius of the hypersphere structure are obtained as follows:
[0057]
[0058]
[0059] K1=K(ω k b k ,ω k b k )
[0060] K2=K(ω k b k ,ω i b i )
[0061] K3=K(ω i b i ,ω j b j )
[0062]
[0063] 0≤α i ≤C1,y i =+1
[0064] 0≤α i ≤C2,y i =-1
[0065] Among them, y i Represents the binary classification label; α i represents the Lagrange multiplier; ω i represents the weight parameter of feature i; b i represents the bias of feature i; α j represents the Lagrange multiplier; K(·) represents the Gaussian kernel function; K1 represents the kernel matrix obtained by the hypersphere center vector itself; K2 represents the kernel matrix obtained by the hypersphere vector and the support vector i; K3 represents the kernel matrix obtained by the support vector i and the support vector j; ω k represents the weighting parameter of the center vector of the hypersphere; b k represents the bias of the center vector of the hypersphere; ω j represents the weight parameter of feature j; b j represents the paranoia of feature j;
[0066] Using training data x test By comparing the predictive coding and support vector data description models, the following formula is used to calculate the training data x testDistance from the center of the high-dimensional hypersphere:
[0067]
[0068] K1=K(ω test b test ,ω test b test )
[0069] K2=K(ω test b test ,ω i b i )
[0070] K3=K(ω i b i ,ω j b j )
[0071] Among them, ω test represents the weighting parameter of the center vector of the training data hypersphere; b test Indicates that the center vector of the training data hypersphere is biased;
[0072] Step S5 uses the hypersphere parameters determined in step S4 to determine the suspected electricity theft user by comparing the unit time series of the user to be detected, thereby completing the detection of the electricity theft user, specifically including:
[0073] Suspected electricity theft users are identified based on the relationship between the spherical distance of the electricity consumption data to be tested and the radius of the hypersphere. The corresponding classification criteria are as follows:
[0074]
[0075] Among them, d test Represents the distance from the sample data to the center of the hypersphere; R max Indicates the maximum limit value of the hypersphere judgment boundary;
[0076] The method for detecting electricity theft users based on comparative predictive coding and support vector data provided by the present invention extracts the long-term pattern features that best represent the user's electricity consumption behavior from the time series of unit time electricity consumption of each user under the substation through comparative predictive coding, discards the low-level instantaneous fluctuation information of electricity consumption in the global information, and uses a gated recursive unit to construct positive and negative sample pairs for comparative learning; uses the features extracted by the aforementioned comparative predictive coding model to train a support vector data description classifier to obtain the center and radius of the corresponding hypersphere; and identifies users whose unit time electricity consumption time series of the user to be detected is greater than the radius of the hypersphere as suspected electricity theft users; the accuracy of the method of the present invention is improved, the required cost is reduced, and the user's electricity consumption behavior is fully considered. BRIEF DESCRIPTION OF THE DRAWINGS
[0077] Figure 1 Schematic diagram of the process of the present invention. DETAILED DESCRIPTION
[0078] like Figure 1 The method flow diagram of the present invention is shown as follows: The method for detecting electricity theft users based on comparison of predictive coding and support vector data provided by the present invention comprises the following steps:
[0079] S1. Obtain the unit time electricity consumption data of each user in the area to be inspected, and establish a unit time electricity consumption time series of each user in the area under inspection; specifically including:
[0080] Define the time series of power consumption per unit time of each user in the area to be inspected as X i ={X i1 ,X i2 ,…,X in}, i = 1, 2, ..., N, where n represents the number of elements in the time series; N represents the number of all users in the area to be inspected;
[0081] Determine the substation area to be inspected based on the line loss rate or line loss fluctuation rate of each substation area;
[0082] When determining the substations to be inspected based on line loss rates, the power supply company shall make the decision based on the actual local conditions. The theoretical line loss of 10kV distribution substations is usually between 2% and 3%. Substations with line loss higher than 5% are generally considered to be high-loss substations.
[0083] Obtain line loss rate data through the integrated power grid line loss platform;
[0084] Obtain the power loss per unit time of the substation and the power consumption per unit time of the user through the telecommunications collection system;
[0085] The unit time includes a specific time period; when the unit time is an hour or 60 minutes, the power consumption data of each user in the substation area includes hourly power consumption data, which can directly establish a time series of hourly power consumption of each user;
[0086] S2. Preprocess the power consumption time series established in step S1; specifically, the following steps are performed:
[0087] Data preprocessing includes missing value processing and normalization processing, specifically including:
[0088] The following formula is used to describe the missing value processing process:
[0089]
[0090] Among them, f(x i) represents the missing value calculation function; x i Indicates the value of the smart meter; x i-1 Represents x i The last electrical value of x i+1 Represents x i The next value represents a value; NaN represents a missing value;
[0091] The normalization process is described by the following formula:
[0092]
[0093] Among them, f(x i ) represents the normalized calculation function; x i represents the value of electricity in the electricity data sequence X; max{X} represents the maximum value in the electricity data sequence X; min{X} represents the minimum value in the electricity data sequence X;
[0094] S3. Using the data pre-processed in step S2, construct a comparative coding prediction model to extract the long-term pattern characteristics representing the user's electricity consumption behavior from the time series of each user's unit time consumption in the substation area, and simultaneously construct positive and negative sample pairs; specifically, the following steps are included:
[0095] A three-layer one-dimensional convolutional neural network is used to extract the spatial features of electricity consumption data and transform the high-dimensional electricity consumption data sequence X i(t) Encoded as a latent representation Z i(t) ; Using Z i(t) The time series information of electricity consumption data at the previous moment is summarized through the gated recursive cycle unit layer to generate the state matrix C at the current moment i(t) ; Using C i(t) Predict the potential representation Z′ at time k i(t+k) , t represents the current moment in the time series;
[0096] Using a sequence selected from the same X i(t) Construct positive sample pair Z′ i(t+k) and Z i(t+k) , the positive sample pairs share the same long-term pattern information; using different sequences X i(t) and X j(t) Construct negative sample pair Z′ i(t+k) and Z j(t+k) , negative sample pairs do not share the same long-term information; through the above processing, positive and negative sample pairs for contrastive learning are constructed;
[0097] By optimizing the InfoNCE loss function, the discriminability of positive and negative sample pairs is enhanced. The following formula is used to describe the InfoNCE loss function:
[0098]
[0099] Among them, x i (t+k) represents the actual value of the input sequence after the prediction time k; c i (t) represents the context representation state matrix at the current moment t; E[·] represents the average loss of all input sequence data; X represents the high-dimensional electricity consumption data time series; x j (t+k) represents the actual value of another input sequence after the predicted time k; f k / ∑ X f k represents the predicted value of the comparison predictive coding model;
[0100] f k (x j (t+k),C i (t))=sin((t+k),Z′ i (t+k))
[0101] Among them, sin((t+k),Z′ i (t+k)) is calculated according to the following formula:
[0102]
[0103] in, represents a vector; ||·|| represents the L2 norm of a vector; · represents the dot product of two vectors;
[0104] S4. Using the long-term pattern features extracted in step S3, training the support vector data description classifier to determine the corresponding hypersphere parameters; specifically including:
[0105] Define the center of the hypersphere as a and the radius as R;
[0106] Select as many normal power consumption data as possible to be located inside the hypersphere, and abnormal power consumption data to be located outside the hypersphere, and construct the hypersphere;
[0107] Define the user electricity consumption data as B = {b1, b2, ..., b n}; Map the original data B to the high-dimensional space, and the corresponding minimization loss function is as follows:
[0108] F(R,a)=R 2
[0109] The corresponding constraints are as follows:
[0110]
[0111]
[0112] Where ψ(·) represents a nonlinear function; i represents the subscript of a normal sample; l represents the subscript of an abnormal sample;
[0113] A relaxation factor is introduced to penalize samples in the training set whose distance from the sphere center is greater than a set value. At the same time, the penalty coefficient is set to balance the minimization of the hypersphere volume and the minimization of the model error. The objective function is calculated using the following formula to construct a hypersphere of user electricity consumption data:
[0114]
[0115]
[0116]
[0117] Among them, ξ i ,ξ l Both represent relaxation factors; C1 and C2 both represent penalty coefficients; It means arbitrary;
[0118] Combine the above constraints with the objective function and solve the objective function using the Lagrange multiplier method;
[0119] The weighted electricity consumption data extracted from the coding model is selected for comparative prediction to train the hypersphere constructed above, and the calculation formulas for the center and radius of the hypersphere structure are obtained as follows:
[0120]
[0121]
[0122] K1=K(ω k b k ,ω k b k )
[0123] K2=K(ω k b k ,ω i b i )
[0124] K3=K(ω i b i ,ω j b j )
[0125]
[0126] 0≤α i ≤C1,y i =+1
[0127] 0≤α i ≤C2,yi =-1
[0128] Among them, y i Represents the binary classification label; α i represents the Lagrange multiplier; ω i represents the weight parameter of feature i; b i represents the bias of feature i; α j represents the Lagrange multiplier; K(·) represents the Gaussian kernel function; K1 represents the kernel matrix obtained by the hypersphere center vector itself; K2 represents the kernel matrix obtained by the hypersphere vector and the support vector i; K3 represents the kernel matrix obtained by the support vector i and the support vector j; ω k represents the weighting parameter of the center vector of the hypersphere; b k represents the bias of the center vector of the hypersphere; ω j represents the weight parameter of feature j; b j represents the paranoia of feature j;
[0129] Using training data x test By comparing the predictive coding and support vector data description models, the following formula is used to calculate the training data x test Distance from the center of the high-dimensional hypersphere:
[0130]
[0131] K1=K(ω test b test ,ω test b test )
[0132] K2=K(ω test b test ,ω i b i )
[0133] K3=K(ω i b i ,ω j b j )
[0134] Among them, ω test represents the weighting parameter of the center vector of the training data hypersphere; b test Indicates that the center vector of the training data hypersphere is biased;
[0135] S5. Using the hypersphere parameters determined in step S4, the suspected electricity theft user is determined by comparing the time series of the electricity consumption per unit time of the user to be tested, thereby completing the detection of the electricity theft user; specifically including:
[0136] Suspected electricity theft users are identified based on the relationship between the spherical distance of the electricity consumption data to be tested and the radius of the hypersphere. The corresponding classification criteria are as follows:
[0137]
[0138] Among them, d test Represents the distance from the sample data to the center of the hypersphere; R max Indicates the maximum limit value of the hypersphere judgment boundary;
[0139] The method of the present invention selects 200 users in the abnormal area from the smart meter data published by the State Grid Corporation of China, and collects the hourly electricity consumption X1~X1 of the users from July 1 to October 31 respectively. 200 Analysis was performed; using the preprocessed data, the prediction coding model was compared with the support vector data description model, and the confusion matrix was used to evaluate the detection performance of the model. The performance table is shown below:
[0140] Table 1 Model detection performance table
[0141] Model ACC / % TPR / % FPR / % CPC-SVDD 81.0 84.31 13.52 SVDD 62.3 76.19 19.05
[0142] The accuracy rate is defined as ACC; the hit rate is TPR; the false positive rate is FPR; and the F1 measure is calculated using the following formula:
[0143]
[0144]
[0145]
[0146] F1=2TP / (2TP+FP+FN)
[0147] Among them, TP represents the number of electricity theft users identified as abnormal; TN represents the number of normal users identified as normal; FN represents the number of electricity theft users identified as normal; FP represents the number of normal users identified as abnormal;
[0148] According to the performance test results in Table 1, the long-term user pattern features are effectively extracted through comparative coding prediction. Compared with the direct use of support vector data description, the hit rate and accuracy of the classification algorithm are improved by 8.12% and 18.7% respectively. At the same time, the false detection rate is reduced by 5.53%. This shows that discarding low-level instantaneous power consumption fluctuation information during feature extraction can reduce interference and effectively improve the model recognition accuracy.
Claims
1. A method for detecting electricity theft users based on comparative predictive coding and support vector data, comprising the following steps: S1 obtains the unit time electricity consumption data of each user under the inspection area, and establishes a unit time electricity consumption time series of each user under the unit time; S2. Preprocess the power consumption time series established in step S1; S3. Using the data pre-processed in step S2, a comparative coding prediction model is constructed to extract the long-term pattern characteristics representing the user's electricity consumption behavior from the time series of each user's unit time consumption in the substation area, and to construct positive and negative sample pairs; specifically, the following steps are included: A three-layer one-dimensional convolutional neural network is used to extract the spatial features of electricity consumption data and transform the high-dimensional electricity consumption data sequence X i(t) Encoded as a latent representation Z i(t) ; Using Z i(t) The time series information of electricity consumption data at the previous moment is summarized through the gated recursive cycle unit layer to generate the state matrix C at the current moment i(t) ; Using C i(t) Predict the potential representation Z′ at time k i(t+k) , t represents the current moment in the time series; Using a sequence selected from the same X i(t) Construct positive sample pair Z′ i(t+k) and Z i(t+k) , the positive sample pairs share the same long-term pattern information; using different sequences X i(t) and X j(t) Construct negative sample pair Z′ i(t+k) and Z j(t+k) , negative sample pairs do not share the same long-term information; through the above processing, positive and negative sample pairs for contrastive learning are constructed; By optimizing the InfoNCE loss function, the discriminability of positive and negative sample pairs is enhanced. The following formula is used to describe the InfoNCE loss function: Among them, x i (t+k) represents the actual value of the input sequence after the prediction time k; c i (t) represents the context representation state matrix at the current moment t; E[·] represents the average loss of all input sequence data; X represents the high-dimensional electricity consumption data time series; x j (t+k) represents the actual value of another input sequence after the predicted time k; f k / Σ X f k represents the predicted value of the comparison predictive coding model; f k (x j (t+k),C i (t))=sin((t+k),Z′ i(t+k) ) Among them, sin((t+k),Z′ i(t+k) ) is calculated according to the following formula: in, represents a vector; ||·|| represents the L2 norm of a vector; · represents the dot product of two vectors; S4. Using the long-term pattern features extracted in step S3, training the support vector data description classifier to determine the corresponding hypersphere parameters; S5. Using the hypersphere parameters determined in step S4, by comparing the time series of electricity consumption per unit time of the user to be detected, the suspected electricity theft user is determined, thereby completing the detection of the electricity theft user.
2. The method for detecting electricity theft users based on comparative predictive coding and support vector data according to claim 1 is characterized in that The step S1 of obtaining the unit time electricity consumption data of each user in the area to be inspected and establishing the unit time electricity consumption time series of each user in the area to be inspected specifically includes: Define the time series of power consumption per unit time of each user in the area to be inspected as X i ={X i1 ,X i2 ,…,X in }, i = 1, 2, ..., N, where n represents the number of elements in the time series; N represents the number of all users in the area to be inspected; Determine the substation area to be inspected based on the line loss rate or line loss fluctuation rate of each substation area; When determining the substation area to be inspected based on line loss rate, the power supply company shall make the decision based on the actual local conditions; Obtain line loss rate data through the integrated power grid line loss platform; Obtain the power loss per unit time of the substation and the power consumption per unit time of the user through the telecommunications collection system; The unit time includes a specific time period; when the unit time is an hour, or 60 minutes, the acquired electricity consumption data of each user under the substation includes hourly electricity consumption data, and a time series of hourly electricity consumption of each user under the substation can be directly established.
3. The method for detecting electricity theft users based on comparative predictive coding and support vector data according to claim 2 is characterized in that The preprocessing of the power consumption time series established in step S1 described in step S2 specifically includes: Data preprocessing includes missing value processing and normalization processing, specifically including: The following formula is used to describe the missing value processing process: Among them, f(x i ) represents the missing value calculation function; x i Indicates the value of the smart meter; x i-1 Represents x i The last electrical value of x i+1 Represents x i The next value represents a value; NaN represents a missing value; The normalization process is described by the following formula: Among them, f(x i ) represents the normalized calculation function; x i represents the electricity value in the electricity data sequence X; max{X} represents the maximum value in the electricity data sequence X; min{X} represents the minimum value in the electricity data sequence X.
4. The method for detecting electricity theft users based on comparative predictive coding and support vector data according to claim 3 is characterized in that The step S4 uses the long-term pattern features extracted in step S3 to train a support vector data description classifier and determine the corresponding hypersphere parameters, specifically including: Define the center of the hypersphere as a and the radius as R; Select as many normal power consumption data as possible to be located inside the hypersphere, and abnormal power consumption data to be located outside the hypersphere, and construct the hypersphere; Define the user electricity consumption data as B = {b1, b2, ..., b n }; Map the original data B to the high-dimensional space, and the corresponding minimization loss function is as follows: F(R,a)=R 2 The corresponding constraints are as follows: Where ψ(·) represents a nonlinear function; i represents the subscript of a normal sample; l represents the subscript of an abnormal sample; A relaxation factor is introduced to penalize samples in the training set whose distance from the sphere center is greater than a set value. At the same time, the penalty coefficient is set to balance the minimization of the hypersphere volume and the minimization of the model error. The objective function is calculated using the following formula to construct a hypersphere of user electricity consumption data: Among them, ξ i ,ξ l Both represent relaxation factors; C1 and C2 both represent penalty coefficients; It means arbitrary; Combine the above constraints with the objective function and solve the objective function using the Lagrange multiplier method; The weighted electricity consumption data extracted from the coding model is selected for comparative prediction to train the hypersphere constructed above, and the calculation formulas for the center and radius of the hypersphere structure are obtained as follows: K1=K(ω k b k ,oh k b k ) K2=K(ω k b k ,oh i b i ) K3=K(ω i b i ,ω j b j ) 0≤α i ≤C1,y i =+1 0≤α i ≤C2,y i =-1 Among them, y i Represents the binary classification label; α i represents the Lagrange multiplier; ω i represents the weight parameter of feature i; b i represents the bias of feature i; α j represents the Lagrange multiplier; K(·) represents the Gaussian kernel function; K1 represents the kernel matrix obtained by the hypersphere center vector itself; K2 represents the kernel matrix obtained by the hypersphere vector and the support vector i; K3 represents the kernel matrix obtained by the support vector i and the support vector j; ω k represents the weighting parameter of the center vector of the hypersphere; b k represents the bias of the center vector of the hypersphere; ω j represents the weight parameter of feature j; b j represents the paranoia of feature j; Using training data x test By comparing the predictive coding and support vector data description models, the following formula is used to calculate the training data x test Distance from the center of the high-dimensional hypersphere: K1=K(ω test b test ,oh test b test ) K2=K(ω test b test ,oh i b i ) K3=K(ω i b i ,ω j b j ) Among them, ω test represents the weighting parameter of the center vector of the training data hypersphere; b test Indicates the bias of the center vector of the training data hypersphere.
5. The method for detecting electricity theft users based on comparative predictive coding and support vector data according to claim 4 is characterized in that Step S5 uses the hypersphere parameters determined in step S4 to determine the suspected electricity theft user by comparing the unit time series of the user to be detected, thereby completing the detection of the electricity theft user, specifically including: Suspected electricity theft users are identified based on the relationship between the spherical distance of the electricity consumption data to be tested and the radius of the hypersphere. The corresponding classification criteria are as follows: Among them, d test Represents the distance from the sample data to the center of the hypersphere; R max Indicates the maximum limit value of the hypersphere judgment boundary.