Non-intrusive load monitoring method based on multi-task learning

By using the shared module and self-attention mechanism of MMoE combined with LSTM encoding module in non-intrusive load monitoring, the multi-task learning model is optimized, which solves the problem of weak correlation between equipment status and active power, and improves the prediction accuracy and performance of the model.

CN115564046BActive Publication Date: 2025-09-09SUZHOU CITY INVESTMENT SECURITY SERVICE CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202211403044.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-11-10
Publication Date
2025-09-09
Estimated Expiration
2042-11-10

AI Technical Summary

Technical Problem

Existing non-intrusive load monitoring methods have poor model performance when establishing a multi-task learning model of device status and active power due to the weak correlation between device status and active power.

Method used

By acquiring the electric energy data of various physical quantities in the trunk line, a shared module combining a multi-gate mixture of experts (MMoE) layer and a long short-term memory (LSTM) encoding module is used to mine the correlation information between different physical quantities. The self-attention mechanism and different weighted combinations are introduced into the multi-task learning model to optimize the training process of the subtask modules.

Benefits of technology

The performance of the multi-task learning model is improved, the prediction accuracy of multiple physical quantities of the target device is enhanced, especially the prediction accuracy of active power, and the risk of model overfitting is reduced.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115564046B_ABST
    Figure CN115564046B_ABST
Patent Text Reader

Abstract

The present application relates to a non-intrusive load monitoring method based on multi-task learning, which belongs to the field of load monitoring technology. The method comprises: inputting N physical quantities of electric energy data in a trunk line into a shared module of a pre-trained multi-task learning model to obtain correlation information between different physical quantities; the shared module is established by combining a trainable matrix of a gating network in an MMoE with an LSTM encoding module; inputting the correlation information into multiple parallel subtask modules in the multi-task learning model respectively to obtain the corresponding physical quantity of a target device output by each subtask module; the method can solve the problem of poor model performance of existing multi-task learning models; since the correlation between different physical quantities is strong, and the MMoE combined with the LSTM encoding module and Self-Attention can extract more complex correlation relationships, the correlation relationship between different physical quantities can be learned more accurately.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to a non-invasive load monitoring method based on multi-task learning, which belongs to the technical field of load monitoring. Background Art

[0002] Non-intrusive load monitoring (NILM) refers to installing a monitoring device at the user's main line (or bus) entrance, decomposing the collected total load electrical quantity into independent operating data of each electrical appliance through an intelligent algorithm, identifying the working status of each electrical appliance, and analyzing the user's electricity consumption behavior. At present, in the field of machine learning, especially in the field of non-intrusive load monitoring problems, most tasks are single-task learning, that is, the model only learns one task at a time. For example: The purpose of non-intrusive load monitoring is to obtain the power consumption data of the equipment through the data of the main line, and the power consumption data contains a variety of different physical quantity information. When inferring the power consumption data of the target device, the existing methods only infer the active power data of the device. At this time, during the model training process, the model has only one loss function, which is single-task learning.

[0003] However, non-intrusive load monitoring sometimes requires optimizing multiple objectives simultaneously. In these cases, multi-task learning can be combined to optimize these multiple objectives. Currently, multi-task learning can improve the average overall performance of a model across all tasks through regularization and transfer learning techniques. However, because deep learning-based multi-task learning models are sensitive to data distribution and the relationships between tasks, not all tasks are consistently outperformed by their single-task counterparts.

[0004] For these reasons, applying multi-task learning to non-intrusive load monitoring requires ensuring that different subtasks have a certain degree of similarity and correlation. Some non-intrusive load monitoring solutions employ multi-task approaches to treat target device state recognition and power inference as separate tasks, leveraging the interrelationships between these tasks to simultaneously improve the model's performance on both state recognition and power inference.

[0005] However, the correlation between device status and power may not be strong. In this case, the model performance obtained by multi-task learning based on device status and power is poor. Summary of the Invention

[0006] This application provides a non-intrusive load monitoring method based on multi-task learning. This method can solve the problem of poor performance of the multi-task learning model when the device status and active power are used to establish the multi-task learning model. This application provides the following technical solutions:

[0007] Obtaining N physical quantities of power data in the trunk line, where N is an integer greater than 1;

[0008] Inputting the N physical quantities into a shared module of a pre-trained multi-task learning model to obtain correlation information between different physical quantities mined by the shared module; the shared module is established by combining the trainable matrix of the gating network in the multi-gate mixture of experts (MMoE) layer with the long short-term memory (LSTM) encoding module;

[0009] The association information is respectively input into multiple parallel subtask modules in the multi-task learning model to obtain the corresponding physical quantity of the target device output by each subtask module, and different subtask modules correspond to different physical quantities.

[0010] Optionally, the gating network introduces a self-attention mechanism after the LSTM encoding module to represent the feature of each input as a weight parameter for the sharing module to calculate the association information in combination with the weight parameter.

[0011] Optionally, inputting the N physical quantities into a shared module of a multi-task learning model to obtain association information between different physical quantities mined by the shared module includes:

[0012] N physical quantities are encoded respectively through N LSTM encoding modules to obtain the feature vector of each physical quantity;

[0013] Perform concatenation operation on each eigenvector to obtain the eigenmatrix E;

[0014] The pre-trained matrix W q and W k Matrix Q and matrix K obtained by cross-producting the characteristic matrix E respectively;

[0015] Calculate the dot product between matrix Q and the transposed matrix of matrix K to get the self-attention mechanism score;

[0016] Obtaining a normalized value based on the self-attention mechanism score through a normalization function;

[0017] The normalized value is multiplied by an output value obtained by weighted summation of the N physical quantities to obtain the associated information.

[0018] Optionally, obtaining a normalized value based on the self-attention mechanism score through a normalization function includes:

[0019] Scaling the self-attention mechanism score using a preset scale to obtain a scaled self-attention mechanism score;

[0020] The scaled self-attention mechanism score is normalized to a probability distribution through a normalization function to obtain the normalized value.

[0021] Optionally, each subtask module includes a feature extraction module and a feature fusion module connected to the feature extraction module;

[0022] Among them, the feature extraction module is established based on the autoencoder, and the feature fusion module is established based on a transposed convolutional layer.

[0023] Optionally, the autoencoder is a fully convolutional network structure.

[0024] Optionally, the subtask modules include subtask modules corresponding to the main task and subtask modules corresponding to the auxiliary task; the method further includes:

[0025] Acquire a training set, the training set including N sample physical quantities corresponding one-to-one to the types of the N physical quantities, and label values ​​of corresponding physical quantities of target devices corresponding to the N sample physical quantities;

[0026] Output the N sample physical quantities to an untrained multi-task learning model to obtain the model results output by each subtask module;

[0027] For each subtask module, the loss function corresponding to the subtask module is used to calculate the loss value between the model result and the label value corresponding to the subtask module; different subtask modules have different loss functions;

[0028] Calculate the weighted sum of the loss values ​​corresponding to each subtask module. The weighted weight of the subtask module corresponding to the main task is greater than the weighted weight of the subtask module corresponding to the auxiliary task.

[0029] The untrained multi-task learning model is iteratively trained using the weighted sum to obtain a trained multi-task learning model.

[0030] Optionally, the different loss functions are of the same type.

[0031] Optionally, before calculating the weighted sum of the loss values ​​corresponding to the subtask modules, the method further includes:

[0032] Iteratively training the untrained multi-task learning model using different weighted weight combinations to obtain a model performance indicator corresponding to each weighted weight combination;

[0033] According to the model performance index, a weighted weight combination corresponding to the best model performance is selected.

[0034] The beneficial effects of the present application include at least: obtaining N physical quantities of electric energy data in the trunk line; inputting the N physical quantities into the shared module of the pre-trained multi-task learning model to obtain the correlation information between different physical quantities mined by the shared module; the shared module is established by combining the trainable matrix of the gated network in the MMoE with the LSTM encoding module; inputting the correlation information into multiple parallel sub-task modules in the multi-task learning model respectively to obtain the corresponding physical quantity of the target device output by each sub-task module, and the physical quantities corresponding to different sub-task modules are different; it can solve the problem that when using device status and active power to establish a multi-task learning model, the model performance of the multi-task learning model is poor due to the weak correlation between the device status and active power; since N physical quantities are used to predict multiple physical quantities of the target device, the multi-task learning model can learn the correlation between different physical quantities, and the correlation between different physical quantities is stronger than the correlation between the device status and active power. Therefore, the model performance of the multi-task learning model can be improved, thereby improving the accuracy of predicting any physical quantity of the target device.

[0035] In addition, by using MMoE combined with LSTM encoding modules to build shared modules, the correlation between different physical quantities can be learned more accurately, further improving the model performance of the multi-task learning model.

[0036] In addition, by adding Self-Attention to the gating network of MMoE, the accuracy of the model in calculating the main task can be improved.

[0037] In addition, by iteratively training the untrained multi-task learning model using different weighted weight combinations, the model performance indicators corresponding to each weighted weight combination are obtained; by selecting the weighted weight combination corresponding to the best model performance according to the model performance indicators, the accuracy of the weights corresponding to each subtask module can be improved, thereby further improving the model performance of the multi-task learning model.

[0038] The above description is only an overview of the technical solution of the present application. In order to more clearly understand the technical means of the present application and to implement it in accordance with the contents of the specification, the following is a detailed description of the preferred embodiments of the present application in conjunction with the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] Figure 1 This is a flowchart of a non-intrusive load monitoring method based on multi-task learning provided by an embodiment of the present application;

[0040] Figure 2 This is a schematic diagram of three different parameter sharing models provided by an embodiment of the present application;

[0041] Figure 3This is a schematic diagram comparing the differences between the RNN and LSTM unit network structures provided by an embodiment of the present application;

[0042] Figure 4 This is a schematic diagram of the LSTM encoding process provided by an embodiment of the present application;

[0043] Figure 5 This is a schematic diagram of an optimized MMoE network structure provided by an embodiment of the present application;

[0044] Figure 6 This is a schematic diagram of the structure of a subtask module provided by an embodiment of the present application;

[0045] Figure 7 This is a schematic diagram of the structure of a feature extraction module and a feature fusion module provided by an embodiment of the present application;

[0046] Figure 8 This is a schematic diagram of the impact of the main task weight on different performance indicators of the model provided by an embodiment of the present application. DETAILED DESCRIPTION

[0047] The following embodiments are used to illustrate the present invention, but are not intended to limit the scope of the present invention.

[0048] When inferring the power consumption data of the target device, the inference about each physical quantity can be regarded as an independent task. There is a certain connection between different physical quantities in the same circuit system, and they are not completely independent of each other. Therefore, there is a correlation between these independent tasks of inferring different physical quantities. And the correlation between different physical quantities is stronger than the correlation between physical quantities and device status. For the overall task of inferring multiple physical quantities of the target device in the entire circuit system, when the single-task models corresponding to different subtasks are incorporated into the overall model, the single-task models can complement each other with relevant information in the learning field and promote each other's learning, so as to achieve the purpose of improving generalization effect, avoiding overfitting of the overall model, and improving the performance of the overall model. Therefore, the present application proposes a non-invasive load monitoring method based on multi-task learning.

[0049] There are several key points to applying multi-task learning to solve problems. First, the multiple subtasks in multi-task learning should be correlated and share information. The non-intrusive load monitoring method provided in this application uses subtasks to infer corresponding physical quantity data from the equipment using physical quantity data from the mains. These subtasks have similar objectives, and the data processed by different subtasks is generated by the same circuit system. This setup ensures that the subtasks are related. Second, it is necessary to design appropriate methods to obtain shared representations of different subtasks. The non-intrusive load monitoring method provided in this application obtains shared information from different subtasks by designing a dedicated neural network module. This neural network module automatically discovers shared information between tasks by continuously adjusting parameters during model training. Finally, a key point in multi-task learning is to distinguish the importance of different subtasks. Although multi-task learning can improve the performance of each subtask simultaneously, people often pay more attention to a specific task. This specific task should be designated as the primary task, and the other tasks should be designated as auxiliary tasks. With this setup, the overall model will be more biased towards the primary task during training. Multi-task learning is a type of reduction transfer, which can improve model performance by reducing bias. The reduction bias in multi-task learning is provided by the auxiliary task. Since active power is directly related to power consumption, which is the user's electricity bill, the inferred active power value of the device is more accurate and more practical, and it is also convenient for comparison with other non-invasive load monitoring methods. Based on this, the non-invasive load monitoring method provided in this application will be explained by taking the inference of the active power of the device as the main task and the task of inferring other physical quantities as the auxiliary task. In actual implementation, the main task can also be set to other types of physical quantities according to actual needs.

[0050] Optionally, the present application uses the non-invasive load monitoring method based on multi-task learning provided in each embodiment as an example for use in an electronic device. The electronic device is a terminal or server with computing capabilities. The terminal can be a smart meter connected to the main line, or a computer or tablet computer connected to the smart meter for communication. This embodiment does not limit the type of electronic device.

[0051] Figure 1 This is a flowchart of a non-intrusive load monitoring method based on multi-task learning provided by an embodiment of the present application. The method includes at least the following steps:

[0052] Step 101: Obtain N physical quantities of power data in the trunk line.

[0053] Wherein, N is an integer greater than 1.

[0054] Generally speaking, increasing the number of input data types can improve model performance. However, it is important to note that the newly added data must be relevant to the task and the original data. Otherwise, adding data with little relevance to the model will hinder model training and convergence, resulting in a loss of model performance. Furthermore, when the model input information is diverse, it is necessary to design a suitable network structure to integrate multiple feature information, so that the neural network can combine different types of data to obtain its target data.

[0055] In load monitoring scenarios, most household electricity is AC. Therefore, the main physical quantities in the circuit system are as follows:

[0056] 1. Active power (P). When energy storage elements such as inductors and capacitors are present in an AC circuit, they may cause the direction of energy flow in the circuit system to change periodically. The net flow of energy in one direction during a complete cycle is called active power.

[0057] 2. Reactive power (Q): The energy that moves back and forth between the energy storage element and the power source during a complete cycle is called reactive power.

[0058] 3. Phase difference The presence of inductive or capacitive elements in a circuit will cause a phase difference between the voltage and current of the same frequency. This difference is called the phase difference.

[0059] 4. Apparent power (S). The modulus of the vector sum of active power and reactive power is called apparent power. Apparent power reflects the total capacity of the system and is a specific manifestation of both active and reactive power.

[0060] 5. Power Factor (PF): Power factor is a unique physical quantity in AC power systems. It refers to the ratio of active power to apparent power, and its value range is [0, 1].

[0061] 6. Admittance (Y). The essence of non-invasive load monitoring is to analyze the internal information of a circuit system through mains data. This information includes the type and operating status of the equipment in the circuit. Admittance is a physical quantity that can describe the internal information of a device. Its physical meaning is to characterize the difficulty of AC current passing through a circuit or system. Admittance consists of two parts: conductance (G) and susceptance (B). Conductance indicates the strength of a conductor's ability to transmit current; susceptance is the reciprocal of reactance, which describes the resistance of capacitance and inductance to current.

[0062] The above physical quantities can all represent the operating status of the entire circuit system from different aspects, which is related to the operating status and power of the equipment in the circuit. Comprehensive use of these physical quantity information can extract more useful physical quantity information from limited data.

[0063] When the above physical quantities exist in the same power grid system, the instantaneous voltage of the alternating current is recorded as u(t), the instantaneous current is recorded as i(t), and the instantaneous power is recorded as p(t). The effective values ​​of the voltage and current in the sinusoidal alternating current are recorded as V rms and I rms , the imaginary unit is denoted as j. The physical quantities in the circuit have the following constraints:

[0064] p(t)=u(t)i(t)

[0065]

[0066]

[0067]

[0068]

[0069] Y=G+jB

[0070]

[0071] It can be seen from the above calculation formula that there is a certain mathematical relationship between different physical quantities. The physical quantities existing in actual circuits are far more than those mentioned above. There are more than ten meaningful physical quantities that can be obtained in the circuit through direct acquisition or indirect calculation. These physical quantities may have information redundancy, and some physical quantities may not be helpful for non-invasive load monitoring tasks. The number of physical quantities input to the model affects the number of feature extraction modules and the number of layers of feature fusion modules. In order to avoid overfitting of the network model due to information redundancy, and to avoid too many parameters in the model, it is necessary to select a small number of representative key physical quantities (i.e., N physical quantities in this step) from more than ten physical quantities as the input of the model, that is, feature selection is required. The purpose of feature selection is to find the optimal feature subset. Feature selection can eliminate redundant or irrelevant features in the feature set, which can reduce the number of features and achieve the purpose of improving model performance and reducing running time.

[0072] Based on this, the methods for obtaining N physical quantities in this embodiment include but are not limited to the following:

[0073] The first method is to obtain N physical quantities preset by the user and related to the active power of the predicted target device.

[0074] The second method is to determine the types of the N physical quantities before obtaining the N physical quantities of the electric energy data in the main line.

[0075] The types of the N physical quantities can be determined using a filtering method, a wrapper method, or an embedded method. Each of these methods is described below.

[0076] 1. Filtering method. That is, the features are scored according to the Pearson correlation coefficient, chi-square verification, mutual information and maximum information coefficient, and distance correlation coefficient, and then a threshold or the number of features to be selected is set for screening. Specifically, the types of N physical quantities are determined, including: collecting power data of the main line to obtain a first physical quantity; using the power data to calculate each type of second physical quantity; using the Pearson correlation coefficient, chi-square verification, mutual information and maximum information coefficient, and distance correlation coefficient to score each first physical quantity and second physical quantity; and determining the type of the first physical quantity and / or second physical quantity that is greater than a preset scoring threshold as the type of the N physical quantities.

[0077] The second physical quantity is directly calculated using the first physical quantity, or is further calculated using the result calculated using the first physical quantity. This embodiment does not limit the implementation method of the second physical quantity.

[0078] 2. Packaging method. That is, according to the result value of the model evaluation index, several features are selected or eliminated from the feature set each time. Specifically, the types of N physical quantities are determined, including: determining the initial type of the physical quantity; using the physical quantity of the initial type to train the full convolutional autoencoder network to obtain the first result value of the model evaluation index; using the physical quantity of the initial type and the physical quantity of other types to train the full convolutional autoencoder network again to obtain the second result value of the model evaluation index; wherein the other types are different from the initial types, and the other types are data types that can be collected from the main line, or data types that can be calculated based on the electric energy data collected from the main line; when the second result value is greater than the first result value, the other types are added to the initial type, and the step of training the full convolutional autoencoder network again using the physical quantity of the initial type and the physical quantity of other types to obtain the second result value of the model evaluation index is executed again; when the second result value is less than or equal to the first result value, the initial type is determined to be the type of N physical quantities.

[0079] The initial types include at least two of active power, active component of current, reactive component of current, admittance and power factor.

[0080] 3. Embedding method. That is, first obtain the weight coefficient of each feature through a specific machine learning model, and then select features from large to small according to the coefficient value. This method is similar to the filtering method, but the difference is that the feature weight coefficient in this method is obtained through the model training method. Specifically, the types of N physical quantities are determined, including: collecting electric energy data to obtain a first physical quantity; using the electric energy data to calculate the second physical quantity of each type; inputting the first physical quantity and the second physical quantity into a pre-trained weight calculation model to obtain the weight coefficient of each physical quantity; and selecting the types of N physical quantities in descending order of the weight coefficients.

[0081] The weight calculation model is established based on a neural network and is trained using sample physical quantities and weight coefficient labels of the sample physical quantities.

[0082] In step 102 , N physical quantities are input into a shared module of a pre-trained multi-task learning model to obtain correlation information between different physical quantities mined by the shared module.

[0083] Among them, the shared module is established by combining the trainable matrix of the gating network in the Multi-gate Mixture-of-Experts (MMoE) layer with the long short-term memory (LSTM) encoding module.

[0084] In step 103, the associated information is input into multiple parallel subtask modules in the multi-task learning model to obtain the corresponding physical quantity of the target device output by each subtask module. Different subtask modules have different corresponding physical quantities.

[0085] According to steps 102 and 103, the multi-task learning model has multiple inputs and multiple outputs. The input of the multi-task learning model is a variety of different physical quantities in the trunk line, and the output of the model is the corresponding physical quantity data in the branch line where the target device is located. In the model training and reasoning stages, different physical quantity data are first input as input information into the same shared module. The shared module can learn and mine the information between different physical quantity data. Connected to the shared module are multiple parallel subtask modules for different tasks. The number of subtask modules is consistent with the number of subtasks. Each subtask module is used to infer the corresponding physical quantity data of the target device through N physical quantities such as active power and admittance in the trunk line. Among them, the number of subtasks is set based on user needs, and the number of subtasks can be the same as or different from the value of N.

[0086] In this example, a multi-expert mixture layer is used as the bottom shared layer of the model to explore information between different subtasks. Combining multiple subtask modules with the bottom shared layer forms a multi-task non-intrusive load monitoring model. Furthermore, in this example, the expert mixture layer is modified for non-intrusive load monitoring.

[0087] When applying multi-task learning methods to solve problems, it is necessary to design an appropriate network structure as a parameter sharing module. Currently, network results for multi-task learning include: Mixture-of-Experts (Mixture-of-Experts), Sparsely-Gated Mixture-of-Experts (MoE), and Multi-gate Mixture-of-Experts (MMoE). Among them, MMoE can explicitly model the relationship between models from the data. MMoE captures task-related information by automatically setting parameters during model training, thereby reducing the number of model parameters and avoiding the problem of difficulty in convergence during model training.

[0088] Model structure reference for traditional shared models Figure 2 As shown, Figure 2 (a) is a schematic diagram of the underlying sharing model. Figure 2 (b) is a schematic diagram of a single-gate MoE model. Figure 2 (c) is a schematic diagram of the multi-gate MoE model. The multi-gate MMoE model is the MMoE model, which is a type of bottom sharing model. The bottom sharing network is represented by the function f(x), and h is used to represent the bottom sharing network. k Represents the subtask modules corresponding to K different tasks, where the value range of k is 1≤k≤K. Figure 2 As shown in (a), the bottom shared network is connected to the input layer, and the unique network of each subtask module is built on the bottom shared network. The output y of each subtask module is k From the h corresponding to this subtask module k Therefore, for task k, the model can be expressed as:

[0089] y k =h k (f(x))

[0090] The original expert mixture model is expressed as follows:

[0091]

[0092] There are constraints g(x) i is the i-th output of g(x), indicating the expert fi Specifically, f i It is an expert network, g represents a gating network that brings together the results of all experts. The gating network g produces a distribution on n experts, and the final actual output of the model is the weighted sum of the outputs of all experts.

[0093] The MMoE model is obtained by combining the bottom shared model with the original mixture of experts model. Specifically, MMoE replaces the bottom shared network with the MoE layer and adds a separate gating network for each subtask k. At this time, the output of subtask k is:

[0094]

[0095] Among them, the gate control network g k (x) is realized by combining linear transformation and Softmax layer, namely:

[0096] g k (x) = Softmax(W gk x)

[0097] is a trainable matrix. n is the number of experts, and d is the feature dimension, or the number of physical quantities. A key feature of MMoE is that each gating network can learn to "select" a subset of experts to process input samples, making it suitable for flexible parameter sharing in multi-task learning scenarios. In special cases, if each gating network selects only the expert with the highest score, the n gating networks effectively linearly divide the input space into n regions, each corresponding to an expert. MMoE can model subtask relationships in complex ways.

[0098] However, the gating network of the expert module in the original MMoE framework is too simple. At the same time, the data of the non-invasive load monitoring task is a time series data, and the expert module in the original MMoE framework does not have a targeted network design for time series data. To this end, this embodiment modifies and optimizes the original MMoE, replacing the trainable matrix therein with a more complex LSTM encoding module. LSTM is a special recurrent neural network (RNN). A recurrent neural network is a neural network suitable for processing sequence data. Compared with general neural networks, RNN can effectively process changes in sequence data, which is in line with the characteristics of the data in the non-invasive load monitoring problem.

[0099] The network structure differences between RNN units and LSTM are as follows Figure 3As shown. As can be seen from the figure, compared with RNN, LSTM units have more cell state information, and LSTM can memorize information through cell state. The unique "gating mechanism" in the LSTM structure can effectively solve the gradient vanishing and gradient explosion problems of RNN during long sequence training. LSTM combines the input gate, output gate and forget gate through the Sigmoid function and the tanh function to enable LSTM to handle not only short-term dependency problems but also long-term dependency problems. This is very useful in solving non-invasive load monitoring problems. There are various devices in the entire circuit system, and the operating time of different devices is different. For example, the operating time of an electric kettle is about five minutes, and the operating time of a washing machine is about forty minutes. At the same time, the washing machine has different operating modes in different time periods of the entire operating cycle, and long-term and short-term data need to be analyzed at the same time. The process of encoding data using LSTM units is as follows. Figure 4 As shown. Figure 4 As can be seen in Figure 2, a sequence of data is input into the LSTM unit at each time step, and the output vector of the LSTM unit in the final state is the vector representation of the input data. In the non-intrusive load monitoring method provided in this embodiment, the LSTM encoding module encodes different physical quantity data from the input layer into different feature vectors of the same size.

[0100] Optionally, in this embodiment, the gating network in the original MMoE framework is also optimized. Specifically, the gating network introduces a self-attention mechanism after the LSTM encoding module to represent each input feature as a weight parameter, which the shared module then uses to calculate association information.

[0101] The Self-Attention mechanism originates from the Attention mechanism. The Attention mechanism is also called the attention mechanism. The idea of ​​the attention mechanism comes from allowing computers to simulate the internal process of human observation behavior. For example, when humans observe a picture, they will first quickly scan the entire picture, and then analyze the target area that needs to be focused on, and then devote more energy to this area. The Attention mechanism is similar to this process. It will represent the features of each input as a different weight parameter, so that the model can pay more attention to the part related to the input element and reduce the influence of other irrelevant information. The essence of the Attention function can be understood as a mapping from a query (Query) to multiple key-value pairs (Key-Value). The difference between Self-Attention and Attention is that the content of the source and target in Attention is different. The Attention mechanism occurs between the query element in the source and all elements in the target, while the source and target of Self-Attention are derived from the same content. In other words, Self-Attention is an attention mechanism that occurs between internal elements. Below, the specific calculation process of the gating network in the optimization scheme proposed in this embodiment is introduced. Please refer to Figure 5 , input N physical quantities into the shared module of the multi-task learning model, and obtain the correlation information between different physical quantities mined by the shared module, which includes at least the following steps:

[0102] Step 51: Encode N physical quantities respectively through N LSTM encoding modules to obtain a feature vector for each physical quantity.

[0103] Among them, each physical quantity corresponds to an LSTM encoding module, and different physical quantities correspond to different LSTM encoding modules.

[0104] Figure 5 In this example, the physical quantity sequence data with a dimension of 256 × 1 is input to each LSTM encoding module. The original sequence data is processed as the model input using the sliding window technique, and the window size is set to 256 data points. Therefore, the shape of the input vector corresponding to N physical quantities is 256 × 1. After encoding by the LSTM encoding module, a 1 × 64-dimensional feature vector is obtained.

[0105] Step 52: perform concatenation operation on each eigenvector to obtain a eigenmatrix E.

[0106] For example, the N 1×64-dimensional feature vectors obtained by N LSTM encoding modules are concatenated through the Concate function to obtain an N×64-dimensional feature matrix E.

[0107] Step 53: The pre-trained matrix Wq and W k Matrix Q and matrix K are obtained by cross-producting with the feature matrix E respectively.

[0108] Step 54: Calculate the dot product between the matrix Q and the transposed matrix of the matrix K to obtain the self-attention mechanism score.

[0109] For example, if matrix Q is an N×32 matrix and matrix K is an N×32 matrix, the dot product of matrix Q and the transposed matrix of matrix K yields an N×N matrix, i.e., the self-attention score.

[0110] Step 55: Obtain a normalized value based on the self-attention mechanism score through a normalization function.

[0111] In one example, the Softmax function is used to normalize the probability distribution to obtain a normalized value SoftmaxScore.

[0112] Optionally, in order to prevent the dot product of the transposed matrix of matrix Q and matrix K from being too large, it is necessary to use a scale Zoom in or out. k is the dimension of K. The purpose of scaling is to make the model have a more stable dimension. Accordingly, a normalized value is obtained based on the self-attention mechanism score through a normalization function, including: scaling the self-attention mechanism score using a preset scale to obtain a scaled self-attention mechanism score; and normalizing the scaled self-attention mechanism score to a probability distribution through a normalization function to obtain a normalized value.

[0113] Step 56 : multiply the normalized value by the output value of the weighted sum of the N physical quantities to obtain the associated information.

[0114] For example: Use the Concate function to perform weighted summation on N physical quantities to obtain a 256×N-dimensional output value X weighted , the normalized value is a 256×N dimensional matrix, then X weighted Multiply it with the 256×N-dimensional matrix, and then split the obtained eigenvalue into N 256×1-dimensional strings through the split function to obtain the associated information, which is output to the corresponding subtask modules respectively. In this way, the associated information corresponding to each sliding window can be obtained.

[0115] Specifically, the specific calculation process of the gating network provided in this embodiment can be expressed by the following formula:

[0116]

[0117] Where Q = W q E, K = W kE, E=LSTM(X).

[0118] Furthermore, this embodiment proposes a subtask module that can use multiple physical quantity data from the trunk line to infer a specific physical quantity of the target device. Each subtask module includes a feature extraction module and a feature fusion module connected to the feature extraction module. The feature extraction module is based on an autoencoder, and the feature fusion module is based on a transposed convolutional layer. The autoencoder is a fully convolutional network structure.

[0119] In this embodiment, the set of N physical quantities in the trunk line is recorded as Y, and each physical quantity data is recorded as Y j The set of N physical quantities in the sub-circuit where the target device is located is recorded as X, and each physical quantity data is recorded as X j This embodiment adopts a multi-task learning method to obtain X through Y, that is, to infer multiple physical quantity data in the line where the target device is located through multiple physical quantity data information in the trunk line. In the multi-task method, the purpose of a single task is set to obtain X through Y. j Get X j , that is, to infer the corresponding physical quantity data in the equipment branch line through a certain physical quantity data in the main line.

[0120] Given this, existing deep learning methods for non-intrusive load monitoring suffer from the excessive number of model parameters. In this embodiment, fully connected layers are not used in the subtask modules. Instead, convolution or transposed convolution operations are used to process data, significantly reducing the number of model parameters. Based on this principle, the subtask module design draws on the ideas of autoencoders and depthwise separable convolution. The subtask modules can infer the values ​​of corresponding physical quantities of target devices using shared information from the trunk line.

[0121] refer to Figure 6 The execution process of the non-invasive load monitoring method provided in this embodiment specifically includes: first, inputting the shared information into the feature extraction module 61, and the number of feature extraction modules is 1. The design concept of the feature extraction module comes from the autoencoder. The purpose of the autoencoder is to learn a representation for a set of data. The representation is also called characterization or encoding. The specific network design in the feature extraction module is described in detail below. The feature fusion module 62 is connected after the feature extraction module 61. The function of the feature fusion module 62 is to fuse the features extracted by the feature extraction module 61. The feature fusion module is described in more detail below. The last part of the network is the output layer 63. The output layer 63 is responsible for processing the fused features and converting them into the output of the model. Finally, the output of the model is denormalized to obtain the corresponding physical quantity of the target device.

[0122] Among them, the design idea of ​​the feature extraction module comes from the noise reduction autoencoder. To some extent, non-invasive load decomposition can be regarded as a denoising task. Typical denoising tasks include removing granular points from old photos or removing reverberation from recordings. As for non-invasive load decomposition, it can be regarded as recovering the "clean" power data of the target device from the "mixed" data containing "noise" in the main line. Autoencoder is a commonly used artificial neural network for noise reduction tasks. The autoencoder can use the input information as the target to be learned and learn a code based on the input information. The autoencoder mainly consists of two parts: encoder (Encoder) and decoder (Decoder). The encoder is used to compress the input into a latent space representation, and the decoder is used to reconstruct the input signal through the latent space representation. The autoencoder is a typical Encoder-Decoder structure. As a general framework, Encoder-Decoder can be used for processing tasks of various types of data such as text, language, image, video, etc. The encoder and decoder can be built with different network structures respectively. The specific network structure of the feature extraction module used in the multi-physical quantity fusion non-invasive load monitoring method is as follows. Figure 7 The autoencoder includes an encoder 71 and a decoder 72 connected to the encoder.

[0123] The encoder 71 includes three sequentially connected one-dimensional convolutional layers, and after the data input to the encoder passes through the three one-dimensional convolutional layers, the size of the features is reduced. The decoder 32 includes four sequentially connected one-dimensional transposed convolutional layers, and after the data input to the decoder passes through the four one-dimensional transposed convolutional layers, the size of the features is restored to the original size of the data input to the autoencoder.

[0124] Figure 7 In this example, three consecutive one-dimensional convolutional layers with a kernel size of 8 are used. The number of convolutional kernels in each one-dimensional convolutional layer is 1 / 2 of the number of convolutional kernels in the next one-dimensional convolutional layer. For example, the first one-dimensional convolutional layer has 8 convolutional kernels, the second one-dimensional convolutional layer has 16 convolutional kernels, and the third one-dimensional convolutional layer has 32 convolutional kernels. Each one-dimensional convolutional layer includes a Rectified Linear Unit (ReLU) function with a stride of 1.

[0125] Figure 7In the , the convolution kernel size of the four sequentially connected one-dimensional transposed convolutional layers is also 8, and the number of convolution kernels in each one-dimensional transposed convolutional layer is twice the number of convolution kernels in the next one-dimensional transposed convolutional layer. For example: the number of convolution kernels in the first one-dimensional transposed convolutional layer is 16, the number of convolution kernels in the second one-dimensional transposed convolutional layer is 8, the number of convolution kernels in the third one-dimensional transposed convolutional layer is 1, and the number of convolution kernels in the fourth one-dimensional transposed convolutional layer is 1; each one-dimensional transposed convolutional layer includes a sigmoid function with a stride of 1.

[0126] pass Figure 7 It can be seen that the parameters of the convolutional layer and the transposed convolutional layer are set to make the encoder and decoder network structures symmetrical. The data of the non-intrusive load monitoring task is time series data, so it is more suitable to use one-dimensional convolution to operate on it.

[0127] refer to Figure 7 The feature fusion layer is a transposed convolution layer 73. The convolution kernel size in the transposed convolution layer is not 1 in the time direction, and each transposed convolution layer does not use an activation function. For example, the convolution kernel size in the transposed convolution layer is 8, the number of convolution kernels is 1, and the stride is 1. The one-dimensional transposed convolution operation can fuse the features of the feature extraction module into a single feature.

[0128] The advantage of using transposed convolution over fully connected feature fusion methods is that it can greatly reduce the amount of computation and parameters. Depthwise separable convolution is mainly divided into two processes: channel-by-channel convolution and point-by-point convolution. In channel-by-channel convolution, each convolution kernel is responsible for only one channel, and each channel is convolved with only one convolution kernel. The channel-by-channel convolution operation performs an independent convolution operation on each channel and cannot effectively utilize the feature information of the same channel in spatial position. Therefore, it is necessary to combine the features through point-by-point convolution to generate new features. Point-by-point convolution and conventional convolution operations are very similar. The only difference is that the convolution kernel size of point-by-point convolution is 1×1×M, where M is the number of channels in the previous layer. The point-by-point convolution operation will perform a weighted combination of the features generated by the channel-by-channel convolution operation to generate new features.

[0129] The feature extraction module in the non-intrusive load monitoring method provided in this embodiment only extracts features from individual physical quantities and cannot effectively utilize the temporal information of the features. The feature extraction module shares similar characteristics with channel-by-channel convolution, so it is possible to fuse the extracted features using the concept of point-by-point convolution. However, unlike point-by-point convolution, the feature fusion module also needs to restore the features reduced in size by the convolution operation to their original input size. This ensures that the data of the trunk line and the equipment branch lines form a simultaneous correspondence, meeting the sequence-to-sequence requirement. Therefore, transposed convolution is used for feature fusion. Furthermore, the convolution kernel size in the feature fusion module differs from that in point-by-point convolution. The first dimension of the convolution kernel size in the transposed convolution, that is, the dimension in the temporal direction, cannot be 1. This is because performing a transposed convolution on the physical quantity data at a single time point is meaningless. Incorporating data from a time period into the receptive field of the transposed convolution can reveal features such as the degree of data variation. Therefore, the transposed convolution kernel size in this chapter is set to 8. The purpose of the feature fusion module is to fuse the features extracted by the feature extraction module, replacing the fully connected layer in Seq2Point. Therefore, no activation function is used in the transposed convolution layer in the feature fusion module.

[0130] In this embodiment, the subtask modules include subtask modules corresponding to the main task and subtask modules corresponding to the auxiliary task. Before using the multi-task learning model, it is necessary to train the multi-task learning model. The specific training process includes at least the following steps:

[0131] Step 1: Obtain a training set, where the training set includes N sample physical quantities corresponding one-to-one to the types of the N physical quantities, and label values ​​of corresponding physical quantities of target devices corresponding to the N sample physical quantities.

[0132] Step 2: Output the N sample physical quantities to the untrained multi-task learning model to obtain the model results output by each subtask module.

[0133] Step 3: For each subtask module, use the loss function corresponding to the subtask module to calculate the loss value between the model result and the label value corresponding to the subtask module; different subtask modules correspond to different loss functions.

[0134] Different loss functions have the same type.

[0135] Step 4: Calculate the weighted sum of the loss values ​​corresponding to each subtask module. The weighted weight of the subtask module corresponding to the main task is greater than the weighted weight of the subtask module corresponding to the auxiliary task.

[0136] When there are N subtasks, the loss function of the i-th task is defined as The corresponding weight factor is α i, then the overall loss function The calculation formula is:

[0137]

[0138] When setting weights for different tasks, we need to consider both the task types and their importance. Balancing different types of tasks is necessary because when the loss functions for different tasks have significantly different scales, failing to unify the scales of each loss function can cause the network to be dominated by the simpler task during training, impacting overall model performance.

[0139] In this embodiment, different subtasks are all about inferring data in the equipment line from the trunk data, and different subtasks are tasks of the same type. Learning tasks in machine learning can be divided into two categories: classification and regression. The prediction of qualitative output or discrete variables is a classification task, and the prediction of quantitative output or continuous variables is a regression task. According to this definition, the non-invasive load monitoring task belongs to the regression task. In this embodiment, the mean square error (MSE) commonly used in regression tasks is selected as the loss function of the subtask. Because the type of loss function selected for each subtask is the same, there is no need to consider the impact of task type differences when setting task weights. In terms of task importance, this embodiment uses the subtask of inferring the physical quantity of active power as the main task, and other tasks as auxiliary tasks to help the main task obtain better performance. Therefore, the weight of the loss function corresponding to the main task is greater than that of other auxiliary tasks.

[0140] Step 5: Use the weighted sum to iteratively train the untrained multi-task learning model to obtain a trained multi-task learning model.

[0141] Optionally, before calculating the weighted sum of the loss values ​​corresponding to each subtask module, it also includes: iteratively training the untrained multi-task learning model using different weighted weight combinations to obtain the model performance index corresponding to each weighted weight combination; and selecting the weighted weight combination corresponding to the best model performance according to the model performance index.

[0142] Schematically, the performance evaluation indicators of the multi-task learning model include but are not limited to: Mean Absolute Error (MAE), signal aggregate error (SAE) and F1 score (F1-Score).

[0143] When calculating the F1 score, it is necessary to set the power-on threshold of the device according to the device characteristics of the data set selected in this embodiment. For example, the power-on threshold settings of each target device in this embodiment are shown in Table 2.

[0144] Table 2:

[0145]

[0146] For example, we can set several different weight values ​​for each task and conduct experiments to observe the model performance. Specifically, among N tasks, there is one main task and N-1 auxiliary tasks. Let the loss weight of the main task be β and the loss weight of the i-th auxiliary task be γ. i In the loss weight determination process of this embodiment, they must meet the following constraints:

[0147] 1. The main task needs to be more important than any auxiliary task, so the loss function weight of the main task should be greater than that of any auxiliary task, so β>1 / N should be satisfied.

[0148] 2. Each auxiliary task has the same status in the entire multi-task model training process, so the weight of each auxiliary task should be equal.

[0149] 3. The sum of the weights of all tasks is 1, so

[0150] During the experiment, the weight of the main task was increased by 0.1 from 0.3 to 1. The weights of the other four auxiliary tasks were set to meet the above three constraints. If a washing machine is used as the target device, MAE, SAE, and F1 score are used as model performance evaluation indicators.

[0151] refer to Figure 8 As can be seen from the figure, when the weight of the main task is 0.3, the model performance is poor. As the weight of the main task increases, the model performance gradually improves. When the weight of the main task is 0.7, the model's three performance indicators perform best. As the weight of the main task continues to increase, the model's performance gradually decreases. When the weight of the main task is 1 and the weights of other tasks are 0, the model performance is the worst.

[0152] In addition, this embodiment also compares the single-task method, the multi-task method implemented using the original MMoE, and the multi-task method implemented using the optimized MMoE in this application. The comparison results are shown in Table 2. As can be seen from Table 2, the performance of the single-task method, the original MMoE method, and the optimized MMoE method improves in this order. In terms of MAE, the original MMoE averaged a decrease of 10.230 points compared to single-task performance, a decrease of approximately 31.17%, while the optimized MMoE averaged a decrease of 4.373 points compared to the original MMoE, a decrease of approximately 19.36 points. In terms of SAE, the original MMoE averaged a decrease of 0.073 points compared to single-task performance, a decrease of approximately 23.03%, while the optimized MMoE averaged a decrease of 0.030 points compared to the original MMoE, a decrease of approximately 12.30%. In terms of F1, the original MMoE averaged a 0.097 point increase over single-task performance, an increase of approximately 17.70%, while the optimized MMoE averaged a 0.034 point increase over the original MMoE, an increase of approximately 5.27%. The experimental results in Table 2 show that both the original MMoE and the optimized MMoE achieve better performance than the single-task learning method, demonstrating that multi-task learning methods can learn more useful information and improve decomposition performance compared to single-task learning methods. In addition, through the experimental comparison between the optimized MMoE and the original MMoE, it is shown that the optimized MMoE is more suitable for non-intrusive load monitoring than the original MMoE, which proves the effectiveness of the MMoE optimization scheme proposed in this application.

[0153] Table 2:

[0154]

[0155] According to the above content, in this embodiment, first, the weight of each subtask in the non-invasive load monitoring method based on multi-task learning is determined through experiments. Subsequently, a comparative experiment is conducted on the multi-task learning method implemented by applying a multi-expert mixed layer and the method using a single task, which proves that setting the original task as the main task in multi-task learning can effectively improve the performance of the original task, confirming the effectiveness of the multi-task learning method. Finally, a comparison is made between the multi-task non-invasive load monitoring method implemented by the optimized MMoE framework and the original MMoE framework, which proves that, in terms of non-invasive load monitoring problems, the MMoE framework optimization scheme proposed in this application can better model task relationships, mine information between tasks, and improve model performance than the original MMoE. In the comparative experiment, the physical quantity selected by the single-task method is active power, and the multi-task method selects 5 physical quantities. In this embodiment, the physical quantity selection scheme is active power, active component of current, reactive component of current, admittance and power factor. The specific reasons are as follows:

[0156] Active power (P): Since the physical quantity output by the model is active power, it is most intuitive to use active power as input information.

[0157] The active component of current (Ia), or the ratio of active power to voltage, minimizes the effects of voltage fluctuations in AC systems due to the grid. Calculating this ratio by dividing active power by voltage can minimize the effects of voltage fluctuations.

[0158] The reactive component of current (Ir), that is, the ratio of reactive power to voltage: the reason is the same as that of the active component of current.

[0159] Admittance (Y): Admittance is a characteristic quantity that is independent of voltage and its value depends only on the properties of the device itself.

[0160] Power Factor (PF): The power factor is closely related to the nature of the load in a circuit. Different electrical appliances have different inductive, capacitive, and resistive components. The power factor value varies depending on the devices in the circuit. It is useful for distinguishing the types of devices in a circuit system and is a suitable input for non-intrusive load decomposition.

[0161] As can be seen from the foregoing, in the non-intrusive load monitoring method provided by this embodiment, the task of inferring the active power data of the target device from the active power data of the main line is set as the main task, and the task of inferring other physical quantities is set as the auxiliary task. During the model training process, the information learned by the auxiliary tasks can help the model generalize and improve the learning effect of the main task. In terms of the model network structure design, the subtask module and the multi-gate expert mixture layer are combined to implement a non-intrusive load monitoring model based on a multi-task approach. Because the neural network in the multi-gate expert mixture layer is too simple and its network structure design does not consider the characteristics of time series data, this embodiment optimizes the multi-gate expert mixture layer by combining the LSTM encoding concept and the self-attention mechanism. Finally, experiments were conducted on the real data set AMPds2, comparing a single-task learning model, a multi-task learning model implemented using the original multi-gate expert mixture layer, and a multi-task learning model implemented using the optimized multi-gate expert mixture layer. The results confirm that the multi-task learning method is more effective than the single-task learning method in solving the non-intrusive load monitoring problem, and also confirm the effectiveness of the multi-gate expert mixture layer optimization scheme proposed in this embodiment.

[0162] In summary, the non-intrusive load monitoring method based on multi-task learning provided in this embodiment obtains N physical quantities of power data in the trunk line; inputs the N physical quantities into the shared module of the pre-trained multi-task learning model to obtain the correlation information between the different physical quantities mined by the shared module; the shared module is established by combining the trainable matrix of the gate control network in the MMoE with the LSTM encoding module; the correlation information is respectively input into multiple parallel subtask modules in the multi-task learning model to obtain the corresponding physical quantity of the target device output by each subtask module, and the physical quantities corresponding to different subtask modules are different; this can solve the problem of poor model performance of the multi-task learning model when using device status and active power to establish a multi-task learning model due to the weak correlation between device status and active power; since N physical quantities are used to predict multiple physical quantities of the target device, the multi-task learning model can learn the correlation between different physical quantities, and the correlation between different physical quantities is stronger than the correlation between device status and active power. Therefore, the model performance of the multi-task learning model can be improved, thereby improving the accuracy of predicting any physical quantity of the target device.

[0163] In addition, by using MMoE combined with LSTM encoding modules to build shared modules, the correlation between different physical quantities can be learned more accurately, further improving the model performance of the multi-task learning model.

[0164] In addition, by adding Self-Attention to the gating network of MMoE, the accuracy of the model in calculating the main task can be improved.

[0165] In addition, by iteratively training the untrained multi-task learning model using different weighted weight combinations, the model performance indicators corresponding to each weighted weight combination are obtained; by selecting the weighted weight combination corresponding to the best model performance according to the model performance indicators, the accuracy of the weights corresponding to each subtask module can be improved, thereby further improving the model performance of the multi-task learning model.

[0166] Optionally, the present application also provides a computer-readable storage medium, in which a program is stored. The program is loaded and executed by a processor to implement the non-intrusive load monitoring method based on multi-task learning of the above method embodiment.

[0167] Optionally, the present application also provides a computer product, which includes a computer-readable storage medium, in which a program is stored. The program is loaded and executed by a processor to implement the non-intrusive load monitoring method based on multi-task learning of the above method embodiment.

[0168] The technical features of the above-mentioned embodiments can be combined arbitrarily. In order to make the description concise, not all possible combinations of the technical features in the above-mentioned embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0169] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present invention. It should be noted that a person skilled in the art could make various modifications and improvements without departing from the spirit of the present application, all of which fall within the scope of protection of the present application. Therefore, the scope of protection of the present patent application shall be determined by the appended claims.

Claims

1. A non-intrusive load monitoring method based on multi-task learning, characterized in that: The method comprises: Obtaining N physical quantities of power data in the trunk line, where N is an integer greater than 1; Inputting the N physical quantities into a shared module of a pre-trained multi-task learning model to obtain correlation information between different physical quantities mined by the shared module; the shared module is established by combining the trainable matrix of the gating network in the multi-gate mixture of experts (MMoE) layer with the long short-term memory (LSTM) encoding module; Inputting the association information into multiple parallel subtask modules in the multi-task learning model respectively, obtaining the corresponding physical quantity of the target device output by each subtask module, where different subtask modules correspond to different physical quantities; Inputting the N physical quantities into a shared module of the multi-task learning model to obtain correlation information between different physical quantities mined by the shared module includes: N physical quantities are encoded respectively through N LSTM encoding modules to obtain the feature vector of each physical quantity; Perform concatenation operation on each eigenvector to obtain the eigenmatrix E; The pre-trained matrix W q and W k Matrix Q and matrix K obtained by cross-producting the characteristic matrix E respectively; Calculate the dot product between matrix Q and the transposed matrix of matrix K to get the self-attention mechanism score; Obtaining a normalized value based on the self-attention mechanism score through a normalization function; The normalized value is multiplied by an output value obtained by weighted summation of the N physical quantities to obtain the associated information.

2. The method according to claim 1, characterized in that The gating network introduces a self-attention mechanism after the LSTM encoding module to represent the feature of each input as a weight parameter for the sharing module to calculate the association information in combination with the weight parameter.

3. The method according to claim 2, characterized in that The normalized value is obtained by a normalization function based on the self-attention mechanism score, including: Scaling the self-attention mechanism score using a preset scale to obtain a scaled self-attention mechanism score; The scaled self-attention mechanism score is normalized to a probability distribution through a normalization function to obtain the normalized value.

4. The method according to claim 1, wherein Each subtask module includes a feature extraction module and a feature fusion module connected to the feature extraction module; Among them, the feature extraction module is established based on the autoencoder, and the feature fusion module is established based on a transposed convolutional layer.

5. The method according to claim 4, characterized in that The autoencoder is a fully convolutional network structure.

6. The method according to claim 1, characterized in that The subtask modules include subtask modules corresponding to the main task and subtask modules corresponding to the auxiliary task; the method further includes: Acquire a training set, the training set including N sample physical quantities corresponding one-to-one to the types of the N physical quantities, and label values ​​of corresponding physical quantities of target devices corresponding to the N sample physical quantities; Input the N sample physical quantities into an untrained multi-task learning model to obtain the model results output by each subtask module; For each subtask module, the loss function corresponding to the subtask module is used to calculate the loss value between the model result and the label value corresponding to the subtask module; different subtask modules have different loss functions; Calculate the weighted sum of the loss values ​​corresponding to each subtask module. The weighted weight of the subtask module corresponding to the main task is greater than the weighted weight of the subtask module corresponding to the auxiliary task. The untrained multi-task learning model is iteratively trained using the weighted sum to obtain a trained multi-task learning model.

7. The method according to claim 6, characterized in that Different loss functions have the same type.

8. The method according to claim 6, characterized in that Before calculating the weighted sum of the loss values ​​corresponding to the subtask modules, the method further includes: Iteratively training the untrained multi-task learning model using different weighted weight combinations to obtain a model performance indicator corresponding to each weighted weight combination; According to the model performance index, a weighted weight combination corresponding to the best model performance is selected.

Citation Information

Patent Citations

  • A non-intrusive load decomposition method and system based on a long-short-term memory network

    CN109685314A

  • Device and method for predicting energy load

    CN113627091A

  • Comprehensive energy load prediction method based on multi-task learning strategy and deep learning

    CN113822481A