Method, electronic device and storage medium for monitoring non-intrusive anomalous load behavior
By denoising and color-coding the real-time data from non-intrusive load monitoring devices, and using conditional generative adversarial networks to generate VI trajectory images, the problem of large monitoring errors in existing non-intrusive load monitoring methods when electrical equipment is changed or aged is solved, achieving flexible and efficient abnormal load monitoring.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- NORTHEASTERN UNIV AT QINHUANGDAO
- Filing Date
- 2022-08-31
- Publication Date
- 2026-05-05
AI Technical Summary
Existing non-intrusive load monitoring methods suffer from large monitoring errors, low scalability, and low flexibility when electrical equipment is changed or aged.
By acquiring real-time data from non-intrusive load monitoring devices, denoising is performed, and then color coding is performed using a conditional generative adversarial network to generate a VI trajectory image. Finally, a conditional autoencoder and capsule network are used to determine whether there is an abnormal load in the power circuit.
It enables flexible monitoring of power user loads, reduces monitoring errors, and improves the scalability and flexibility of non-intrusive abnormal load behavior monitoring.
Smart Images

Figure CN115423128B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of load monitoring technology, and in particular to a non-invasive method, electronic device, and storage medium for monitoring abnormal load behavior. Background Technology
[0002] In modern society, a large amount of renewable energy is currently generated and utilized at the consumer end. User behavior can promote the efficient integration of distributed energy resources, which are highly dependent on weather conditions. Therefore, observing users' electricity consumption activities and actions is crucial. Obtaining real-time power consumption information for each appliance within a user's home is particularly important.
[0003] Unlike current smart meters that only acquire total load power consumption information, load power consumption detail monitoring uses certain technical means to acquire real-time power consumption information of each appliance within the power user's premises, including the appliance's operating status, power consumption, cumulative power consumption, and even fault information.
[0004] In existing technologies, load monitoring mainly includes invasive and non-invasive methods. Invasive load monitoring requires installing a data measurement sensor with communication capabilities inside the electrical load for each appliance, and then collecting and transmitting power consumption information locally. To achieve the same purpose, non-invasive load monitoring only requires installing a data measurement sensor with communication capabilities at the power supply inlet of the electrical load. It can then obtain the power consumption information of each appliance inside the user's premises by analyzing the total load data. Compared with invasive methods, non-invasive methods are lower in cost, easier to install, and have proven effective in application due to the detailed data obtained from non-invasive load monitoring.
[0005] Current non-intrusive load monitoring methods, due to their fixed algorithms, are only suitable for the ideal situation where the types of electricity loads used by power users remain unchanged. When electrical equipment changes or ages, they can produce large monitoring errors and have the drawbacks of being inflexible and unscalable. Summary of the Invention
[0006] (a) Technical problems to be solved
[0007] In view of the above-mentioned shortcomings and deficiencies of the prior art, the present invention provides a non-intrusive abnormal load behavior monitoring method, electronic device and storage medium. The method solves the technical problems of low scalability, low flexibility and high monitoring error in the prior art of non-intrusive load monitoring.
[0008] (II) Technical Solution
[0009] To achieve the above objectives, in a first aspect, the present invention provides a non-invasive method for monitoring abnormal load behavior, comprising the following steps:
[0010] S1. Acquire real-time monitoring data from a non-intrusive load monitoring device and denoise it; the monitoring data includes: the total voltage and total current data of the pre-selected power circuit monitored by the non-intrusive load monitoring device;
[0011] S2. For the noise-reduced monitoring data, the monitoring data with load state transitions will be considered as valid monitoring data.
[0012] S3. Based on the pre-built power strategy, the effective monitoring data is color-coded to obtain the VI trajectory image of each individual load in the power circuit;
[0013] S4. Input the VI trajectory image into the trained conditional generative adversarial network, and reconstruct the image based on the generated features to determine whether there is abnormal load in each power circuit;
[0014] The conditional generative adversarial network includes a conditional autoencoder, a capsule network, and a classifier. The conditional autoencoder is used to convert the Gaussian prior probability of the load in the VI trajectory image into a Gaussian posterior probability. The capsule network is used to achieve the compactness of the same type of features near the center of the Gaussian distribution, so that the classifier can detect the load.
[0015] Optionally, before S1, the method further includes: S0, training the conditional generative adversarial network:
[0016] The S0 includes:
[0017] S01. Obtain training monitoring data samples and verification monitoring data samples for training the conditional generative adversarial network; the training monitoring data samples and the verification monitoring data samples are historical monitoring total voltage and total current data of the same power circuit;
[0018] S02. Based on the pre-built power strategy, the training monitoring data samples and the verification detection data samples are encoded to obtain the training VI trajectory image and the verification VI trajectory image of each individual load in the power circuit.
[0019] S03. For each individual load, the training VI trajectory image is input into the conditional adversarial generative network to reconstruct the feature reconstruction image of the training VI trajectory;
[0020] S04. Input the verification VI trajectory image and the feature reconstruction image corresponding to each individual load into a pre-built discriminator to determine whether the feature reconstruction image matches the verification VI trajectory image.
[0021] S05. Adjust the training parameters of the conditional adversarial generation network, and alternately generate feature reconstruction images and input discriminator networks so that the feature reconstruction image finally generated by the conditional adversarial monitoring network matches the verification VI trajectory image, thereby obtaining the trained conditional adversarial monitoring network.
[0022] Optionally, S01 includes:
[0023] Acquire historical monitoring data of at least one load state transition event in a power circuit monitored by a non-intrusive load monitoring device; the load state transition event is the circuit load transition process caused by the opening and / or closing of a single load in the pre-selected power circuit;
[0024] Based on a predefined event detection window, the time period for the occurrence of load state transition events is calculated; specifically:
[0025] Calculate the total actual power S of the preselected power circuit. t Determine ΔS t >S on1 At time t;
[0026] Based on a pre-built event detection window, the total real power change ΔS is calculated and determined when t = t + TR. t+TR <S on1 R is the step size of the event detection window, ΔS t =S t+1 -S t ;
[0027] If S t+TR -S t <S on2 Determine if a load state transition event occurs during the time period t to t+TR;
[0028] Collect total voltage and total current data for T time periods before and after the load state transition event to obtain training monitoring data samples and verification monitoring data samples;
[0029] The S on1 S is the predefined threshold for the start of load state transition events. on2 The threshold for the end of a predefined load state transition event.
[0030] Optionally, S3 includes:
[0031] S30. Based on a pre-built spectrum analysis method, the effective monitoring data is sampled to obtain the voltage and current values of each individual load in the power circuit;
[0032] S31. For each individual load, based on the pre-built Fryze power strategy, determine the active component current i of the current i(t) of that individual load. a (t) and reactive component current i f (t);
[0033] Based on the active component current i a (t) and reactive component current i f (t), calculate and obtain the power factor matrix. The power factor is the ratio of the power of the active component current to the power of the reactive component current.
[0034] The power factor matrix The expression is:
[0035]
[0036] K is the total number of sampling points, P apparent For actual power, V rms I rms These are the effective values of the load voltage and current, respectively.
[0037] S32. For each individual load, construct the hue matrix of the VI trajectory based on the pre-built HSV color space. and voltage period matrix V;
[0038] S33. For each individual load, connect the power factor matrix in a standard three-dimensional coordinate system. Hue Matrix Using the voltage period matrix V, obtain the VI trajectory image of the single load.
[0039] Optionally, S32 specifically includes;
[0040] S321. Based on the HSV color space, obtain the motion direction H of the VI trajectory using the hue attribute. j ;
[0041] Based on the motion direction H j Store the hue of the j-th sampling point into a 2N×2N matrix to obtain the hue matrix.
[0042] The direction of motion H j The calculation expression is:
[0043]
[0044] The arg is the arctangent function in each of the four quadrants;
[0045] The hue matrix The calculation expression is:
[0046]
[0047] |A| is the cardinality of the set;
[0048] S322, Based on a pre-constructed binary image W m (1,2,...,M), average the M cycles of a single load voltage to obtain the voltage cycle matrix V;
[0049] The expression for the voltage period matrix V is:
[0050]
[0051] Optionally, the training parameters of the conditional adversarial monitoring network can be adjusted, specifically as follows:
[0052] Based on a pre-constructed loss function, the minimum value of the training loss of the conditional adversarial monitoring network is calculated;
[0053] The parameters of the conditional generative adversarial network are adjusted by weighting the minimum value.
[0054] The loss function includes a feature matching loss function, a reconstruction loss function, an additional encoder loss function, a center constraint loss function, and / or a contrastive loss function.
[0055] Optionally, the feature matching loss function is expressed as follows:
[0056]
[0057] f(x) is the output of the intermediate layer of the discriminator given the input VI trajectory x;
[0058] The reconstruction loss function is expressed as follows:
[0059]
[0060] The μ is the average intensity of the training VI trajectory images, and δ is the standard deviation of the training VI trajectory images. The covariance of the VI trajectory and feature-reconstructed image is used for training; c1 and c2 are constants.
[0061] The additional encoder loss function expression is:
[0062]
[0063] The z represents the sampled vector features output by the capsule network during the training of the VI trajectory image. Reconstruct the encoded features of the image based on the features;
[0064] The expression for the central constraint loss function is:
[0065] L KL =d(C,sg[P y ]);
[0066] The C is a probability capsule, and P is a Gaussian distribution of the target load cluster;
[0067] The expression for the contrastive loss function is:
[0068]
[0069] The above [·] + A function that returns a positive number as an argument;
[0070] The formula for weighted calculation of the minimum value is:
[0071] L=αL KL +βL rec +γL contr +σL enc +λL adv α, β, γ, σ and λ are all constants.
[0072] Optionally, S4 specifically includes:
[0073] The real-time VI trajectory of the power circuit is input into the trained conditional generative adversarial network to generate a real-time feature reconstruction image.
[0074] Calculate the minimum distance between the real-time feature reconstructed image and the historical feature reconstructed image of the finally trained conditional generative adversarial network;
[0075] If the minimum distance between the real-time feature reconstruction image and the historical feature reconstruction image is greater than the threshold τ that satisfies the preset requirement, it is determined that an abnormal load has occurred in the pre-selected power circuit.
[0076] In a second aspect, the present invention provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program stored in the memory to implement the steps of the non-intrusive abnormal load behavior monitoring method described in any of the first aspects above.
[0077] Thirdly, a computer-readable storage medium storing a computer program that, when executed by a processor, implements the steps of the non-intrusive abnormal load behavior monitoring method as described in any of the first aspects above.
[0078] (III) Beneficial Effects
[0079] This invention provides a non-invasive method, electronic device, and storage medium for monitoring abnormal load behavior. In the method, a conditional generative adversarial network is pre-trained. By judging and sampling historical load voltage and current values that cause load state transition events, and combining them with a power strategy, the voltage and current values are color-coded to obtain a color load VI trajectory image, which is beneficial for visual recognition. The VI trajectory image and the feature reconstruction image are input multiple times into the pre-constructed conditional generative adversarial network and a repeat discriminator to determine the accuracy of the recognition, thereby achieving a conditional generative adversarial network that meets the preset recognition accuracy ratio.
[0080] The feature reconstruction image of the VI trajectory image of the real-time collected voltage and current values is compared with the minimum distance of the historical feature reconstruction image of the load preset requirement to determine whether there is an abnormal load, thereby realizing the monitoring of abnormal load of the circuit under test.
[0081] Compared with existing technologies, the above technical solution can monitor the actual load of the power user, achieving the goal of flexible monitoring when the power user changes electrical appliances, improving the flexibility and scalability of non-intrusive abnormal load behavior monitoring, and reducing detection errors. Attached Figure Description
[0082] Figure 1 A flowchart illustrating a non-invasive method for monitoring abnormal load behavior according to an embodiment of the present invention;
[0083] Figure 2 A flowchart illustrating the training process of the conditional generative adversarial network provided in an embodiment of the present invention;
[0084] Figure 3 A schematic diagram of a training conditional generative adversarial network model provided in an embodiment of the present invention;
[0085] Figure 4 This is a schematic diagram of the logic flow for detecting load state switching events according to an embodiment of the present invention. Detailed Implementation
[0086] To better explain and facilitate understanding of the present invention, it will be described in detail below with reference to the accompanying drawings and specific embodiments. While exemplary embodiments of the invention are shown in the drawings, it should be understood that the invention can be implemented in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided to enable a clearer and more thorough understanding of the invention and to fully convey the scope of the invention to those skilled in the art.
[0087] In today's society, electricity has become one of the most important energy sources, and residents' electricity demand is increasing daily. Therefore, household energy management is an effective way to reduce electricity waste. In existing technologies, non-intrusive load monitoring methods can only be applied well when the load type is fixed and does not change. To address this, this invention proposes a non-intrusive method for monitoring abnormal load behavior, which can effectively handle various scenarios of adding or removing electrical appliances or aging appliances in household electrical circuits.
[0088] like Figure 1 As shown, Figure 1 This invention provides a non-intrusive method for monitoring abnormal load behavior. The non-intrusive load monitoring only requires installing a data measurement sensor with communication capabilities at the power supply inlet of the electrical load. It can then obtain the power consumption information of each appliance within the user's premises by analyzing the total load data. The method includes the following steps:
[0089] S1. Acquire real-time monitoring data from a non-intrusive load monitoring device and denoise it; the monitoring data includes: the total voltage and total current data of the pre-selected power circuit monitored by the non-intrusive load monitoring device.
[0090] S2. For the noise-reduced monitoring data, the monitoring data that shows load state transitions will be considered as valid monitoring data.
[0091] S3. Based on the pre-built power strategy, the effective monitoring data is color-coded to obtain the VI trajectory image of each individual load in the power circuit.
[0092] In practical applications, the single load can be any appliance in a household power circuit. Since the shape of the VI trajectory largely depends on the load current that reflects the physical characteristics of the power load, the proportion of active current in the power factor is greater than that of reactive current, resulting in little difference in the shape of the VI trajectory for loads of the same type. Therefore, in some embodiments, the Fryze power strategy can be used to decompose the load current into active current components and reactive current components that represent resistance and non-resistance information, thereby enhancing the uniqueness of the VI trajectory.
[0093] S4. Input the VI trajectory image into the trained conditional generative adversarial network, and determine whether there is abnormal load in each power circuit based on the generated feature reconstructed image.
[0094] The conditional generative adversarial network includes a conditional autoencoder, a capsule network, and a classifier. The conditional autoencoder is used to convert the Gaussian prior probability of the load in the VI trajectory image into a Gaussian posterior probability. The capsule network is used to achieve the compactness of the same type of features near the center of the Gaussian distribution, so that the classifier can detect the load.
[0095] The present invention proposes a non-intrusive abnormal load behavior monitoring method, which acquires real-time monitoring data from a non-intrusive load monitoring device and generates a VI trajectory image. The VI trajectory image is then input into a pre-trained conditional generative adversarial network to determine whether abnormal load exists and to monitor abnormal load. This method is unaffected by changes or aging of electrical equipment, has good scalability, is flexible in use, and has high applicability.
[0096] Specifically, in another embodiment of the above-mentioned non-invasive abnormal load behavior monitoring method, step S3 may include:
[0097] S30. Based on a pre-built spectrum analysis method, the effective monitoring data is sampled to obtain the voltage and current values of each individual load in the power circuit;
[0098] S31. For each individual load, based on the pre-built Fryze power strategy, determine the active component current i of i(t) of that individual load. a (t) and reactive component current i f (t);
[0099] Based on the active component current i a (t) and reactive component current i f (t), calculate and obtain the power factor matrix.
[0100] In this embodiment, the active current is defined as the orthogonal projection of the load current onto the voltage v(t) direction, i.e., i a (t) is proportional to v(t), conveying resistance information, and the active current i a (t) and active power P active The expression is:
[0101]
[0102]
[0103] Among them, V rms Here, is the effective value of the voltage, and T is the power supply cycle. The reactive component current and voltage are orthogonal to each other; the reactive current i can be calculated using the instantaneous voltage and current of the load. f (t) is used to represent:
[0104]
[0105] In practical applications, because active current accounts for a large proportion, the shape of the VI trajectory is not significantly different for loads of the same type. Therefore, only reactive current i can be used. f (t) replaces the uncomputed current data i(t), based on the reactive current if (t) Obtain the VI trajectory. In order to avoid losing information between active and reactive components, saturation can be used to represent the ratio of active power to reactive power in multiple cycles, i.e., the power factor.
[0106] That is, the power factor is the ratio of the power of the active component current to the power of the reactive component current.
[0107] The power factor matrix The expression is:
[0108]
[0109] K is the total number of sampling points, P apparent For actual power, V rms I rms These are the effective values of the load voltage and current, respectively.
[0110] S32. For each individual load, construct the hue matrix of the VI trajectory based on the pre-built HSV color space. And the voltage period matrix V.
[0111] In specific implementation, S32 may include:
[0112] S321. For a single load, based on the HSV color space, obtain the motion direction H of the VI trajectory using the hue attribute. j ;
[0113] Based on the motion direction H j Store the hue of the j-th sampling point into a new 2N×2N matrix to obtain the hue matrix.
[0114] The direction of motion H j The calculation expression is:
[0115]
[0116] The arg is an arctangent function in four quadrants; the phase angle between two consecutive points in the VI trajectory is calculated, with a value ranging from 0° to 360°.
[0117] The hue matrix The calculation expression is:
[0118]
[0119] |A| is the cardinality of the set.
[0120] S322, Based on a pre-constructed binary image W m(1,2,...,M), average the voltage over M periods to obtain the voltage period matrix V; that is, the color generation attribute Value of the HSV color space is used to represent the repeatability of the VI trajectory.
[0121] The expression for the voltage period matrix V is:
[0122]
[0123] Where m = 1, 2, 3, ..., M.
[0124] S33. For each individual load, connect the power factor matrix in a standard three-dimensional coordinate system. Hue Matrix Using the voltage period matrix V, obtain the VI trajectory image of the single load.
[0125] In one embodiment, the value of M is preferably 10. In application, it is determined according to the actual situation and is not limited here.
[0126] The HSV (Hue, Saturation, Lightness) color space is a non-linear transformation of the RGB (Red, Green, Blue) color space, which is more in line with human color perception. The HSV color space can be represented using an inverted cone model, where each hue is distributed in radial slices from red to yellow, green, cyan, blue, and magenta. Hue is used to represent the color category. Saturation is defined as the ratio of color to lightness, increasing with distance from the center of the cone, and is used to represent the vividness of the color. Lightness represents brightness, and the distance from the center of the cone to the apex represents the lightness or darkness of each color.
[0127] In one embodiment, step S33 is specifically implemented by converting the power factor matrix... Hue Matrix The voltage period matrix V is connected along the third dimension, and the hue-saturation-brightness is converted into equivalent values of red-green-blue so that the created color image can be perceived by humans.
[0128] Of course, other colors may be included in other embodiments, which are not limited here.
[0129] In some other embodiments, S4 may specifically include:
[0130] The real-time VI trajectory of the power circuit is input into the trained conditional generative adversarial network to generate a real-time feature reconstruction image.
[0131] Calculate the minimum distance between the real-time feature reconstruction image and the historical feature reconstruction image of the finally trained conditional generative adversarial network.
[0132] If the minimum distance between the real-time feature reconstruction image and the historical feature reconstruction image is greater than the threshold τ that satisfies the preset requirement, it is determined that an abnormal load has occurred in the pre-selected power circuit.
[0133] In practical applications, the type of input load can also be determined by the threshold. That is, if the minimum distance between the real-time feature reconstruction image and the historical feature reconstruction image is less than the threshold τ that meets the preset requirements, then the type of input load is determined to be the same as the type of load corresponding to the minimum distance; if the minimum distance between the real-time feature reconstruction image and the historical feature reconstruction image is equal to the threshold τ that meets the preset requirements, then the type of input load is determined to be an unknown load.
[0134] In some embodiments, an abnormal load is determined when the minimum distance between the real-time feature reconstruction image and the historical feature reconstruction image is greater than or equal to a threshold τ that satisfies the preset requirement.
[0135] The non-intrusive abnormal load behavior monitoring method provided by the above embodiments of the present invention separates the active and reactive components of the load current, and can only regard the reactive component as the original load current to generate a significantly different VI trajectory. Based on this, the conditional generative adversarial network can better extract learning features and reduce recognition errors during training.
[0136] In other embodiments, such as power circuits using a non-intrusive load monitoring device for the first time, the method may further include, prior to S1: S0, training the conditional generative adversarial network, such as... Figure 2 As shown, Figure 2 The training flowchart of the conditional generative adversarial network provided in an embodiment of the present invention is shown.
[0137] The S0 may include:
[0138] S01. Obtain training monitoring data samples and verification monitoring data samples for training the conditional generative adversarial network; the training monitoring data samples and the verification monitoring data samples are historical monitoring total voltage and total current data of the same power circuit;
[0139] Specifically, in some other embodiments, the training monitoring data samples and the verification monitoring data samples can be public non-intrusive load monitoring data of pre-selected power circuits. The original data contains noise, which will affect the extraction of load features. In order to facilitate subsequent feature extraction, the data samples are usually denoised.
[0140] In one specific embodiment, S01 is implemented as follows:
[0141] Acquire historical monitoring data of at least one load state transition event in a power circuit monitored by a non-intrusive load monitoring device; the load state transition event is the circuit load transition process caused by the opening and / or closing of equipment in the pre-selected power circuit.
[0142] Based on a predefined event detection window, the time period for the occurrence of load state transition events is calculated; specifically:
[0143] Calculate the total actual power S of the preselected power circuit. t Determine ΔS t >S on1 At time t;
[0144] Based on a pre-built event detection window, the total real power change ΔS is calculated and determined when t = t + TR. t+TR <S on1 R is the step size of the event detection window, ΔS t =S t+1 -S t ;
[0145] If S t+TR -S t <S on2 Determine if a load state transition event occurs during the time period t to t+TR.
[0146] Collect total voltage and total current data for T time periods before and after the load state transition event to obtain training monitoring data samples and verification detection data samples.
[0147] The S on1 S is the predefined threshold for the start of load state transition events. on2 The threshold for the end of a predefined load state transition event.
[0148] S02. Based on the pre-built power strategy, the training monitoring data samples and the verification detection data samples are encoded to obtain the training VI trajectory image and the verification VI trajectory image of each individual load in the power circuit.
[0149] In actual operation, the process of generating training VI trajectory images and verifying VI trajectory images in S02 can be the same as the steps of generating real-time VI trajectory images in the above embodiment.
[0150] S03. For each individual load, the training VI trajectory image is input into the conditional adversarial generative network to reconstruct the feature reconstruction image of the training VI trajectory.
[0151] S04. Input the verification VI trajectory image and the feature reconstruction image corresponding to each individual load into a pre-built discriminator to determine whether the feature reconstruction image matches the verification VI trajectory image.
[0152] S05. Adjust the training parameters of the conditional adversarial generation network, and alternately generate feature reconstruction images and input discriminator networks so that the feature reconstruction image finally generated by the conditional adversarial monitoring network matches the verification VI trajectory image, thereby obtaining the trained conditional adversarial monitoring network.
[0153] In some embodiments, adjusting the training parameters of the conditional adversarial monitoring network in step S05 can be specifically implemented as follows:
[0154] Based on a pre-constructed loss function, the minimum value of the training loss of the conditional adversarial monitoring network is calculated;
[0155] The parameters of the conditional generative adversarial network are adjusted by weighting the minimum value.
[0156] In one specific embodiment, the loss function may include a feature matching loss function, a reconstruction loss function, an additional encoder loss function, a center constraint loss function, and / or a contrast loss function, etc.
[0157] Specifically, the feature matching loss function is used for adversarial learning to reduce the instability of training the conditional generative adversarial network (GAN). It aligns the GAN's encoded feature distribution and the reconstructed VI trajectory image with the real VI trajectory image. Based on the feature matching loss function, the generated VI trajectory is sufficient to deceive the discriminator, effectively distinguishing the feature representations of known and unknown devices. Specifically, the generator is updated based on the discriminator's internal representation. Formally, let f be a function that outputs the discriminator's intermediate layer based on the given input VI trajectory x drawn according to the input data distribution. Feature matching calculates the L2 distance between the feature representation of the original VI trajectory image and the generated VI trajectory image.
[0158] The feature matching loss function, i.e., the adversarial loss function, is expressed as follows:
[0159]
[0160] f(x) is the output of the discriminator intermediate layer based on the input VI trajectory x.
[0161] In another embodiment, the failure to optimally utilize the contextual information of the input VI data to obtain a reliable reconstruction result can be addressed by measuring the reconstruction loss between the input and the reconstructed VI trajectory image. Since the generation process of the VI trajectory image contains rich structural information, some embodiments use structural similarity loss as the generator's reconstruction loss. Structural similarity loss considers brightness, contrast, and structural information, and is less sensitive to the positional offset of the input VI trajectory and its reconstruction, thus making the network more likely to converge. Therefore, the model trained with structural similarity loss tends to focus more on global information rather than local features during VI trajectory reconstruction.
[0162] The expression for the reconstruction loss function, also known as the structural similarity loss function, is as follows:
[0163]
[0164] The μ is the average intensity of the training VI trajectory images, and δ is the standard deviation of the training VI trajectory images. The covariance of the VI trajectory and feature reconstruction image is used for training; c1 and c2 are constants, and in some embodiments, the constants c1 and c2 are set to 0.01 and 0.03, respectively.
[0165] Based on the two loss functions mentioned above, the generator can be forced to produce realistic images that are relevant to the context.
[0166] Furthermore, in some other embodiments, an additional encoder loss L1 can be utilized to minimize the sampled vector features of the capsule network output from the input z and the encoded features of the reconstructed VI trajectory image. Based on the distance between them, the conditional generative adversarial network learns how to encode the VI trajectory features of known load samples. Both the generator and the additional encoder network are optimized only for data samples with known loads.
[0167] The additional encoder loss function expression is:
[0168]
[0169] The z represents the sampled vector features output by the capsule network during the training of the VI trajectory image. The encoded features of the image are reconstructed from the features.
[0170] In other embodiments, to encode the VI trajectory features of each known power circuit load class, forming a compact cluster of load features, making it easier for the model to identify unknown load features, a center-constrained loss can be used in the generator's latent space to push the probability capsule C toward the target load cluster P. yThe center of the target area is such that the density of all known load samples is concentrated in the target region.
[0171] The expression for the central constraint loss function is:
[0172] L KL =d(C,sg[P y ]);
[0173] The function sg[·] represents the stopping gradient operator, which is defined as the identity during forward computation and has zero partial derivatives, restricting its parameters to unupdated constants.
[0174] The C is a probability capsule, and P is a Gaussian distribution of the target load cluster; the probability capsule is a Gaussian distribution of the input VI trajectory.
[0175] In one embodiment, a contrastive loss function was also constructed, using the margin loss function and marginm. k The boundary will push all target loads that do not belong to y far away from distribution C, by considering P ≠y It is P y The differences prevent the collapse of the previous target load of the conditional generative adversarial network and promote the separation of the load from all other loads (which may be unknown corresponding loads).
[0176] The expression for the contrastive loss function is:
[0177]
[0178] The above [·] + A function that returns a positive number as an argument.
[0179] Based on the five loss functions mentioned above, the formula for updating the network parameters by weighted combination of the minimum values of the five loss functions is as follows:
[0180] L=αL KL +βL rec +γL contr +σL enc +λL adv .
[0181] The values α, β, γ, σ, and λ are all constants. In one embodiment, α is preferably 1, β is preferably 0.01, γ is preferably 1, σ is preferably 0.01, and λ is preferably 10.
[0182] In this embodiment, a conditional autoencoder and capsule network are used as the generator of the conditional generative adversarial network. During model training, capsule features of the same type of load are matched with a predetermined Gaussian distribution. A Gaussian distribution is defined for each type of load. Specifically, a variational autoencoder framework is used, with a set of Gaussian priors as an approximation of the posterior distribution. This allows control over the compactness of features of the same type near the center of the Gaussian distribution, thereby controlling the classifier's ability to detect unknown loads. The VI trajectories generated by the generator are passed through a discriminator and an additional encoding network. The additional encoding network maps the generated VI trajectories to hidden layer representations to minimize the distance between the generated VI trajectories and the hidden layer representations of the generator's VI trajectories. By constructing multiple loss functions and finding their minimum values, the model parameters are adjusted, enabling the generator to better learn the distribution characteristics of known loads, increasing its ability to monitor unknown loads, resulting in high monitoring flexibility and small errors.
[0183] like Figure 3 As shown, Figure 3 This is a schematic diagram of a conditional generative adversarial network model for training according to an embodiment of the present invention. Figure 3 In the illustrated embodiment, the conditional generative adversarial network includes a conditional autoencoder and a capsule network, as well as an additional encoder. Each load has a non-independent Gaussian distribution, and the conditional autoencoder approximates the Gaussian prior of the load as a posterior probability. The additional encoder is used to map the generated VI trajectories to hidden layer representations to minimize the distance between the generated VI trajectory hidden layer representations and those in the conditional autoencoder. The capsule network is used to achieve compactness of features of the same class near the center of the Gaussian distribution, thereby controlling the classifier's ability to detect unknown loads.
[0184] To better explain the technical solution proposed in this invention, a specific embodiment will be described in detail below.
[0185] This embodiment describes the monitoring of abnormal load behavior in a household electrical circuit using a non-intrusive load monitoring device. In a household electrical circuit, each appliance / device / appliance is considered a single load. Load state switching is accompanied by changes in actual power. Motor-type loads often experience changes in power and current RMS values during startup, resulting in a change in load state; this process is considered a load state switching event. The change in power or current RMS value can be compared to a preset threshold; if it exceeds the threshold, an event is considered to have occurred. Based on the changes in voltage and current before and after the event, the voltage and current values of the load that caused the event can be obtained.
[0186] First, the conditional generation network is trained; the network is trained using only VI trajectories with known loads.
[0187] The steps include:
[0188] A1. Obtain the raw monitoring data from the non-intrusive load monitoring equipment and denoise the raw monitoring data;
[0189] A2. Calculate the time period during which load state transition events occur based on a predefined event detection window.
[0190] like Figure 4 The above, Figure 4 This is a schematic diagram of the logic flow for detecting load state switching events provided in this embodiment.
[0191] In this embodiment, the detection of load state switching events is specifically implemented as follows:
[0192] Define the step size of the time detection window as R, S t ΔS represents the total real power at time t seconds. t =S t+1 -S t , representing the change in total real power. When ΔS t >S on1 At that time, the event detection window begins to move and calculate ΔS. t+1 ΔS t+2 …, until ΔS t+TR <S o1n If S t+TR -S t <S o2n This indicates that a load state change occurred within the time interval t to t+TR seconds, meaning an unknown load state switching event was detected. The start time of the load state switching event is t. on The event lasts for t seconds, and the event ends at time t. off Let t+TR, where TR represents the duration of the event.
[0193] The detection process for the aforementioned load state transition events can be represented by the following formula:
[0194] ΔS t |≥S on1 &&|ΔS t+1 |≥S on1 &&...&&|ΔS t+TR-1 |≥S on1
[0195] &&|ΔS t+TR |<S on1 &&|ΔS t+TR+1 |<S on1 &&|S t+TR -S t |≥S on2 .
[0196] A3. Extract the steady-state voltage and current waveforms for T cycles before and after the load state switching event, and obtain the voltage and current values of a single load based on the spectrum analysis method.
[0197] Specifically, extract the steady-state voltage and current waveforms v for T cycles before and after the load state transition event. on v off i on i off The base voltage phase angle is calculated using spectral analysis methods such as Fast Fourier Transform, and then the sampling point with a phase angle of zero is used as the initial sampling point to ensure the current waveform i off and i on They can be directly subtracted in the time domain. The voltage of a single load is v = (v off +v on ) / 2 and current i=i off -i on .
[0198] V on The total voltage after a load state switching event, V off The total voltage before the load state switching event, I on The total current I after a load state switching event. off The total current before the load state switching event.
[0199] A4. Using the Fryze power strategy, color-code the voltage and current values of the individual load to obtain a colored load VI trajectory image. Divide the VI trajectory image into training VI trajectory images and verification VI trajectory images, and train the conditional generative adversarial network until the correct recognition rate of the conditional generative adversarial network reaches 95%.
[0200] The correct recognition rate of the conditional generative adversarial network is 95%. A threshold τ is set to identify abnormal loads. The threshold τ is the distribution threshold of the Gaussian distribution of the VI trajectory image reconstructed by the conditional generative adversarial network for the same load.
[0201] In this embodiment, the correct recognition rate of the trained conditional generative adversarial network is 95%, based on the actual needs of this embodiment. In other embodiments, the accuracy is determined according to actual needs, and no limitation is imposed here.
[0202] Then, the trained conditional adversarial generative network is used to monitor the power circuit to determine whether any abnormal loads have occurred.
[0203] Specifically, it includes:
[0204] B1. Obtain real-time monitoring data of the power circuit and remove noise. The real-time monitoring data is the total voltage and total current of the power circuit.
[0205] B2. For the noise-reduced monitoring data, the monitoring data with load state transitions are taken as valid monitoring data. In this embodiment, the process for determining the monitoring data with load state transitions is the same as in A2, and an event detection window of the same length is used.
[0206] B3. Extract the steady-state voltage and current waveforms for T cycles before and after the load state switching event. Based on the spectrum analysis method, obtain the voltage and current values of a single load. The steps are the same as in A3. Calculate the base voltage phase angle using spectrum analysis methods such as Fast Fourier Transform, and then use the sampling point with a zero phase angle as the initial sampling point to ensure the current waveform i off and i on They can be subtracted directly in the time domain.
[0207] B4. Using the Fryze power strategy, the voltage and current values of the above-mentioned single load are color-coded to obtain a colored load VI trajectory image of the load.
[0208] B5. Input the VI trajectory image into the trained conditional generative adversarial network, and reconstruct the image based on the generated features to determine whether there is abnormal load in each power circuit.
[0209] The VI trajectory to be tested is input into the trained conditional generative adversarial network. If the minimum distance between the capsule feature (i.e., the feature reconstruction map) of the load's VI trajectory and the Gaussian distribution of each known load is greater than or equal to a threshold, an abnormal load is determined to have occurred. If the minimum distance between the feature reconstruction map and the Gaussian distribution of the known load is less than the threshold, the load type label is the load type label corresponding to the minimum distance.
[0210] Furthermore, the present invention proposes an electronic device including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program stored in the memory to implement the steps of the non-intrusive abnormal load behavior monitoring method described in any of the above embodiments.
[0211] In practical applications, human-computer interaction devices can also be set up to allow users to view the current monitoring results in real time.
[0212] The present invention also provides a computer-readable storage medium storing a computer program, which, when executed by a processor, implements the steps of the non-intrusive abnormal load behavior monitoring method as described in any of the above embodiments.
[0213] This invention provides a non-intrusive method, electronic device, and storage medium for monitoring abnormal load behavior. By training a conditional generative adversarial network, it achieves the monitoring of abnormal load behavior and the correct identification of known loads.
[0214] The generator of the conditional generative adversarial network (GAN) provided in one embodiment of the present invention consists of an autoencoder and a capsule network. The capsule features of the same load VI trajectory after passing through the encoder and capsule network correspond to a predefined Gaussian distribution. Each load has its own independent Gaussian distribution. The conditional autoencoder approximates the Gaussian prior of the load as the posterior probability. An additional encoding network maps the VI trajectory generated by the generator to a hidden layer representation to minimize the distance between the hidden layer representation and the VI trajectory in the generator. By constructing multiple loss functions to minimize each loss, the parameters of the conditional GAN are adjusted and updated, achieving compactness of the same load feature near the center of the Gaussian distribution. The conditional GAN learns how to encode the VI trajectory features of the load and learns the data distribution of known loads, enabling real-time monitoring of unknown or abnormal loads in power users. It has high scalability, high flexibility, and low error.
[0215] The non-intrusive abnormal load behavior monitoring method, electronic device, and storage medium provided in the various embodiments of this invention offer high accuracy in monitoring abnormal load behavior. Applied to household and other electrical circuit systems, they can acquire real-time power consumption information for various electrical appliances within a user's home, including the appliance's operating status, power consumption, cumulative power consumption, and even fault information. This is beneficial for the formulation of energy efficiency policies, preventing aging of internal circuit hardware that could lead to appliance malfunctions and direct economic losses for electricity users. Furthermore, the method provided by this invention has low installation costs, is flexible and convenient to apply, and has high scalability, making it a promising candidate for future applications.
[0216] In the description of this invention, it should be understood that the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of indicated technical features. Therefore, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature. In the description of this invention, "a plurality of" means two or more, unless otherwise explicitly specified.
[0217] In the description of this specification, the terms "one embodiment," "some embodiments," "embodiment," "example," "specific example," or "some examples," etc., refer to specific features, structures, materials, or characteristics described in connection with that embodiment or example, which are included in at least one embodiment or example of the present invention. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.
[0218] Although embodiments of the present invention have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting the present invention. Those skilled in the art can make modifications, alterations, substitutions and variations to the above embodiments within the scope of the present invention.
Claims
1. A non-invasive method for monitoring abnormal load behavior, characterized in that, Includes the following steps: S1. Acquire real-time monitoring data from a non-intrusive load monitoring device and denoise it; the monitoring data includes: the total voltage and total current data of the pre-selected power circuit monitored by the non-intrusive load monitoring device; S2. For the noise-reduced monitoring data, the monitoring data with load state transitions will be considered as valid monitoring data. S3. Based on the pre-built power strategy, the effective monitoring data is color-coded to obtain the VI trajectory image of each individual load in the power circuit; S4. Input the VI trajectory image into the trained conditional generative adversarial network, and reconstruct the image based on the generated features to determine whether there is abnormal load in each power circuit; The conditional generative adversarial network includes a conditional autoencoder, a capsule network, and a classifier. The conditional autoencoder is used to convert the Gaussian prior probability of the load in the VI trajectory image into a Gaussian posterior probability. The capsule network is used to achieve the compactness of the same type of features near the center of the Gaussian distribution, so that the classifier can detect the load. Prior to S1, the method further includes: S0, training the conditional generative adversarial network: The S0 includes: S01. Obtain training monitoring data samples and verification monitoring data samples for training the conditional generative adversarial network; the training monitoring data samples and the verification monitoring data samples are historical monitoring total voltage and total current data of the same power circuit; S02. Based on the pre-built power strategy, the training monitoring data samples and the verification detection data samples are encoded to obtain the training VI trajectory image and the verification VI trajectory image of each individual load in the power circuit. S03. For each individual load, the training VI trajectory image is input into the conditional generative adversarial network to reconstruct the feature reconstruction image of the training VI trajectory; S04. Input the verification VI trajectory image and the feature reconstruction image corresponding to each individual load into a pre-built discriminator to determine whether the feature reconstruction image matches the verification VI trajectory image. S05. Adjust the training parameters of the conditional generative adversarial network and alternately generate feature reconstruction images and input discriminant networks so that the feature reconstruction image finally generated by the conditional adversarial monitoring network matches the verification VI trajectory image, thereby obtaining the trained conditional adversarial monitoring network. The training parameters of the conditional adversarial monitoring network are adjusted as follows: Based on a pre-constructed loss function, the minimum value of the training loss of the conditional adversarial monitoring network is calculated; The parameters of the conditional generative adversarial network are adjusted by weighting the minimum value. The loss function includes a feature matching loss function, a reconstruction loss function, an additional encoder loss function, a center constraint loss function, and / or a contrastive loss function; The expression for the feature matching loss function is as follows: ; f(x) is the output of the intermediate layer of the discriminator given the input VI trajectory x; The reconstruction loss function is expressed as follows: ; The μ represents the average intensity of the training VI trajectory images, and δ represents the standard deviation of the training VI trajectory images. The covariance of the VI trajectory and feature-reconstructed image is used for training; c1 and c2 are constants. The additional encoder loss function expression is: ; The z represents the sampled vector features output by the capsule network during the training of the VI trajectory image. Reconstruct the encoded features of the image based on the features; The expression for the central constraint loss function is: L KL =d(C,sg[P y ]), sg[·] represents the stopping gradient operator; The C is a probability capsule, and P is a Gaussian distribution of the target load cluster; The expression for the contrastive loss function is: ; The above [·] + A function that returns a positive number as an argument; The formula for weighted calculation of the minimum value is: L = αL KL + βL rec + γL contr + σL enc + λL adv , where α, β, γ, σ, and λ are all constants.
2. The monitoring method as described in claim 1, characterized in that, S01 includes: Acquire historical monitoring data of at least one load state transition event in a power circuit monitored by a non-intrusive load monitoring device; the load state transition event is the circuit load transition process caused by the opening and / or closing of a single load in the pre-selected power circuit; Based on a predefined event detection window, the time period for the occurrence of load state transition events is calculated; specifically: Calculate the total actual power S of the preselected power circuit. t ,Sure S t >S on1 At time t; Based on a pre-built event detection window, the change in total real power at t=t+TR is calculated and determined. S t+TR on1 R is the step size of the event detection window. S t =S t +1-S t ; If S t+TR -S t on2 Determine if a load state transition event occurs during the time period t to t+TR; Collect total voltage and total current data for T time periods before and after the load state transition event to obtain training monitoring data samples and verification monitoring data samples; The S on1 S is the predefined threshold for the start of load state transition events. on2 The threshold for the end of a predefined load state transition event.
3. The monitoring method as described in claim 1, characterized in that, S3 include: S30. Based on a pre-built spectrum analysis method, the effective monitoring data is sampled to obtain the voltage and current values of each individual load in the power circuit; S31. For each individual load, based on the pre-built Fryze power strategy, determine the active component current i of the current i(t) of that individual load. a (t) and reactive component current i f (t); Based on the active component current i a (t) and reactive component current i f (t), calculate and obtain the power factor matrix. The power factor is the ratio of the power of the active component current to the power of the reactive component current. The power factor matrix The expression is: ; P represents the total number of sampling points. active For active power, P apparent For actual power, V rms I rms These are the effective values of the load voltage and current, respectively. S32. For each individual load, construct the hue matrix of the VI trajectory based on the pre-built HSV color space. and voltage period matrix V; S33. For each individual load, connect the power factor matrix in a standard three-dimensional coordinate system. Hue Matrix Using the voltage period matrix V, obtain the VI trajectory image of the single load.
4. The monitoring method as described in claim 3, characterized in that, S32 specifically includes; S321. Based on the HSV color space, obtain the motion direction H of the VI trajectory using the hue attribute. j ; Based on the motion direction H j Store the hue of the j-th sampling point into a 2N×2N matrix to obtain the hue matrix. ; The direction of motion H j The calculation expression is: ; The The arctangent function is defined in four quadrants. The hue matrix The calculation expression is: ; |A| is the cardinality of the set; S322, Based on a pre-constructed binary image W m (1,2,...,M), average the M cycles of a single load voltage to obtain the voltage cycle matrix V; The expression for the voltage period matrix V is: 。 5. The monitoring method as described in claim 1, characterized in that, S4 specifically includes: The real-time VI trajectory of the power circuit is input into the trained conditional generative adversarial network to generate a real-time feature reconstruction image. Calculate the minimum distance between the real-time feature reconstructed image and the historical feature reconstructed image of the finally trained conditional generative adversarial network; If the minimum distance between the real-time feature reconstruction image and the historical feature reconstruction image is greater than a preset threshold τ, it is determined that an abnormal load has occurred in the pre-selected power circuit.
6. An electronic device, characterized in that, The method includes a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program stored in the memory to implement the steps of the non-intrusive abnormal load behavior monitoring method according to any one of claims 1 to 5.
7. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the non-intrusive abnormal load behavior monitoring method as described in any one of claims 1 to 5.