Federal learning-based non-intrusive load monitoring model adaptive migration method and device, and storage medium

By employing federated learning and domain adaptation techniques, the challenges of cross-domain migration and privacy security of NILM models are addressed. This enables efficient migration and performance improvement of NILM models on edge devices, ensuring data privacy and model adaptability.

CN121599271APending Publication Date: 2026-03-03ELECTRIC POWER SCI & RES INST OF STATE GRID TIANJIN ELECTRIC POWER CO +2
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511522917.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-23
Publication Date
2026-03-03

AI Technical Summary

Technical Problem

Existing NILM models face challenges in cross-domain migration and privacy security, resulting in insufficient adaptability and reliability in different home power environments, as well as high deployment difficulty and communication costs.

Method used

A federated learning-based approach is adopted, in which a global NILM model is built and pruned in the cloud and then distributed to edge devices for adaptive transfer training. Combined with the domain adaptation technique CORAL, the local model's adaptability is enhanced, and the global model is updated through a federated aggregation algorithm to ensure data privacy and security.

Benefits of technology

It enables efficient migration and performance improvement of NILM models on edge devices, ensures user data privacy and security, reduces model complexity and communication costs, and improves the model's adaptability and decomposition accuracy in different home environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121599271A_ABST
    Figure CN121599271A_ABST
Patent Text Reader

Abstract

The invention discloses a federated learning-based non-intrusive load monitoring model adaptive migration method and device, and a storage medium. According to the federated learning-based non-intrusive load monitoring model adaptive migration method, a global NILM model is constructed in a cloud server, a lightweight NILM model is constructed through a model pruning technology and is issued to an edge device, and a domain adaptive method is adopted in the edge device to enhance the adaptability of the local NILM model. And finally, based on a federated learning mechanism, aggregating local NILM models of a plurality of target domain users to update a global NILM model, and ensuring data and privacy security of user loads through interaction of model parameters. By continuously repeating the cloud edge interaction process, effective migration and performance improvement of the NILM model from a cloud source domain to an edge end target domain user are realized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of non-intrusive power load monitoring technology, and in particular to an adaptive migration method, device and storage medium for a non-intrusive load monitoring model based on federated learning. Background Technology

[0002] The power industry is a key foundational industry driving national economic development. With the sustained high-speed development of the national economy and the increasing modernization of social life, total electricity consumption has shown a rapid growth trend, posing a severe challenge to the national energy supply. In response to this situation, it is essential to actively build a new power system based on new energy sources, promote the application of refined energy management on the demand side, tap the potential for flexible dispatch of demand-side resources, alleviate the contradiction between power supply and demand, and achieve the efficient utilization of clean energy.

[0003] Load monitoring is a key technology for refined energy management. It is divided into intrusive load monitoring (ILM) and non-intrusive load monitoring (NILM) based on whether sensors are installed inside the user's premises. Among them, NILM has become the focus of load monitoring research because of its advantages such as low maintenance cost and easy implementation.

[0004] NILM (Non-Integrated Power Management) technology was first proposed by MIT scholar Hart in the 1980s. Its aim is to infer the operating status and energy consumption of various electrical devices in a scenario by analyzing the total power signal acquired at the power input, without intruding on the user's internal systems. Currently, the technical solutions in this field are primarily data-driven. Although they have shown some effectiveness in load monitoring, the limited generalization ability of the models, leading to a decline in decomposition accuracy, remains an unresolved issue.

[0005] In recent years, thanks to the rapid development of artificial intelligence technology, the academic community both domestically and internationally has proposed a variety of deep learning models to solve the NILM problem. In 2015, it was proposed to apply recurrent neural networks (RNNs) and denoising autoencoders (DAEs) to this problem, achieving decomposition results superior to traditional methods. Subsequently, researchers have explored and applied convolutional neural networks (CNNs), generative adversarial networks (GANs), and long short-term memory networks (LSTMs), significantly enhancing the feature extraction capabilities of NILM models.

[0006] Applying the aforementioned NILM model to real-world systems for residential users faces numerous challenges, primarily due to the following three aspects: First, the approach to solving the NILM problem using deep learning involves training a neural network model for each electrical appliance within the user's home. Given that residential users typically have dozens of electrical appliances, the memory and computing resources required for model training can only be met by cloud devices, significantly increasing the difficulty of deploying the model on edge devices. Second, the large amount of data required for model training relies on the interactive transmission between cloud and edge devices. This process not only significantly increases communication costs but also poses a potential risk to user privacy and security. Finally, the performance of the trained model may gradually decline due to changes in the type and number of electrical appliances in the user's home, thus requiring adaptive migration of the model to adapt to different household electricity environments.

[0007] To address this, various lightweight methods have been applied to NILM models, significantly reducing the number of parameters and computational load to enable model deployment on edge devices. Federated learning methods are increasingly being used in the NILM field to ensure user privacy and data security. These methods primarily utilize labeled data from edge devices to train local models, then upload the parameters to the cloud to update the global model. However, these methods have two main drawbacks: firstly, labeled data from edge devices is difficult to obtain; and secondly, the updated global model is not suitable for cross-domain transfer. While transfer learning methods can improve the adaptability of NILM models to specific scenarios, there is currently no research on cross-domain model transfer. To date, although some of the aforementioned methods have successfully completed NILM tasks using lightweight neural network models, these methods have not yet designed federated learning mechanisms more suitable for cross-domain transfer, taking into account the functional characteristics of NILM models. Furthermore, to adapt to the home electricity usage scenarios of different users across regions, the mechanism for knowledge transfer through domain adaptation methods in lightweight NILM models deployed on edge devices also requires further research.

[0008] In particular, for the NILM task, although the academic community has developed a variety of deep neural network models, these models have not yet achieved large-scale application and promotion. The main factors hindering their widespread adoption include: privacy and security concerns leading to user worries, the complexity of the models themselves increasing the difficulty of practical deployment, and limited generalization ability affecting the consistency and reliability of the models in different scenarios.

[0009] Therefore, developing a model transfer technology that can protect privacy and security is of great significance. Summary of the Invention

[0010] The purpose of this invention is to overcome the shortcomings and defects of the prior art and to provide a non-intrusive load monitoring model adaptive migration method, device and storage medium based on federated learning.

[0011] One objective of this invention is to provide a non-intrusive adaptive migration method for load monitoring models based on federated learning, comprising:

[0012] S1. The cloud server sends a model training request to the edge device and creates a user set consisting of the users to be trained after obtaining their consent.

[0013] S2. The cloud server builds a global NILM model and initializes the model. Based on the pre-stored dataset, it trains and prunes the global NILM model to obtain a lightweight NILM model. The lightweight NILM model is then distributed to all edge devices in the user set.

[0014] S3. The cloud server selects labeled data from the pre-stored dataset and distributes it to all edge devices in the user set;

[0015] S4. The edge device receives the lightweight NILM model, performs adaptive transfer training of the local NILM model based on the distributed labeled data and locally stored unlabeled data, and uploads the trained local NILM model to the cloud server.

[0016] S5. The cloud server receives the local NILM model uploaded by each edge device, updates the global NILM model based on the local NILM model using the federated aggregation algorithm, and then prunes and lightens the updated global NILM model before redistributing it to all edge devices in the user set.

[0017] S6. Determine whether model aggregation has ended based on the global NILM model test results. If not, return to step S4. If yes, each edge device receives the lightweight local NILM model that has been pruned and distributed by the cloud server for the last time, which serves as the final edge-end local NILM model.

[0018] Preferably, in step S2, the global NILM model is composed of two feature extraction convolutional layers, one Flattern layer, and one power regression network layer connected in sequence.

[0019] Preferably, in step S2, when pruning the global NILM model, filter pruning is first used to simplify the convolutional layer architecture of the model, and then neuron pruning is used to reduce the number of parameters and computational cost of the fully connected layers.

[0020] Preferably, in step S2, distributing the lightweight NILM model to all edge devices in the user set means distributing all model parameters of the lightweight NILM model to all edge devices in the user set.

[0021] Preferably, in step S4, the CORAL method is used to perform the adaptive transfer training process of the local NILM model.

[0022] Preferably, in step S4, uploading the trained local NILM model to the cloud server means only uploading the parameters of the fully connected layers of the local NILM model to the cloud server.

[0023] Preferably, in step S5, the global NILM model is updated based on the local NILM model using a federated aggregation algorithm, including:

[0024] After each edge device uploads its trained local NILM model to the cloud server, a federated averaging algorithm is used to average all parameters at the same location in each local NIL model, and the resulting parameters are used to update the global NILM model.

[0025] Preferably, in step S5, the updated global NILM model is pruned and lightweighted and then redistributed to all edge devices in the user set, which means that all model parameters of the updated global NILM model after pruning and lightweighting are redistributed to all edge devices in the user set.

[0026] A second objective of the present invention is to provide a computer device including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the method described.

[0027] A third objective of the present invention is to provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the method described.

[0028] This invention constructs a global NILM model on a cloud server, builds a lightweight NILM model using model pruning techniques, and distributes it to edge devices. Then, a domain-adaptive method is used on the edge devices to enhance the adaptability of the local NILM model. Finally, a federated learning mechanism is used to aggregate the local NILM models of multiple target domain users to update the global NILM model. The interaction of model parameters ensures the data and privacy security of user workloads. By continuously repeating the above cloud-edge interaction process, the effective migration and performance improvement of the NILM model from the source domain in the cloud to the target domain users at the edge are achieved. Attached Figure Description

[0029] Figure 1 This is a schematic diagram of the adaptive migration framework of the NILM model based on federated learning proposed in the adaptive migration method of the non-intrusive load monitoring model based on federated learning in this invention.

[0030] Figure 2This is a flowchart of the non-intrusive load monitoring model adaptive migration method based on federated learning, which is the subject of this invention.

[0031] Figure 3 This is a structural diagram of the NILM model designed in this invention. Detailed Implementation

[0032] The present invention will be further described in detail below with reference to the accompanying drawings and specific embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.

[0033] In an exemplary embodiment of this application, the non-intrusive load monitoring model adaptive migration method based on federated learning constructs a global NILM model on a cloud server, constructs a lightweight NILM model using model pruning techniques and distributes it to edge devices, then enhances the adaptability of the local NILM model on the edge devices using a domain adaptation method, and finally updates the global NILM model by aggregating the local NILM models of multiple target domain users based on a federated learning mechanism. The interaction of model parameters ensures the data and privacy security of user loads. By continuously repeating the above cloud-edge interaction process, the effective migration and performance improvement of the NILM model from the cloud source domain to the target domain users at the edge are achieved.

[0034] like Figure 1 As shown in the embodiment of the present invention, the non-intrusive load monitoring model adaptive migration method based on federated learning is implemented using a federated learning-based NILM model adaptive migration framework, including a cloud server and multiple edge devices deployed at power users 1, 2, ..., K. In this NILM model adaptive migration framework, the cloud server acts as a coordinator, not only training the constructed global NILM model based on labeled data of the target appliances and pruning it before deploying it to the edge devices, but also aggregating the local NILM model parameters of multiple users to update and optimize the global NILM model. Through continuous interaction, the global NILM model is migrated from the cloud source domain to the target domain users at the edge. The edge devices receive lightweight model parameters from the cloud server, perform adaptive training in their local environment using stored unlabeled load data, update their local NILM model parameters, and upload them to the cloud server. This process iterates repeatedly until training is complete, at which point the edge devices use the updated local NILM model from the last round of training to complete the NILM task.

[0035] The key advantage of this NILM model adaptive transfer framework is that all edge devices participating in federated learning can update and optimize the NILM model by leveraging the collaboration mechanism between the cloud server and the edge devices without uploading their own payload data to the cloud server, thus ensuring data privacy while improving model performance.

[0036] See Figure 2 As shown in the embodiment of this application, the adaptive transfer method for NILM models based on federated learning specifically achieves the collaborative training of NILM models through the following steps:

[0037] S1. The cloud server sends a model training request to the edge device and creates a user set consisting of the users to be trained after obtaining their consent.

[0038] S2. The cloud server builds a global NILM model and initializes the model. Based on the pre-stored dataset, it trains and prunes the global NILM model to obtain a lightweight NILM model. The lightweight NILM model is then distributed to all edge devices in the user set.

[0039] S3. The cloud server selects labeled data from the pre-stored dataset and distributes it to all edge devices in the user set;

[0040] S4. The edge device receives the lightweight NILM model, performs adaptive transfer training of the local NILM model based on the distributed labeled data and locally stored unlabeled data, and uploads the trained local NILM model to the cloud server.

[0041] S5. The cloud server receives the local NILM model uploaded by each edge device, updates the global NILM model based on the local NILM model using the federated aggregation algorithm, and then prunes and lightens the updated global NILM model before redistributing it to all edge devices in the user set.

[0042] S6. Determine whether model aggregation has ended based on the global NILM model test results. If not, return to step S4. If yes, each edge device receives the lightweight local NILM model that has been pruned and distributed by the cloud server for the last time, which serves as the final edge-end local NILM model.

[0043] In this embodiment of the invention, step S2 provides a global NILM model consisting of two feature extraction convolutional layers (composed of Padding, Conv, and PreLU from input to output), a Flattern layer, and a power regression network layer (composed of PreLU and a fully connected layer FC from input to output) connected sequentially. The sequence-to-sequence learning architecture adopted by this global NILM model increases the complexity of the model, leading to an increase in the number of parameters and computational requirements, which in turn results in a large memory footprint and a long computation time. Therefore, pruning and lightweighting are required.

[0044] In this embodiment of the invention, in step S2, when pruning the global NILM model, two pruning measures are performed to construct the final lightweight NILM model. First, filter pruning is used to simplify the convolutional layer architecture of the model, and second, neuron pruning is used to reduce the number of parameters and computation of the fully connected layers.

[0045] In this embodiment of the invention, step S2, distributing the lightweight NILM model to all edge devices in the user set, means distributing all model parameters of the lightweight NILM model to all edge devices in the user set.

[0046] In this embodiment of the invention, in step S3, the cloud server filters some labeled data from the pre-stored dataset and sends it to the edge devices. The purpose is to provide each edge device with the label data required for adaptive migration. For example, the cloud server randomly selects the total power data of the working and non-working sequences of 50% of the target appliances (such as electric kettles, microwave ovens, refrigerators, dishwashers, and washing machines) in the dataset. This can make full use of the user diversity in the dataset and effectively improve the decomposition performance of the model.

[0047] In this embodiment of the invention, step S4 employs the CORAL method for adaptive transfer training of the local NILM model. Correlation alignment (CORAL) is a key method in domain adaptation techniques, aiming to mitigate domain shift by adjusting the similarity of feature distributions between the source and target domains. The core of the CORAL method lies in learning a mapping that not only captures the nonlinear relationship between the source and target domains but also constructs a differentiable covariance matrix alignment loss function during this transformation process, thereby effectively reducing the statistical differences between the two domain feature spaces.

[0048] Specifically, the CORAL method emphasizes minimizing the Frobenius norm distance between the second-order covariances of features in the source and target domains, ensuring higher consistency in the second-order statistical properties of features after nonlinear transformation across different domains. Therefore, when the pruned local model is deployed to an edge device, this invention employs the CORAL method to implement an adaptive transfer process for the local NILM model.

[0049] In this embodiment of the invention, step S4, uploading the trained local NILM model to the cloud server, refers only to uploading the parameters of the fully connected layers of the local NILM model to the cloud server.

[0050] In this embodiment of the invention, step S5 involves updating the global NILM model based on the local NILM model using a federated aggregation algorithm, including:

[0051] After each edge device uploads its trained local NILM model to the cloud server, a federated averaging algorithm is used to average all parameters at the same location in each local NIL model, and the resulting parameters are used to update the global NILM model.

[0052] The federated aggregation algorithm of this invention employs the federated averaging (FedAvg) algorithm. After each edge user uploads the trained model parameters to the cloud server, the algorithm directly averages all parameters at the same location in the model, prunes the aggregated and updated global model, and then distributes it to each edge user. Through multiple rounds of iterative updates, the FedAvg algorithm fully utilizes local data from each user's domain, thereby enhancing the generalization ability of the global model.

[0053] In this embodiment of the invention, step S5, after the updated global NILM model is pruned and lightweighted, it is redistributed to all edge devices in the user set. This means that all model parameters of the updated global NILM model after pruning and lightweighting are redistributed to all edge devices in the user set.

[0054] In the CNN model architecture of the global NILM model, its convolutional layers can extract general features from different domains, while the domain shift is mainly reflected in the feature representation of the fully connected layers. This indicates that although the domain of the input data may vary, the features learned by the convolutional layers have broad applicability, while the parameters of the fully connected layers need to be adjusted for specific domains to optimize performance. Typically, cloud servers can access and download labeled datasets, which originate from anonymized user information. For user privacy and security reasons, edge devices are only authorized to collect unlabeled total payload data. Therefore, in this embodiment, in the proposed model architecture, the training process of the convolutional layers is designed specifically for cloud servers to fully utilize their powerful computing capabilities and rich labeled data resources; while the fine-tuning of the fully connected layers is performed on edge devices, aiming to adapt to local data characteristics while protecting user data privacy. Therefore, in steps S2, the model parameters transmitted downwards by the cloud server include both convolutional and fully connected layers, while in steps S4, the model parameters transmitted downwards by each isolated device are limited to the fully connected layers.

[0055] The computational complexity of federated learning for NILM model training in this embodiment is related to the model's complexity and the number of edge devices participating in the training. Communication overhead is typically determined by the number of model parameters, the number of training epochs, and the number of edge devices participating in each epoch update. Convergence is related to the model's structure and the distribution differences of user data. The determination of whether model aggregation has ended based on the global NILM model's test results can be achieved by the cloud server calculating the current global NILM model's load decomposition result evaluation metrics MAE and SAE using an independent test set. If these two load decomposition result evaluation metrics reach a preset accuracy requirement, or if they no longer show significant improvement after multiple consecutive epochs, the edge training-cloud aggregation cycle is stopped, and aggregation is considered complete. The specific calculation of the load decomposition result evaluation metrics MAE and SAE is explained later.

[0056] The technology in this application embodiment can be achieved by initializing network parameters through a network training and verification module, followed by training and verification of the initialized network to obtain a cloud-based global NILM model for load decomposition. After the local NILM model has completed adaptive migration, a network testing module can be set up to judge the decomposition effect of the edge-side local NILM model. This involves substituting the sliding total power window into the established local NILM model to obtain the power sequence of a single load device and the energy consumption sequence, i.e., the load decomposition result. In practical applications, edge devices can be used to collect the total load power data of untagged appliances, and the real-time / period performance consumption data of a single appliance can be calculated using the local NILM model contained therein. In other words, the total power of a user's appliances can be decomposed into the power of each appliance.

[0057] The edge device is deployed on the user side, such as in residential homes or small commercial locations, for the collection and calculation of power data. It is a terminal that can collect the user's power consumption data and calculate the real-time / period-time performance consumption data of individual appliances based on the local NILM model.

[0058] Experimental example:

[0059] Taking a practical application scenario as an example, the steps for implementing adaptive transfer of the NILM model using the method of this invention are as follows:

[0060] 1) Obtain the training, validation, and test data from the dataset and normalize the data;

[0061] The proposed method was validated using the publicly available UKDALE and REFIT datasets, focusing on five common household appliances: electric kettles, microwave ovens, refrigerators, dishwashers, and washing machines. The data sampling interval was 8 seconds. All data from buildings 1 and 2 in the UKDALE dataset were pre-stored in the cloud as training data, and all data from buildings 3 and 5 in the REFIT dataset were used as test data. The sample time span ranged from several months to several years. Furthermore, edge users selected buildings 9, 15, and 20 in the REFIT dataset as research subjects.

[0062] 2) Initialize the global NILM model in the cloud, input the normalized data into the network structure for training and aggregation to obtain the final global NILM model; enable the model to recognize the general power characteristics of electrical appliances;

[0063] 3) After lightweighting the trained global NILM model, the final local NILM model is obtained through an adaptive transfer process. That is, the model is adapted to the specific scenario by using labeled data distributed from the cloud and local unlabeled data for adaptive transfer learning.

[0064] 4) Based on continuous total power data, the sliding total power window is substituted into the established local NILM model to obtain the power sequence of a single load device and the power consumption, i.e., the load decomposition result;

[0065] Among them, the evaluation indicators for load decomposition results include mean absolute error (MAE) and signal aggregate error (SAE), with the following expressions:

[0066]

[0067] MAE is used to calculate power prediction values. Compared with the true value x t The average of the absolute errors between the two values, where T represents the total duration of the test period, and SAE is used to calculate the predicted power consumption during the test period. The ratio of the error between the true value r and the actual value r.

[0068] The MAE and SAE results of the local NILM models of users 9, 15, and 20 at the edge terminal obtained using the method of the present invention are shown in Tables 1 to 3.

[0069] Table 1. MAE and SAE Indicators for User No. 9

[0070] index electric kettle Micro-wave oven refrigerator dishwasher washing machine MAE(W) 14.8 11.7 27.3 12.5 11.4 SAE (%) 30.5 39.8 16.4 20.5 28.5

[0071] Table 2 MAE and SAE indices for User No. 15

[0072] index electric kettle Micro-wave oven refrigerator dishwasher washing machine MAE(W) 16.9 9.5 16.9 21.5 18.8 SAE (%) 16.5 22.3 14.7 28.1 31.7

[0073] Table 3. MAE and SAE Indicators for User No. 20

[0074] index electric kettle Micro-wave oven refrigerator dishwasher washing machine MAE(W) 17.0 12.5 24.8 14.5 13.6 SAE (%) 36.5 12.7 18.7 20.0 21.7

[0075] It can be seen that after adaptive transfer training, the local NILM model of each edge user has significantly improved the decomposition effect of the target appliance. Specifically, the MAE and SAE of the target appliance of the resident user No. 9 decreased by an average of 0.8W and 3.3%, the resident user No. 15 decreased by an average of 1.3W and 2.0%, and the resident user No. 20 decreased by an average of 0.8W and 1.3%.

[0076] The results above demonstrate that the CORAL method proposed in this invention effectively improves the decomposition performance of the local NILM model, making the local NILM model more suitable for edge users.

[0077] Embodiments of the present invention also provide a computer device, including a memory and a processor, wherein the memory stores a computer program, and the processor executes the computer program to implement the steps of the method described.

[0078] Embodiments of the present invention also provide a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the steps of the method described herein.

[0079] The foregoing has shown and described the basic principles, main features, and advantages of the present invention. It will be apparent to those skilled in the art that the present invention is not limited to the details of the above exemplary embodiments, and that the present invention can be implemented in other specific forms without departing from the spirit or basic features of the present invention.

[0080] Therefore, the embodiments should be regarded as exemplary and non-limiting in all respects, and the scope of the invention is defined by the appended claims rather than the foregoing description. Thus, it is intended that all variations falling within the meaning and scope of the equivalents of the claims be included within the invention.

[0081] Furthermore, it should be understood that although this specification describes embodiments, not every embodiment contains only one independent technical solution. This narrative style is merely for clarity. Those skilled in the art should consider the specification as a whole, and the technical solutions in each embodiment can also be appropriately combined to form other embodiments that can be understood by those skilled in the art.

Claims

1. An adaptive migration method for non-intrusive load monitoring models based on federated learning, characterized in that, Includes the following steps: S1. The cloud server sends a model training request to the edge device and creates a user set consisting of the users to be trained after obtaining their consent. S2. The cloud server builds a global NILM model and initializes the model. Based on the pre-stored dataset, it trains and prunes the global NILM model to obtain a lightweight NILM model. The lightweight NILM model is then distributed to all edge devices in the user set. S3. The cloud server selects labeled data from the pre-stored dataset and distributes it to all edge devices in the user set; S4. The edge device receives the lightweight NILM model, performs adaptive transfer training of the local NILM model based on the distributed labeled data and locally stored unlabeled data, and uploads the trained local NILM model to the cloud server. S5. The cloud server receives the local NILM model uploaded by each edge device, updates the global NILM model based on the local NILM model using the federated aggregation algorithm, and then prunes and lightens the updated global NILM model before redistributing it to all edge devices in the user set. S6. Determine whether model aggregation has ended based on the global NILM model test results. If not, return to step S4. If yes, each edge device receives the lightweight local NILM model that has been pruned and distributed by the cloud server for the last time, which serves as the final edge-end local NILM model.

2. The adaptive migration method for non-intrusive load monitoring models based on federated learning according to claim 1, characterized in that, In step S2, the global NILM model consists of two feature extraction convolutional layers, one Flattern layer, and one power regression network layer connected in sequence.

3. The adaptive migration method for non-intrusive load monitoring models based on federated learning according to claim 1, characterized in that, In step S2, when pruning the global NILM model, filter pruning is first used to simplify the convolutional layer architecture of the model, and then neuron pruning is used to reduce the number of parameters and computational cost of the fully connected layers.

4. The adaptive migration method for non-intrusive load monitoring models based on federated learning according to claim 1, characterized in that, In step S2, distributing the lightweight NILM model to all edge devices in the user set means distributing all model parameters of the lightweight NILM model to all edge devices in the user set.

5. The adaptive migration method for non-intrusive load monitoring models based on federated learning according to claim 1, characterized in that, In step S4, the CORAL method is used to perform the adaptive transfer training process of the local NILM model.

6. The adaptive migration method for non-intrusive load monitoring models based on federated learning according to claim 1, characterized in that, In step S4, uploading the trained local NILM model to the cloud server means that only the parameters of the fully connected layers of the local NILM model are uploaded to the cloud server.

7. The adaptive migration method for non-intrusive load monitoring models based on federated learning according to claim 1, characterized in that, In step S5, the global NILM model is updated based on the local NILM model using a federated aggregation algorithm, including: After each edge device uploads its trained local NILM model to the cloud server, a federated averaging algorithm is used to average all parameters at the same location in each local NIL model, and the resulting parameters are used to update the global NILM model.

8. The adaptive migration method for non-intrusive load monitoring models based on federated learning according to claim 1, characterized in that, In step S5, the updated global NILM model is pruned and lightweighted and then redistributed to all edge devices in the user set. This means that all model parameters of the updated global NILM model after pruning and lightweighting are redistributed to all edge devices in the user set.

9. A computer device, comprising a memory and a processor, wherein the memory stores a computer program, characterized in that, When the processor executes the computer program, it implements the steps of the method according to any one of claims 1 to 7.

10. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the method according to any one of claims 1 to 8.