Method and system for establishing prediction of electricity theft users
By collecting and analyzing the power consumption data and social work data of power stolen users, building a power stolen identification model, and using similarity fitting and transfer learning models, the shortcomings of prediction accuracy and real-time of power stolen users in the existing technology are solved, and more accurate and adaptive power stolen users are achieved.
Patent Information
- Application Number
- CN202411829245.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-12
- Publication Date
- 2025-04-08
AI Technical Summary
The existing power stolen user prediction model has shortcomings in accuracy and real-timeness, and the traditional model ignores the impact of external environmental factors on electricity consumption behavior, resulting in poor results under different conditions.
By collecting electricity consumption data and social work data of sample users over T consecutive historical periods, extracting electricity consumption characteristics and classification characteristics, building a power stolen identification model, and using similarity fitting and transfer learning models to improve the ability to predict electricity stolen by unknown users.
It realizes more accurate and real-time user predictions of power theft, improves the adaptability of the model in different environments, and can better capture the power consumption characteristics under different socio-economic backgrounds.
Smart Images

Figure CN119782878A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of electricity theft user prediction, and in particular to a method and system for establishing electricity theft user prediction. Background Art
[0002] With the rapid development of information technology such as mobile networks, cloud computing and the Internet of Things, big data technologies represented by distributed storage, distributed computing, and massive data mining have developed unprecedentedly and matured. With the continuous development of intelligent power grids, the power system has generated a large amount of operating data. How to use the large amount of data collected and accumulated over many years of operation to study the strategy of electricity theft detection, analyze data processing methods, and establish electricity theft models are all difficulties in this field. With the development of new technologies, data technology has concentrated the important advantages of artificial intelligence, automation, and the Internet. In the work of electricity theft detection and investigation, combining big data theory with artificial intelligence can improve the efficiency of electricity theft detection and investigation, and has particularly important value and significance for optimizing the work process of electricity theft detection; in the work of electricity theft detection and investigation, combining big data with artificial intelligence can comprehensively cover all electricity users of power supply enterprises, which is of particular significance for gradually expanding the scope of electricity theft detection and investigation.
[0003] In the prior art, a method, system, storage medium and device for establishing a prediction model for electricity theft users provided by publication number CN113570002A include the following steps: obtaining electricity consumption data of multiple users and grid operation data of the substations to which the users belong, extracting all features, performing correlation analysis on all features and whether the users have stolen electricity, and screening out associated features with a high correlation with whether the users have stolen electricity from all features, preparing an electricity theft training table for each user according to the associated features of each user and their corresponding data values, classifying and labeling the electricity theft training table for each user according to the electricity theft results of whether each user has stolen electricity to obtain an electricity theft training table labeled with an electricity theft code or a non-electricity theft code, preparing an electricity theft training set according to the classified and labeled electricity theft training tables of all users, inputting the electricity theft training set into an initial prediction model for training to obtain a pre-trained prediction model, and the prediction model of the method can be used to quickly and accurately predict whether a user has stolen electricity.
[0004] However, there are still the following deficiencies. As can be seen from the above statements, in the prior art, the electricity theft user prediction model mainly relies on the user's historical electricity consumption data and power grid operation data, and identifies potential electricity theft users through correlation analysis. Although this method can achieve the prediction of electricity theft users to a certain extent, its accuracy and real-time performance are limited by many factors. In addition, traditional models often use static data features for analysis, ignoring the fact that electricity consumption behavior is affected by external environmental factors (such as climate change and economic conditions), which leads to poor performance of the model under different conditions. Furthermore, when dealing with the electricity theft prediction of unknown users, the model lacks effective similarity analysis and real-time data processing, which makes the identification of electricity theft behavior of new users not accurate enough.
[0005] The above information disclosed in this Background section is only for enhancement of understanding of the background of the present disclosure and therefore it may contain information that does not constitute the prior art that is already known to one of ordinary skill in the art. Summary of the invention
[0006] The purpose of the present invention is to provide a method and system for establishing a prediction of electricity theft users, so as to solve the problems raised in the above background technology.
[0007] To achieve the above object, the present invention provides the following technical solutions:
[0008] A method for establishing a prediction of electricity theft users, the specific steps comprising:
[0009] S1. Collect electricity consumption data and social engineering data of sample users in T consecutive historical time periods. Sample users include normal users and electricity theft users. Social engineering data include temperature, rainfall, annual income and population density of the city where the sample users are located;
[0010] S2. Extract the electricity consumption characteristics of the sample users from the collected electricity consumption data, including the electricity consumption change rate, the maximum electricity consumption, the minimum electricity consumption, the average temperature and the average rainfall, perform equal-width binning on the annual income and population density, generate classification characteristics, including the classification label of the annual income of the city where the sample users are located and the classification label of the population density, merge the extracted electricity consumption characteristics and classification characteristics of the sample users, and form a feature matrix of the sample users, including the electricity consumption change rate, the maximum electricity consumption, the minimum electricity consumption, the average temperature, the average rainfall, the classification label of the annual income and the classification label of the population density;
[0011] S3. Build an electricity theft identification model, take the feature matrix of sample users in T historical time periods as input, and use the electricity theft results as label training models to train the electricity theft identification model. The electricity theft results are 1 or 0, 0 represents a normal user, and 1 represents an electricity theft user;
[0012] S4. Collect the electricity consumption data and social work data of the user to be predicted in the T time periods before the current moment, form a feature matrix of the user to be predicted, input the feature matrix of the user to be predicted into the electricity theft identification model, and obtain the electricity theft result;
[0013] S5. Perform similarity fitting on the feature matrix of the sample user and the feature matrix of the user to be predicted, obtain a similarity list of the user to be predicted and the sample user, find the sample user with the greatest similarity, and use the sample user with the greatest similarity as a reference user of the user to be predicted;
[0014] S6. Determine whether the user to be predicted has stolen electricity based on the electricity theft result and the reference user of the user to be predicted.
[0015] Furthermore, the electricity consumption characteristics of sample users are extracted from the collected electricity consumption data, including the electricity consumption change rate, maximum electricity consumption, minimum electricity consumption, average temperature and average rainfall. The specific process is as follows:
[0016] Assuming that the length of each time period is 1 day, the electricity consumption data in the i-th historical time period is E i , i is the index of the historical time period, and i∈[1,T];
[0017] The power consumption change rate is used to measure the fluctuation of power consumption of sample users in T consecutive historical time periods. The power consumption change rate is calculated by the following formula:
[0018]
[0019] Among them, EBL is the rate of change of electricity consumption, E i is the electricity consumption in the i-th historical period, E i-1 is the electricity consumption in the i-1th historical time period;
[0020] The maximum power consumption refers to the maximum value of power consumption in T consecutive historical time periods, in the following form:
[0021] E max =max(E i |i∈[1,T])
[0022] Among them, E max The maximum power consumption in T consecutive historical time periods; the power consumption valley period refers to the minimum power consumption in T consecutive historical time periods in the following form:
[0023] E min =min(E i |i∈[1,T])
[0024] Among them, E min is the minimum power consumption in T consecutive historical time periods;
[0025] Get the mean temperature μ wd , the calculation formula is as follows:
[0026]
[0027] Among them, wd i is the temperature value in the i-th historical time period;
[0028] Get the average rainfall μ r , the calculation formula is as follows:
[0029]
[0030] Among them, r i is the rainfall in the i-th historical time period.
[0031] Furthermore, the annual income and population density are binned to form classification features. The specific process is as follows:
[0032] The annual income and population density are divided into equal-width bins. Equal-width binning is to divide the data range evenly into several intervals. The number of bins for annual income and population density is set to k. P and k D , binning is performed by the following steps:
[0033] max(P)=max(P α |α∈[1,m])
[0034] min(P)=min(P α |α∈[1,m])
[0035]
[0036] max(D)=max(D α |α∈[1,m])
[0037] min(D)=min(D α |α∈[1,m])
[0038]
[0039] Among them, QK P is the interval width of annual income, max(P) is the maximum annual income of all sample users in the city, min(P) is the minimum annual income of all sample users in the city, QK D is the width of the population density interval, max(D) is the maximum population density, and min(D) is the minimum population density;
[0040] According to max(P), min(P) and QK P , divided into k P The annual income range is expressed as:
[0041]
[0042] in, is the γth interval of annual income P, where γ is the index of the annual income interval;
[0043] According to max(D), min(D), QK D , divided into k D Population density intervals are expressed as:
[0044]
[0045] in, is the jth interval of population density D, j is the index of the population density interval;
[0046] According to the intervals to which the annual income and population density belong, the annual income and population density of each sample user's city are converted into corresponding classification features and classified according to the following rules:
[0047]
[0048]
[0049] in, is the classification label of the annual income of the city where the αth sample user is located, used to indicate the αth sample user P α The annual income range is the classification label of the population density of the city where the αth sample user is located, used to indicate the αth sample user D α The population density interval, E α represents the annual income of the city where the αth sample user is located, D α represents the population density of the city where the αth sample user is located, α is the index of the sample user, α∈[1,m], and m is the number of sample users.
[0050] Furthermore, the extracted electricity consumption characteristics and classification characteristics of the sample users are combined to form a feature matrix of the sample users. The specific process is as follows:
[0051] All extracted features are combined into a feature matrix. Each row of the feature matrix represents the features of a sample user and contains the following:
[0052]
[0053] Among them, Xα is the feature matrix of the αth sample user, x α,1 、x α,2 、x α,3 、x α,4 、x α,5 、x α,6 、x α,7 They are respectively the electricity consumption change rate, maximum electricity consumption, minimum electricity consumption, average temperature, average rainfall, classification labels of annual income and classification labels of population density of sample users.
[0054] Furthermore, the electricity theft identification model includes a basic classification model and a transfer learning model;
[0055] The transfer learning model is a pre-trained model:
[0056] Use the pre-trained deep learning model to extract time series data, including the electricity consumption change rate, maximum electricity consumption, and minimum electricity consumption of sample users in T historical time periods;
[0057] Use time series data as feature input, then add a classification layer and use an activation function to output the probability of electricity theft;
[0058] The basic classification models include:
[0059] Input layer: receives the feature matrix of sample users in T historical time periods;
[0060] Hidden layer: Several fully connected layers, the activation function is ReLU or Leaky ReLU;
[0061] Output layer: Sigmoid activation function for binary classification, with output values in the range of [0, 1], indicating the probability of electricity theft;
[0062] The electricity theft results are labeled in the feature matrix of the corresponding sample users, and then the feature matrix is input into the basic classification model and the transfer learning model. These data are used to train the model. After the training is completed, an electricity theft identification model is obtained. The feature matrix of the user to be predicted is input into the electricity theft identification model, and the model will output the electricity theft results, which are divided into 0 or 1.
[0063] Furthermore, the feature matrix of the sample user and the feature matrix of the user to be predicted are similarly fitted to obtain the similarity between the user to be predicted and the known electricity theft user at the current moment. The specific formula is as follows:
[0064] Set the characteristics X of the sample user:
[0065]
[0066] Feature vector of the user to be predicted:
[0067]
[0068] Among them, X new is the feature vector of the user to be predicted, x new,1 、x new,2 、x new,3 、x new,4 、x new,5 、x new,6 、x new,7 They are the classification labels of the electricity consumption change rate, maximum electricity consumption, minimum electricity consumption, average temperature, average rainfall, annual income and population density of the users to be predicted;
[0069] Set the weight vector W, each feature corresponds to a weight coefficient:
[0070]
[0071] Among them, ω1, ω2, ω3, ω4, ω5, ω6, and ω7 are the weight coefficients of the classification labels of electricity consumption change rate, maximum electricity consumption, minimum electricity consumption, average temperature, average rainfall, annual income, and population density, respectively. 0<ω7<ω6<ω5<ω4<ω3<ω2<ω1<1, ω7+ω6+ω5+ω4+ω3+ω2+ω1=1;
[0072] The weighted feature vector X of the user to be predicted new,wei :
[0073]
[0074] The weighted feature vector X of known electricity stealing users α,wei :
[0075]
[0076] Calculate the weighted cosine similarity between the αth sample user and the user to be predicted:
[0077]
[0078]
[0079]
[0080]
[0081] Among them, Sim(X new,wei , X α,wei ) is the weighted cosine similarity between the αth sample user and the user to be predicted, ||X new,wei || is the modulus of the weighted feature vector of the user to be predicted, ||Xα,wei || is the modulus of the weighted feature vector of the sample user, ω β is the weight coefficient of the βth feature, x new,β is the βth feature of the user to be predicted, x α,β is the βth feature of the αth sample user, β is the index of the feature, β∈[1,7].
[0082] Furthermore, according to the electricity theft result and the reference user of the user to be predicted, it is determined whether the user to be predicted steals electricity or not. The specific process is as follows:
[0083] The similarities between the m sample users and the user to be predicted are arranged in descending order according to the similarity, and a similarity threshold YZ is set. The sample user with the highest similarity and a similarity higher than the similarity threshold YZ is selected as the reference of the user to be predicted. The reference of the user to be predicted is a normal user or a power stealing user.
[0084] When there are more than two sample users with the highest similarity above the similarity threshold YZ, as long as there is more than one electricity theft user, the reference user to be predicted is the electricity theft user, otherwise it is a normal user;
[0085] When there are only sample users whose similarity is lower than the threshold value YZ, it is determined whether the user to be predicted steals electricity according to the electricity theft result;
[0086] When the electricity theft result is a normal user and the reference is a normal user, it means that the user to be predicted has not stolen electricity;
[0087] When the electricity theft result is a normal user and the reference is an electricity theft user, it means that the user to be predicted is stealing electricity;
[0088] When the electricity theft result is an electricity theft user and the reference is a normal user, it means that the user to be predicted is stealing electricity;
[0089] When the electricity theft result is an electricity theft user and the reference is an electricity theft user, it means that the user to be predicted has stolen electricity.
[0090] A system for establishing a prediction of electricity theft users, wherein the coefficient is used to execute any of the above-mentioned methods for establishing a prediction of electricity theft users, comprising:
[0091] The data collection module is used to collect the electricity consumption data and social engineering data of sample users in T consecutive historical time periods. The sample users include normal users and electricity theft users. The social engineering data include temperature, rainfall, annual income and population density of the city where the sample users are located;
[0092] The feature matrix construction module is used to extract the power consumption characteristics of the sample users from the collected power consumption data, including the power consumption change rate, the maximum power consumption, the minimum power consumption, the average temperature and the average rainfall, and to perform equal-width binning of the annual income and the population density to generate classification characteristics, including the classification label of the annual income of the city where the sample users are located and the classification label of the population density, and to merge the extracted power consumption characteristics and classification characteristics of the sample users to form a feature matrix of the sample users, including the power consumption change rate, the maximum power consumption, the minimum power consumption, the average temperature, the average rainfall, the classification label of the annual income and the classification label of the population density;
[0093] The electricity theft identification model building module is used to build an electricity theft identification model. The feature matrix of sample users in T historical time periods is used as input, and the electricity theft results are used as label training models to train the electricity theft identification model. The electricity theft results are 1 or 0, where 0 represents a normal user and 1 represents an electricity theft user.
[0094] The electricity theft result acquisition module is used to collect the electricity consumption data and social work data of the user to be predicted in the T time periods before the current moment, form a feature matrix of the user to be predicted, input the feature matrix of the user to be predicted into the electricity theft identification model, and obtain the electricity theft result;
[0095] A fitting module is used to perform similarity fitting between the feature matrix of the sample user and the feature matrix of the user to be predicted, obtain a similarity list of the user to be predicted and the sample user, find the sample user with the greatest similarity, and use the sample user with the greatest similarity as a reference user of the user to be predicted;
[0096] The judgment module is used to judge whether the user to be predicted steals electricity according to the electricity stealing result and the reference user of the user to be predicted.
[0097] Compared with the prior art, the present invention has the following beneficial effects:
[0098] The present invention introduces the electricity consumption data of sample users in T consecutive historical time periods, and adds social engineering data (such as temperature, rainfall, economic conditions and population density) to construct a multi-dimensional sample user feature matrix. This feature matrix not only includes dynamic characteristics such as electricity consumption change rate, maximum electricity consumption and minimum electricity consumption, but also comprehensively considers the influence of environmental and socio-economic factors, so as to more comprehensively reflect the user's electricity consumption behavior; in addition, the user's annual income and population density are processed with equal width bins to generate classification labels, which can better capture the electricity consumption characteristics of users under different socio-economic backgrounds. This processing method makes the model more convenient to classify and identify, and improves the model's recognition ability for different user groups. Improvement scheme: Through similarity fitting and transfer learning models, similar reference users can be quickly obtained from known electricity theft users, thereby enhancing the ability to predict electricity theft for unknown users, realizing the precision and real-time identification of electricity theft users, and improving the adaptability of the model in different environments. BRIEF DESCRIPTION OF THE DRAWINGS
[0099] Figure 1 It is a schematic diagram of the overall method flow of the present invention;
[0100] Figure 2 This is a block diagram of the module composition of the present invention. DETAILED DESCRIPTION
[0101] In order to make the objectives, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with specific embodiments.
[0102] It should be noted that, unless otherwise defined, the technical terms or scientific terms used in the present invention should be understood by people with ordinary skills in the field to which the present invention belongs. The words "first", "second" and similar words used in the present invention do not indicate any order, quantity or importance, but are only used to distinguish different components. "Include" or "comprise" and similar words mean that the elements or objects appearing before the word include the elements or objects listed after the word and their equivalents, without excluding other elements or objects. "Connect" or "connected" and similar words are not limited to physical or mechanical connections, but may include electrical connections, whether direct or indirect. "Up", "down", "left", "right" and the like are only used to indicate relative positional relationships. When the absolute position of the described object changes, the relative positional relationship may also change accordingly.
[0103] Embodiment 1:
[0104] See also Figure 1 , the present invention provides a technical solution:
[0105] A method for establishing a prediction of electricity theft users, the specific steps comprising:
[0106] S1. Collect electricity consumption data and social engineering data of sample users in T consecutive historical time periods. Sample users include normal users and electricity theft users. Social engineering data include temperature, rainfall, annual income and population density of the city where the sample users are located. Annual income refers to per capita annual income. Per capita annual income and population density can be obtained from the website of the Statistics Bureau, because the provincial or municipal statistics bureau will regularly release economic, population and other related data of each city every year, including per capita annual income and population density.
[0107] S2. Extract the electricity consumption characteristics of the sample users from the collected electricity consumption data, including the electricity consumption change rate, the maximum electricity consumption, the minimum electricity consumption, the average temperature and the average rainfall, perform equal-width binning on the annual income and population density, generate classification characteristics, including the classification label of the annual income of the city where the sample users are located and the classification label of the population density, merge the extracted electricity consumption characteristics and classification characteristics of the sample users, and form a feature matrix of the sample users, including the electricity consumption change rate, the maximum electricity consumption, the minimum electricity consumption, the average temperature, the average rainfall, the classification label of the annual income and the classification label of the population density;
[0108] S3. Build an electricity theft identification model, take the feature matrix of sample users in T historical time periods as input, and use the electricity theft results as label training models to train the electricity theft identification model. The electricity theft results are 1 or 0, 0 represents a normal user, and 1 represents an electricity theft user;
[0109] S4. Collect the electricity consumption data and social work data of the user to be predicted in the T time periods before the current moment, form a feature matrix of the user to be predicted, input the feature matrix of the user to be predicted into the electricity theft identification model, and obtain the electricity theft result;
[0110] S5. Perform similarity fitting on the feature matrix of the sample user and the feature matrix of the user to be predicted, obtain a similarity list of the user to be predicted and the sample user, find the sample user with the greatest similarity, and use the sample user with the greatest similarity as a reference user of the user to be predicted;
[0111] S6. Determine whether the user to be predicted has stolen electricity based on the electricity theft result and the reference user of the user to be predicted.
[0112] Based on the above embodiment, the electricity consumption characteristics of the sample users are extracted from the collected electricity consumption data, including the electricity consumption change rate, the maximum electricity consumption, the minimum electricity consumption, the average temperature and the average rainfall. The specific process is as follows:
[0113] Assuming that the length of each time period is 1 day, the electricity consumption data in the i-th historical time period is E i , i is the index of the historical time period, and i∈[1,T];
[0114] The power consumption change rate is used to measure the fluctuation of power consumption of sample users in T consecutive historical time periods. The power consumption change rate is calculated by the following formula:
[0115]
[0116] Among them, EBL is the rate of change of electricity consumption, E i is the electricity consumption in the i-th historical period, E i-1 is the electricity consumption in the i-1th historical time period;
[0117] The maximum power consumption refers to the maximum value of power consumption in T consecutive historical time periods, in the following form:
[0118] E max =max(E i |i∈[1,T])
[0119] Among them, E max The maximum power consumption in T consecutive historical time periods; the power consumption valley period refers to the minimum power consumption in T consecutive historical time periods in the following form:
[0120] E min =min(E i |i∈[1,T])
[0121] Among them, E min is the minimum power consumption in T consecutive historical time periods;
[0122] Get the mean temperature μ wd , the calculation formula is as follows:
[0123]
[0124] Among them, wd i is the temperature value in the i-th historical time period;
[0125] Get the average rainfall μr, the calculation formula is as follows:
[0126]
[0127] Among them, r i is the rainfall in the i-th historical time period.
[0128] Based on the above embodiment, the annual income and population density are binned to form classification features. The specific process is as follows:
[0129] The annual income and population density are divided into equal-width bins. Equal-width binning is to divide the data range evenly into several intervals. The number of bins for annual income and population density is set to k. P and k D, binning is performed by the following steps:
[0130] max(P)=max(P α |α∈[1,m])
[0131] min(P)=min(P α |α∈[1,m])
[0132]
[0133] max(D)=max(D α |α∈[1,m])
[0134] min(D)=min(D α |α∈[1,m])
[0135]
[0136] Among them, QK P is the interval width of annual income, max(P) is the maximum annual income of all sample users in the city, min(P) is the minimum annual income of all sample users in the city, QK D is the width of the population density interval, max(D) is the maximum population density, and min(D) is the minimum population density;
[0137] According to max(P), min(P) and QK P , divided into k P The annual income range is expressed as:
[0138]
[0139] in, is the γth interval of annual income P, where γ is the index of the annual income interval;
[0140] According to max(D), min(D), QK D , divided into k D Population density intervals are expressed as:
[0141]
[0142] in, is the jth interval of population density D, j is the index of the population density interval;
[0143] According to the intervals to which the annual income and population density belong, the annual income and population density of each sample user's city are converted into corresponding classification features and classified according to the following rules:
[0144]
[0145]
[0146] in, is the classification label of the annual income of the city where the αth sample user is located, used to indicate the αth sample user P α The annual income range is the classification label of the population density of the city where the αth sample user is located, used to indicate the αth sample user D α The population density interval, E a represents the annual income of the city where the αth sample user is located, D α represents the population density of the city where the αth sample user is located, α is the index of the sample user, α∈[1,m], and m is the number of sample users.
[0147] On the basis of the above embodiment, the extracted electricity consumption characteristics and classification characteristics of the sample users are combined to form a characteristic matrix of the sample users. The specific process is as follows:
[0148] All extracted features are combined into a feature matrix. Each row of the feature matrix represents the features of a sample user and contains the following:
[0149]
[0150] Among them, X α is the feature matrix of the αth sample user, x α,1 、x α,2 、x α,3 、x α,4 、x α,5 、x α,6 、x α,7 They are respectively the electricity consumption change rate, maximum electricity consumption, minimum electricity consumption, average temperature, average rainfall, classification labels of annual income and classification labels of population density of sample users.
[0151] Based on the above embodiment, the electricity theft identification model includes a basic classification model and a transfer learning model;
[0152] The transfer learning model is a pre-trained model:
[0153] Use the pre-trained deep learning model to extract time series data, including the electricity consumption change rate, maximum electricity consumption, and minimum electricity consumption of sample users in T historical time periods;
[0154] Use time series data as feature input, then add a classification layer and use an activation function to output the probability of electricity theft;
[0155] The basic classification models include:
[0156] Input layer: receives the feature matrix of sample users in T historical time periods;
[0157] Hidden layer: Several fully connected layers, the activation function is ReLU or Leaky ReLU;
[0158] Output layer: Sigmoid activation function for binary classification, with output values in the range of [0, 1], indicating the probability of electricity theft;
[0159] The electricity theft results are labeled in the feature matrix of the corresponding sample users, and then the feature matrix is input into the basic classification model and the transfer learning model. These data are used to train the model. After the training is completed, an electricity theft identification model is obtained. The feature matrix of the user to be predicted is input into the electricity theft identification model, and the model will output the electricity theft results, which are divided into 0 or 1.
[0160] On the basis of the above embodiment, the feature matrix of the sample user and the feature matrix of the user to be predicted are similarly fitted to obtain the similarity between the user to be predicted and the known electricity theft user at the current moment. The specific formula is as follows:
[0161] Set the characteristics X of the sample user:
[0162]
[0163] Feature vector of the user to be predicted:
[0164]
[0165] Among them, X new is the feature vector of the user to be predicted, x new,1 、x new,2 、x new,3 、x new,4 、x new,5 、x new,6 、x new,7 They are the classification labels of the electricity consumption change rate, maximum electricity consumption, minimum electricity consumption, average temperature, average rainfall, annual income and population density of the users to be predicted;
[0166] Set the weight vector W, each feature corresponds to a weight coefficient:
[0167]
[0168] Among them, ω1, ω2, ω3, ω4, ω5, ω6, and ω7 are the weight coefficients of the electricity consumption change rate, the maximum electricity consumption, the minimum electricity consumption, the average temperature, the average rainfall, the classification label of the annual income, and the classification label of the population density, respectively;
[0169] Normally, the weight coefficient ω1 of the electricity consumption change rate is the largest, because it directly reflects the changes in the user's electricity consumption behavior, can reflect the user's electricity consumption habits and needs, and has the greatest correlation with electricity theft; the maximum electricity consumption and the minimum electricity consumption provide the range and limit of the user's electricity consumption, and directly affect the overall electricity consumption pattern. The impact of these two characteristics is not as direct as the electricity consumption change rate, and their correlation with electricity theft is not as great as the electricity consumption change rate. Therefore, the weight coefficients ω2 and ω3 of the maximum electricity consumption and the minimum electricity consumption are lower than the weight coefficient ω1 of the electricity consumption change rate. The weight coefficient ω2 of the maximum electricity consumption is usually larger than the weight coefficient ω3 of the minimum electricity consumption. The impact of temperature on electricity demand may vary in different seasons and regions, and is especially important during peak electricity consumption periods. Although temperature affects electricity consumption, its effect is usually Indirect, especially in extreme weather conditions, the correlation with electricity theft is not as great as the minimum electricity consumption, so the weight ω4 is lower than the weight coefficient ω3 of the previous minimum electricity consumption. Compared with temperature, rainfall has a more limited effect on the user's electricity consumption pattern, and the correlation with electricity theft is not as great as temperature, so the weight ω5 is further reduced. The two characteristics of the user's annual income and population density mainly provide information about the user's socioeconomic background, and the way they affect electricity consumption is relatively indirect, and the correlation with electricity theft is not as great as rainfall, so ω6 and ω7 are lower than other parameters. The user's annual income and population density are indicators of two different dimensions, and they are equally important, so the weight coefficients ω6 and ω7 of the classification label of the user's annual income and the classification label of the population density are set to be equal. Therefore, set 0<ω7=ω6<ω5<ω4<ω3<ω2<ω1<1, ω7+ω6+ω5+ω4+ω3+ω2+ω1=1;
[0170] The weighted feature vector X of the user to be predicted new,wei :
[0171]
[0172] The weighted feature vector X of known electricity stealing users α,wei :
[0173]
[0174] Calculate the weighted cosine similarity between the αth sample user and the user to be predicted:
[0175]
[0176]
[0177]
[0178]
[0179] Among them, Sim(Xnew,wei , X α,wei ) is the weighted cosine similarity between the αth sample user and the user to be predicted, ||X new,wei || is the modulus of the weighted feature vector of the user to be predicted, ||X α,wei || is the modulus of the weighted feature vector of the sample user, ω β is the weight coefficient of the βth feature, x new,β is the βth feature of the user to be predicted, x α,β is the βth feature of the αth sample user, β is the index of the feature, β∈[1,7].
[0180] On the basis of the above embodiment, according to the electricity theft result and the reference user of the user to be predicted, it is determined whether the user to be predicted has stolen electricity. The specific process is as follows:
[0181] The similarities between the m sample users and the user to be predicted are arranged in descending order according to the similarity, and a similarity threshold YZ is set. The sample user with the highest similarity and a similarity higher than the similarity threshold YZ is selected as the reference of the user to be predicted. The reference of the user to be predicted is a normal user or a power stealing user.
[0182] When there are more than two sample users with the highest similarity above the similarity threshold YZ, as long as there is more than one electricity theft user, the reference user to be predicted is the electricity theft user, otherwise it is a normal user;
[0183] When there are only sample users whose similarity is lower than the threshold value YZ, it is determined whether the user to be predicted steals electricity according to the electricity theft result;
[0184] When the electricity theft result is a normal user and the reference is a normal user, it means that the user to be predicted has not stolen electricity;
[0185] When the electricity theft result is a normal user and the reference is an electricity theft user, it means that the user to be predicted is stealing electricity;
[0186] When the electricity theft result is an electricity theft user and the reference is a normal user, it means that the user to be predicted is stealing electricity;
[0187] When the electricity theft result is an electricity theft user and the reference is an electricity theft user, it means that the user to be predicted has stolen electricity.
[0188] See also Figure 2 , the present invention also provides a technical solution:
[0189] A system for establishing a prediction of electricity theft users, wherein the coefficient is used to execute any of the above-mentioned methods for establishing a prediction of electricity theft users, comprising:
[0190] The data collection module is used to collect the electricity consumption data and social engineering data of sample users in T consecutive historical time periods. The sample users include normal users and electricity theft users. The social engineering data include temperature, rainfall, annual income and population density of the city where the sample users are located;
[0191] The feature matrix construction module is used to extract the power consumption characteristics of the sample users from the collected power consumption data, including the power consumption change rate, the maximum power consumption, the minimum power consumption, the average temperature and the average rainfall, and to perform equal-width binning of the annual income and the population density to generate classification characteristics, including the classification label of the annual income of the city where the sample users are located and the classification label of the population density, and to merge the extracted power consumption characteristics and classification characteristics of the sample users to form a feature matrix of the sample users, including the power consumption change rate, the maximum power consumption, the minimum power consumption, the average temperature, the average rainfall, the classification label of the annual income and the classification label of the population density;
[0192] The electricity theft identification model building module is used to build an electricity theft identification model. The feature matrix of sample users in T historical time periods is used as input, and the electricity theft results are used as label training models to train the electricity theft identification model. The electricity theft results are 1 or 0, where 0 represents a normal user and 1 represents an electricity theft user.
[0193] The electricity theft result acquisition module is used to collect the electricity consumption data and social work data of the user to be predicted in the T time periods before the current moment, form a feature matrix of the user to be predicted, input the feature matrix of the user to be predicted into the electricity theft identification model, and obtain the electricity theft result;
[0194] A fitting module is used to perform similarity fitting between the feature matrix of the sample user and the feature matrix of the user to be predicted, obtain a similarity list of the user to be predicted and the sample user, find the sample user with the greatest similarity, and use the sample user with the greatest similarity as a reference user of the user to be predicted;
[0195] The judgment module is used to judge whether the user to be predicted steals electricity according to the electricity stealing result and the reference user of the user to be predicted.
[0196] The above formulas are all dimensionless and numerical calculations. The formula is a formula for the most recent real situation obtained by collecting a large amount of data and performing software simulation. The preset parameters in the formula are set by technicians in this field according to actual conditions.
[0197] The above embodiments may be implemented in whole or in part by software, hardware, firmware or any other combination thereof. When implemented using software, the above embodiments may be implemented in whole or in part in the form of a computer program product. Those skilled in the art may appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein may be implemented by computer software, electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed by hardware or software depends on the specific application and design constraints of the technical solution.
[0198] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, and may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0199] The above description is only a specific implementation manner of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application.
[0200] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, and may be located in one place or distributed on multiple network units. Some or all of the units may be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0201] The above description is only a specific implementation manner of the present application, but the protection scope of the present application is not limited thereto. Any technician familiar with the technical field can easily think of changes or substitutions within the technical scope disclosed in the present application, which should be included in the protection scope of the present application.
Claims
1. A method for establishing a prediction of electricity theft users, characterized in that: The specific steps include: S1. Collect electricity consumption data and social engineering data of sample users in T consecutive historical time periods. Sample users include normal users and electricity theft users. Social engineering data include temperature, rainfall, annual income and population density of the city where the sample users are located; S2. Extract the electricity consumption characteristics of the sample users from the collected electricity consumption data, including the electricity consumption change rate, the maximum electricity consumption, the minimum electricity consumption, the average temperature and the average rainfall, perform equal-width binning on the annual income and population density, generate classification characteristics, including the classification label of the annual income of the city where the sample users are located and the classification label of the population density, merge the extracted electricity consumption characteristics and classification characteristics of the sample users, and form a feature matrix of the sample users, including the electricity consumption change rate, the maximum electricity consumption, the minimum electricity consumption, the average temperature, the average rainfall, the classification label of the annual income and the classification label of the population density; S3. Build an electricity theft identification model, take the feature matrix of sample users in T historical time periods as input, and use the electricity theft results as label training models to train the electricity theft identification model. The electricity theft results are 1 or 0, 0 represents a normal user, and 1 represents an electricity theft user; S4. Collect the electricity consumption data and social work data of the user to be predicted in the T time periods before the current moment, form a feature matrix of the user to be predicted, input the feature matrix of the user to be predicted into the electricity theft identification model, and obtain the electricity theft result; S5. Perform similarity fitting on the feature matrix of the sample user and the feature matrix of the user to be predicted, obtain a similarity list of the user to be predicted and the sample user, find the sample user with the greatest similarity, and use the sample user with the greatest similarity as a reference user of the user to be predicted; S6. Determine whether the user to be predicted has stolen electricity based on the electricity theft result and the reference user of the user to be predicted.
2. The method for establishing electricity theft user prediction according to claim 1, characterized in that: The electricity consumption characteristics of sample users are extracted from the collected electricity consumption data, including the electricity consumption change rate, maximum electricity consumption, minimum electricity consumption, average temperature and average rainfall. The specific process is as follows: Assuming that the length of each time period is 1 day, the electricity consumption data in the i-th historical time period is E i , i is the index of the historical time period, and i∈[1,T]; The power consumption change rate is used to measure the fluctuation of power consumption of sample users in T consecutive historical time periods. The power consumption change rate is calculated by the following formula: Among them, EBL is the rate of change of electricity consumption, E i is the electricity consumption in the i-th historical period, E i-1 is the electricity consumption in the i-1th historical time period; The maximum power consumption refers to the maximum value of power consumption in T consecutive historical time periods, in the following form: E max =max(E i |i∈[1,T]) Among them, E max The maximum power consumption in T consecutive historical time periods; the power consumption valley period refers to the minimum power consumption in T consecutive historical time periods in the following form: The min =min(E i |i∈[1,T]) Among them, E min is the minimum power consumption in T consecutive historical time periods; Get the mean temperature μ wd , the calculation formula is as follows: Among them, wd i is the temperature value in the i-th historical time period; Get the average rainfall μ r , the calculation formula is as follows: Among them, r i is the rainfall in the i-th historical time period.
3. The method for establishing electricity theft user prediction according to claim 2 is characterized in that: The annual income and population density are binned to form classification features. The specific process is as follows: The annual income and population density are divided into equal-width bins. Equal-width binning is to divide the data range evenly into several intervals. The number of bins for annual income and population density is set to k. P and k D , binning is performed by the following steps: max(P)=max(P α |α∈[1,m]) min(P)=min(P α |α∈[1,m]) max(D)=max(D α |α∈[1,m]) min(D)=min(D α |α∈[1,m]) Among them, QK P is the interval width of annual income, max(P) is the maximum annual income of all sample users in the city, min(P) is the minimum annual income of all sample users in the city, QK D is the width of the population density interval, max(D) is the maximum population density, and min(D) is the minimum population density; According to max(P), min(P) and QK P , divided into k P The annual income range is expressed as: in, is the γth interval of annual income P, where γ is the index of the annual income interval; According to max(D), min(D), QK D , divided into k D Population density intervals are expressed as: in, is the jth interval of population density D, j is the index of the population density interval; According to the intervals to which the annual income and population density belong, the annual income and population density of each sample user's city are converted into corresponding classification features and classified according to the following rules: in, is the classification label of the annual income of the city where the αth sample user is located, used to indicate the αth sample user P α The annual income range is the classification label of the population density of the city where the αth sample user is located, used to indicate the αth sample user D α The population density interval, E α represents the annual income of the city where the αth sample user is located, D α represents the population density of the city where the αth sample user is located, α is the index of the sample user, α∈[1,m], and m is the number of sample users.
4. The method for establishing electricity theft user prediction according to claim 3 is characterized by: The extracted electricity consumption characteristics and classification characteristics of the sample users are combined to form the feature matrix of the sample users. The specific process is as follows: All extracted features are combined into a feature matrix. Each row of the feature matrix represents the features of a sample user and contains the following: Among them, X α is the feature matrix of the αth sample user, x α,1 、x α,2 、x α,3 、x α,4 、x α,5 、x α,6 、x α,7 They are respectively the electricity consumption change rate, maximum electricity consumption, minimum electricity consumption, average temperature, average rainfall, classification labels of annual income and classification labels of population density of sample users.
5. The method for establishing electricity theft user prediction according to claim 4 is characterized in that: The electricity theft identification model includes a basic classification model and a transfer learning model; The transfer learning model is a pre-trained model: Use the pre-trained deep learning model to extract time series data, including the electricity consumption change rate, maximum electricity consumption, and minimum electricity consumption of sample users in T historical time periods; Use time series data as feature input, then add a classification layer and use an activation function to output the probability of electricity theft; The basic classification models include: Input layer: receives the feature matrix of sample users in T historical time periods; Hidden layer: Several fully connected layers, the activation function is ReLU or Leaky ReLU; Output layer: Sigmoid activation function for binary classification, with output values in the range of [0,1], indicating the probability of electricity theft; The electricity theft results are labeled in the feature matrix of the corresponding sample users, and then the feature matrix is input into the basic classification model and the transfer learning model. The models are trained using these data. After the training is completed, an electricity theft identification model is obtained. The feature matrix of the user to be predicted is input into the electricity theft identification model, and the model outputs the electricity theft results. The electricity theft results are divided into 0 or 1, and 0 represents a normal user.
6. The method for establishing electricity theft user prediction according to claim 5, characterized in that: The feature matrix of the sample user and the feature matrix of the user to be predicted are fitted with similarity to obtain the similarity between the user to be predicted and the known electricity theft user at the current moment. The specific formula is as follows: Set the characteristics X of the sample user: Feature vector of the user to be predicted: Among them, X new is the feature vector of the user to be predicted, x new,1 、x new,2 、x new,3 、x new,4 、x new,5 、x new,6 、x new,7 They are the classification labels of the electricity consumption change rate, maximum electricity consumption, minimum electricity consumption, average temperature, average rainfall, annual income and population density of the users to be predicted; Set the weight vector W, each feature corresponds to a weight coefficient: Among them, ω1, ω2, ω3, ω4, ω5, ω6, and ω7 are the weight coefficients of the classification labels of electricity consumption change rate, maximum electricity consumption, minimum electricity consumption, average temperature, average rainfall, annual income, and population density, respectively. 0<ω7=ω6<ω5<ω4<ω3<ω2<ω1<1, ω7+ω6+ω5+ω4+ω3+ω2+ω1=1; The weighted feature vector X of the user to be predicted new,wei : The weighted feature vector X of known electricity theft users α,wei : Calculate the weighted cosine similarity between the αth sample user and the user to be predicted: Among them, Sim(X new,wei ,X α,wei ) is the weighted cosine similarity between the αth sample user and the user to be predicted, ||X new,wei || is the modulus of the weighted feature vector of the user to be predicted, ||X α,wei || is the modulus of the weighted feature vector of the sample user, ω β is the weight coefficient of the βth feature, x new,β is the βth feature of the user to be predicted, x α,β is the βth feature of the αth sample user, β is the index of the feature, β∈[1,7].
7. The method for establishing electricity theft user prediction according to claim 6, characterized in that: According to the electricity theft results and the reference users of the predicted users, it is determined whether the predicted users have stolen electricity or not. The specific process is as follows: The similarities between the m sample users and the user to be predicted are arranged in descending order according to the similarity, and a similarity threshold YZ is set. The sample user with the highest similarity and a similarity higher than the similarity threshold YZ is selected as the reference of the user to be predicted. The reference of the user to be predicted is a normal user or a power stealing user. When there are more than two sample users with the highest similarity above the similarity threshold YZ, as long as there is more than one electricity theft user, the reference user to be predicted is the electricity theft user, otherwise it is a normal user; When there are only sample users whose similarity is lower than the threshold value YZ, it is determined whether the user to be predicted steals electricity according to the electricity theft result; When the electricity theft result is a normal user and the reference is a normal user, it means that the user to be predicted has not stolen electricity; When the electricity theft result is a normal user and the reference is an electricity theft user, it means that the user to be predicted is stealing electricity; When the electricity theft result is an electricity theft user and the reference is a normal user, it means that the user to be predicted is stealing electricity; When the electricity theft result is an electricity theft user and the reference is an electricity theft user, it means that the user to be predicted has stolen electricity.
8. A system for establishing a prediction of electricity theft users, wherein the coefficient is used to execute a method for establishing a prediction of electricity theft users according to any one of claims 1 to 7, characterized in that: include: The data collection module is used to collect the electricity consumption data and social engineering data of sample users in T consecutive historical time periods. The sample users include normal users and electricity theft users. The social engineering data include temperature, rainfall, annual income and population density of the city where the sample users are located; The feature matrix construction module is used to extract the power consumption characteristics of the sample users from the collected power consumption data, including the power consumption change rate, the maximum power consumption, the minimum power consumption, the average temperature and the average rainfall, and to perform equal-width binning of the annual income and the population density to generate classification characteristics, including the classification label of the annual income of the city where the sample users are located and the classification label of the population density, and to merge the extracted power consumption characteristics and classification characteristics of the sample users to form a feature matrix of the sample users, including the power consumption change rate, the maximum power consumption, the minimum power consumption, the average temperature, the average rainfall, the classification label of the annual income and the classification label of the population density; The electricity theft identification model building module is used to build an electricity theft identification model. The feature matrix of sample users in T historical time periods is used as input, and the electricity theft results are used as label training models to train the electricity theft identification model. The electricity theft results are 1 or 0, where 0 represents a normal user and 1 represents an electricity theft user. The electricity theft result acquisition module is used to collect the electricity consumption data and social work data of the user to be predicted in the T time periods before the current moment, form a feature matrix of the user to be predicted, input the feature matrix of the user to be predicted into the electricity theft identification model, and obtain the electricity theft result; A fitting module is used to perform similarity fitting between the feature matrix of the sample user and the feature matrix of the user to be predicted, obtain a similarity list of the user to be predicted and the sample user, find the sample user with the greatest similarity, and use the sample user with the greatest similarity as a reference user of the user to be predicted; The judgment module is used to judge whether the user to be predicted steals electricity according to the electricity stealing result and the reference user of the user to be predicted.
Citation Information
Patent Citations
Establishment method and system of electricity stealing user prediction model, storage medium and equipment
CN113570002A