Non-intrusive load monitoring method

By combining the power periodic characteristics extracted by the TimesNet model and the natural factor characteristics of the fusion of the multi-head self-attention mechanism, the problem of relying on single power data in the prior art is solved, and the prediction accuracy and accuracy of non-invasive load monitoring are improved.

CN119598131APending Publication Date: 2025-03-11NINGXIA UNIVERSITY
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411730735.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-28
Publication Date
2025-03-11

AI Technical Summary

Technical Problem

The existing non-invasive load monitoring technology relies too much on the power characteristics of the appliance itself, ignores the information provided by users' electricity usage habits and other natural factors, making it difficult to improve the decomposition effect.

Method used

The periodic characteristics of the power sequence were extracted using the TimesNet model, and the characteristics of natural factors such as temperature, humidity, and wind speed were fused through the multi-head self-attention mechanism to perform non-invasive load monitoring.

Benefits of technology

The prediction accuracy of the load decomposition model is improved, the problem of insufficient extraction of single power data is overcome, and more accurate load monitoring results are achieved, achieving the purpose of energy conservation, emission reduction and cost reduction.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119598131A_ABST
    Figure CN119598131A_ABST
Patent Text Reader

Abstract

The invention provides a non-intrusive load monitoring method, which comprises the following steps of: (1) acquiring power utilization characteristics and other characteristics from a data source, performing data preprocessing, and dividing a data set into a training set and a test set; (2) performing feature extraction on the power sequence by using a Times Net model to obtain periodic features of the power sequence; (3) performing feature fusion on the power periodic features and other natural factor features by using a multi-head self-attention mechanism; and (4) carrying out non-intrusive load monitoring test, selecting evaluation parameters, and carrying out comparison evaluation with other models. The method provided by the invention solves the problem that the decomposition effect is always difficult to improve because the current load decomposition model excessively depends on the power characteristics of the electric appliance and neglects the power utilization habit of the user and the information provided by other natural factors. The method has high applicability, and high economic benefits can be obtained.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of non-intrusive load monitoring. Specifically, the present invention relates to a non-intrusive load monitoring method. More specifically, the present invention relates to a non-intrusive load monitoring method that considers the fusion of power periodicity characteristics and non-electrical quantity characteristics. Background Art

[0002] The following describes the relevant background technologies of the present invention, but these descriptions do not necessarily constitute the prior art of the present invention.

[0003] Non-intrusive load monitoring (NILM) was first proposed by Hart in 1992. It is a method to obtain the status of a single load in a certain area and whether the load exists by analyzing the total power consumption in a certain area over a period of time. Compared with intrusive load monitoring, it does not require the installation of monitoring devices on each electrical device to be detected to obtain the status and power consumption of the appliance. It is a low-cost, easy to deploy, and highly scalable monitoring method. At the same time, it strengthens the protection of customer privacy in some aspects.

[0004] Non-intrusive load monitoring has high value in practical applications: on the one hand, the various load parameters provided by NILM can help users to understand the detailed usage of household appliances in a timely manner, and then cultivate the habit of reasonable electricity use among residents, so as to achieve the purpose of reducing electricity bills and saving energy and reducing emissions. On the other hand, the power supply company can accurately understand the electricity usage of each user based on the feedback results of non-intrusive load monitoring, and provide safe and accurate services to residents based on this. In addition, enterprises can also adjust subsequent production strategies based on the feedback results to achieve higher production capacity and economic benefits. Therefore, NILM can not only achieve the purpose of energy conservation and emission reduction and reduce costs, but also prevent fires caused by electrical failures and reduce unnecessary losses.

[0005] At present, domestic and foreign scholars have conducted extensive research on non-intrusive load monitoring, but most networks are based on a single parameter as input, and multiple inputs only account for a small part of them. However, extracting features only from a single power data will lead to insufficient mapping between input and output, resulting in unsatisfactory prediction accuracy of NILM.

[0006] To solve the problem that the current load decomposition model overly relies on the power characteristics of the electrical appliances themselves and ignores the information provided by users' electricity usage habits and other natural factors, resulting in the difficulty in improving the decomposition effect, an improved load decomposition method that considers multiple characteristics is proposed. Summary of the invention

[0007] As mentioned above, in order to solve the aforementioned problems, the design scheme of the present invention is proposed.

[0008] Specifically, in order to address the problem that the current load decomposition model relies too much on the power characteristics of the electrical appliance itself and ignores the information provided by other factors, resulting in the decomposition effect being always difficult to improve, the present invention proposes a non-invasive load monitoring method that considers the periodic characteristics of power and the fusion of multiple characteristics.

[0009] According to one aspect of the present invention, the present invention proposes a non-intrusive load monitoring method, comprising the following steps: step (1): obtaining power consumption characteristics and other characteristics from a data source, performing data preprocessing, and dividing the data set into a training set and a test set; step (2): using a TimesNet model to extract features of a power sequence and obtain periodic features of the power sequence; step (3): using a multi-head self-attention mechanism to perform feature fusion on power periodic features and other natural factor features; step (4): performing a non-intrusive load monitoring test, selecting evaluation parameters, and performing comparative evaluation with other models.

[0010] Preferably, in step (1), the data source refers to a public data set, the power consumption feature refers to the total power consumption of the house and the power of each electrical appliance, and the other features refer to the temperature, humidity and wind speed of the environment. The method further includes resampling the total power consumption and the power of each electrical appliance after obtaining the features, and interpolating the temperature, humidity and wind speed of the environment so that each feature corresponds to time one by one, and finally obtaining a sample corresponding to the time series; then, in order to avoid a large gap between data values ​​of different feature values, all data are normalized.

[0011] The normalization formula is as follows:

[0012]

[0013] In the formula, y is the normalized data, x is t is the original data at time t, is the mean value of the original data, σ is the standard deviation of the original data, and the normalized range is [0, 1].

[0014] Then, the first 80% of the dataset is used as the training set, and the last 20% of the combined dataset is used as the test set.

[0015] Preferably, in step (2), the TimesNet model is used to extract features from the power sequence, and obtaining the periodic features of the power sequence includes: first obtaining the amplitude of the one-dimensional time power sequence by fast Fourier transform, then selecting the k frequencies corresponding to the largest amplitudes, and dividing the frequency by the time series length to obtain the period length. The formula is as follows:

[0016] A=Avg(Amp(FFT(X 1D )))

[0017]

[0018] In the formula, T is the length of the time series, C is the number of variables, FFT(·) refers to the fast Fourier transform of the time series, Amp(·) refers to the amplitude obtained in the fast Fourier transform, Avg refers to the average operation along the C dimension, A refers to the obtained amplitude, f refers to the frequency corresponding to each amplitude, p refers to the period length corresponding to each frequency, and k is a hyperparameter used to select the first k largest amplitude frequencies.

[0019] Preferably, the step (2) includes: converting the one-dimensional time series into multiple time windows according to the power cycle length and frequency, and filling the one-dimensional time series according to the power cycle length and frequency and reshaping it into a two-dimensional tensor. The formula is as follows:

[0020]

[0021] Where Pdding(·) is the padding operation along the time dimension, Reshape(·) is the reshaping operation, and p i and f i are the number of rows and columns of the reshaped two-dimensional tensor, respectively. represents the i-th reconstructed time series;

[0022] Then, the Inception model, which has achieved good results in visual tasks, is used to extract features from the two-dimensional tensor to obtain the intra-cycle and inter-cycle features of the power. The learned two-dimensional features are then converted into a one-dimensional space to prepare for the subsequent feature fusion. The formula is as follows:

[0023]

[0024] In the formula, Inception(·) means using the Inception model to extract features from a two-dimensional tensor, and Trunc(·) means the truncation operation. i ×f i The padding sequence is truncated to its original length T.

[0025] Preferably, in step (3), the multi-head self-attention mechanism is to divide the input features into multiple heads, each head is linearly transformed through independent Query, Key and Value weight matrices, and then the attention weight and feature weighted output of each head are calculated, and finally the outputs of all heads are spliced ​​together and a fused feature representation is obtained through linear transformation; wherein, before applying the multi-head self-attention mechanism to each feature, linear projection is required to generate Query, Key and Value matrices, and for each feature, it is projected onto h heads, and the formula is as follows:

[0026]

[0027] In the formula T is the length of the time series, d is the embedding dimension of each feature, is the projection matrix, is the dimension of each head;

[0028] Then the attention weight is calculated for each head to obtain the self-attention output of feature i. This operation generates a weighted output for each head, focusing on the dependencies between the features. The formula is as follows:

[0029]

[0030] Where softmax(·) refers to the normalized exponential function;

[0031] The attention outputs of all features are concatenated, and then fused through linear projection to complete the fusion of multiple features. Finally, the load decomposition result is obtained through the fully connected layer. The formula is as follows:

[0032]

[0033] Z=Fully(MuntltiHead Fusion (X1,…,X F ))

[0034] in, It is a linear transformation matrix used for fusion, which fuses the concatenated features into the final embedding representation. Concat(·) refers to the concatenation operation, and Fully(·) refers to the full connection operation.

[0035] Preferably, the step (4) comprises: inputting test set data for model testing, performing power decomposition on the selected electrical appliances according to the trained non-intrusive load monitoring model, finally obtaining the power data of a single electrical appliance by denormalization, and calculating the relevant evaluation index of the power decomposition value of the single electrical appliance; wherein the two evaluation indexes used are the mean absolute error and the root mean square error:

[0036] The mean absolute error is calculated as follows:

[0037]

[0038] The formula for calculating the root mean square error is as follows:

[0039]

[0040] Where: ——predicted value, (in is the decomposition value of electrical appliances at each moment), y i True value, y i ={y1...y n}(where y1...y n is the actual value of the electrical appliance at each moment), where, when evaluating the model, the smaller the MAE, the higher the overall prediction accuracy of the model; the smaller the RMSE, the higher the prediction accuracy of the model at the extreme point.

[0041] The non-intrusive load monitoring method according to the present invention uses the TimesNet model to extract the periodic features in the power. The extracted power periodic features combine the power features of the electrical appliance itself and the features of the user's electricity usage habits. At the same time, through the multi-head self-attention mechanism, the features of natural factors such as temperature, humidity and wind speed are also integrated into the input data feature selection, overcoming the limitation of the existing NILM that only considers the electrical data features, and improving the prediction accuracy of the deep learning model. The present invention solves the problem that the current load decomposition model is overly dependent on the power features of the electrical appliance itself, while ignoring the information provided by the user's electricity usage habits and other natural factors, resulting in the problem that the decomposition effect is always difficult to improve. It has strong applicability and can obtain higher economic benefits. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] Figure 1 A schematic diagram of a flow chart of a non-intrusive load monitoring method according to an embodiment of the present invention;

[0043] Figure 2 Schematic diagram of a model of a non-intrusive load monitoring method according to an embodiment of the present invention. DETAILED DESCRIPTION

[0044] Figure 1 A schematic diagram of a flow chart of a non-intrusive load monitoring method according to an embodiment of the present invention; Figure 2 Schematic diagram of a model of a non-intrusive load monitoring method according to an embodiment of the present invention.

[0045] In order to verify the effectiveness and feasibility of the non-intrusive load monitoring model proposed in this paper, the AMPds2 dataset was selected as a sample for algorithm verification. This dataset records the average electricity consumption behavior of some households over two years, including the power, voltage, current of 20 electrical loads, as well as climate variables such as temperature and humidity.

[0046] Step (1) obtaining electricity consumption characteristics and other characteristics from the data source and performing data preprocessing, such as data normalization and dividing into training sets and test sets;

[0047] Step (2) Use TimesNet model to extract features of the power sequence and obtain the periodic features of the power sequence;

[0048] Step (3) uses a multi-head self-attention mechanism to perform feature fusion on the extracted features, that is, to perform feature fusion on the power periodicity features and other natural factor features;

[0049] Step (4) performs a non-intrusive load monitoring test, that is, tests the created model, selects evaluation parameters, and compares and evaluates it with other models.

[0050] Specifically, in step (1), the data source refers to a public data set, the power consumption feature refers to the total power consumption of the house and the power of each electrical appliance, and the other features refer to the temperature, humidity and wind speed of the environment. Since the sampling frequency of the power data and the ambient temperature, humidity and wind speed features in the AMPds2 data set is inconsistent, it is not possible to achieve a one-to-one correspondence with time, so the data needs to be preprocessed. After obtaining the features, the total power consumption and the power of each electrical appliance are resampled, and the ambient temperature, humidity and wind speed are interpolated so that each feature corresponds one-to-one with time, and finally a sample corresponding to the time series is obtained. In order to avoid excessive differences in data values ​​between different feature values, all data are normalized.

[0051] The normalization formula is as follows:

[0052]

[0053] In the formula, y is the normalized data, which is the original data at time t, and x is t is the original data at time t, is the mean value of the original data, σ is the standard deviation of the original data, and the normalized range is [0, 1].

[0054] Then the first 80% of the dataset is used as the training set, and the last 20% of the combined dataset is used as the test set.

[0055] In step (2), the TimesNet model is a model based on convolutional neural network (CNN) and Fourier transform, which can effectively process the periodicity and trend characteristics in time series data. The core design concept of TimesNet is to decompose the time series data into multiple time windows, convert the one-dimensional time series into a two-dimensional tensor, and then use the achievements in vision to extract features for each time window, so as to capture the short-term and long-term dependencies in the time series. Using this model to extract features from the total power series, the periodic characteristics of the total power series can be well obtained, so as to capture the short-term and long-term time dependencies in the total power series.

[0056] The algorithm first obtains the amplitude of the one-dimensional time power series through fast Fourier transform, then selects the k frequencies corresponding to the largest amplitudes, and divides the frequency by the time series length to obtain the period length. The formula is as follows:

[0057] A=Avg(Amp(FFT(X 1D )))

[0058]

[0059] In the formula T is the length of the time series, C is the number of variables, FFT(·) refers to the fast Fourier transform of the time series, Amp(·) refers to the amplitude obtained in the fast Fourier transform, Avg refers to the average operation along the C dimension, A refers to the obtained amplitude, f refers to the frequency corresponding to each amplitude, p refers to the period length corresponding to each frequency, and k is a hyperparameter used to select the first k largest amplitude frequencies.

[0060] Then, the one-dimensional time series is converted into multiple time windows according to the power cycle length and frequency, and the one-dimensional time series is padded and reshaped into a two-dimensional tensor according to the obtained power cycle length and frequency. The formula is as follows:

[0061]

[0062] Where Pdding(·) is the padding operation along the time dimension, that is Figure 2 The filling in , Reshape(·) is the reshaping operation, that is, Figure 2 Reshaping in, p i and f i are the number of rows and columns of the reshaped two-dimensional tensor, respectively. represents the i-th reconstructed time series.

[0063] Then, the Inception model, which has achieved good results in visual tasks, is used to extract features from the two-dimensional tensor, that is, Figure 2The convolutional neural network in is used to obtain the intra-cycle and inter-cycle features of the power, and then the learned two-dimensional features are converted into one-dimensional space to prepare for the subsequent feature fusion. The formula is as follows:

[0064]

[0065] In the formula, Inception(·) means using the Inception model to extract features from a two-dimensional tensor, and Trunc(·) means the truncation operation. i ×f i The padding sequence is truncated to its original length T.

[0066] In step (3), the multi-head self-attention mechanism divides the input features into multiple heads, each head is linearly transformed through independent Query, Key and Value weight matrices, and then the attention weight and feature weighted output of each head are calculated. Finally, the outputs of all heads are spliced ​​together and the fused feature representation is obtained through linear transformation. Before applying the multi-head self-attention mechanism to each feature, linear projection is required to generate Query, Key and Value matrices. For each feature, it is projected onto h heads, and the formula is as follows:

[0067]

[0068] In the formula T is the length of the time series, d is the embedding dimension of each feature, is the projection matrix, is the dimension of each head.

[0069] Then the attention weight is calculated for each head to obtain the self-attention output of feature i. This operation generates a weighted output for each head, focusing on the dependencies between features. The formula is as follows:

[0070]

[0071] Here, softmax(·) refers to the normalized exponential function.

[0072] The attention outputs of all features are concatenated, and then fused through linear projection to complete the fusion of multiple features. Finally, the load decomposition result is obtained through the fully connected layer. The formula is as follows:

[0073]

[0074] Z=Fully(MuntltiHead Fusion (X1,…,X F ))

[0075] in, It is a linear transformation matrix used for fusion, which fuses the concatenated features into the final embedding representation. Concat(·) refers to the concatenation operation, and Fully(·) refers to the full connection operation.

[0076] In step (4), the input test set data is used for model testing, and the power of the selected electrical appliances is decomposed according to the trained non-intrusive load monitoring model. Finally, the power data of a single electrical appliance is obtained by denormalization, and the relevant evaluation index of the power decomposition value of a single electrical appliance is calculated. The two evaluation indexes used are the mean absolute error and the root mean square error.

[0077] The mean absolute error is calculated as follows:

[0078]

[0079] The formula for calculating the root mean square error is as follows:

[0080]

[0081] Where: The predicted value, (in is the decomposition value of the electrical appliance at each moment), yi real value, yi={y1...yn}(where y1...y n is the real value of the electrical appliance at each moment). When evaluating the model, the smaller the MAE, the higher the overall prediction accuracy of the model; the smaller the RMSE, the higher the prediction accuracy of the model at the extreme point.

[0082] Table 1 Error comparison of three NILM models

[0083]

[0084] As can be seen from Table 1, compared with other existing models, the mean absolute error and root mean square error of the non-intrusive load decomposition model of the present invention are both reduced. For details, please refer to the specific values ​​of the three electrical appliances, refrigerator, electric heat pump, and television, given in Table 1 above. It can be concluded that the non-intrusive load monitoring method according to the present invention can greatly improve the prediction accuracy, has higher efficiency and stronger superiority, and solves the problems in the prior art.

[0085] Furthermore, compared with the existing non-intrusive load monitoring that relies solely on power characteristics, the non-intrusive load monitoring method of the present invention can integrate the user's power consumption habits and other non-electrical quantity characteristics, which can greatly improve the performance of the non-intrusive load monitoring model and obtain higher accuracy and waveform closeness. Therefore, users can obtain more accurate load monitoring results, achieve the purpose of energy conservation and emission reduction, reduce costs, obtain higher economic benefits, and have strong applicability.

[0086] Although the present invention has been described in detail above with general descriptions and specific embodiments, it is obvious to those skilled in the art that some modifications or improvements can be made based on the present invention. Therefore, these modifications or improvements made without departing from the spirit of the present invention all fall within the scope of protection claimed by the present invention.

Claims

1. A non-intrusive load monitoring method, characterized in that: The following steps are involved: Step (1): Obtain electricity consumption characteristics and other characteristics from the data source, perform data preprocessing, and divide the data set into a training set and a test set; Step (2): Use the TimesNet model to extract features from the power sequence and obtain the periodic features of the power sequence; Step (3): Use the multi-head self-attention mechanism to fuse the power periodicity features and other natural factor features; Step (4): Conduct non-intrusive load monitoring tests, select evaluation parameters, and conduct comparative evaluation with other models.

2. The method according to claim 1, characterized in that: In step (1), the data source refers to a public data set, the power consumption feature refers to the total power consumption of the house and the power of each electrical appliance, and the other features refer to the temperature, humidity and wind speed of the environment. After obtaining the features, the total power consumption and the power of each electrical appliance are resampled, and the temperature, humidity and wind speed of the environment are interpolated so that each feature corresponds to time one by one, and finally a sample corresponding to the time series is obtained; then, in order to avoid a large gap between data values ​​of different feature values, all data are normalized. The normalization formula is as follows: In the formula, y is the normalized data, x is t is the original data at time t, is the mean value of the original data, σ is the standard deviation of the original data, and the normalized range is [0,1]. Then, the first 80% of the dataset is used as the training set, and the last 20% of the combined dataset is used as the test set.

3. The method according to claim 1 or 2, characterized in that: In the step (2), the TimesNet model is used to extract features from the power sequence, and the periodic features of the power sequence are obtained by first obtaining the amplitude of the one-dimensional time power sequence through fast Fourier transform, then selecting the k frequencies corresponding to the largest amplitudes, and dividing the frequency by the time series length to obtain the period length. The formula is as follows: A=Avg(Amp(FFT(X 1D ))) In the formula, T is the length of the time series, C is the number of variables, FFT(·) refers to the fast Fourier transform of the time series, Amp(·) refers to the amplitude obtained in the fast Fourier transform, Avg refers to the average operation along the C dimension, A refers to the obtained amplitude, f refers to the frequency corresponding to each amplitude, p refers to the period length corresponding to each frequency, and k is a hyperparameter used to select the first k largest amplitude frequencies.

4. The method according to claim 3, characterized in that The step (2) includes: converting the one-dimensional time series into multiple time windows according to the power cycle length and frequency, and filling the one-dimensional time series according to the power cycle length and frequency and reshaping it into a two-dimensional tensor. The formula is as follows: Where Pdding(·) is the padding operation along the time dimension, Reshape(·) is the reshaping operation, and p i and f i are the number of rows and columns of the reshaped two-dimensional tensor, respectively. represents the i-th reconstructed time series; Then, the Inception model, which has achieved good results in visual tasks, is used to extract features from the two-dimensional tensor to obtain the intra-cycle and inter-cycle features of the power. The learned two-dimensional features are then converted into a one-dimensional space to prepare for the subsequent feature fusion. The formula is as follows: In the formula, Inception(·) means using the Inception model to extract features from a two-dimensional tensor, and Trunc(·) means the truncation operation. i ×f i The padding sequence is truncated to its original length T.

5. The method according to claim 4, characterized in that In step (3), the multi-head self-attention mechanism divides the input features into multiple heads, each head is linearly transformed through independent Query, Key and Value weight matrices, and then the attention weight and feature weighted output of each head are calculated, and finally the outputs of all heads are spliced ​​together and a fused feature representation is obtained through linear transformation; wherein, before applying the multi-head self-attention mechanism to each feature, linear projection is required to generate Query, Key and Value matrices, and for each feature, it is projected onto h heads, and the formula is as follows: In the formula T is the length of the time series, d is the embedding dimension of each feature, is the projection matrix, is the dimension of each head; Then the attention weight is calculated for each head to obtain the self-attention output of feature i. This operation generates a weighted output for each head, focusing on the dependencies between the features. The formula is as follows: Where softmax(·) refers to the normalized exponential function; The attention outputs of all features are concatenated, and then fused through linear projection to complete the fusion of multiple features. Finally, the load decomposition result is obtained through the fully connected layer. The formula is as follows: Z=Fully(MunltiHead Fusion (X1,···,X F )) in, It is a linear transformation matrix used for fusion, which fuses the concatenated features into the final embedding representation. Concat(·) refers to the concatenation operation, and Fully(·) refers to the full connection operation.

6. The method according to claim 5, characterized in that The step (4) comprises: inputting test set data for model testing, performing power decomposition on the selected electrical appliances according to the trained non-intrusive load monitoring model, finally obtaining power data of a single electrical appliance by denormalization, and calculating relevant evaluation indicators of the power decomposition value of the single electrical appliance; wherein the two evaluation indicators used are the mean absolute error and the root mean square error: The mean absolute error is calculated as follows: The formula for calculating the root mean square error is as follows: Where: ——predicted value, (in is the decomposition value of electrical appliances at each moment), y i True value, y i ={y1...y n }(where y1...y n is the actual value of the electrical appliance at each moment), where, when evaluating the model, the smaller the MAE, the higher the overall prediction accuracy of the model; the smaller the RMSE, the higher the prediction accuracy of the model at the extreme point.