Non-intrusive load disaggregation method and system based on multi-feature event classification
By employing a non-intrusive load decomposition method based on multi-feature event classification, and utilizing low-frequency power features and a Transformer network model to mask the no-working-range, the method solves the problem of misjudgment when equipment operating states are similar, achieving higher load decomposition accuracy and efficiency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-07
- Publication Date
- 2026-03-03
AI Technical Summary
Existing non-intrusive load monitoring technologies face challenges in terms of equipment classification accuracy and decomposition performance, especially when equipment is in similar operating conditions, which can easily lead to misjudgment, resulting in decreased decomposition performance. Furthermore, high-frequency data increases the cost of load monitoring.
A non-intrusive load decomposition method based on multi-feature event classification is adopted. Low-frequency power features are used for event detection and classification. A CNN network model is used to identify device switching events. A Transformer network model is used to mask the non-working range in the total power data, shielding interference information and improving decomposition accuracy.
It can accurately identify the operating time period of the equipment, ignore data interference during the period when the equipment is not running, improve the accuracy and efficiency of the load decomposition model, and avoid the problem of misjudgment in the existing technology.
Smart Images

Figure CN116166992B_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of load monitoring technology in the field of smart electricity consumption, and specifically relates to a non-intrusive load decomposition method based on multi-feature event classification. Background Technology
[0002] With societal development, the demand for energy is increasing dramatically. Fossil fuels, represented by oil, account for over 40% of energy consumption. To reduce dependence on fossil fuels and promote the development of a low-carbon economy and clean energy, it is necessary to improve the efficiency of electricity utilization. Therefore, the concept of load monitoring has been proposed.
[0003] In the context of promoting smart grids, achieving efficient energy utilization requires acquiring information on the usage of user-owned equipment, analyzing electricity consumption data, and providing feedback to guide users towards economical and rational electricity consumption behaviors. In past load monitoring, to ensure accurate equipment classification, high-frequency power data was often added to load characteristics, which undoubtedly increased the cost of load monitoring. With the increasing number of electrical devices, similar operating states may occur among them, leading to misjudgments of equipment operating ranges by the model during load decomposition tasks, resulting in a significant decrease in decomposition performance. Therefore, ensuring the task accuracy of the NILM system without increasing model complexity is a significant challenge for non-intrusive load monitoring. Summary of the Invention
[0004] The purpose of this invention is to propose a non-intrusive load decomposition method based on multi-feature event classification to solve the technical problems mentioned above. This decomposition method can accurately classify events generated by equipment using low-frequency power characteristics, while also allowing the load decomposition model to focus more on the operating status of the equipment and ignore the inactive state.
[0005] To achieve the above objectives, the present invention employs the following technical solution:
[0006] In a first aspect, the present invention provides a non-intrusive load decomposition method based on multi-feature event classification, the load decomposition method comprising:
[0007] Step 1: Obtain the total power data of the load type under study from the existing load dataset, and determine the true value of the power data for each load type;
[0008] Step 2: Preprocess the data of the load to be studied to obtain the total power data and the true value of the power data of each load, and perform event detection on the total power data to obtain M state change quantities of multiple loads;
[0009] The event detection process is as follows: A sliding window length is set, and the processed total power data is processed using a sliding window. One sliding window length corresponds to one original power sequence. The mean within each window is calculated using the sliding window method, and the mean sequence is subtracted from the original power sequence to obtain the residual power sequence. This maps load events to the vicinity of zero. When an event occurs, for simple loads where power characteristics undergo a step change, the extreme values and slopes of the residual power are compared. If both the extreme values and slopes exceed the set thresholds, an event is determined to have occurred. For complex loads with long transition times, the occurrence of an event is determined by comparing the number of zero-crossing points of the residual power within the window to see if it exceeds the zero-crossing threshold.
[0010] Step 3: Construct a classification dataset
[0011] The original power sequence and corresponding residual power sequence of the event are selected. The original power sequence of the event is then processed by step-wise transformation. After step-wise transformation, the original power sequence is processed by FFT to obtain amplitude and phase sequences of the same length as the original power sequence. The amplitude sequence, phase sequence, residual power sequence, and original power sequence constitute multiple load features. Finally, the multiple load features are concatenated into a single sample, with each sample corresponding to the state change of the load. A large number of samples of the data of the load to be studied and the corresponding state changes of the load constitute a classification dataset.
[0012] Step 4: Train the CNN network model using the classification dataset. The input to the CNN network model is multiple load features, and the number of output nodes of the CNN network model is the sum of the number of all state changes for all types of loads plus 1; adding 1 indicates that the CNN network model distinguishes between no events.
[0013] The trained CNN network model is used to classify the detected event sequences and obtain the switching event results for each load;
[0014] Step 5: Use the trained CNN network model to obtain the event classification results, locate the working range of the target load based on the event classification results, mask the non-working range in the processed total power data, and train the Transformer network model using the masked total power data and the ground truth power data of each corresponding processed load.
[0015] The trained Transformer network model is used to decompose the total input load to obtain the power waveform of the target device.
[0016] Sensors are installed inside existing user rooms and at entrances to monitor the usage of loads inside user rooms, acquire total power data of users and power data of each type of load, and select the low-frequency power characteristics used; according to different loads inside user rooms, the event transition duration is obtained, and corresponding thresholds for power difference, slope and extreme values before and after the event, as well as zero-crossing thresholds are set. The total power monitored is preprocessed before event detection to obtain the original power sequence of the event, and then the user load is decomposed through steps 3-5.
[0017] The CNN network model includes an input layer, a convolutional layer, a pooling layer, a linear layer, and an output layer. The convolutional kernel size is 3×1, the number of convolutional kernels is 3, and the boundary padding is set to "same" to ensure that the size of the feature sequence remains unchanged after the convolution operation. The results of the three convolution calculations are summed and then input into the ReLU activation function to obtain the convolutional layer results. The max pooling method is used to extract features.
[0018] Two linear layers were used. The number of input nodes of the first linear layer was equal to the length of the data after stretching the result of the convolutional pooling layer. The number of output nodes of the first linear layer was set to 128. The number of input nodes of the second linear layer was equal to the number of output nodes of the first linear layer. The number of output nodes of the second linear layer was 32.
[0019] The output layer is fully connected to the previous layer, and the number of output nodes in the output layer is set to 2N+1, where N is the number of events that the training model is required to classify for several types of loads, and 1 is added because the model needs to distinguish between no events; softmax is used as the activation function for the last layer.
[0020] During training, the label corresponding to each event is converted into a one-hot encoding, which is used to calculate the loss value. The loss value gradient descent method is used to update the parameters of the CNN network model.
[0021] The paddingmask operation is used to mask out the regions that are not in use. At the input of the decoder of the Transformer network model, the masking operation needs to be performed. The Transformer network model has 8 heads, the word vector dimension is 512, and the encoder and decoder contain 6 layers. The linear layers inside the encoder and decoder are set to have 2048 input nodes, the word vector dimension is set to 128, and the internal dropout is set to 0.1.
[0022] The existing load dataset is either the REDD dataset or the UK-DALE dataset.
[0023] In a second aspect, the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, can implement the steps of the load decomposition method described above.
[0024] Thirdly, the present invention provides a non-intrusive load decomposition system based on multi-feature event classification, characterized in that the system comprises:
[0025] The data acquisition module is used to acquire the total power data and single load power data of the load types under study;
[0026] The data preprocessing module is used to preprocess the power data obtained by the data acquisition module;
[0027] The working area localization module is used to complete event detection, select the original power sequence of the event using the event detection results, perform time-frequency domain transformation to form a feature vector composed of time-domain features and frequency-domain features, and construct a CNN network model to classify the type of event and locate the working area of the target load based on the event classification results.
[0028] The load decomposition module masks the non-working intervals in the processed total power data, and uses the masked total power data and the corresponding ground truth power value of each individual load to train a Transformer network model. The trained Transformer network model is then used to decompose the input total load to obtain the power waveform of the target device.
[0029] Compared with existing technologies, this invention proposes a non-intrusive load decomposition method based on multi-feature event classification. The beneficial effects of this invention are:
[0030] (1) The decomposition method of this invention classifies events using time-frequency domain features. Based on the event classification results, the working time period of the device can be determined, and the working range of the device can be located. By utilizing the self-attention mechanism of Transformer to ignore data during periods when the device is not running, attention can be focused on the working range of the target device based on the located working range, thus enabling better prediction of the operating power of the target device. For example... Figure 3 As shown, at the end of the first working cycle of the refrigerator, the dishwasher starts working, creating a similar operating state to the refrigerator. This causes the decomposition model to mistakenly identify the refrigerator as starting to work, resulting in a deviation in the decomposition results. In this invention, after masking irrelevant information, i.e. data during the period when the target device is not running, the decomposition model can effectively ignore the interference of other loads.
[0031] (2) This invention uses time-frequency domain transformation for low-frequency power, selecting the amplitude sequence, phase sequence, and residual power sequence corresponding to the original power sequence of the event, and using the feature vector composed of multiple features as training data, which significantly improves the event classification accuracy of the subsequent event classification network model. The event classification network model can identify the turn-on and turn-off events of the target device, enabling the function of operating range positioning and obtaining the operating range of the target device. This avoids the shortcomings of existing load monitoring tasks, which only detect which load is working but cannot provide the accurate operating range of the load. Attached Figure Description
[0032] To more clearly illustrate the technical solutions of the present invention, the accompanying drawings required for the embodiments are briefly described below. The following drawings only illustrate the embodiments given in this invention and are part of the specification, but should not be considered as limiting the scope. Other researchers can obtain other related drawings without creative effort.
[0033] Figure 1 This is a schematic diagram of the framework structure of the non-intrusive load decomposition system based on multi-feature event classification of the present invention.
[0034] Figure 2 This is a schematic diagram of event detection in Example 2.
[0035] Figure 3 This is an exploded view of the refrigerator in Example 1.
[0036] Figure 4 This is an exploded view of the refrigerator in Example 2. Detailed Implementation
[0037] The embodiments of the present invention will be described in detail below with reference to the accompanying drawings. These embodiments are implemented based on the technical route designed in this invention, and the scope of protection of this invention is not limited to the following embodiments.
[0038] The non-intrusive load decomposition method focusing on a specific interval proposed in this application has the following structure diagram: Figure 1 As shown,
[0039] Step 1: Obtain the total power data of the load under study from the existing dataset and determine the true power value of each load, or install sensors at the electricity meters and equipment in the user's residence to obtain the user's electricity consumption information and select the low-frequency power characteristics inside the user's residence. This embodiment uses a public dataset, eliminating the need for on-site data collection using a data acquisition platform.
[0040] Step 2: Perform data preprocessing on the collected data, including handling missing and outlier data. Taking the REDD dataset as an example, the dataset contains power data for a single appliance at a sampling frequency of 1 / 3 Hz, and power data for all appliances at a sampling frequency of 1 Hz.
[0041] Step 3: Perform event detection on the continuous power sequence (i.e., the processed total power data) of the selected sampling points to determine when the appliances start working and when they stop working. The sequences that are identified as appliance on or off events need to be recorded. Using residual power to detect events is effective not only for step loads but also for detecting events of appliances with long transition states.
[0042] Step 4: Construct multiple load features, namely the original power sequence, residual power sequence, FFT amplitude sequence, and FFT phase sequence. Each feature sequence (i.e., one original power sequence) has 50 sampling points, and the four feature sequences have 200 sampling points. Standardize the data input format and magnitude of each feature sequence and concatenate them into a feature vector to distinguish different events. Build a supervised classification network model. The number of input nodes in the supervised classification network model is related to the sample length, and the number of output nodes is related to the number of events to be classified. The supervised classification network model is used to classify the detected event sequences to obtain the switching event results for each load.
[0043] Step 5: Determine the current load operating status based on the event classification results. Mask the areas where the target device is not operating on the processed total power data and mark the power values of individual loads. Then, build a Transformer network model to decompose the input total load and obtain the power waveform of the target device.
[0044] In step 1, since on-site power data collection is inefficient and suffers from problems such as large errors, high costs, long cycles, and inconvenient maintenance, using publicly available datasets, such as the REDD dataset and the UK-DALE dataset, is an economical and effective method from the perspective of training an effective model. Installing one or more sensors at the user's power inlet—that is, at the power supply line from which all loads originate—is a non-intrusive power data collection method. It requires no changes to the user's circuit structure or the installation of multiple sensors; simply analyzing the total power data using intelligent devices allows for the estimation of the operating status of individual loads.
[0045] In step 2, using public datasets inevitably leads to data loss or anomalies, usually caused by equipment malfunctions or the inherent characteristics of the workload. Lost and anomalies can interfere with subsequent event classification models (supervised classification network models) and decomposition models (Transformer network models), thus requiring handling of these two situations.
[0046] Events can be detected using a single-time-scale event detector. A rolling median filter is used to filter the original power sequence by setting a certain window length. Meaning within the window not only eliminates small-amplitude noise but also preserves clear event edges when removing DC bias. The power sequence obtained by subtracting the mean sequence from the original power sequence is called the residual sequence, and it is used as the basis for event determination.
[0047] Step 3: In this invention, the characteristic sequence of the load is processed, and the residual power of the original power sequence is calculated, so that the events of the load in the data are mapped to the vicinity of zero. When an event occurs, for simple loads where the power characteristics will change abruptly, the extreme values and slopes of the residual power can be compared to determine whether an event has occurred; for complex loads with long transition times, the number of zero-crossing points of the residual power within the window can be compared to determine whether an event has occurred.
[0048] The original power sequence is processed to assess and modify the reasonableness of the input data. Furthermore, data standardization is necessary to facilitate successful model training. Pre-labeled event types are selected as the training dataset for the classification model. However, to increase the discriminative power between events and help the classification model analyze differences in new features, new time-frequency domain features can be added to the existing low-frequency power data.
[0049] After constructing the dataset, a one-dimensional convolutional neural network model is built. Since this invention uses low-frequency data, the length of the load event sequence is short at low sampling rates, so a classic convolutional neural network structure can be used.
[0050] In step 4: Regarding feature extraction, for low-frequency power features, time-frequency domain transformation can be used to construct other load features. The obtained frequency domain features need to be concatenated with the original power sequence to form a feature vector, which represents the unique label of the event. For event classification, a one-dimensional convolutional neural network is used as the classification model. The network input is a feature vector composed of multiple features, and the output is the load event type. In this embodiment, the load event types are divided into on-time events and off-time events. For sequences that are misidentified as events, the classification model should output a result indicating no event occurred. Therefore, the model's output nodes should include the load's on-time and off-time events, as well as the result indicating no event occurred.
[0051] Using the event results from the previous step, the power-on and power-off events of the target device are located, and this segment is masked using a mask. The masking method is detailed in the embodiment. Next, a load breakdown dataset is built. The input of this dataset is the total load, and the output is the power data of individual devices. The masking operation is performed on the input samples.
[0052] The load decomposition model is then trained. This invention uses a sequence-to-sequence network model consisting of an encoder and a decoder. During training, total load data is input from the encoder, and individual load data is input from the decoder. The output of the decomposition model and the actual power loss value of the target device are calculated. Parameters are corrected using an optimized gradient descent method. During the testing phase, the total load data to be predicted is added to the encoder, and the model sequentially predicts the power data of individual loads.
[0053] For load decomposition, the total load power data is used as the model input, and the target load power sequence is used as the output. Before training, to shield against interference from similar loads outside the working range, these sequences need to be masked so that the network model will not notice them during subsequent self-attention calculations.
[0054] In this invention, the time it takes for one state to transition to another steady state is called the transition time. A transition time greater than five times the sampling interval is considered a long transition time. A complex load with a long transition time refers to a load whose transition process is a non-step change. In this embodiment, the dataset has a 1-second sampling interval. When an event occurs, a simple load typically completes the event change in 1-2 seconds. This invention can detect events for both simple and complex devices, and the mean change is not affected by the window position. The residual power event detection method is not only suitable for event detection of simple loads at low frequencies, but also for complex loads with long transition processes and complex states.
[0055] In this invention, the user's internal load can correspond to the same type of equipment with different rated power, or it can be different types of equipment.
[0056] In the Transformer model with load decomposition, the Adam gradient descent optimization algorithm was adopted. The Adam gradient descent optimization algorithm is a combination of the momentum method and the RMSprop algorithm. It incorporates a momentum term to accelerate the training process and also takes into account the learning rate constraint.
[0057] In this application, step 2 mainly involves preprocessing the data to make it more organized and orderly. This is fundamental for training neural networks. If there is too much "dirty data" in the training set, it can lead to problems such as inaccurate predictions or failure to converge. The specific implementation method is as follows:
[0058] In step 2 of this invention, when faced with missing load data, if the time span of consecutive missing data is small, such as less than one-fifth of the load working interval span, then interpolation is used to fill the data. For sequences with a large time span of missing data, exceeding one-fifth of the set threshold, they are directly discarded.
[0059] In step 2 of this invention, the abnormal data in the collected data is generated by the load entering an overvoltage state. Although this is the actual state of the load, it can easily interfere with subsequent models for an architecture that uses low-frequency power as the load's electrical characteristic. Taking a refrigerator device in the REDD dataset as an example, an overvoltage will occur when it starts working. If the acquisition device happens to capture the overvoltage state of the device, it will generate extremely high instantaneous power, resulting in invalid abnormal data in this invention. For power data obtained at a low sampling rate, there is usually only one outlier in a single working cycle. Therefore, the processing method for this type of data is to discard it first, calculate the average of the power values before and after the outlier, and fill it in as new data.
[0060] In step 2 of this invention, since the distributions of the samples are different, it is necessary to standardize the samples to limit the data to a certain range. This will prevent the event data from losing its original features during the subsequent training of the network model. The standardization method used in this invention is min-max standardization, also known as deviation standardization. The standardization result is shown in equation (1).
[0061]
[0062] In the formula, x represents the input sample power data, and min and max are the minimum and maximum values of the input sequence, respectively; x * This is the standardized data.
[0063] In step 3 of this invention, the mean within each window is calculated using the sliding window method for the total power sequence. The window length is set to 5. The processed total power data is then processed using the sliding window method, with one sliding window length corresponding to one original power sequence. The mean sequence is then subtracted from the original power sequence to obtain P. R This is called residual power. The calculation process of the residual power sequence is shown in equation (2).
[0064] P R =PP M (2)
[0065] As shown in the accompanying drawings of this invention. Figure 2 As shown, the power step change originally caused by the refrigerator event is mapped as a triangular wave-like wave. This invention relies on the slope and extrema at the point of event occurrence to determine whether an event has occurred. The slope K and the extrema maximum are shown in equation (3).
[0066]
[0067]
[0068] In the formula, `width` is the set window length. In the event detection in step 2, a slope threshold of 50 and an extreme value threshold of 180 are set for the refrigerators in the REDD dataset. To increase practicality, redundancy needs to be set, which is set to ±10% in this invention. If the extreme value and slope characteristics of the detected refrigerator residual power differ from the corresponding set thresholds by less than 10%, it is considered that a refrigerator event has occurred. The same applies to other loads.
[0069] When detecting events under complex loads, the sliding window method can also be used for event detection. However, it cannot calculate the slope and extrema of the triangular wave because the transition process of complex loads is complex and the transition time is long. Therefore, the number of zero-crossing points within a certain window can be detected. If it exceeds the zero-crossing threshold, an event is considered to have occurred.
[0070] In step 4 of this invention, the problem to be solved is to classify the events of each device, which can effectively solve the problem of classifying similar events.
[0071] Firstly, regarding the construction of multiple features, to increase the distinguishability between events, additional features need to be introduced for learning. Step 4 uses the Fourier algorithm. For the frequency domain transformation of discrete data, the Discrete Fourier Transform (DFT) is required. However, subsequent researchers, leveraging the symmetry and other characteristics of the DFT, developed the Fast Fourier Transform (FFT) method. Furthermore, developers integrated the FFT method into Python. In this invention, the construction of multiple event features is implemented in a Python 3.8 environment. To avoid drastic changes in the phase sequence caused by window movement and slight waveform variations, the original power sequence of the occurring events needs to be staggered. For example, data with power between 80 and 84 are all set to 80, and data with power between 85 and 89 are all set to 85. After FFT processing, the staggered original power data yields an amplitude sequence and a phase sequence of the same length as the original power sequence. Finally, the amplitude sequence, phase sequence, residual power, and original power sequence are concatenated and used as the classification criterion, input into the CNN network model.
[0072] Secondly, regarding the network model, this paper selects the classic one-dimensional convolutional neural network as the learning model, with the following parameter settings: The CNN structure in this invention consists of an input layer, a convolutional layer, a pooling layer, a linear layer, and an output layer.
[0073] Input layer: The input is a processed sequence of events consisting of multiple load features. If the time span (number of sample points) of the input samples is N, then the number of nodes in the input layer is set to 4N. In step 4, N is set to 50. This is suitable for datasets with low sampling frequencies, such as the REDD dataset with a sampling frequency of 1Hz. For datasets with long sampling intervals, such as UK-DALE, the power data can be interpolated and padded before being input into the network model.
[0074] Convolutional and pooling layers: Convolutional and pooling layers can preserve information in the field of view and reduce computational cost. Step 4 uses a 3×1 kernel size and 3 kernels, with the boundary padding set to "same" to ensure that the size of the feature sequence remains unchanged after convolution. After summing multiple convolution results, the ReLU function is used as the activation function. The pooling layer uses max pooling, which can extract the maximum value in the field of view and preserve the maximum feature of the original field of view.
[0075] Linear Layers: In the CNN structure of step 4, two linear layers are used. The number of input nodes of the first linear layer is equal to the length of the data after stretching through the convolutional pooling layers, and the number of output nodes of the first linear layer is set to 128. The number of input nodes of the second linear layer is equal to the number of output nodes of the first linear layer, and the number of output nodes of the second linear layer is 32.
[0076] Output Layer: In the CNN structure of step 4, the output layer is fully connected to the previous layer, and the number of output nodes is set to 2N+1, where N represents the number of events the training model is required to classify under several loads, and the increment is 1 because the model needs to classify events where none occur. In the training of multi-class models, softmax is typically used as the activation function for the last layer. During training, the label corresponding to each event needs to be converted into a one-hot encoding for calculating the loss value. Gradient descent of the loss value is used to update the model's parameters. When the trained model is applied to a classification scenario, the node type corresponding to the maximum value of the output layer nodes is the classification result.
[0077] In step 5 of this invention, the decomposition model helps to shield load information outside the working range, shield irrelevant information, and insert it into the data processing process of load decomposition.
[0078] In the Transformer network model of this invention, there are two places where the mask matrix can be represented. One is at the input of the Transformer, called padding mask, which masks the regions where no work is performed. In practice, to ensure that all samples have the same length, a padding operation is required, and the padding data is set to an infinitesimal value (1×10 in this invention). -9 This allows the weights of the padding data to be reset to zero when calculating attention weights later. Secondly, the decoder input also requires a masking operation, called a sequence mask. The purpose of masking is to facilitate the model's serial training effect, similar to RNNs and LSTMs, but in practice, training is parallel. The actual process is as follows: assuming the input sample window length is N, an N×N matrix is set, resulting in a triangular matrix. This triangular matrix is multiplied by the input matrix and input into the model to predict the power value of a single load.
[0079] Secondly, in terms of model building, the model parameters are set to be the same as the classic Transformer structure, that is, there are 8 heads, the word vector dimension is 512, the encoder and decoder contain 6 layers, the linear layers inside the encoder and decoder are set to have 2048 input nodes, the word vector dimension is set to 128, and the internal dropout is set to 0.1. Setting dropout can reduce the impact of model overfitting.
[0080] Appendix Figure 1This is a diagram of the non-intrusive load decomposition framework proposed in this invention. The arrows in the diagram represent the direction of data flow. As shown in the diagram, the framework is divided into a data acquisition module, a data preprocessing module, a work zone localization module, and a load decomposition module. First, the load data of this invention comes from a publicly available dataset, and unreasonable data in the dataset has been processed. Then, events that generate load are detected, and the event sequences are transformed in the time-frequency domain to form a feature vector composed of time-domain features and frequency-domain features. A CNN network model is then constructed to classify the types of events. Finally, the work zone is located, and the non-work zone is masked to train the load decomposition model.
[0081] Example 1
[0082] The Transformer network model construction and training process in this embodiment is as follows:
[0083] (1) Constructing the load decomposition training dataset. A fixed window length of 200 is set. A sliding window method is used to acquire sample data from the total load power data and the target device power data. Start and end characters for the samples are inserted, and the window movement step size is set to be the same as the window length. The load decomposition training dataset includes the total load power data after masking the non-working area and the true power values of each load (single load power information). The Transformer training dataset format consists of encoder input, decoder input, and decoder output. The encoder requires input to calculate and encode the self-attention of the total load data to be predicted. The decoder also requires input to calculate the internal self-attention of the power sequence of a single device. The decoder also requires output, which is also the power sequence of a single device. During training, this output participates in parallel training and can also be used to calculate the loss value.
[0084] (2) Building the network model. The mask matrix at the decoder input is constructed, and a Transformer model is built using the PyTorch deep learning framework. The number of heads is set to 8, converting the sample data into word vectors of dimension 512. The number of layers inside the decoder and encoder is set to 6, and the linear layer for converting word vectors into Q and V vectors is set to 512*128.
[0085] (3) Training and Testing. During training, the total payload information is input into the encoder, and the individual payload information is input into the decoder. The decoder input passes through a masked multi-head attention layer and is then processed by a multi-head attention mechanism with the encoder output. The features are then integrated and compressed using a feedforward neural network. The decoder's calculation results are compared with the real data to calculate the loss value, and the parameters are updated using a backpropagation optimization algorithm. During testing, the required decomposed data is input into the encoder, and the decoder is given a start symbol to begin serial prediction.
[0086] Appendix Figure 2 This invention presents an event detection method. In the figure, the solid line represents the original power waveform of the refrigerator, and the dashed line represents the residual power waveform. As can be seen from the figure, the residual power maps the step change at the event point of the original power waveform into a triangular wave-like waveform.
[0087] Appendix Figure 3 The diagram shows the result of decomposing the refrigerator according to Example 1, i.e., without event classification. The solid line in the diagram represents the actual operating waveform of the refrigerator, and the dashed line represents the predicted waveform of the refrigerator obtained after decomposition by the load decomposition model.
[0088] Appendix Figure 4 The diagram shows the result of decomposing the refrigerator according to Example 2. The solid line in the diagram represents the actual operating waveform of the refrigerator, and the dashed line represents the predicted waveform of the refrigerator obtained after model decomposition.
[0089] From the appendix Figure 3 and attached Figure 4 The comparison shows that by masking the data in the non-operating areas and providing the model with information about the target device's operating areas, the model can focus more on the operational status of those areas. Furthermore, the model can distinguish between similar loads, preventing it from misinterpreting power changes in similar loads as operational data for the target device, thus improving the model's decomposition capabilities.
[0090] Example 2
[0091] This embodiment uses a non-intrusive load decomposition method based on multi-feature event classification, as detailed below:
[0092] (1) Event Detection and Classification. Event detection utilizes the sliding window method to detect events for each load in the total load (dishwasher on / off events, microwave oven on / off events, refrigerator on / off events, oven on / off events, and light on / off events). Taking the refrigerator as the target device, the residual power is calculated for the original power sequence, and extreme values and slopes are used as features for event detection. A feature vector composed of the original power, residual power, FFT amplitude features, and phase features is constructed and input into the CNN network model. Parameters are detailed in the specific implementation method.
[0093] Classification datasets for CNN network models
[0094] (2) Construct the load decomposition training dataset. This is the same as step (1) in Example 1.
[0095] (3) Build the network model. Process the padding mask matrix. Based on the event classification results in step (1), set the data in the non-working area to zero and replace it with the minimum value when calculating attention in the subsequent process. The network model is the same as step (2) in Example 1.
[0096] (4) Training and testing. Same as step (3) in Example 1.
[0097] In summary, the non-intrusive load decomposition method based on multi-feature event classification of this invention has the following advantages compared with other previous deep learning models:
[0098] First, the internal multi-feature event CNN network model can be used independently for event detection. It utilizes frequency domain features to assist classification and employs convolutional and pooling layers in the CNN network model for feature condensation, thereby increasing the accuracy of event classification without significantly increasing the computational load.
[0099] Second, incorporating event information into the training process of the decomposition model can help train a model that shields against interference. This does not significantly increase the workload and improves the decomposition effect of the model, making it particularly suitable for decomposing periodic loads.
[0100] Third, in the decomposition model, parallel training of data samples is allowed, which shortens the training cycle of the model.
[0101] The above embodiments are part of the present invention and are only used to illustrate the technical solutions of the present invention, but are not intended to limit it. Technical solutions obtained by researchers in the art by modifying or replacing the technical solutions based on the framework provided by the present invention are all within the protection scope of the present invention.
[0102] The embodiments described above are some, but not all, embodiments of the present invention. The detailed description of the embodiments of the present invention is not intended to limit the scope of the claimed invention, but merely to illustrate selected embodiments. All other embodiments obtained by those skilled in the art based on the embodiments of the present invention without inventive effort are within the scope of protection of the present invention.
Claims
1. A non-intrusive load decomposition method based on multi-feature event classification, characterized in that, The load decomposition method includes: Step 1: Obtain the total power data of the load type under study from the existing load dataset, and determine the true value of the power data for each load type; Step 2: Preprocess the data of the load to be studied to obtain the total power data and the true value of the power data of each load, and perform event detection on the total power data to obtain M state change quantities of multiple loads; The event detection process is as follows: A sliding window length is set, and the processed total power data is processed using a sliding window. One sliding window length corresponds to one original power sequence. The mean within each window is calculated using the sliding window method, and the mean sequence is subtracted from the original power sequence to obtain the residual power sequence. This maps load events to the vicinity of zero. When an event occurs, for simple loads where power characteristics undergo a step change, the extreme values and slopes of the residual power are compared. If both the extreme values and slopes exceed the set thresholds, an event is determined to have occurred. For complex loads with long transition times, the occurrence of an event is determined by comparing the number of zero-crossing points of the residual power within the window to see if it exceeds the zero-crossing threshold. Step 3: Construct a classification dataset The original power sequence and corresponding residual power sequence of the event are selected. The original power sequence of the event is then processed by step-wise transformation. After step-wise transformation, the original power sequence is processed by FFT to obtain amplitude and phase sequences of the same length as the original power sequence. The amplitude sequence, phase sequence, residual power sequence, and original power sequence constitute multiple load features. Finally, the multiple load features are concatenated into a single sample, with each sample corresponding to the state change of the load. A large number of samples of the data of the load to be studied and the corresponding state changes of the load constitute a classification dataset. Step 4: Train the CNN network model using the classification dataset. The input to the CNN network model is multiple load features, and the number of output nodes of the CNN network model is the sum of the number of all state changes for all types of loads plus 1; adding 1 indicates that the CNN network model distinguishes between no events. The trained CNN network model is used to classify the detected event sequences and obtain the switching event results for each load; Step 5: Use the trained CNN network model to obtain the event classification results, locate the working range of the target load based on the event classification results, mask the non-working range in the processed total power data, and train the Transformer network model using the masked total power data and the ground truth power data of each corresponding processed load. The trained Transformer network model is used to decompose the total input load to obtain the power waveform of the target device.
2. The non-intrusive load decomposition method based on multi-feature event classification according to claim 1, characterized in that, Sensors are installed inside existing user rooms and at entrances to monitor the usage of loads inside user rooms, obtain total power data of users and power data of each type of load, and select the low-frequency power characteristics to be used. Based on the different internal loads of users, the event transition duration is obtained, and corresponding thresholds for power difference, slope and extreme values before and after the event, as well as zero-crossing thresholds, are set. The total power detected is preprocessed before event detection is performed to obtain the original power sequence of the event. Then, the user load is decomposed through steps 3-5.
3. The non-intrusive load decomposition method based on multi-feature event classification according to claim 1, characterized in that, The CNN network model includes an input layer, a convolutional layer, a pooling layer, a linear layer, and an output layer. The convolutional kernel size is 3×1, the number of convolutional kernels is 3, and the boundary padding is set to "same" to ensure that the size of the feature sequence remains unchanged after the convolution operation. The results of the three convolution calculations are summed and then input into the ReLU activation function to obtain the convolutional layer results. The max pooling method is used to extract features. Two linear layers were used. The number of input nodes of the first linear layer was equal to the length of the data after stretching the result of the convolutional pooling layer. The number of output nodes of the first linear layer was set to 128. The number of input nodes of the second linear layer was equal to the number of output nodes of the first linear layer. The number of output nodes of the second linear layer was 32. The output layer is fully connected to the previous layer, and the number of output nodes in the output layer is set to 2N+1, where N is the number of events that the training model is required to classify for several types of loads, and 1 is added because the model needs to distinguish between no events; softmax is used as the activation function for the last layer. During training, the label corresponding to each event is converted into a one-hot encoding, which is used to calculate the loss value. The loss value gradient descent method is used to update the parameters of the CNN network model.
4. The non-intrusive load decomposition method based on multi-feature event classification according to claim 1, characterized in that, The paddingmask operation is used to mask out the regions that are not in use. At the input of the decoder of the Transformer network model, the masking operation needs to be performed. The Transformer network model has 8 heads, the word vector dimension is 512, and the encoder and decoder contain 6 layers. The linear layers inside the encoder and decoder are set to have 2048 input nodes, the word vector dimension is set to 128, and the internal dropout is set to 0.
1.
5. The non-intrusive load decomposition method based on multi-feature event classification according to claim 1, characterized in that, The existing load dataset is either the REDD dataset or the UK-DALE dataset.
6. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the program can implement the steps of the load decomposition method according to any one of claims 1-5.
7. A non-intrusive load decomposition system based on multi-feature event classification, characterized in that, The system employs the load decomposition method according to any one of claims 1-5, including: The data acquisition module is used to acquire the total power data and single load power data of the load types under study; The data preprocessing module is used to preprocess the power data obtained by the data acquisition module; The working area localization module is used to complete event detection, select the original power sequence of the event using the event detection results, perform time-frequency domain transformation to form a feature vector composed of time-domain features and frequency-domain features, and construct a CNN network model to classify the type of event and locate the working area of the target load based on the event classification results. The load decomposition module masks the non-working intervals in the processed total power data, and uses the masked total power data and the corresponding ground truth power value of each individual load to train a Transformer network model. The trained Transformer network model is then used to decompose the input total load to obtain the power waveform of the target device.
Citation Information
Patent Citations
Attention-based non-intrusive load decomposition method
CN113920362A
CUSUM-Bi-LSTM-based edge side online non-intrusive load identification method
CN115186258A