Non-intrusive load identification method and system based on multi-channel data
A non-intrusive load identification method based on multi-channel data conversion and model training solves the problem of identification accuracy for low-power appliances and appliances with similar power, thus improving the application effect of non-intrusive load identification.
Patent Information
- Application Number
- CN202511649477.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-12
- Publication Date
- 2026-02-17
AI Technical Summary
Existing non-intrusive load identification schemes based on high-frequency data are not accurate enough in identifying low-power appliances and appliances with similar power, which limits the application of non-intrusive load identification methods on the residential side.
A non-intrusive load identification method based on multi-channel data is adopted. The current and voltage data of electrical equipment are collected and converted into apparent power, active power and reactive power. A non-intrusive load identification model based on multi-channel data is constructed and trained using a triplet loss function. The embedded feature vector is output by combining the power difference before and after the switching event, and the appliance category is calculated using cosine similarity.
It improves the accuracy of identifying low-power and similar-power appliances, enhances the application scenarios of non-intrusive load identification, reduces the impact of high-power appliances on identification, and improves the identification effect.
Smart Images

Figure CN121540924A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of load identification technology, and in particular to a non-intrusive load identification method and system based on multi-channel data. Background Technology
[0002] With continuous social development and technological progress, energy consumption, especially electricity, is gradually increasing across all sectors. In 2022, total electricity consumption reached 8,637.2 billion kilowatt-hours, a year-on-year increase of 3.6%. By sector, primary industry electricity consumption was 114.6 billion kilowatt-hours, a year-on-year increase of 10.4%; secondary industry electricity consumption was 5,700.1 billion kilowatt-hours, a year-on-year increase of 1.2%; tertiary industry electricity consumption was 1,485.9 billion kilowatt-hours, a year-on-year increase of 4.4%; and residential electricity consumption was 1,336.6 billion kilowatt-hours, a year-on-year increase of 13.8%. This continuous growth in electricity consumption is putting increasing pressure on the power grid. Therefore, optimizing electricity consumption behavior across industries, improving efficiency, and reducing energy waste are becoming increasingly important.
[0003] Against the backdrop of ever-increasing electricity consumption, non-intrusive load identification technology has emerged. This technology acquires total load consumption information, including characteristic parameters such as current and voltage, at a single measurement point, and then analyzes this information to obtain the consumption information of individual loads within the load. Non-intrusive load identification methods enable load monitoring, facilitating more refined electricity management on the load side and thus promoting the construction of smart grids. Furthermore, this technology has low equipment requirements, can identify loads without damaging the wiring itself, is easy to deploy and maintain, and is highly practical.
[0004] Current non-invasive load identification schemes can be mainly divided into two categories: those based on high-frequency data and those based on low-frequency data. However, research has shown that non-invasive load identification schemes based on low-frequency data suffer from a low upper limit and poor load identification performance. High-frequency data, on the other hand, carries a large amount of information, allowing algorithms to more effectively extract appliance information and achieve better appliance identification results. Therefore, non-invasive load identification schemes based on high-frequency data exhibit superior performance and greater application value.
[0005] However, non-intrusive load identification schemes based on high-frequency data suffer from inaccurate identification of low-power appliances and similar appliances. Among these schemes, some researchers have proposed a few-shot learning-based non-intrusive load monitoring method that identifies the load by subtracting the current before and after a switching event. However, this method does not address the noise issue present in the current obtained after the subtraction. (See below.) Figure 9As shown, when a laptop is turned on or off while the kettle is in use, the current from the laptop obtained through the switch event differs significantly from the current when the laptop is running alone. This can lead to misidentification of the laptop. Furthermore, the current solution also fails to accurately identify appliances with similar power ratings, such as a 1000-watt kettle and a hair dryer.
[0006] In other words, existing non-intrusive load identification schemes based on high-frequency data have problems such as inaccurate identification of low-power appliances and inaccurate identification of appliances of different categories but similar power, which limits the application of non-intrusive load identification methods on the residential side.
[0007] Therefore, how to provide a non-intrusive load identification method and system based on multi-channel data is an urgent problem to be solved. Summary of the Invention
[0008] This invention provides a non-intrusive load identification method and system based on multi-channel data to overcome the limitations of existing non-intrusive load identification schemes based on high-frequency data, improve the identification effect of low-power appliances and the identification effect of different types of appliances with similar power, thereby expanding the application scenarios of non-intrusive load identification.
[0009] To provide a basic understanding of some aspects of the disclosed embodiments, a brief summary is given below. This summary is not intended as a general commentary, nor is it intended to identify key / important components or to describe the scope of protection of these embodiments. Its sole purpose is to present some concepts in a simple form as a prelude to the detailed description that follows.
[0010] According to a first aspect of the present invention, a non-intrusive load identification method based on multi-channel data is provided.
[0011] In one embodiment, a non-intrusive load identification method based on multi-channel data includes:
[0012] Collect current and voltage data of electrical equipment, and convert the current and voltage data into apparent power, active power and reactive power to form a training dataset;
[0013] A non-intrusive load identification model based on multi-channel data is constructed and trained using a training dataset and a triplet loss function;
[0014] Using a trained, non-intrusive load identification model based on multi-channel data, combined with apparent power, active power, and reactive power before and after a switching event, an embedded feature vector is output.
[0015] Based on cosine similarity, the similarity between the class center of various electrical appliances and the embedded feature vector is calculated, and the load identification result is determined according to the similarity calculation result.
[0016] In one embodiment, the process of collecting current and voltage data from electrical equipment and converting the current and voltage data into apparent power, active power, and reactive power to form a training dataset includes:
[0017] Collect current and voltage data of electrical equipment and use the collected current and voltage data as the initial training set;
[0018] Based on the cycle unit of the collected data, the apparent power, active power and reactive power in the initial training dataset are calculated, and the training dataset is constructed using the calculated apparent power, active power and reactive power data.
[0019] In one embodiment, the formula for calculating apparent power is:
[0020] P s =I rms ·U rms ;
[0021] The formula for calculating active power is:
[0022]
[0023] The formula for calculating reactive power is:
[0024]
[0025] In the formula, P s For apparent power, I rms For the effective current of one cycle, U rms P is the effective voltage of one cycle. a For active power, I i For the current data points in one cycle, U i For the voltage data points in one cycle, P da This refers to reactive power.
[0026] In one embodiment, constructing a non-intrusive load identification model based on multi-channel data and training it using a training dataset and a triplet loss function includes:
[0027] Construct an apparent power feature extraction channel, an active power feature extraction channel, and a reactive power feature extraction channel, and then concatenate the outputs of each feature extraction channel into a hybrid feature.
[0028] The channel attention mechanism is used to process the feature extraction channels in the mixed features. Based on a fully connected neural network, the weight values of each feature extraction channel are determined and weighted onto the feature extraction channels in the mixed features.
[0029] Based on residual networks and fully connected networks, and combined with feature extraction channels and channel attention mechanisms, a non-intrusive load identification model based on multi-channel data is constructed.
[0030] A non-intrusive load identification model based on multi-channel data is trained using the training dataset and the triplet loss function.
[0031] In one embodiment, the process of using a channel attention mechanism to process the feature extraction channels in the mixed features, based on a fully connected neural network, to determine the weight values of each feature extraction channel and weight them onto the feature extraction channels in the mixed features includes:
[0032] Average pooling is used to process each feature extraction channel in the hybrid feature to obtain the feature dimension of the hybrid feature, and features are extracted from the feature extraction channel according to the feature dimension;
[0033] Based on a fully connected neural network, the weight values of each feature extraction channel are determined by combining the extracted features, and then weighted onto the feature extraction channels in the mixed features.
[0034] In one embodiment, the expression for the triplet loss function is:
[0035] L=max(dis(a,p)-dis(a,n)+marg in,0);
[0036]
[0037] In the formula, L is the triple loss function value, dis is the cosine similarity, a is the anchor point in the triple, p is the positive instance in the triple, n is the negative instance in the triple, margin is a hyperparameter that defines the minimum difference that must be maintained between the similarity between anchor point a and positive instance p and the similarity between anchor point a and negative instance n, max(·, 0) is a function used to ensure that the loss function is non-negative, and dis(x, y) is the distance between two feature vectors x and y.
[0038] In one embodiment, the non-intrusive load identification model based on multi-channel data, trained and combined with apparent power, active power, and reactive power before and after a switching event, outputs an embedded feature vector including:
[0039] The timing of switching events is obtained using a switching event detection method, and voltage and current data before and after the switching event are extracted.
[0040] Calculate the apparent power, active power, and reactive power before and after the switching event based on the voltage and current data before and after the switching event.
[0041] The apparent power difference, active power difference, and reactive power difference before and after the switching event are calculated and input into the trained non-intrusive load identification model based on multi-channel data to obtain the embedded feature vector.
[0042] In one embodiment, the step of calculating the similarity between the class centers of various electrical appliances and the embedded feature vectors based on cosine similarity, and determining the load identification result based on the similarity calculation result, includes:
[0043] Extract the class centers of various electrical appliances, and use cosine similarity to calculate the similarity between the embedded feature vector and the class centers;
[0044] Based on the similarity ranking results, the appliances with the highest similarity are selected, and the type of the appliance is used as the recognition result of the input sample.
[0045] In one embodiment, the extraction formula for the electrical appliance category center is:
[0046]
[0047] In the formula, C A Let N be the feature center of Class A appliances, and P be the number of samples used to calculate the feature center. i Let f(·) be the i-th input sample of the A-class electrical appliance, and f(·) be a non-intrusive load identification model based on multi-channel data.
[0048] According to a second aspect of the present invention, a non-intrusive load identification system based on multi-channel data is provided.
[0049] In one embodiment, the non-intrusive load identification system based on multi-channel data includes:
[0050] The training dataset construction module is used to collect current and voltage data of electrical equipment and convert the current and voltage data into apparent power, active power and reactive power to form the training dataset.
[0051] The load identification model building module is used to build a non-intrusive load identification model based on multi-channel data and to train it using the training dataset and triplet loss function.
[0052] The embedded feature vector output module is used to output embedded feature vectors by combining the apparent power, active power and reactive power before and after the switching event with the trained non-intrusive load identification model based on multi-channel data.
[0053] The load result recognition module is used to calculate the similarity between the class center of various electrical appliances and the embedded feature vector based on cosine similarity, and to determine the load recognition result based on the similarity calculation result.
[0054] According to a third aspect of the present invention, a computer device is provided.
[0055] In some embodiments, the computer device includes a memory and a processor, the memory storing a computer program, and the processor executing the computer program to implement the steps of the method described above.
[0056] According to a fourth aspect of the present invention, a computer-readable storage medium is provided.
[0057] In one embodiment, a computer program is stored on the computer-readable storage medium, which, when executed by a processor, implements the steps of the above method.
[0058] The technical solutions provided by the embodiments of the present invention may include the following beneficial effects:
[0059] (1) In the identification process, the present invention first transforms the input and calculates the apparent power, active power and reactive power based on the high-frequency sampled current and voltage, so that the model changes from learning the current waveform to learning the apparent power, active power and reactive power; secondly, a non-intrusive load identification model with multi-channel data is designed and a channel attention mechanism is introduced to improve the model's ability to identify different types of electrical appliances with similar power; finally, the model is trained by the triplet loss function so that the model can extract the features of electrical appliances to achieve load identification, thereby improving the identification effect of low-power electrical appliances and the identification effect of different types of electrical appliances with similar power, thus improving the application scenarios of non-intrusive load identification.
[0060] (2) The present invention performs non-intrusive load identification based on apparent power, active power and reactive power, thereby effectively reducing the impact of high-power electrical appliances on current and increasing the identification effect of low-power electrical appliances.
[0061] (3) By setting up a multi-channel input module, the present invention can extract the characteristics of the input apparent power, active power and reactive power separately without interference.
[0062] (4) The feature enhancement method based on the SE channel attention mechanism of the present invention can enable the model to learn more important features, thereby improving the recognition effect of different types of electrical appliances with similar power.
[0063] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit the invention. Attached Figure Description
[0064] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.
[0065] Figure 1 This is a flowchart illustrating a non-intrusive load identification method based on multi-channel data according to an exemplary embodiment;
[0066] Figure 2 This is a flowchart illustrating a non-intrusive load identification process according to an exemplary embodiment;
[0067] Figure 3 This is a framework diagram of a non-intrusive load identification model for multi-channel input in a non-intrusive load identification method based on multi-channel data, according to an exemplary embodiment.
[0068] Figure 4 This is a framework diagram of a multi-channel input module in a non-intrusive load identification method based on multi-channel data, according to an exemplary embodiment.
[0069] Figure 5 This is a schematic diagram of the SE channel attention mechanism module in a non-intrusive load identification method based on multi-channel data, according to an exemplary embodiment.
[0070] Figure 6 This is a framework diagram of a feature output module in a non-intrusive load identification method based on multi-channel data, according to an exemplary embodiment.
[0071] Figure 7 This is a flowchart illustrating a non-intrusive load identification system based on multi-channel data, according to an exemplary embodiment.
[0072] Figure 8 This is a schematic diagram of the structure of a computer device according to an exemplary embodiment;
[0073] Figure 9 This is a diagram comparing the difference in current during a laptop's switching event with the current during a laptop without a switching event. Detailed Implementation
[0074] The following description and accompanying drawings fully illustrate specific embodiments described herein to enable those skilled in the art to practice them. Some embodiments may include or substitute parts and features of other embodiments. The scope of the embodiments herein encompasses the entire scope of the claims and all available equivalents thereof. Throughout this document, the terms “first,” “second,” etc., are used only to distinguish one element from another without requiring or implying any actual relationship or order between the elements. Indeed, a first element can also be referred to as a second element, and vice versa. Furthermore, the terms “comprising,” “including,” or any other variations thereof are intended to cover non-exclusive inclusion, such that a structure, apparatus, or device that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a structure, apparatus, or device. Without further limitation, an element defined by the phrase “comprising one…” does not exclude the presence of other identical elements in the structure, apparatus, or device that includes said element. The various embodiments described herein are presented in a progressive manner, with each embodiment focusing on its differences from other embodiments; similar or identical parts between embodiments can be referred to interchangeably.
[0075] The terms "longitudinal," "lateral," "upper," "lower," "front," "rear," "left," "right," "vertical," "horizontal," "top," "bottom," "inner," and "outer" used in this document to indicate orientation or positional relationships are based on the orientation or positional relationships shown in the accompanying drawings and are used only for the convenience of describing this document and simplifying the description. They do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as limiting the invention. In the description herein, unless otherwise specified and limited, the terms "installed," "connected," and "linked" should be interpreted broadly. For example, they can refer to mechanical or electrical connections, or internal connections between two elements, or direct connections or indirect connections through an intermediate medium. Those skilled in the art can understand the specific meaning of the above terms according to the specific circumstances.
[0076] In this document, unless otherwise stated, the term "multiple" means two or more.
[0077] In this article, the character " / " indicates that the objects before and after it are in an "or" relationship. For example, A / B means: A or B.
[0078] In this article, the term "and / or" describes an association between objects, indicating that three relationships can exist. For example, A and / or B means: A or B, or A and B.
[0079] It should be understood that although the steps in the flowchart are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order constraint on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the diagram may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the sub-steps or stages of other steps.
[0080] The modules in the apparatus or system of this application can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device in hardware form, or stored in the memory of a computer device in software form, so that the processor can call and execute the operations corresponding to each module.
[0081] Where there is no conflict, the embodiments and features in the embodiments of the present invention can be combined with each other.
[0082] Figure 1 An embodiment of the non-intrusive load identification method based on multi-channel data of the present invention is shown.
[0083] In this optional embodiment, the non-invasive load identification method based on multi-channel data includes:
[0084] Step S101: Collect current and voltage data of electrical equipment, and convert the current and voltage data into apparent power, active power and reactive power to form a training dataset;
[0085] Step S102: Construct a non-intrusive load identification model based on multi-channel data, and train it using the training dataset and triplet loss function;
[0086] Step S103: Using the trained non-intrusive load identification model based on multi-channel data, combined with the apparent power, active power and reactive power before and after the switching event of electrical equipment, output the embedded feature vector.
[0087] Step S104: Based on cosine similarity, calculate the similarity between the class center of each type of electrical appliance and the embedded feature vector, and determine the load identification result based on the similarity calculation result.
[0088] In this optional embodiment, the switching event of the electrical equipment includes any process where its state changes from on to off, or from off to on. Current and voltage data of the electrical equipment are collected before and after the switching event, and the current and voltage data are converted into apparent power, active power, and reactive power to form a training dataset, including:
[0089] Collect current and voltage data of electrical equipment and use the collected current and voltage data as the initial training set;
[0090] Based on the cycle unit of the collected data, the apparent power, active power and reactive power in the initial training dataset are calculated, and the training dataset is constructed using the calculated apparent power, active power and reactive power data.
[0091] Specifically, current and voltage data of electrical equipment are collected at a sampling rate of no less than 6.4 kHz. This data is then processed to convert it into apparent power, active power, and reactive power, forming a training dataset. The specific process is as follows:
[0092] Collect current and voltage data using data acquisition devices such as smart meters and oscilloscopes, with a sampling rate of no less than 6.4 kHz, collecting data from at least 8 types of electrical appliances, with at least 400 data points for each appliance, and each data point being at least 3 seconds long. Use the collected current and voltage data from these appliances as the initial training set. Note that if publicly available datasets also meet the above conditions, they can also be added to the initial training set.
[0093] The initial training set is processed, and the apparent power P is calculated. s Active power P a and reactive power P da Since the sampling rate of the current and voltage data is 6.4 kHz, each cycle of the acquired data contains 128 data points. Apparent power, active power, and reactive power are calculated using each cycle as a unit.
[0094] In this optional embodiment, the formula for calculating apparent power is:
[0095] P s =I rms ·U rms ;
[0096] The formula for calculating active power is:
[0097]
[0098] The formula for calculating reactive power is:
[0099]
[0100] In the formula, Ps For apparent power, I rms For the effective current of one cycle, U rms P is the effective voltage of one cycle. a For active power, I i For the current data points in one cycle, U i For the voltage data points in one cycle, P da This refers to reactive power.
[0101] If the sampling rate is f s If the sampling time is t, then after conversion to power data, the length of each data point will be determined by f. s ·t is changed to 50·t, where 50 represents the oscillation frequency of the power grid. The data converted to apparent power, active power, and reactive power forms the training dataset. The reason for using this data to train the model is that subtracting current data will introduce noise from high-power appliances, primarily caused by the reactive current of these appliances. In this embodiment, subtracting the apparent power, active power, and reactive power data before and after the switching event can, to some extent, offset the impact of the reactive power from high-power appliances.
[0102] In this optional embodiment, the construction of a non-intrusive load identification model based on multi-channel data, and the training using a training dataset and a triplet loss function, includes:
[0103] Construct an apparent power feature extraction channel, an active power feature extraction channel, and a reactive power feature extraction channel, and then concatenate the outputs of each feature extraction channel into a hybrid feature.
[0104] The channel attention mechanism is used to process the feature extraction channels in the mixed features. Based on a fully connected neural network, the weight values of each feature extraction channel are determined and weighted onto the feature extraction channels in the mixed features.
[0105] Based on residual networks and fully connected networks, and combined with feature extraction channels and channel attention mechanisms, a non-intrusive load identification model based on multi-channel data is constructed.
[0106] A non-intrusive load identification model based on multi-channel data is trained using the training dataset and the triplet loss function.
[0107] In this optional embodiment, the process of using a channel attention mechanism to process the feature extraction channels in the mixed features, and determining the weight values of each feature extraction channel based on a fully connected neural network, and weighting them onto the feature extraction channels in the mixed features, includes:
[0108] Average pooling is used to process each feature extraction channel in the hybrid feature to obtain the feature dimension of the hybrid feature, and features are extracted from the feature extraction channel according to the feature dimension;
[0109] Based on a fully connected neural network, the weight values of each feature extraction channel are determined by combining the extracted features, and then weighted onto the feature extraction channels in the mixed features.
[0110] In this optional embodiment, the expression for the triplet loss function is:
[0111] L=max(dis(a,p)-dis(a,n)+marg in,0);
[0112]
[0113] In the formula, L is the triplet loss function value, dis is the cosine similarity, a is the anchor point in the triplet, p is the positive instance in the triplet that belongs to the same class as a, n is the negative instance in the triplet that does not belong to the same class as a, margin is a hyperparameter that defines the minimum difference that must be maintained between the similarity between anchor point a and positive instance p and the similarity between anchor point a and negative instance n, max(·, 0) is a function used to ensure that the loss function is non-negative, and dis(x, y) is the distance between two feature vectors x and y.
[0114] Specifically, a non-intrusive load identification model based on multi-channel data is constructed. This model mainly consists of a multi-channel input module, an attention mechanism module, and a feature output module.
[0115] First, construct the multi-channel input module, which mainly includes the following steps:
[0116] A multi-channel input module is constructed. The inputs to this module include apparent power, active power, and reactive power. Each of these three inputs is fed into its respective channel for initial feature extraction. The three channels allow the model to extract features of apparent power, active power, and reactive power independently. The structure of the multi-channel input module is as follows: Figure 4 As shown, the input module is divided into three parts. From top to bottom, the three parts are the apparent power feature extraction channel, the active power feature extraction channel, and the reactive power feature extraction channel. The three channels have the same structure, all using a residual convolutional network, where the convolutional layers are 1D convolutional networks and the number of residual blocks is no less than 8. The input data for the apparent power feature extraction channel is apparent power, the input data for the active power feature extraction channel is active power, and the input data for the reactive power feature extraction channel is reactive power. The outputs of the three channels are F... ps F pa F pda .
[0117] The outputs of the three channels are concatenated to obtain the blended features. The concatenation formula is shown below:
[0118] F mix =concat(F ps ,F pa ,F pda );
[0119] In the formula, F mix For mixed features, `cancat` is a splicing operation that combines the apparent power F. ps Active power F pa and reactive power F pda The outputs of the three feature channels are concatenated along the channel dimension to form a fused multi-channel feature representation.
[0120] It is important to note that, unlike a 3-channel convolutional neural network, the multi-channel input module constructed in this embodiment does not interfere with each other when extracting apparent power, active power, and reactive power. If the data is set as 3-dimensional data input to a 3-channel convolutional layer, the convolutional network will cause interference in feature extraction, making it impossible to extract the individual features. The multi-channel input module in this embodiment avoids this problem.
[0121] Secondly, we construct the attention mechanism module, whose structure is as follows: Figure 5 As shown, its construction and data processing mainly include the following steps:
[0122] A channel attention mechanism (SE) is used to process the hybrid features. First, global average pooling is applied to each channel of the hybrid feature. If the dimensions of the hybrid feature are [B, C, Length], where B represents the batch size, C represents the number of channels, and Length represents the length of the hybrid feature, then after global average pooling, the feature dimension is [B, C, 1]. The extracted feature is represented as F. mixtemp .
[0123] A weight value is generated for each feature channel. This weight value is obtained through a fully connected neural network using the following formula:
[0124] Value temp =F mixtemp ·Dns1 C×X ;
[0125] Value = Value temp ·Dns2 X×C ;
[0126] In the formula, Value tempValue represents the weight values output by the first fully connected layer, Value represents the weight values output by the second fully connected layer, and Dns represents the fully connected layer. C×X This represents the first fully connected layer, with C input channels and X output neurons, where X is a hyperparameter. (Dns2) X×C This indicates the second fully connected layer, with X input channels and C output neurons. The resulting Value, after a reshape operation, has dimensions [B, C, 1].
[0127] The obtained weights are weighted onto each channel feature to obtain F. mixtemp2 The formula is as follows:
[0128] F mixtemp2 =Value2·F mixtemp ;
[0129] In the formula, F mixtemp2 Value1 represents the weighted feature vector for each channel, and Value2 represents the weight.
[0130] Next, the feature output module is constructed, and the results of the feature output module are as follows. Figure 6 As shown, it mainly includes a residual network and a fully connected network. The number of residual blocks is no less than 4. The output of the feature output module is the embedded feature, which is the output of the entire model and represents the representation of an input sample in the feature space.
[0131] Next, a triplet loss function is set to train the model. By training the model with this loss function, the model can continuously learn the similarity between input samples, thereby increasing the similarity between samples of the same type of electrical appliances and reducing the similarity between samples of different types of electrical appliances.
[0132] Finally, model training. The specific process is as follows: the constructed multi-channel input module, attention mechanism module, and feature output module are concatenated to obtain a non-intrusive load recognition model based on multi-channel data. The model is then trained using the triplet loss function from step one and the training data. The model training ends when the loss function converges to a certain value and no longer shows a significant decrease.
[0133] In this optional embodiment, the non-intrusive load identification model based on multi-channel data, which is trained, combines the apparent power, active power, and reactive power before and after the switching event to output an embedded feature vector, includes:
[0134] The timing of switching events is obtained using a switching event detection method, and voltage and current data before and after the switching event are extracted.
[0135] Calculate the apparent power, active power, and reactive power before and after the switching event based on the voltage and current data before and after the switching event.
[0136] The apparent power difference, active power difference, and reactive power difference before and after the switching event are calculated and input into the trained non-intrusive load identification model based on multi-channel data to obtain the embedded feature vector.
[0137] In this optional embodiment, the step of calculating the similarity between the class centers of various electrical appliances and the embedded feature vectors based on cosine similarity, and determining the load identification result based on the similarity calculation result, includes:
[0138] Extract the class centers of various electrical appliances, and use cosine similarity to calculate the similarity between the embedded feature vector and the class centers;
[0139] Based on the similarity ranking results, the appliances with the highest similarity are selected, and the type of the appliance is used as the recognition result of the input sample.
[0140] Specifically, after the model training is completed, the class centers of various electrical appliances are extracted. The formula for extracting the class centers of electrical appliances is as follows:
[0141]
[0142] In the formula, C A Let N be the feature center of Class A appliances, and P be the number of samples used to calculate the feature center. i Let f(·) be the i-th input sample of the A-class electrical appliance, and f(·) be a non-intrusive load identification model based on multi-channel data; it should be noted that P i The dimensions are [Length, h3], where Length represents the length of the input sample and 3 represents the data dimension, including active power, reactive power, and volatile power. After the class centers are calculated, non-intrusive load identification can be achieved by comparing the embedded features of the input samples with the class centers. The process is as follows: Figure 7 The specific steps are shown below:
[0143] First, the timing of the switch event is obtained through a switch event detection method. Switch events are not within the scope of this embodiment.
[0144] Secondly, voltage and current data before and after the switching event are extracted, and the apparent power, active power, and reactive power before and after the switching event are calculated. The apparent power, active power, and reactive power before the switching event are denoted as P. fs P fa and P fda The apparent power, active power, and reactive power after the switching event are denoted as P, respectively. hs P ha and Phda .
[0145] Then, the difference between the power before and after is used as the input to the model, and the calculation formula is shown below:
[0146] P s-input =|P fs -P hs |;
[0147] P s-input =|P fs -P hs |;
[0148] P da-input =|P fda -P hda |;
[0149] In the formula, P s-input P represents the difference in apparent power before and after a switching event. a-input P represents the difference in active power before and after the switching event. da-input This represents the difference in reactive power before and after the switching event, i.e., P. s-input P a-input P da-input This is the input to the model.
[0150] Finally, P s-input P a-input P da-input After inputting the model, embedded feature vectors are obtained. These vectors are then compared with each class center using cosine similarity to obtain the similarity result. The class to which a sample belongs is determined by which class center it is closest to. This process can be expressed by the following formula:
[0151] Embeed = f(P);
[0152] Sim = dis(Embeed, C x );
[0153] Where P represents the input of the model, i.e., Pinput s-input P a-input P da-input The data consists of three dimensions, where Embeed represents the feature vector and sim represents the similarity between Embeed and C. x similarity, C x This represents the class center of all electrical appliance categories. The electrical appliance category corresponding to the highest similarity value obtained from Sim is the recognition result of the input sample.
[0154] Furthermore, in this embodiment, after S104, the method further includes verifying and correcting the load identification result corresponding to the embedded feature vector based on rules and Bayesian inference algorithms, specifically including the following steps:
[0155] First, a rule base is constructed, specifically as follows: A thorough analysis of the operating characteristics of various electrical devices is conducted, and combined with actual power consumption scenarios, logical rules for device operation are summarized. For example, an electric water heater enters a heat preservation state after heating, and its power drops sharply from a high-power heating state to a low-power heat preservation state; a washing machine only enters the spin-drying stage after completing the washing cycle, and the two stages do not run simultaneously. Power association rules are formulated based on the power range and combined usage of different devices. For instance, in a typical household, the total power of all lighting devices generally does not exceed 1000 watts; high-power devices such as air conditioners and electric heaters usually do not operate at full power simultaneously, and if the total power of both operating simultaneously exceeds the safe carrying capacity of the household circuit, it is considered abnormal; time-series rules are set considering the time characteristics of device operation. A refrigerator's start-stop cycle is typically 15-60 minutes. Multiple start-stop cycles within a short period (e.g., 5 minutes) do not conform to normal operating patterns. An electric kettle usually takes 3-10 minutes to boil water; excessively short or long heating times may lead to recognition errors. A dynamic update mechanism for the rule base should be established to adjust and supplement the rule base in a timely manner as new devices are added, equipment ages and its operating characteristics change, and user electricity consumption habits evolve. For example, when a new inverter air conditioner is added to a home, its operating power characteristics differ from traditional fixed-frequency air conditioners, requiring the addition of corresponding rules.
[0156] Secondly, rule-based verification is performed as follows: From the load identification results corresponding to the embedded feature vectors, information such as the identified device type, device operating status (e.g., power on, power off, high power operation, low power operation), and corresponding power values are extracted. This extracted information is then matched against the rules in the rule base one by one. First, the device operating logic rules are checked to determine if the identified device operating status conforms to its normal operating process. Next, the power association rules are verified to check if the total power of the device combination is within a reasonable range and if there are any power conflicts. Finally, the time series rules are checked to confirm if the device's operating time conforms to the normal cycle. If the identification result does not match any rule, the identification result is marked as suspicious. For example, if the identification result shows that the refrigerator starts and stops 3 times within 5 minutes, violating the refrigerator's normal start-stop cycle rule, it is marked as suspicious; if the air conditioner and electric heater are both running at full power simultaneously, and the total power exceeds the household circuit's carrying capacity, the identification result is also marked as suspicious.
[0157] Finally, the correction based on Bayesian inference is as follows: Historical electricity consumption data related to suspicious results is collected, including the operating status and power data of various devices under similar electricity consumption scenarios at the same time points over a past period (e.g., the past week or month). Simultaneously, current real-time power, current, voltage, and other feature information are acquired as input data for Bayesian inference. Based on historical data, the prior probability of various devices appearing in different states is calculated. For example, statistical analysis shows that the prior probability of a television being on between 7-9 PM is 0.7. The conditional probability of the current real-time feature data appearing under various device operating states is calculated. For example, the conditional probability of the current power fluctuation range appearing when the refrigerator is known to be in cooling mode is 0.8. The posterior probability of various devices being in different operating states under the current feature data is calculated using the Bayesian formula. By comparing the magnitudes of the posterior probabilities of different devices, the most likely device operating state is determined. For example, if the posterior probability of the refrigerator being in cooling mode is calculated to be 0.6 under the current feature data, while the posterior probabilities of other devices being in the corresponding mode are all lower than this value, then it is more reasonable to consider the refrigerator to be in cooling mode. The operating mode of the device with the highest calculated posterior probability is taken as the corrected load identification result. If the corrected result differs from the original identification result, the load identification result is updated, and this correction process is recorded for subsequent optimization of the rule base and inference model.
[0158] Figure 2 An embodiment of a non-intrusive load identification system based on multi-channel data according to the present invention is shown.
[0159] In this optional embodiment, the non-invasive load identification system based on multi-channel data includes:
[0160] The training dataset construction module 201 is used to collect current and voltage data of electrical equipment and convert the current and voltage data into apparent power, active power and reactive power to form the training dataset.
[0161] The load identification model building module 202 is used to build a non-intrusive load identification model based on multi-channel data and to train it using a training dataset and a triplet loss function.
[0162] The embedded feature vector output module 203 is used to output an embedded feature vector by combining the apparent power, active power and reactive power before and after the switching event using the trained non-intrusive load identification model based on multi-channel data.
[0163] The load result recognition module 204 is used to calculate the similarity between the class center of various electrical appliances and the embedded feature vector based on cosine similarity, and determine the load recognition result based on the similarity calculation result.
[0164] In one embodiment, a computer device is provided, which may be a server, and its internal structure diagram may be as follows: Figure 8 As shown, the computer device includes a processor, memory, and a network interface connected via a system bus. The processor provides computing and control capabilities. The memory includes a non-volatile storage medium and internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The database stores static and dynamic information data. The network interface communicates with external terminals via a network connection. When the computer program is executed by the processor, it implements the steps in the above method embodiments.
[0165] Those skilled in the art will understand that Figure 8 The structure shown is merely a block diagram of a portion of the structure related to the present invention and does not constitute a limitation on the computer device to which the present invention is applied. A specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0166] In addition, the present invention also provides a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps in the above method embodiments.
[0167] In addition, the present invention also provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps in the above method embodiments.
[0168] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the methods described above. Any references to memory, storage, databases, or other media used in the embodiments provided by this invention can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, or optical storage, etc. Volatile memory can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM), etc.
[0169] This invention is not limited to the structures described above and shown in the accompanying drawings, and various modifications and changes can be made without departing from its scope. The scope of this invention is limited only by the appended claims.
Claims
1. A non-intrusive load identification method based on multi-channel data, characterized in that, include: Collect current and voltage data of electrical equipment, and convert the current and voltage data into apparent power, active power and reactive power to form a training dataset; A non-intrusive load identification model based on multi-channel data is constructed and trained using a training dataset and a triplet loss function; Using a trained, non-intrusive load identification model based on multi-channel data, combined with apparent power, active power, and reactive power before and after a switching event, an embedded feature vector is output. Based on cosine similarity, the similarity between the class center of various electrical appliances and the embedded feature vector is calculated, and the load identification result is determined according to the similarity calculation result.
2. The non-intrusive load identification method based on multi-channel data according to claim 1, characterized in that, The current and voltage data of the collected electrical equipment are converted into apparent power, active power, and reactive power to form a training dataset, which includes: Collect current and voltage data of electrical equipment and use the collected current and voltage data as the initial training set; Based on the cycle unit of the collected data, the apparent power, active power and reactive power in the initial training dataset are calculated, and the training dataset is constructed using the calculated apparent power, active power and reactive power data.
3. The non-intrusive load identification method based on multi-channel data according to claim 2, characterized in that, The formula for calculating apparent power is: P s =I rms ·IN rms ; The formula for calculating active power is: The formula for calculating reactive power is: In the formula, P s For apparent power, I rms For the effective current of one cycle, U rms P is the effective voltage of one cycle. a For active power, I i For the current data points in one cycle, U i For voltage data points in one cycle, P da This refers to reactive power.
4. The non-intrusive load identification method based on multi-channel data according to claim 1, characterized in that, The construction of a non-intrusive load identification model based on multi-channel data, and its training using a training dataset and a triplet loss function, includes: Construct an apparent power feature extraction channel, an active power feature extraction channel, and a reactive power feature extraction channel, and then concatenate the outputs of each feature extraction channel into a hybrid feature. The channel attention mechanism is used to process the feature extraction channels in the mixed features. Based on a fully connected neural network, the weight values of each feature extraction channel are determined and weighted onto the feature extraction channels in the mixed features. Based on residual networks and fully connected networks, and combined with feature extraction channels and channel attention mechanisms, a non-intrusive load identification model based on multi-channel data is constructed. A non-intrusive load identification model based on multi-channel data is trained using the training dataset and the triplet loss function.
5. The non-intrusive load identification method based on multi-channel data according to claim 4, characterized in that, The process of using a channel attention mechanism to process the feature extraction channels in the mixed features, based on a fully connected neural network, to determine the weight values of each feature extraction channel and weight them onto the feature extraction channels in the mixed features includes: Average pooling is used to process each feature extraction channel in the hybrid feature to obtain the feature dimension of the hybrid feature, and features are extracted from the feature extraction channel according to the feature dimension; Based on a fully connected neural network, the weight values of each feature extraction channel are determined by combining the extracted features, and then weighted onto the feature extraction channels in the mixed features.
6. The non-intrusive load identification method based on multi-channel data according to claim 4, characterized in that, The expression for the triplet loss function is: L=max(dis(a,p)-dis(a,n)+margin,0); In the formula, L is the triplet loss function value, dis is the cosine similarity, a is the anchor point in the triplet, p is the positive instance in the triplet, n is the negative instance in the triplet, margin is a hyperparameter that defines the minimum difference that must be maintained between the similarity between anchor point a and positive instance p and the similarity between anchor point a and negative instance n, max(·, 0) is a function used to ensure that the loss function is non-negative, and dis(x, y) is the distance between two feature vectors x and y.
7. The non-intrusive load identification method based on multi-channel data according to claim 1, characterized in that, The non-intrusive load identification model based on multi-channel data, trained and combined with apparent power, active power, and reactive power before and after a switching event, outputs an embedded feature vector including: The timing of switching events is obtained using a switching event detection method, and voltage and current data before and after the switching event are extracted. Calculate the apparent power, active power, and reactive power before and after the switching event based on the voltage and current data before and after the switching event. The apparent power difference, active power difference, and reactive power difference before and after the switching event are calculated and input into the trained non-intrusive load identification model based on multi-channel data to obtain the embedded feature vector.
8. The non-intrusive load identification method based on multi-channel data according to claim 6, characterized in that, The process of calculating the similarity between the class centers of various electrical appliances and their embedded feature vectors based on cosine similarity, and determining the load identification result based on the similarity calculation results, includes: Extract the class centers of various electrical appliances, and use cosine similarity to calculate the similarity between the embedded feature vector and the class centers; Based on the similarity ranking results, the appliances with the highest similarity are selected, and the type of the appliance is used as the recognition result of the input sample.
9. The non-intrusive load identification method based on multi-channel data according to claim 8, characterized in that, The extraction formula for the electrical appliance category center is: In the formula, C A Let N be the feature center of Class A appliances, and P be the number of samples used to calculate the feature center. i Let f(·) be the i-th input sample of the A-class electrical appliance, and f(·) be a non-intrusive load identification model based on multi-channel data.
10. A non-intrusive load identification system based on multi-channel data, characterized in that, include: The training dataset construction module is used to collect current and voltage data of electrical equipment and convert the current and voltage data into apparent power, active power and reactive power to form the training dataset. The load identification model building module is used to build a non-intrusive load identification model based on multi-channel data and to train it using the training dataset and triplet loss function. The embedded feature vector output module is used to output embedded feature vectors by combining the apparent power, active power and reactive power before and after the switching event with the trained non-intrusive load identification model based on multi-channel data. The load result recognition module is used to calculate the similarity between the class center of various electrical appliances and the embedded feature vector based on cosine similarity, and to determine the load recognition result based on the similarity calculation result.