Power consumer electricity price abnormity identification method and device and electronic equipment
By combining low-rank tensor decomposition and improved generative adversarial networks with spatiotemporal correlation matrices to identify abnormal electricity prices for power users, the problems of data sample defects and insufficient dynamic adaptability are solved, achieving higher recognition accuracy and lower false alarm rate.
Patent Information
- Application Number
- CN202510754666.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-06
- Publication Date
- 2025-10-17
AI Technical Summary
The existing technology for identifying anomalies in electricity prices for power users has problems such as data sample defects, insufficient dynamic adaptability of the static threshold mechanism, and inaccurate anomaly identification caused by regional characteristics differences.
Low-rank tensor decomposition technology is used to repair missing data, combined with spatiotemporal correlation matrix for preprocessing, and an improved adversarial generative network is used to generate adversarial electricity theft sample data. Anomaly identification is performed through a multimodal credibility joint judgment method, combined with dynamic weight update and periodic dynamic threshold adjustment.
The accuracy of identifying abnormal electricity prices for power users is improved, the false alarm rate is reduced, and the problems of insufficient sample size and insufficient dynamic adaptability in traditional methods are solved.
Smart Images

Figure CN120807032A_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of power big data analysis and intelligent detection, and particularly relates to a power user electricity price anomaly identification method and device and electronic equipment. BACKGROUND
[0002] In the field of power user electricity price anomaly detection, the existing technology mainly focuses on power consumption behavior pattern recognition and power consumption feature modeling, and the specific technical route includes: a statistical threshold method based on: setting peak-valley ratio, power consumption standard deviation and other static index thresholds to identify anomalies, which is difficult to effectively distinguish seasonal load fluctuations from abnormal data patterns caused by human electricity stealing behavior (such as peak power consumption ratio exceeding ± 15% being determined as abnormal). Comparative technology based on group clustering analysis: using K-means, spectral clustering and other algorithms to construct user power consumption behavior baseline, and identifying abnormal individuals by deviation within the group. However, in actual scenarios, highly nonlinear characteristics such as night step load changes of agricultural and sideline users and irregular production power consumption of small and micro enterprises lead to a high misjudgment rate of traditional clustering models. Time series pattern recognition method: using LSTM, TCN and other models to mine power consumption time series features and electricity price anomaly groups. Defects of existing technology: data sample defects: low abnormal sample collection rate of agricultural and sideline users, and traditional SMOTE sample generation method causes feature collapse in electricity price data, resulting in a sample distance (FAD) that is higher than real data. Static threshold mechanism has poor dynamic adaptability: behavior pattern shift: peak-valley period migration (average shift 2.5 hours) caused by business user operating time adjustment during holidays, causing baseline curve matching deviation; regional characteristic difference: abnormal leakage current of insulating subdue in high-altitude areas due to reduced air density, which is highly similar to real fault current characteristics. SUMMARY
[0003] Therefore, the present application provides a power user electricity price anomaly identification method and device and electronic equipment, which mainly aims to solve the problem of inaccurate anomaly identification due to data sample defects, poor dynamic adaptability of static threshold mechanism and regional characteristic differences in current power user electricity price anomaly identification.
[0004] To solve the above problems, the present application provides a power user electricity price anomaly identification method, which comprises:
[0005] Obtaining power consumption data of each power user;
[0006] Preprocessing each power consumption data to obtain a spatio-temporal correlation score between each power user;
[0007] Generating an adversarial sample based on the power consumption data, each spatio-temporal correlation score and external environmental influence factors using an improved generative adversarial network to obtain an adversarial electricity stealing sample data;
[0008] Adopting a multi-modal credibility joint determination method to perform abnormal identification on the anti-electricity-stealing sample data, to obtain an electricity price abnormality identification result of the power users.
[0009] Optionally, the power consumption data is pre-processed to obtain a spatio-temporal correlation score between each of the power users, specifically including:
[0010] A low-rank tensor decomposition data repair method is adopted to supplement missing values in the power consumption data, to obtain power consumption data after missing value supplementation;
[0011] Based on the power consumption data of each of the power users, a preset spatio-temporal correlation function is used for calculation and processing, to obtain a spatio-temporal correlation score between each of the power users.
[0012] Optionally, an improved generative adversarial network is used for anti-sample generation based on the power consumption data, each of the spatio-temporal correlation scores, and external environmental influence factors, to obtain anti-electricity-stealing sample data, specifically including:
[0013] A multi-scale BiLSTM encoding method is used to extract features from the power consumption data, to obtain time-domain features;
[0014] A short-time Fourier transform method is used to extract features from the power consumption data, to obtain frequency-domain features;
[0015] An adaptive attention gate method is used for calculation and processing based on the time-domain features, the frequency-domain features, and the external environmental influence factors, to obtain adaptive attention weights;
[0016] Feature fusion processing is performed based on the time-domain features, the frequency-domain features, and the adaptive attention weights, to obtain time-frequency hybrid features;
[0017] A pre-trained generator is used to generate abnormal samples based on the time-frequency hybrid features, to obtain the anti-electricity-stealing sample data.
[0018] Optionally, the multi-scale BiLSTM encoding method is used to extract features from the power consumption data, to obtain time-domain features, specifically including:
[0019] For the same power user, each of the spatio-temporal correlation scores is screened, and the maximum spatio-temporal correlation score corresponding to the same power user is determined as a target spatio-temporal correlation score;
[0020] The power consumption data of a target user corresponding to the target spatio-temporal correlation score is determined as target power consumption data;
[0021] The time domain features are obtained by using a multi-scale BiLSTM network for feature extraction based on the power consumption data and the target power consumption data of the same power user.
[0022] Optionally, the method further comprises:
[0023] The pre-trained discriminator is used to distinguish the adversarial electricity stealing sample data and the power consumption data respectively, to obtain a first discrimination probability corresponding to the adversarial electricity stealing sample data and a second discrimination probability corresponding to the power consumption data.
[0024] The pre-trained generator is updated in parameters based on the first discrimination probability, with the objective of minimizing a first preset loss function, to update the generator.
[0025] The pre-trained discriminator is updated in parameters based on the first discrimination probability and the second discrimination probability, with the objective of minimizing a second preset loss function, to update the discriminator.
[0026] Optionally, the multi-modal credibility joint determination method is used to perform abnormality identification on the adversarial electricity stealing sample data, to obtain a power user electricity price abnormality identification result, specifically comprising:
[0027] The current light gradient boosting machine model is used to predict the adversarial electricity stealing sample data, to obtain a first initial abnormality probability corresponding to a feature statistical dimension.
[0028] The current one-dimensional convolutional neural network model is used to predict the adversarial electricity stealing sample data, to obtain a second initial abnormality probability corresponding to a time sequence mode dimension.
[0029] The current support vector regression model is used to predict the adversarial electricity stealing sample data, to obtain a third initial abnormality probability corresponding to a spatial correlation dimension.
[0030] The target fusion probability is obtained by performing calculation and processing based on a current first weight of the current light gradient boosting machine model, the first initial abnormality probability, a current second weight of the current one-dimensional convolutional neural network model, the second initial abnormality probability, a current third weight of the current support vector regression model, and the third initial abnormality probability.
[0031] Abnormality identification is performed based on the target fusion probability and a current abnormality determination threshold, to obtain a power user electricity price abnormality identification result.
[0032] Optionally, the method further comprises:
[0033] update the current first weight, the current second weight and the current third weight based on a time decay factor, to update the current light gradient boosting machine model, the current one-dimensional convolutional neural network model and the current support vector regression model respectively.
[0034] Optionally, the method further comprises: updating the current anomaly determination threshold;
[0035] The updating of the current anomaly determination threshold specifically comprises:
[0036] determining a baseline threshold vector of an anomaly event type and an anomaly intensity vector corresponding to the anomaly event type based on the adversarial electricity stealing sample data;
[0037] performing Hadamard product calculation processing based on the baseline threshold vector, the anomaly intensity vector and a predetermined risk degree correction factor, to obtain a three-dimensional determination matrix;
[0038] calculating a mean and a standard deviation of confidence of the three-dimensional determination matrix within a preset time range;
[0039] performing calculation processing based on the mean and the standard deviation of confidence by using a preset dynamic threshold adjustment function, to obtain an updated current anomaly determination threshold.
[0040] To solve the above problems, the present application provides a power user electricity price anomaly identification device, comprising:
[0041] An acquisition module is configured to acquire electricity consumption data of each power user;
[0042] A preprocessing module is configured to preprocess each of the electricity consumption data, to obtain a spatio-temporal correlation score between each of the power users;
[0043] An adversarial sample generation module is configured to generate adversarial samples based on the electricity consumption data, each of the spatio-temporal correlation scores and external environmental influence factors by using an improved generative adversarial network, to obtain adversarial electricity stealing sample data;
[0044] An anomaly identification module is configured to identify anomalies in the adversarial electricity stealing sample data by using a multi-modal credibility joint determination method, to obtain a power user electricity price anomaly identification result.
[0045] To solve the above problems, the present application provides an electronic device, which at least comprises a memory and a processor, the memory has a computer program stored thereon, and the processor implements the steps of the power user electricity price anomaly identification method described above when executing the computer program stored on the memory.
[0046] The beneficial effects in the present application: the present application repairs missing data by adopting low-rank tensor decomposition technology, pre-processes power consumption data in combination with a space-time correlation matrix, and solves the misjudgment problem caused by insufficient sample quantity in traditional methods. The generator adopts an improved adversarial generation network to simulate power consumption patterns, so that the discriminator can accurately distinguish seasonal fluctuations from real abnormal signals. A multi-modal credibility joint determination method with dynamic weight update algorithm is introduced, and in combination with periodic dynamic threshold adjustment, the adversarial electricity stealing sample data is identified, and the false positive rate of power user price anomaly identification is reduced.
[0047] The above description is only a summary of the technical solutions of the present application. In order to enable one skilled in the art to better understand the technical means of the present application, the contents of the specification can be implemented, and in order to enable the above and other purposes, features and advantages of the present application to be more obvious and easy to understand, the specific embodiments of the present application are described below. BRIEF DESCRIPTION OF DRAWINGS
[0048] By reading the detailed description of the preferred embodiments below, various other advantages and benefits will become apparent to those of ordinary skill in the art. The drawings are only for the purpose of illustrating the preferred embodiments and are not considered to be limiting on the present application. Moreover, the same reference symbols are used throughout the drawings to represent the same components. In the drawings:
[0049] Figure 1 A flowchart of a power user price anomaly identification method provided by an embodiment of the present application is shown;
[0050] Figure 2 A flowchart of a power user price anomaly identification method provided by another embodiment of the present application is shown;
[0051] Figure 3 A block diagram of a power user price anomaly identification device provided by another embodiment of the present application is shown. DETAILED DESCRIPTION
[0052] The various schemes and features of the present application are described herein with reference to the accompanying drawings.
[0053] It should be understood that various modifications can be made to the embodiments of the present application. Therefore, the above description should not be considered limiting, but only as an example of the embodiments. Those skilled in the art will think of other modifications within the scope and spirit of the present application.
[0054] The accompanying drawings, included in the specification and forming a part thereof, illustrate embodiments of the present application and, together with the general description of the present application given above and the detailed description of the embodiments given below, serve to explain the principles of the present application.
[0055] These and other characteristics of the present application will become patently apparent as the description proceeds.
[0056] It should also be understood that, while the present application has been described above with reference to particular means, materials and embodiments, the application is not limited to the particulars described and as such extends to all functionally equivalent structures, methods and equivalents thereof.
[0057] The above and other aspects, features and advantages of the present application will become apparent as the description proceeds.
[0058] Specific embodiments of the present application are described hereinafter, by way of example only, with reference to the accompanying drawings. It should be understood that the disclosed embodiments are merely representative of the application, which can be practiced in a variety of ways. Well-known and / or repetitive functionality and structure are not described in detail to avoid obscuring the application unnecessarily.
[0059] The specification can use phrases such as "in one embodiment", "in another embodiment", "in yet another embodiment", or "in other embodiments", which can refer to one or more of the same or different embodiments of the application.
[0060] The embodiments of the present application provide a power user price anomaly identification method, as shown in the method, comprising: Figure 1
[0061] Step S101: obtaining power consumption data of each power user;
[0062] In the implementation process, the power users are users under the same power grid architecture, the power consumption data can be power consumption data of the power consumption user, and the power users can be residential, agricultural and sideline users, etc.
[0063] Step S102: preprocessing each power consumption data to obtain a time-space correlation score between each power user;
[0064] In the implementation process, the missing value of the power consumption data is supplemented by using a low-rank tensor decomposition data repair method to obtain the power consumption data after the missing value is supplemented; and the time-space correlation function is used to calculate and process the power consumption data of each power user to obtain the time-space correlation score between each power user.
[0065] Step S103: generating an adversarial electricity stealing sample data by using an improved generative adversarial network based on the electricity consumption data, the spatio-temporal correlation scores and external environmental factors;
[0066] In the implementation process of the present step, a multi-scale BiLSTM encoding method is used to extract features of the electricity consumption data to obtain time domain features; a short-time Fourier transform method is used to extract features of the electricity consumption data to obtain frequency domain features; an adaptive attention gate method is used to calculate and process the time domain features, the frequency domain features and the external environmental factors to obtain adaptive attention weights; a feature fusion process is performed based on the time domain features, the frequency domain features and the adaptive attention weights to obtain time-frequency mixed features; and a pre-trained generator is used to generate abnormal samples based on the time-frequency mixed features to obtain the adversarial electricity stealing sample data.
[0067] Step S104: performing abnormality identification on the adversarial electricity stealing sample data by using a multi-modal credibility joint determination method to obtain an electricity price abnormality identification result of the power user.
[0068] In the implementation process of the present step, a plurality of pre-trained abnormal probability prediction models are used to perform abnormality identification on the adversarial electricity stealing sample data to obtain an electricity price abnormality identification result of the power user. Initial abnormal probabilities are generated from feature statistics, time series patterns and spatial correlation dimensions; the abnormal probability prediction models include a light gradient boosting machine model (LightGBM), a one-dimensional convolutional neural network model (1D-CNN) and a support vector regression model (SVR); the adversarial electricity stealing sample data is predicted based on the plurality of abnormal probability prediction models to obtain initial abnormal probabilities corresponding to the feature statistics, the time series patterns and the spatial correlation dimensions, respectively; a target fusion probability is obtained by calculating and processing the current weights and the initial abnormal probabilities corresponding to the plurality of abnormal probability prediction models; and abnormality identification is performed based on the target fusion probability and a current abnormality determination threshold to obtain the electricity price abnormality identification result of the power user. When the target fusion probability is greater than or equal to the current abnormality determination threshold, it is determined that the electricity user is an abnormal user, and a warning is triggered.
[0069] The present application solves the misjudgment problem caused by insufficient sample quantity in traditional methods by using low-rank tensor decomposition technology to repair missing data and combining a spatio-temporal correlation matrix to preprocess the electricity consumption data. The generator uses an improved generative adversarial network to simulate legal electricity consumption patterns, so that the discriminator can accurately distinguish between seasonal fluctuations and real abnormal signals. The multi-modal credibility joint determination method with dynamic weight updating algorithm is introduced to identify abnormalities in the adversarial electricity stealing sample data in combination with periodic dynamic threshold adjustment, thereby reducing the false positive rate of electricity price abnormality identification of the power user.
[0070] Another embodiment of the present application provides another power user price anomaly identification method, as shown in the following. Figure 2
[0071] Step S201: Obtain power consumption data of each power user.
[0072] In the implementation process, the power users are users under the same power grid architecture, the power consumption data can be power consumption data of power users, and the power users can be residential, agricultural and sideline users, and the like.
[0073] Step S202: Fill in missing values in the power consumption data by using a low-rank tensor decomposition data repair method to obtain power consumption data after filling in missing values.
[0074] In the implementation process, the missing power consumption matrix is recovered by low-rank constraint, compared with traditional PCA, multi-dimensional correlation (such as user group, time period, and price policy) can be captured, repair error is reduced, and the mathematical expression can be shown in the following formula (1):
[0075]
[0076] wherein x new is the repaired power consumption matrix, x is the original three-dimensional power consumption tensor (user, time, and feature), I is the power consumption, U, V, and M are factor matrices of user group, time period, and price policy tensor respectively, and the data dimension is reduced by decomposition; F is the Frobenius norm; γ is a regularization parameter; ‖·‖ * is the kernel norm (sum of singular values), which forces the data to have a low-rank property.
[0077] Step S203: Calculate and process the power consumption data of each power user based on the power consumption data of each power user by using a preset space-time correlation function to obtain a space-time correlation score between each power user.
[0078] In the implementation process, the calculation mathematical formula of the space-time correlation score can be shown in the following formula (2):
[0079]
[0080] wherein S(i, j) is the space-time correlation score between user i and user j (the greater the value, the stronger the correlation), is the physical distance of user i and user j in the power grid, λ is a spatial attenuation factor, the spatial attenuation factor can be 0.85, and the size of the spatial attenuation factor can be set according to actual needs to control the decay speed of distance influence; and is the power consumption of user i and user j at time t.
[0081] Step S204: generating an adversarial sample based on the power consumption data, the spatio-temporal correlation scores and external environmental factors by using an improved generative adversarial network to obtain an adversarial electricity stealing sample data;
[0082] In the implementation process, a multi-scale BiLSTM encoding method is used to extract features from the power consumption data to obtain time domain features. Specifically, for the same power consumption user, the spatio-temporal correlation scores are filtered, and the maximum spatio-temporal correlation score corresponding to the same power consumption user is determined as a target spatio-temporal correlation score. The power consumption data of the target user corresponding to the target spatio-temporal correlation score is determined as target power consumption data x max(S(i,j)) The power consumption data of the same power consumption user and the target power consumption data are used to extract features by using a multi-scale BiLSTM network to obtain the time domain features. The mathematical expression of the time domain features can be shown in the following formula (3):
[0083]
[0084] Wherein, x new_t is the power consumption data matrix at time t; x new_t-1 is the power consumption data matrix at time t-1; x max(S(i,j)) is the power consumption data matrix with the strongest spatio-temporal correlation score of the user; Δx new_t is the power consumption change rate at time t, which is used to capture sudden abnormalities; Concat(x new_t , Δx new_t ) combines x new_t and Δx new_t into an augmented feature vector; E is an external factor encoding; W (l) is the BiLSTM weight matrix of the lth layer; b (l) is the BiLSTM bias vector of the lth layer; is the output hidden state of the lth layer BiLSTM at time t; ReLU is an activation function; W d is an attention weight matrix. The power consumption data is extracted by using a short-time Fourier transform method to obtain a frequency domain feature F ω ;
[0085] The time domain features, the frequency domain features and the external environmental factors are calculated and processed by using an adaptive attention gating method to obtain an adaptive attention weight. The mathematical expression of the adaptive attention gating can be shown in the following formula (4):
[0086] α t,ω = σ(W a ·[H t ,F ω ,E]+ba )(4)
[0087] wherein, a t,ω is an adaptive attention weight; σ is a Sigmoid activation function; W a is an attention weight matrix; H t is a time domain feature extracted by BiLSTM; F ω is a frequency domain feature extracted by short-time Fourier transform (STFT); b a is an attention bias scalar. Feature fusion processing is performed based on the time domain feature, the frequency domain feature, and the adaptive attention weight to obtain a time-frequency hybrid feature Z t . A mathematical formula of time-frequency feature fusion can be shown in the following formula (5):
[0088] Z t = a t,ω · H t + (1-a t,ω )· F ω (5)
[0089] A pre-trained generator is used to generate an abnormal sample based on the time-frequency hybrid feature to obtain the adversarial electricity stealing sample data. The generator generates an adversarial sample through the following formula (6):
[0090]
[0091] wherein, is a generated adversarial electricity stealing sample; Z is a random noise vector, subject to a standard normal distribution; θ g is a set of trainable parameters of the generator; G is a generator neural network, responsible for mapping the random noise Z to a structured adversarial electricity stealing sample; W out is a weight matrix of the output layer of the generator; b out is a bias vector of the output layer of the generator; Z T is a time-frequency hybrid feature.
[0092] A pre-trained discriminator is used to discriminate the adversarial electricity stealing sample data and the electricity consumption data respectively to obtain a first discrimination probability D(G(Z i )) corresponding to the adversarial electricity stealing sample data and a second discrimination probability D(X i ) corresponding to the electricity consumption data; the pre-trained generator is updated in parameters based on the first discrimination probability to minimize a first preset loss function, so as to update the generator; a mathematical expression of the first preset loss function can be shown in the following formula (7):
[0093]
[0094] wherein, N is the batch size during training; Z i is random noise; G(z i ) is the generated fake sample; D(G(z i )) is the output of the discriminator, i.e., the discrimination result of the i-th generated sample by the discriminator, i.e., the probability that the discriminator considers the sample to be a real sample; log(1-D(G(z i ))) represents the degree to which the generator wants the discriminator to consider the sample to be a fake sample. The pre-trained discriminator is updated in parameters based on the first discrimination probability and the second discrimination probability to minimize the second preset loss function, so as to update the discriminator. The mathematical expression of the second preset loss function can be shown in the following formula (8):
[0095]
[0096] wherein, λ=10, L gp is the gradient penalty term weight; D(x i ) is the discrimination result of the i-th real sample by the discriminator, i.e., the probability that the discriminator considers the sample to be a real sample; L gp is the gradient penalty loss; X i is real data. The objective of the discriminator loss function is to train the discriminator to accurately distinguish between real samples and fake samples generated by the generator. The discriminator loss function consists of two parts: one part is the loss of real samples, and the other part is the loss of generated samples.
[0097] Step S205: performing anomaly probability prediction on the adversarial electricity stealing sample data by using multiple pre-trained anomaly probability prediction models to obtain initial anomaly probabilities;
[0098] In the specific implementation process, the current light gradient boosting machine model is used to predict the adversarial electricity stealing sample data to obtain the first initial anomaly probability corresponding to the feature statistical dimension; the current one-dimensional convolutional neural network model is used to predict the adversarial electricity stealing sample data to obtain the second initial anomaly probability corresponding to the time sequence mode dimension; and the current support vector regression model is used to predict the adversarial electricity stealing sample data to obtain the third initial anomaly probability corresponding to the spatial correlation dimension; the initial anomaly probability includes the first initial anomaly probability, the second initial anomaly probability, and the third initial anomaly probability. The mathematical expression of performing anomaly probability prediction on the adversarial electricity stealing sample data by using multiple pre-trained anomaly probability prediction models can be shown in the following formula (9):
[0099]
[0100] wherein, X statStatistical feature vector (including mean, variance, harmonic content, etc.); X seq Time sequence; X spa Spatial correlation matrix; σ is a sigmoid normalization function. P L First initial anomaly probability; P C Second initial anomaly probability; P S Third initial anomaly probability.
[0101] Step S206: Based on the current weight of the anomaly probability prediction model and the initial anomaly probability, a calculation process is performed to obtain a target fusion probability;
[0102] In the specific implementation process, based on the current first weight of the current light gradient boosting machine model, the first initial anomaly probability, the current second weight of the current one-dimensional convolutional neural network model, the second initial anomaly probability, the current third weight of the current support vector regression model and the third initial anomaly probability, a calculation process is performed to obtain a target fusion probability; The current weight includes the current first weight of the current light gradient boosting machine model, the current second weight of the current one-dimensional convolutional neural network model and the current third weight of the current support vector regression model; The calculation mathematical formula of the target fusion probability can be shown in the following formula (10):
[0103]
[0104] Where, W i (t) is the weight of each model, P i (t) is the prediction probability of each model.
[0105] Based on the time decay factor, the current first weight, the current second weight and the current third weight are updated to update the current light gradient boosting machine model, the current one-dimensional convolutional neural network model and the current support vector regression model respectively. Through the sliding window, the false positive rate of each type is counted, and the weight of the model in the integration is dynamically adjusted according to the recent performance of the model. If the prediction error of a certain model exceeds the threshold value for 3 times in succession, the weight will be exponentially attenuated. The mathematical expression of the model weight update can be shown in the following formula (11):
[0106]
[0107] Where, τ is the forgetting factor, which controls the retention proportion of historical weight (the larger the value, the more significant the historical influence); p i (x) is the prediction value of the underlying multi-granularity integrated learner; y is the true value; |p i (x)-y| is the current prediction error of model i; Weight at t time; is the weight at time t+1.
[0108] Step S207: performing anomaly identification based on the target fusion probability and a current anomaly determination threshold to obtain an electricity user price anomaly identification result.
[0109] In the implementation process, a real-time updated current anomaly determination threshold is obtained; when the target fusion probability is greater than the current anomaly determination threshold, it is determined that the electricity user is an abnormal user, and a warning is triggered. The current anomaly determination threshold is updated; the updating of the current anomaly determination threshold specifically includes: determining a baseline threshold vector B E and an abnormal intensity vector S s corresponding to the abnormal event type based on the adversarial electricity stealing sample data R ; performing Hadamard product calculation processing based on the baseline threshold vector, the abnormal intensity vector, and a predetermined risk degree correction factor R S to obtain a three-dimensional determination matrix; the calculation mathematical formula of the three-dimensional determination matrix can be shown in the following formula (12):
[0110] T(E,S,R)=B E ⊙S S ⊙R R (12)
[0111] wherein B E is an event type baseline threshold vector, represented as B E =[b1,b2...b n ], b1,b2...b n is an event type; S S is an abnormal intensity mapping function, represented as S S =[S1,S2...S n ], S1,S2...S n is an abnormal intensity corresponding to the event type; R R is a risk degree correction factor, represented as R R =[r1,r2...r n ], r1,r2...r n are all 0.5; is a Hadamard product; T(E,S,R) is an abnormal threshold.
[0112] The calculation mathematical formula of the abnormal intensity is shown in the following formula (13):
[0113]
[0114] wherein x i is the electricity consumption on the day when the event b i occurs; μ nσ is the standard deviation of the power consumption of all time periods; μ is the mean of the power consumption of all time periods n σ is the standard deviation of the power consumption of all time periods; μ is the mean of the power consumption of all time periods n The mathematical expression of σ can be shown in the following formula (15):
[0115]
[0116] σ is the standard deviation of the power consumption of all time periods; μ is the mean of the power consumption of all time periods n The mathematical expression of σ can be shown in the following formula (15):
[0117]
[0118] wherein, x i_t is the power consumption of the i_t day in all time periods; n n is the total number of days in all time periods. The mean and standard deviation of the confidence of the three-dimensional judgment matrix in the preset time range are calculated; the calculation mathematical formula of the mean of the confidence can be shown in the following formula (16):
[0119]
[0120] The calculation mathematical formula of the standard deviation can be shown in the following formula (17):
[0121]
[0122] wherein, is the mean and standard deviation of the confidence of the three-dimensional judgment matrix in the past preset time range; T(E, S, R) t is the abnormal threshold value of the t day in the past preset time range. Based on the mean and the standard deviation, a preset dynamic threshold adjustment function is calculated and processed to obtain an updated current abnormal judgment threshold value. The mathematical expression of the preset dynamic threshold adjustment function can be shown in the following formula (18):
[0123]
[0124] wherein, sin(·) is a periodic adjustment term. T can take a value of 720 hours, and γ can take a value of 0.2; when P final >Threshold t+1 an early warning is triggered.
[0125] The application repairs missing data by using low-rank tensor decomposition technology, pre-processes power consumption data in combination with a space-time correlation matrix, and solves the misjudgment problem caused by insufficient sample size in traditional methods. The generator uses an improved adversarial generation network to simulate power consumption patterns, so that the discriminator can accurately distinguish between seasonal fluctuations and real abnormal signals. A multi-modal credibility joint determination method with dynamic weight update algorithm is introduced, combined with periodic dynamic threshold adjustment, to identify abnormal samples of the adversarial electricity stealing sample data, reducing the false positive rate of electricity price anomaly identification of power users.
[0126] Another embodiment of the application provides a power user electricity price anomaly identification device, as shown in Figure 3 The device comprises:
[0127] An acquisition module 1 is configured to acquire power consumption data of each power user.
[0128] A pre-processing module 2 is configured to pre-process each of the power consumption data to obtain a space-time correlation score between each of the power users.
[0129] An adversarial sample generation module 3 is configured to generate adversarial samples based on the power consumption data, each of the space-time correlation scores, and external environmental factors using an improved adversarial generation network to obtain adversarial electricity stealing sample data.
[0130] An anomaly identification module 4 is configured to identify anomalies in the adversarial electricity stealing sample data using a multi-modal credibility joint determination method to obtain a power user electricity price anomaly identification result.
[0131] In the specific implementation process, the pre-processing module 2 is specifically configured to supplement missing values in the power consumption data using a low-rank tensor decomposition data repair method to obtain power consumption data with missing values supplemented; and calculate and process the power consumption data of each power user based on a preset space-time correlation function to obtain a space-time correlation score between each of the power users.
[0132] In the specific implementation process, the adversarial sample generation module 3 is specifically configured to extract features from the power consumption data using a multi-scale BiLSTM encoding method to obtain time domain features; extract features from the power consumption data using a short-time Fourier transform method to obtain frequency domain features; calculate and process the time domain features, the frequency domain features, and the external environmental factors using an adaptive attention gate method to obtain adaptive attention weights; perform feature fusion processing based on the time domain features, the frequency domain features, and the adaptive attention weights to obtain time-frequency mixed features; and generate abnormal samples based on the time-frequency mixed features using a pre-trained generator to obtain the adversarial electricity stealing sample data.
[0133] In the implementation process, the adversarial sample generation module 3 is further configured to: for the same power user, filter the spatio-temporal correlation scores, and determine the maximum spatio-temporal correlation score corresponding to the same power user as a target spatio-temporal correlation score; determine the power consumption data of a target user corresponding to the target spatio-temporal correlation score as target power consumption data; and perform feature extraction on the power consumption data of the same power user and the target power consumption data based on a multi-scale BiLSTM network to obtain the time domain feature.
[0134] In the implementation process, the device further comprises a model parameter updating module, which is specifically configured to: use a pre-trained discriminator to respectively discriminate the adversarial electricity stealing sample data and the power consumption data to obtain a first discrimination probability corresponding to the adversarial electricity stealing sample data and a second discrimination probability corresponding to the power consumption data; update parameters of the pre-trained generator based on the first discrimination probability to minimize a first preset loss function, so as to update the generator; and update parameters of the pre-trained discriminator based on the first discrimination probability and the second discrimination probability to minimize a second preset loss function, so as to update the discriminator.
[0135] In the implementation process, the anomaly identification module 4 is specifically configured to: use a current light gradient boosting machine model to predict the adversarial electricity stealing sample data to obtain a first initial anomaly probability corresponding to a feature statistical dimension; use a current one-dimensional convolutional neural network model to predict the adversarial electricity stealing sample data to obtain a second initial anomaly probability corresponding to a time sequence mode dimension; use a current support vector regression model to predict the adversarial electricity stealing sample data to obtain a third initial anomaly probability corresponding to a spatial correlation dimension; perform calculation and processing based on a current first weight of the current light gradient boosting machine model, the first initial anomaly probability, a current second weight of the current one-dimensional convolutional neural network model, the second initial anomaly probability, a current third weight of the current support vector regression model, and the third initial anomaly probability to obtain a target fusion probability; and perform anomaly identification based on the target fusion probability and a current anomaly judgment threshold to obtain a power user electricity price anomaly identification result.
[0136] In the implementation process, the device further comprises a model weight updating module, which is specifically configured to: update the current first weight, the current second weight, and the current third weight based on a time decay factor, so as to update the current light gradient boosting machine model, the current one-dimensional convolutional neural network model, and the current support vector regression model, respectively.
[0137] In the implementation process, the device further comprises an anomaly determination threshold updating module, which is specifically configured to: determine a baseline threshold vector of an anomaly event type and an anomaly intensity vector corresponding to the anomaly event type based on the adversarial electricity stealing sample data; perform Hadamard product calculation processing based on the baseline threshold vector, the anomaly intensity vector, and a predetermined risk degree correction factor to obtain a three-dimensional determination matrix; calculate the mean and standard deviation of the confidence of the three-dimensional determination matrix within a preset time range; and perform calculation processing based on the mean and the standard deviation using a preset dynamic threshold adjustment function to obtain an updated current anomaly determination threshold.
[0138] The application solves the misjudgment problem caused by insufficient sample quantity in traditional methods by using low-rank tensor decomposition technology to repair missing data and combining a space-time correlation matrix to preprocess power consumption data. The generator uses an improved adversarial generation network to simulate legal power consumption patterns, so that the discriminator can accurately distinguish between seasonal fluctuations and real anomaly signals. A multi-modal credibility joint determination method with dynamic weight updating algorithm is introduced, and a periodic dynamic threshold adjustment is combined to identify anomalies in the adversarial electricity stealing sample data, thereby reducing the false positive rate of power user price anomaly identification.
[0139] Another embodiment of the application provides an electronic device, which can be a server. The electronic device comprises a processor, a memory, a network interface and a database connected by a system bus. The processor of the electronic device is configured to provide computing and control capabilities. The memory of the electronic device comprises a non-volatile and / or volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, a computer program and a database. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the electronic device is configured to communicate with an external client through a network connection. The electronic device program is executed by the processor to implement the functions or steps of the power user price anomaly identification method on the server side.
[0140] In one embodiment, an electronic device is provided, which can be a client. The electronic device comprises a processor, a memory, a network interface, a display screen and an input device connected by a system bus. The processor of the electronic device is configured to provide computing and control capabilities. The memory of the electronic device comprises a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the electronic device is configured to communicate with an external server through a network connection. The electronic device program is executed by the processor to implement the functions or steps of the power user price anomaly identification method on the client side.
[0141] Another embodiment of the present application provides an electronic device, comprising at least a memory and a processor, wherein the memory stores a computer program, and the processor implements the following method steps when executing the computer program on the memory.
[0142] Step one, obtaining power consumption data of each power user;
[0143] Step two, preprocessing each power consumption data to obtain a spatio-temporal correlation score between each power user;
[0144] Step three, generating an adversarial sample based on the power consumption data, each spatio-temporal correlation score, and external environmental influencing factors by using an improved generative adversarial network, to obtain an adversarial electricity stealing sample data;
[0145] Step four, identifying the adversarial electricity stealing sample data as abnormal by using a multi-modal credibility joint determination method, to obtain a power user electricity price abnormality identification result.
[0146] The specific implementation process of the above method steps can be referred to the embodiments of any of the power user electricity price abnormality identification methods described above, which will not be repeated here.
[0147] The present application solves the misjudgment problem caused by insufficient sample quantity in the traditional method by using low-rank tensor decomposition technology to repair missing data, and preprocessing power consumption data by combining a spatio-temporal correlation matrix. The generator uses an improved generative adversarial network to simulate legal power consumption patterns, so that the discriminator can accurately distinguish between seasonal fluctuations and real abnormal signals. The multi-modal credibility joint determination method with dynamic weight update algorithm is introduced to identify the adversarial electricity stealing sample data as abnormal by combining a periodic dynamic threshold adjustment, thereby reducing the false positive rate of power user electricity price abnormality identification.
[0148] The above embodiments are only exemplary embodiments of the present application and are not used to limit the present application, and the protection scope of the present application is defined by the claims. Those skilled in the art can make various modifications or equivalent replacements to the present application within the spirit and protection scope of the present application, and such modifications or equivalent replacements should also be considered to fall within the protection scope of the present application.
Claims
1. A method for identifying abnormal electricity prices for power users, characterized in that: include: Obtain electricity consumption data of each power user; Preprocessing the electricity consumption data to obtain a spatiotemporal correlation score between the electricity users; Based on the electricity consumption data, the spatiotemporal correlation scores, and external environmental influencing factors, an improved adversarial generative network is used to generate adversarial samples to obtain adversarial electricity theft sample data; A multimodal credibility joint judgment method is used to identify anomalies in the adversarial electricity theft sample data, and an abnormality identification result of electricity prices for power users is obtained.
2. The method according to claim 1, wherein The preprocessing of the electricity consumption data to obtain the spatiotemporal correlation scores between the electricity users specifically includes: Using a low-rank tensor decomposition data repair method to supplement missing values in the electricity consumption data, to obtain electricity consumption data after missing value supplementation; A preset spatiotemporal correlation function is used to perform calculations based on the electricity consumption data of each of the electricity users to obtain a spatiotemporal correlation score between the electricity users.
3. The method according to claim 1, wherein The method of generating adversarial samples using an improved adversarial generative network based on the electricity consumption data, the spatiotemporal correlation scores, and external environmental influencing factors to obtain adversarial electricity theft sample data specifically includes: A multi-scale BiLSTM encoding method is used to extract features from the electricity consumption data to obtain time domain features; Using a short-time Fourier transform method to extract features from the electricity consumption data to obtain frequency domain features; Based on the time domain features, the frequency domain features and the external environment influencing factors, an adaptive attention gating method is used to perform calculation processing to obtain an adaptive attention weight; Performing feature fusion processing based on the time domain features, the frequency domain features, and the adaptive attention weight to obtain a time-frequency mixed feature; Based on the time-frequency mixed features, a pre-trained generator is used to generate abnormal samples to obtain the adversarial electricity theft sample data.
4. The method according to claim 3, wherein The multi-scale BiLSTM encoding method is used to extract features from the electricity consumption data to obtain time domain features, specifically including: For the same electricity user, screening the spatiotemporal correlation scores, and determining the maximum spatiotemporal correlation score corresponding to the same electricity user as the target spatiotemporal correlation score; Determining the electricity consumption data of the target user corresponding to the target spatiotemporal correlation score as the target electricity consumption data; A multi-scale BiLSTM network is used to perform feature extraction based on the electricity consumption data and the target electricity consumption data of the same electricity user to obtain the time domain features.
5. The method according to claim 4, wherein The method further comprises: Using a pre-trained discriminator to discriminate the adversarial electricity theft sample data and the electricity usage data, respectively, to obtain a first discriminant probability corresponding to the adversarial electricity theft sample data and a second discriminant probability corresponding to the electricity usage data; Based on the first discrimination probability, updating the parameters of the pre-trained generator with the goal of minimizing a first preset loss function to update the generator; Based on the first discrimination probability and the second discrimination probability, parameters of the pre-trained discriminator are updated with the goal of minimizing a second preset loss function to update the discriminator.
6. The method according to claim 1, wherein The multimodal credibility joint judgment method is used to perform anomaly identification on the adversarial electricity theft sample data to obtain an abnormality identification result of the electricity user electricity price, specifically including: Using the current lightweight gradient boosting machine model to predict the adversarial electricity theft sample data, and obtaining a first initial abnormality probability corresponding to the feature statistical dimension; Using the current one-dimensional convolutional neural network model to predict the adversarial electricity theft sample data, obtaining a second initial abnormality probability corresponding to the time series pattern dimension; Using the current support vector regression model to predict the adversarial electricity theft sample data, obtaining a third initial abnormality probability corresponding to the spatial correlation dimension; Performing calculations based on the current first weight of the current lightweight gradient boosting machine model, the first initial abnormality probability, the current second weight of the current one-dimensional convolutional neural network model, the second initial abnormality probability, the current third weight of the current support vector regression model, and the third initial abnormality probability to obtain a target fusion probability; Anomaly identification is performed based on the target fusion probability and the current anomaly determination threshold to obtain an abnormality identification result of the power user's electricity price.
7. The method according to claim 6, wherein The method further comprises: The current first weight, the current second weight, and the current third weight are updated based on the time decay factor to update the current lightweight gradient boosting machine model, the current one-dimensional convolutional neural network model, and the current support vector regression model, respectively.
8. The method according to claim 6, wherein The method further includes: updating the current abnormality determination threshold; The updating of the current abnormality determination threshold specifically includes: Determine a baseline threshold vector of an abnormal event type and an abnormal intensity vector corresponding to the abnormal event type based on the adversarial electricity theft sample data; Performing Hadamard product calculation based on the baseline threshold vector, the abnormal intensity vector, and a predetermined risk correction factor to obtain a three-dimensional decision matrix; Calculating the confidence mean and standard deviation of the three-dimensional decision matrix within a preset time range; A preset dynamic threshold adjustment function is used to perform calculation based on the confidence mean and the standard deviation to obtain an updated current abnormality determination threshold.
9. A device for identifying abnormal electricity prices for power users, characterized in that: include: An acquisition module is used to obtain the electricity consumption data of each power user; A preprocessing module, configured to preprocess the electricity consumption data to obtain a spatiotemporal correlation score between the electricity users; An adversarial sample generation module is configured to generate adversarial samples using an improved adversarial generative network based on the electricity consumption data, the spatiotemporal correlation scores, and external environmental influencing factors, to obtain adversarial electricity theft sample data; The anomaly identification module is used to use a multimodal credibility joint judgment method to perform anomaly identification on the adversarial electricity theft sample data to obtain an anomaly identification result of the electricity price of the power user.
10. An electronic device, characterized in that: The method comprises at least a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program in the memory, the method implements the steps of the method for identifying abnormal electricity prices for power users as described in any one of claims 1 to 8.