Load identification method and device based on feature repair
By constructing conditional diffusion and load identification models under scenarios with and without electrical noise interference, the problem of decreased load identification accuracy is solved, achieving high-precision and robust load identification, and enabling lightweight deployment in complex power consumption scenarios.
Patent Information
- Application Number
- CN202511332744.8
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-09-18
- Publication Date
- 2026-01-13
- Estimated Expiration
- 2045-09-18
AI Technical Summary
Existing load identification methods suffer from a significant drop in identification accuracy in real-world, complex power consumption scenarios with large-scale aliasing of multiple loads and significant fluctuations in background noise. They struggle to balance high accuracy and robustness, and existing models are highly complex with a large number of parameters, making them difficult to deploy at the edge.
By acquiring load disturbance feature datasets under power consumption scenarios with and without electrical noise interference, a conditional diffusion model and a load identification model are constructed. The models are trained using the training dataset and then fine-tuned by pruning, thereby improving the accuracy of load current data repair and feature extraction capabilities, and reducing model complexity to achieve lightweight deployment.
It improves load identification accuracy, reduces model complexity, facilitates efficient deployment at the edge, and adapts to the identification of load types and operating states in complex power consumption scenarios.
Smart Images

Figure CN120822137B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of load identification, in particular to a load identification method and device based on feature repair, computer equipment, computer readable storage medium and computer program product. BACKGROUND
[0002] With the continuous development of the power industry, improving energy utilization efficiency, reducing carbon emissions, and promoting green and low-carbon transformation of the energy system have become the theme of the current development of the power industry. Fully tapping the adjustable potential of the demand side of the massive flexible resources and designing effective load management and control strategies are important means to improve user electricity efficiency and reduce energy waste on the electricity side. As a key link in demand side resource management, load identification can accurately grasp the electricity information and energy consumption of the internal load of the user, understand the electricity behavior and electricity demand of the user, and provide strong data support for the formulation of user energy management or load control strategies.
[0003] At present, there are related load identification methods. Although the related load identification method has achieved high recognition accuracy in a small number of load mixing and small electrical background noise laboratory scenes, in the face of real complex electricity scenes with large-scale mixed operation of multiple loads and large background noise fluctuations, the extracted load features often produce large distortion, which further leads to a significant decrease in recognition accuracy. Therefore, how to improve the load identification accuracy has become a key problem to be solved. SUMMARY
[0004] Therefore, it is necessary to provide a load identification method, device, computer equipment, computer readable storage medium and computer program product based on feature repair to improve the load identification accuracy.
[0005] In a first aspect, the present application provides a load identification method based on feature repair, comprising:
[0006] In the electricity scene without electrical noise interference, the noise-free current data of multiple types of load monomers in operation is obtained; in the electricity scene with electrical noise interference, the load events of multiple types of load monomers are randomly generated, the power change of the power grid line is analyzed to locate the load event time, and the current data and power frequency voltage data of the corresponding type of load monomer are obtained to construct the load disturbed feature data set; the bus current data of a given period before the load event time is obtained as the base data;
[0007] The difference between the current data in the load disturbed feature data set and the noise-free current data is calculated to obtain current noise. The current noise of the current data in the load disturbed feature data set is amplified and Gaussian noise is added to obtain a noisy sequence. A training data set is constructed based on the noisy sequence, a noisy step, condition information, the load disturbed feature data set, and a label. The condition information includes the base data and the power frequency voltage data. The label includes the type and operating state of the load.
[0008] A conditional diffusion model and a load identification model are constructed. The conditional diffusion model and the load identification model are trained using the training data set. The noisy sequence, the noisy step, and the condition information are input into the conditional diffusion model to output a noise estimate. The load disturbed feature data set is denoised using the noise estimate to obtain a target load disturbed feature data set. The target load disturbed feature data set is input into the load identification model to output a type and operating state prediction result of the load. When a total loss function meets a set requirement, the conditional diffusion model and the load identification model are pruned and then fine-tuned until training is completed. The total loss function is composed of a loss function of the conditional diffusion model and a loss function of the load identification model.
[0009] Actual load disturbed feature data, actual noisy sequence, actual noisy step, and actual condition information are obtained in real time. The actual noisy sequence, the actual noisy step, and the actual condition information are input into the trained conditional diffusion model to obtain an actual noise estimate. The actual load disturbed feature data is denoised using the actual noise estimate to obtain actual target load disturbed feature data. The actual target load disturbed feature data is input into the trained load identification model to obtain a type and operating state prediction result of the corresponding load.
[0010] In one embodiment, the current data and power frequency voltage data of the corresponding type of load monomer are obtained by: obtaining current data of the power grid line for a plurality of periods before the load event time, and current data of the power grid line for the same number of periods after the load event time; extracting the current data of the power grid line at the same sampling point position in each period, and then subtracting the extracted current data of the power grid line to obtain the current data of the corresponding type of load monomer; and obtaining power frequency voltage data of the power grid line for a plurality of periods after the load event time to obtain the power frequency voltage data of the corresponding type of load monomer.
[0011] In one of the embodiments, the load event includes a short transient event and a long transient event, and the power change of the power grid line is analyzed to locate the load event time, including: obtaining the line power difference value corresponding to the target time and two adjacent times of the target time in the to-be-tested period, if the absolute value of the line power difference value of the target time is greater than a first threshold value, and the absolute value of the line power difference value of the target time is greater than the absolute values of the line power difference values of the two adjacent times, the generated load event is a short transient event, and the target time is the load event time of the short transient event; obtaining the line power difference sequence in the to-be-tested period, and performing filtering processing on the line power difference sequence to obtain a target line power difference sequence; if the absolute value of the target line power difference value of the first time in the to-be-tested period is greater than or equal to a second threshold value, and the absolute value of the target line power difference value of the last time of the first time is less than the second threshold value, the first time is the event start time; if the absolute value of the target line power difference value of the second time in the to-be-tested period is less than the second threshold value, and the absolute value of the target line power difference value of the last time of the second time is greater than or equal to the second threshold value, the second time is the event end time; if the absolute value of the difference between the abnormal power corresponding to the last time of the first time and the abnormal power corresponding to the next time of the second time is greater than a third threshold value, the generated load event is a long transient event, and the load event time includes the first time and the second time.
[0012] In one of the embodiments, the first threshold value is an adaptive threshold value, and the adaptive process of the first threshold value includes: obtaining a maximum power difference threshold value and a minimum power difference threshold value; calculating the standard deviation of the line power difference sequence in the to-be-tested period; selecting the maximum value from the standard deviation and the minimum power difference threshold value, and selecting the minimum value from the maximum value and the maximum power difference threshold value to obtain the first threshold value.
[0013] In one of the embodiments, the training data set is constructed, including: after obtaining the condition information, performing mask processing on the condition information to obtain the first condition information, and directly obtaining the condition information to obtain the second condition information; the noise-added sequence, the noise-added step and the first condition information constitute a first sample set, the noise-added sequence, the noise-added step and the second condition information constitute a second sample set, and the first sample set and the second sample set constitute a training set of a condition diffusion model; the load disturbed feature data set and the label constitute a training set of a load identification model; and the training set of the condition diffusion model and the training set of the load identification model constitute the training data set.
[0014] In one of the embodiments, the total loss function is obtained by weighting the loss function of the conditional diffusion model and the loss function of the load identification model respectively, wherein the loss function of the conditional diffusion model comprises an unconditional noise estimation loss function and a conditional noise estimation loss function.
[0015] In a second aspect, the application further provides a load identification device based on feature repair, comprising:
[0016] The data acquisition module is configured to acquire noise-free current data of various types of load monomers in operation in an electrical noise-free power consumption scenario, randomly generate load events of various types of load monomers in an electrical noise interference power consumption scenario, analyze power changes of a power grid line to locate a load event time, and acquire current data and power frequency voltage data of a corresponding type of load monomer to construct a disturbed load feature data set; and acquire bus current data of a given time period before the load event time as base data.
[0017] The training data set construction module is configured to calculate a difference between the current data in the disturbed load feature data set and the noise-free current data to obtain current noise, amplify the current noise of the current data in the disturbed load feature data set and add Gaussian noise to obtain a noisy sequence; and construct a training data set based on the noisy sequence, a noisy step, condition information, the disturbed load feature data set, and a label, wherein the condition information comprises the base data and the power frequency voltage data, and the label comprises a type and an operating state of a load.
[0018] The modeling module is configured to construct a conditional diffusion model and a load identification model, train the conditional diffusion model and the load identification model using the training data set, input the noisy sequence, the noisy step, and the condition information into the conditional diffusion model to output a noise estimation value, denoise the disturbed load feature data set using the noise estimation value to obtain a target disturbed load feature data set, input the target disturbed load feature data set into the load identification model to output a type and an operating state prediction result of a load, and prune the conditional diffusion model and the load identification model when a total loss function meets a set requirement, and then re-tune the training until the training is completed, wherein the total loss function is composed of a loss function of the conditional diffusion model and a loss function of the load identification model.
[0019] The identification module is configured to obtain actual disturbed load feature data, an actual noise-added sequence, an actual noise-added step, and actual condition information in real time; input the actual noise-added sequence, the actual noise-added step, and the actual condition information into the trained conditional diffusion model to obtain an actual noise estimation value; use the actual noise estimation value to denoise the actual disturbed load feature data to obtain actual target disturbed load feature data; and input the actual target disturbed load feature data into the trained load identification model to obtain a corresponding load type and operation state prediction result.
[0020] In a third aspect, the present application also provides a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and the processor implements the following steps when executing the computer program:
[0021] In the power consumption scenario without electrical noise interference, noise-free current data of various types of load monomers in operation is obtained; in the power consumption scenario with electrical noise interference, load events of various types of load monomers are randomly generated, power changes of a power grid line are analyzed to locate a load event time, and current data and power frequency voltage data of the corresponding type of load monomer are obtained to construct a disturbed load feature data set; bus current data of a given time period before the load event time is obtained as base data;
[0022] A difference value between current data in the disturbed load feature data set and the noise-free current data is calculated to obtain current noise, the current noise of the current data in the disturbed load feature data set is amplified and Gaussian noise is added to obtain a noise-added sequence; a training data set is constructed based on the noise-added sequence, a noise-added step, condition information, the disturbed load feature data set, and a label, wherein the condition information comprises the base data and the power frequency voltage data, and the label comprises a load type and an operation state;
[0023] A conditional diffusion model and a load identification model are constructed; the training data set is used to train the conditional diffusion model and the load identification model, the noise-added sequence, the noise-added step, and the condition information are input into the conditional diffusion model to output a noise estimation value; the noise estimation value is used to denoise the disturbed load feature data set to obtain a target disturbed load feature data set, and the target disturbed load feature data set is input into the load identification model to output a load type and operation state prediction result; when a total loss function meets a set requirement, the conditional diffusion model and the load identification model are pruned, and then fine-tuning training is performed again until training is completed, wherein the total loss function is composed of a loss function of the conditional diffusion model and a loss function of the load identification model;
[0024] Real-time actual load disturbance feature data, actual noise-added sequence, actual noise-added step and actual condition information are obtained; the actual noise-added sequence, the actual noise-added step and the actual condition information are input into the trained conditional diffusion model to obtain an actual noise estimation value, and the actual noise estimation value is used to denoise the actual load disturbance feature data to obtain actual target load disturbance feature data, and the actual target load disturbance feature data is input into the trained load identification model to obtain the type and running state prediction result of the corresponding load.
[0025] In a fourth aspect, the present application also provides a computer readable storage medium having a computer program stored thereon, wherein the computer program is executed by a processor to implement the following steps:
[0026] In the electricity consumption scenario without electrical noise interference, noise-free current data of various types of load monomers in operation is obtained; in the electricity consumption scenario with electrical noise interference, load events of various types of load monomers are randomly generated, power changes of the power grid line are analyzed to locate the load event time, and current data and power frequency voltage data of the corresponding type of load monomer are obtained to construct a load disturbance feature data set; bus current data of a given period before the load event time is obtained as base data;
[0027] The difference between the current data in the load disturbance feature data set and the noise-free current data is calculated to obtain current noise, the current noise of the current data in the load disturbance feature data set is amplified and Gaussian noise is added to obtain a noise-added sequence; based on the noise-added sequence, noise-added step, condition information, the load disturbance feature data set and labels, a training data set is constructed, the condition information includes the base data and the power frequency voltage data, and the labels include the type and running state of the load;
[0028] A conditional diffusion model and a load identification model are constructed; the training data set is used to train the conditional diffusion model and the load identification model, the noise-added sequence, the noise-added step and the condition information are input into the conditional diffusion model to output a noise estimation value; the noise estimation value is used to denoise the load disturbance feature data set to obtain a target load disturbance feature data set, and the target load disturbance feature data set is input into the load identification model to output the type and running state prediction result of the load; when a total loss function meets a set requirement, the conditional diffusion model and the load identification model are pruned and then fine-tuned until the training is completed, and the total loss function is composed of a loss function of the conditional diffusion model and a loss function of the load identification model;
[0029] Real-time actual load disturbance feature data, actual noise-added sequence, actual noise-added step and actual condition information are obtained; the actual noise-added sequence, the actual noise-added step and the actual condition information are input into the trained conditional diffusion model to obtain an actual noise estimation value, and the actual noise estimation value is used to denoise the actual load disturbance feature data to obtain actual target load disturbance feature data, and the actual target load disturbance feature data is input into the trained load identification model to obtain the type and running state prediction result of the corresponding load.
[0030] In a fifth aspect, the present application also provides a computer program product comprising a computer program which, when executed by a processor, implements the following steps:
[0031] In the electricity consumption scenario without electrical noise interference, noise-free current data of various types of load monomers in operation is obtained; in the electricity consumption scenario with electrical noise interference, load events of various types of load monomers are randomly generated, power changes of the power grid line are analyzed to locate the load event time, and current data and power frequency voltage data of the corresponding type of load monomer are obtained to construct a load disturbance feature data set; bus current data of a given time period before the load event time is obtained as base data;
[0032] The difference between the current data in the load disturbance feature data set and the noise-free current data is calculated to obtain current noise, the current noise of the current data in the load disturbance feature data set is amplified and Gaussian noise is added to obtain a noise-added sequence; based on the noise-added sequence, noise-added step, condition information, the load disturbance feature data set and labels, a training data set is constructed, the condition information includes the base data and the power frequency voltage data, and the labels include the type and running state of the load;
[0033] A conditional diffusion model and a load identification model are constructed; the training data set is used to train the conditional diffusion model and the load identification model, the noise-added sequence, the noise-added step and the condition information are input into the conditional diffusion model to output a noise estimation value; the noise estimation value is used to denoise the load disturbance feature data set to obtain a target load disturbance feature data set, and the target load disturbance feature data set is input into the load identification model to output the type and running state prediction result of the load; when a total loss function meets a set requirement, the conditional diffusion model and the load identification model are pruned and then fine-tuned until the training is completed, and the total loss function is composed of a loss function of the conditional diffusion model and a loss function of the load identification model;
[0034] The actual load disturbed feature data, the actual noise-added sequence, the actual noise-added step and the actual condition information are obtained in real time; the actual noise-added sequence, the actual noise-added step and the actual condition information are input into the trained conditional diffusion model to obtain an actual noise estimation value, the actual load disturbed feature data is denoised by using the actual noise estimation value to obtain actual target load disturbed feature data, and the actual target load disturbed feature data is input into the trained load identification model to obtain the type and the running state prediction result of the corresponding load.
[0035] The load identification method and device based on feature repair, the computer device, the computer readable storage medium and the computer program product, by obtaining the noise-free current data, the current data and the power frequency voltage data of the multiple types of load monomers in the electrical noise interference and non-electrical noise interference scenes respectively, the load disturbed feature data set is constructed; the bus current data of a given period before the load event moment is obtained as the base data; in this case, the load disturbed feature data set is obtained for the complex scene with electrical noise interference, which prepares for the training data set to be constructed, which is beneficial to improve the load identification accuracy of the model in the complex scene. The difference between the current data and the noise-free current data in the load disturbed feature data set is calculated to obtain the current noise, the current noise of the current data in the load disturbed feature data set is amplified and Gaussian noise is added to obtain the noise-added sequence; based on the noise-added sequence, the noise-added step, the condition information, the load disturbed feature data set and the label, the training data set is constructed, the condition information includes the base data and the power frequency voltage data, and the label includes the type and the running state of the load; therefore, by setting the condition information to guide the reverse diffusion process of the conditional diffusion model, the conditional diffusion model can fully learn the analysis ability of the current noise, thereby improving the repair accuracy of the load current data, so that the target load disturbed feature data set obtained after denoising is closer to the noise-free current data, thereby improving the prediction accuracy of the subsequent load identification model. The conditional diffusion model and the load identification model are constructed; the conditional diffusion model and the load identification model are trained by using the training data set, the noise-added sequence, the noise-added step and the condition information are input into the conditional diffusion model to output the noise estimation value; the noise estimation value is used to denoise the load disturbed feature data set to obtain the target load disturbed feature data set, and the target load disturbed feature data set is input into the load identification model to output the type and the running state prediction result of the load; when the total loss function meets the set requirement, the conditional diffusion model and the load identification model are pruned, and then fine-tuned, until the training is completed, and the total loss function is composed of the loss function of the conditional diffusion model and the loss function of the load identification model. Therefore, the conditional diffusion model and the load identification model can better realize the load deep feature extraction, thereby improving the identification accuracy of the model for the load type and the running state in the complex scene. Through pruning, the parameter quantity and the calculation complexity of the conditional diffusion model and the load identification model can be reduced, and the model can be deployed on the edge side. Compared with the existing prediction method, the load identification accuracy is better by using the trained load identification model to obtain the type and the running state prediction result of the corresponding load. BRIEF DESCRIPTION OF DRAWINGS
[0036] To more clearly illustrate the technical solutions in the embodiments of this application or related technologies, the drawings used in the description of the embodiments of this application or related technologies will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.
[0037] Figure 1 This is a flowchart illustrating a feature-based load identification method in one embodiment;
[0038] Figure 2 This is a structural block diagram of a feature-based load identification device in one embodiment;
[0039] Figure 3 This is an internal structural diagram of a computer device in one embodiment. Detailed Implementation
[0040] To make the objectives, technical solutions, and advantages of this application clearer, the following detailed description is provided in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application.
[0041] While existing load identification methods have achieved high recognition accuracy in laboratory scenarios with a small amount of load cascading and low electrical background noise, the extracted load features often undergo significant distortion when faced with real-world complex power consumption scenarios with large-scale cascading of multiple loads and large fluctuations in background noise, leading to a significant decrease in recognition accuracy.
[0042] The paper "Near-real-time plug load identification using low-frequency power data" extracts power characteristics during load operation and uses machine learning methods to identify individual loads online, achieving an identification accuracy of 93.5%. However, this method cannot be applied to power consumption scenarios with multiple loads overlapping. Papers "An Integrated Non-invasive Load Identification Method Based on Shannon Entropy Weighted Voting Algorithm" and "A novel current signal feature and its application in noninvasive load monitoring" extract high-order current harmonic features or load voltage and current waveform features as the basis for identification. However, these features are greatly affected by current noise fluctuations. In scenarios with complex power consumption and large load fluctuations, abnormal harmonic distortion and waveform distortion can easily occur, affecting the identification accuracy. To address this issue, papers "Load Identification Based on Multi-Scale Feature Fusion and Its Interpretable Interactive Enhancement Method" and "Multi-Time-Scale Shapelet Based Feature Extraction for Non-Intrusive Load Monitoring" introduce multi-time-scale load features. Through the complementary effect of short-term and long-term load waveform features, the ability of extracted features to represent load types is ensured. However, the extraction of long-term and short-term features places higher demands on the acquisition and computing performance of the measurement terminal device, and the introduction of long-term features inevitably reduces the real-time performance of identification, which undoubtedly affects the accurate management and control of the load.
[0043] In summary, existing load identification methods have the following problems: They lack robustness, and their identification accuracy drops significantly in complex power consumption scenarios with aliased loads and large fluctuations in background noise; they struggle to balance accuracy and real-time performance, remaining difficult to achieve high-precision, high-robustness, and high-real-time online load identification; and existing AI-based load identification models suffer from high complexity, a large number of parameters, and significant reliance on hardware resources, making large-scale deployment, application, and expansion at the edge difficult.
[0044] To address the aforementioned problems, this invention proposes a load identification method based on feature repair to improve the load identification accuracy in complex scenarios.
[0045] In one exemplary embodiment, such as Figure 1As shown, a load identification method based on feature repair is provided. This embodiment illustrates the application of this method to a terminal. It is understood that this method can also be applied to a server, and to a system including both a terminal and a server, and can be implemented through the interaction between the terminal and the server. In this embodiment, the method includes the following steps:
[0046] Step 102: In a power consumption scenario without electrical noise interference, acquire noiseless current data of various types of individual loads during operation; in a power consumption scenario with electrical noise interference, randomly generate load events of various types of individual loads, analyze the power changes of the power grid lines to locate the time of the load event, and acquire the current data and power frequency voltage data of the corresponding type of individual loads to construct a load disturbance feature dataset; acquire the bus current data for a given period before the time of the load event as the base data.
[0047] In this context, "electricity usage scenario without electrical noise interference" refers to a scenario where no other loads are operating besides the target load unit. "Electrical noise interference scenario" refers to a scenario where other loads are operating besides the target load unit. The target load unit refers to any load unit among the various types of load units for which noiseless current data needs to be collected. A load event refers to an event in the line where the operating status of the electrical load changes, such as connection, disconnection, or switching of operating modes. The load event time refers to the time when the load event occurs.
[0048] For example, multiple types of individual load cells are identified. In power consumption scenarios without electrical noise interference, noiseless current data of each type of individual load cell during operation is obtained. In power consumption scenarios with electrical noise interference, load events such as connection, disconnection, and operating mode switching of each type of individual load cell are randomly generated. The power changes of the power grid line are analyzed to determine the time of the load event. Current data and power frequency voltage data of the corresponding type of individual load cell are obtained to construct a load disturbance feature dataset. In addition, bus current data for a given period before the load event time is obtained as base data.
[0049] Step 104: Calculate the difference between the current data and the noiseless current data in the load disturbance feature dataset to obtain the current noise. Amplify the current noise in the current data of the load disturbance feature dataset and add Gaussian noise to obtain the noise-added sequence. Based on the noise-added sequence, noise-added step size, condition information, load disturbance feature dataset and labels, construct a training dataset. The condition information includes the base data and power frequency voltage data, and the labels include the load type and operating status.
[0050] In this context, current noise refers to the noise data carried within the current data. Gaussian noise refers to noise whose probability density function follows a Gaussian distribution (i.e., a normal distribution). The noise addition step size is an important parameter in the conditional diffusion model, determining the proportion of noise added at each time step.
[0051] For example, for the same type of load cell, the difference between the current data and the noiseless current data in the load disturbance feature dataset is calculated to obtain the current noise of the load cell of that type. First, the current noise in the current data in the load disturbance feature dataset is amplified, and then Gaussian noise is added to the noise-amplified current data to obtain a noisy sequence. Using the noisy sequence, the noisy step size, the conditional information, the load disturbance feature dataset and the label, a training dataset is constructed, where the conditional information includes the base data and the power frequency voltage data, and the label includes the load type and operating status.
[0052] Step 106: Construct a conditional diffusion model and a load identification model; train the conditional diffusion model and the load identification model using the training dataset, inputting the noisy sequence, noisy step size, and conditional information into the conditional diffusion model to output noise estimates; use the noise estimates to denoise the load disturbance feature dataset to obtain the target load disturbance feature dataset, input the target load disturbance feature dataset into the load identification model to output the load type and operating status prediction results; when the total loss function meets the set requirements, prune the conditional diffusion model and the load identification model, and then retrain them until training is complete. The total loss function consists of the loss function of the conditional diffusion model and the loss function of the load identification model.
[0053] Among them, the conditional diffusion model is a generative model that introduces additional conditional information on top of the standard diffusion model. The load identification model is a neural network model used to predict the type and operating state of the load. The total loss function is a loss function used to measure the training degree of the conditional diffusion model and the load identification model. Pruning refers to removing some unnecessary connections or nodes from the trained neural network.
[0054] For example, a conditional diffusion model and a load identification model are constructed. A total loss function is set for training the conditional diffusion model and the load identification model. The total loss function consists of the loss function of the conditional diffusion model and the loss function of the load identification model. The conditional diffusion model and the load identification model are trained using a training dataset. The noisy sequence, noisy step size, and conditional information in the training dataset are input into the conditional diffusion model to output a noise estimate. The noise estimate is used to denoise the load disturbance feature dataset in the training dataset to obtain a target load disturbance feature dataset. The load identification model is trained using the target load disturbance feature dataset and the labels in the training dataset. When the total loss function meets the set requirements, the conditional diffusion model and the load identification model are pruned and then fine-tuned again until training is complete.
[0055] Step 108: Obtain the actual load disturbance feature data, actual noise sequence, actual noise step size, and actual condition information in real time; input the actual noise sequence, actual noise step size, and actual condition information into the trained conditional diffusion model to obtain the actual noise estimate; use the actual noise estimate to denoise the actual load disturbance feature data to obtain the actual target load disturbance feature data; input the actual target load disturbance feature data into the trained load identification model to obtain the corresponding load type and operating status prediction results.
[0056] Among them, the actual load event time refers to the load event time in the actual scenario. The actual load disturbance characteristic data is the load disturbance characteristic data in the actual scenario. The actual noise-added sequence is the noise-added sequence in the actual scenario, the actual noise-added step size is the noise-added step size in the actual scenario, and the actual condition information is the condition information in the actual scenario.
[0057] For example, for the actual power consumption scenario that needs to be identified, the actual power of the power grid line is obtained in real time. The corresponding location of the actual load event time, actual load disturbance characteristic data, actual noise sequence, actual noise step size and actual condition information are obtained by referring to the above steps. Then, the actual noise sequence, actual noise step size and actual condition information are input into the trained conditional diffusion model to obtain the actual noise estimate. The actual load disturbance characteristic data is subtracted from the actual noise estimate to obtain the actual target load disturbance characteristic data. The actual target load disturbance characteristic data is input into the trained load identification model to obtain the corresponding load type and operation status prediction results.
[0058] In the aforementioned load identification method based on feature repair, noiseless current data, current data, and power frequency voltage data of various types of individual loads are acquired under power consumption scenarios with and without electrical noise interference to construct a load disturbance feature dataset. Bus current data for a given period before the load event is acquired as base data. In this case, the load disturbance feature dataset is acquired for complex scenarios with electrical noise interference to prepare for the training dataset to be constructed, which is beneficial to improving the model's accuracy in identifying loads in complex scenarios. The difference between the current data in the load disturbance feature dataset and the noiseless current data is calculated to obtain the current noise. The current noise in the current data in the load disturbance feature dataset is amplified and Gaussian noise is added to obtain a noisy sequence. Based on the noisy sequence, the noisy step size, conditional information, the load disturbance feature dataset, and labels, a training dataset is constructed. The conditional information includes the base data and power frequency voltage data, and the labels include the load type and operating status. Thus, by setting the conditional information to guide the back diffusion process of the conditional diffusion model, the conditional diffusion model can fully learn the ability to resolve current noise, thereby improving the accuracy of the load current data repair. This makes the target load disturbance feature dataset obtained after denoising closer to the noiseless current data, thereby improving the prediction accuracy of the subsequent load identification model. A conditional diffusion model and a load identification model are constructed. These models are trained using a training dataset. A noisy sequence, noisy step size, and conditional information are input into the conditional diffusion model to output a noise estimate. The noise estimate is then used to denoise the load disturbance feature dataset, resulting in a target load disturbance feature dataset. This target dataset is then input into the load identification model to output predictions of load type and operating status. When the total loss function meets set requirements, the conditional diffusion model and the load identification model are pruned and retrained until training is complete. The total loss function is composed of the loss functions of the conditional diffusion model and the load identification model. This approach allows for better extraction of deep load features, improving the model's accuracy in identifying load type and operating status in complex scenarios. Pruning reduces the number of parameters and computational complexity of the conditional diffusion model and the load identification model, facilitating lightweight deployment at the edge. Compared to existing prediction methods, this invention uses the trained load identification model to obtain corresponding load type and operating status predictions, achieving better load identification accuracy.
[0059] In an exemplary embodiment, obtaining current data and power frequency voltage data of a corresponding type of load cell includes: obtaining current data of the power grid line for multiple cycles before the load event time, and current data of the power grid line for the same number of cycles after the load event time; extracting current data of the power grid line at the same sampling point location within each cycle, and then aligning and subtracting the extracted current data of the power grid line to obtain current data of the corresponding type of load cell; and obtaining power frequency voltage data of the power grid line within multiple cycles after the load event time to obtain power frequency voltage data of the corresponding type of load cell.
[0060] The period is determined based on the sampling frequency. Alignment refers to phase consistency.
[0061] In this embodiment, by acquiring the current data of the power grid lines for multiple cycles before the load event and the current data of the power grid lines for the same number of cycles after the load event, and extracting the current data of the power grid lines at the same sampling point location within each cycle, the extracted current data of the power grid lines are aligned and subtracted to obtain the current data of the corresponding type of load cell. This reduces the impact of power grid fluctuations on the current data and improves the accuracy of the current data of the load cell.
[0062] In an exemplary embodiment, load events include transient events and long transient events. Analyzing the power changes of power grid lines to locate the moment of a load event includes: obtaining the target moment of the period to be measured and the line power difference values corresponding to two adjacent moments of the target moment; if the absolute value of the line power difference value at the target moment is greater than a first threshold, and the absolute value of the line power difference value at the target moment is greater than the absolute value of the line power difference values at two adjacent moments, then the generated load event is a transient event, and the target moment is the moment of the load event that generated the transient event; obtaining the line power difference sequence of the period to be measured, and filtering the line power difference sequence to obtain the target line power difference sequence; If the absolute value of the target line power difference at the first moment in the test period is greater than or equal to the second threshold, and the absolute value of the target line power difference at the previous moment is less than the second threshold, then the first moment is the start time of the event; if the absolute value of the target line power difference at the second moment in the test period is less than the second threshold, and the absolute value of the target line power difference at the previous moment is greater than or equal to the second threshold, then the second moment is the end time of the event; if the absolute value of the difference between the abnormal power corresponding to the previous moment and the abnormal power corresponding to the next moment is greater than the third threshold, then the generated load event is a long transient event, and the load event time includes the first moment and the second moment.
[0063] The period to be tested is the time interval that includes the moment of the load event. A transient event refers to an event that meets the corresponding detection conditions at a specific point in time; a long transient event refers to an event that meets the corresponding detection conditions over a time interval.
[0064] In this embodiment, since the load events corresponding to transient and long transient events are at different times, by judging the transient and long transient events, the time interval of the current data to be collected can be determined more accurately, thereby making the constructed load disturbance feature dataset and the collected base data more accurate, which in turn helps to improve the accuracy of the subsequent model.
[0065] In an exemplary embodiment, the first threshold is an adaptive threshold, and the adaptive process of the first threshold includes: obtaining the maximum power differential threshold and the minimum power differential threshold; calculating the standard deviation of the line power differential sequence for the period to be tested; selecting the maximum value from the standard deviation and the minimum power differential threshold, and selecting the minimum value from the maximum value and the maximum power differential threshold to obtain the first threshold.
[0066] In this embodiment, by setting an adaptive threshold, the judgment of transient events can be adapted to a wider range of scenarios, which is beneficial to improving the judgment accuracy in complex power consumption scenarios.
[0067] In an exemplary embodiment, constructing a training dataset includes: after obtaining conditional information, masking the conditional information to obtain first conditional information, and using the directly obtained conditional information as second conditional information; a noisy sequence, a noisy step size, and the first conditional information constitute a first sample set, and the noisy sequence, the noisy step size, and the second conditional information constitute a second sample set; the first sample set and the second sample set constitute a training set for the conditional diffusion model; a load disturbance feature dataset and labels constitute a training set for the load identification model; and the training set of the conditional diffusion model and the training set of the load identification model constitute a training dataset.
[0068] Masking is a technique for obscuring data.
[0069] In this embodiment, the conditional information is masked and used as the first conditional information, while the directly obtained conditional information is used as the second conditional information. The noisy sequence, the noisy step size, and the first conditional information constitute the first sample set, and the noisy sequence, the noisy step size, and the second conditional information constitute the second sample set. The first and second sample sets constitute the training set of the conditional diffusion model. Thus, using the first sample set, the conditional diffusion model can be trained to predict artificially added Gaussian noise without conditional guidance. Using the second sample set, the conditional diffusion model can be trained to predict both artificially added Gaussian noise and its own inherent noise under conditional guidance.
[0070] In an exemplary embodiment, the total loss function is obtained by weighting the loss function of the conditional diffusion model and the loss function of the load identification model, wherein the loss function of the conditional diffusion model includes an unconditional noise estimation loss function and a conditional noise estimation loss function.
[0071] In this embodiment, by setting multiple objective loss functions (including the loss function of the conditional diffusion model and the loss function of the load identification model) to obtain the total loss function, compared with the existing single loss function, the optimization directions of different objectives can be combined in a weighted manner, so that the conditional diffusion model and the load identification model can simultaneously take into account the needs of multiple tasks, thereby improving the robustness of each model.
[0072] For example, the load identification method based on feature repair specifically includes:
[0073] Step 202: In a power consumption scenario without electrical noise interference, acquire noiseless current data of various types of individual loads during operation; in a power consumption scenario with electrical noise interference, randomly generate load events of various types of individual loads, analyze the power changes of the power grid lines to locate the time of the load event, and acquire the current data and power frequency voltage data of the corresponding type of individual loads to construct a load disturbance feature dataset; acquire the bus current data for a given period before the time of the load event as the base data.
[0074] Specifically, the data acquisition module includes an electrical data acquisition module and an event detection and incremental extraction module.
[0075] Using an electrical data acquisition module, the power frequency voltage and current waveforms of various individual loads are collected and stored in a scenario free from electrical noise interference, thus constructing a load clean feature dataset; among them, the current waveforms in the load clean feature dataset are noiseless current data.
[0076] Using an event detection and incremental extraction module, load events such as connection, disconnection, or duty cycle adjustment are randomly generated in power environments with base load operation or significant noise fluctuations. A dual-tower frame event detection method is used to pinpoint the timing of these load events. Bus current data for a given duration prior to the event is extracted as base data. An incremental method is then used to extract power frequency voltage data and current waveforms (i.e., current data) of various load types from the electrical bus, constructing a load disturbance characteristic dataset. Here, base load refers to the loads operating in the power grid before the load event occurs. Significant noise fluctuations can refer to situations where base load operation is present.
[0077] The electrical data acquisition module is required to sample line power data at frequencies above 1Hz, with a continuous sampling and storage time of no less than 5 minutes; it is also required to sample line voltage (voltage acquired at this frequency is high-frequency voltage) and current data at frequencies above 6.4kHz, with a continuous sampling and storage time of no less than 0.02 seconds. Load events refer to events that change the operating status of electrical loads on the line, such as connection, disconnection, or switching of operating modes.
[0078] The event detection method for the dual-tower frame specifically refers to the use of parallel detection, based on peak-valley detection and trend value accumulation methods, to detect and analyze changes in the line power sequence, thereby identifying transient and long transient events; and designing a post-processing method to filter out false detection events.
[0079] Where the target time is At any given moment, the peak-valley detection method detects transient event points under the following conditions:
[0080] ;
[0081] In the formula, To obtain Line power differential at a given time point The threshold for detecting transient events (i.e., the first threshold). for The line power difference between the two adjacent time points. for The line power difference at the next adjacent time point. The time period to be tested (hereinafter referred to as the test period) has a duration of ≥5 minutes. It means logical AND. To ensure the event detection threshold can be widely adapted to different scenarios, it is based on engineering experience and the actual fluctuations of the sequence. Adaptive thresholding is used:
[0082] ;
[0083] In the formula, The maximum power differential threshold is set based on experience; The minimum power differential threshold is set based on experience; The standard deviation is the power difference sequence for the time period to be detected after outlier removal using the 3sigma method.
[0084] If the first moment is The second time point is The detection process for long transient event intervals using the trend value accumulation method is as follows: First, the power difference sequence is processed using the mean filtering method. :
[0085] ;
[0086] In the formula, Power differential sequence The power difference value at the j-th time point, for Filtered power difference value, Let be the length of the filtering window. It is considered that when the following condition is met... The time is the start time of the long transient event:
[0087] ;
[0088] It is considered that when the following conditions are met... The time is the end time of the long transient event:
[0089] ;
[0090] It is considered that when the following conditions are met... [ t s , t e ] Long transient events within the interval are valid:
[0091] ;
[0092] In the formula, This is a sequence of abnormal power segments; The threshold for detecting long transient events (i.e., the second threshold) The power discrimination threshold for long transient events (i.e., the third threshold). In the abnormal power segment sequence Abnormal power at a given time point (i.e., the time point preceding the first time point); In the abnormal power segment sequence Abnormal power at time point (i.e., the time point after the second time point);
[0093] The post-processing method for filtering out missed events involves first eliminating transient events occurring within long transient periods. Then, the identified transient and long transient events are judged according to the following conditions. The load event is considered valid only when the following conditions are met:
[0094] ;
[0095] ;
[0096] In the formula, The threshold for judging the power of transient events. The threshold for judging the power of long transient events.
[0097] The incremental method is used to extract the power frequency voltage and current waveforms of various loads from the electrical bus. Specifically, the voltage zero-crossing point is first determined based on the load event time. Then, the phase of each current cycle is aligned using the voltage zero-crossing point. The current at the t-th sampling point in each of the N cycles before the event is extracted. The current at the t-th sampling point in each of the last N cycles Then, by aligning and subtracting the currents before and after the event, the current waveform of the load corresponding to that event can be extracted. (Also known as current data), that is:
[0098] ;
[0099] It should be noted that when extracting current, for transient events, the extracted current is the N periods before and the N periods after the event occurrence time; for long transient events, the extracted current is the N periods before the event start time and the N periods after the event end time.
[0100] Load voltage waveform (Also known as power frequency voltage data) equals the voltage waveform over N periods after the event. For transient events, the extracted time period is N periods after the event occurrence time; for long transient events, the extracted time period is N periods after the event termination time.
[0101] Step 204: Calculate the difference between the current data in the load disturbance feature dataset and the noiseless current data to obtain the current noise. Amplify the current noise in the current data in the load disturbance feature dataset and add Gaussian noise to obtain the noise-added sequence. Based on the noise-added sequence, noise-added step size, condition information, load disturbance feature dataset and labels, construct a training dataset. The condition information includes the base data and power frequency voltage data, and the labels include the load type and operating status.
[0102] Step 206: Construct a conditional diffusion model and a load identification model; train the conditional diffusion model and the load identification model using the training dataset, inputting the noisy sequence, noisy step size, and conditional information into the conditional diffusion model to output noise estimates; use the noise estimates to denoise the load disturbance feature dataset to obtain the target load disturbance feature dataset, input the target load disturbance feature dataset into the load identification model to output the load type and operating status prediction results; when the total loss function meets the set requirements, prune the conditional diffusion model and the load identification model, and then fine-tune the training until the training is complete. The total loss function consists of the loss function of the conditional diffusion model and the loss function of the load identification model.
[0103] For steps 204 and 206, a modeling module is designed, which includes a load feature repair module and a load deep feature extraction and recognition module. The load feature adaptive repair module first gradually adds Gaussian noise to the disturbed load features (in this embodiment, the current data in the disturbed load feature dataset, i.e., the disturbed load current waveform features) to fully destroy its original feature information; a conditional diffusion model is constructed, and conditionally guided and unconditionally guided reverse diffusion processes are designed to recover the pure load current sequence (i.e., noise-free current data) and the disturbed load current waveform features after noise amplification from the noisy data, respectively. The load deep feature extraction and recognition module is designed, in which a lightweight load recognition neural network based on multi-scale feature extraction is constructed to achieve the mapping learning from load features to real-time operating status; a multi-objective loss function is designed based on the GradNorm weighting strategy, and the load feature adaptive repair module and the load deep feature extraction and recognition module are trained synchronously.
[0104] Specifically, in the waveform characteristics of the disturbed load current Gaussian noise is gradually added, specifically by following a pre-designed list of noise intensities. Noise is gradually added to the waveform characteristics of the disturbed load current extracted from the line, where t is the noise addition step size. b Let be the total number of steps. , Let be the noise intensity at the t-th noise-adding step. Then, the load characteristic sequence at the t-th noise-adding step... It can be written as:
[0105] ;
[0106] In the formula, This is the load characteristic sequence at the (t-1)th noise-adding step. The Gaussian noise added in step t (i.e., the t-th noise addition step) The Gaussian noise added in step t-1, This refers to the Gaussian noise added throughout the entire noise addition process. Simultaneously, to avoid the artificial noise intensity and the load's own noise intensity differing too much, which could affect the training effect of the conditional diffusion model, the waveform characteristics of the disturbed load current can be analyzed. The inherent noise in the signal is amplified and then subjected to noise amplification. The waveform characteristics of the disturbed load current after noise amplification are shown below. It can be written as:
[0107] ;
[0108] In the formula, n is the noise amplification factor. This is a sequence of clean load currents. The waveform characteristics of the disturbed load current after noise amplification are also shown. Alternative load characteristic sequence Waveform characteristics of disturbed load current To obtain the desired noisy sequence.
[0109] The conditional diffusion model takes a noisy sequence, a noisy step size, and conditional information as input, and outputs an estimate of the noise in the noisy sequence. The conditional diffusion model uses 1D-UNet (a one-dimensional convolutional neural network), which consists of a downsampling path based on convolutional layers and an upsampling path based on deconvolutional layers, connected by jumpers. The conditional information refers to the extracted pre-event base current sequence and load voltage waveform sequence (also known as power frequency voltage data).
[0110] Designing conditionally guided and unconditionally guided reverse diffusion processes specifically involves using a conditional diffusion model to estimate the distribution of Gaussian noise added at each step, and then processing the noisy sequence. By gradually denoising, a pure load current sequence is finally obtained. The implementation process is as follows:
[0111] (1) Mask the conditional information of the input conditional diffusion model and train the conditional diffusion model to achieve the effect of artificially added Gaussian noise under unconditional guidance. The predictions enable the conditional diffusion model to fully learn its ability to resolve unconditional noise from noisy sequences;
[0112] (2) Introduce conditional information into the input of the conditional diffusion model, and train the conditional diffusion model to achieve the processing of artificial noise under conditional guidance. (i.e., artificially added Gaussian noise) and inherent noise The superposition prediction of (i.e., noise carried by current data) enables the conditional diffusion model to fully learn and utilize conditional information to estimate the distribution of conditional noise.
[0113] (3) Assume that the conditional information input to the conditional diffusion model is written as The condition information after the masking operation is written as The estimation result of artificial noise by the conditional diffusion model under unconditional guidance (also known as the noise estimate under unconditional guidance) is written as: The estimation result of conditional noise under conditional guidance (also known as the conditional noise estimate) is written as: The load current characteristics after conditional diffusion model repair It can be calculated using the following formula:
[0114] ;
[0115] Lightweight load recognition neural networks based on multi-scale feature extraction refer to neural networks composed of residual networks, which include convolutional layers with multi-sized convolutional kernels, pooling layers, fully connected layers, activation layers, and residual connections.
[0116] Simultaneously, to facilitate the terminal deployment of the models (including the conditional diffusion model and the load identification model), lightweight operations such as pruning are required for the network. The specific lightweighting methods are:
[0117] (1) Grouping neurons in the network based on dependency relationships. Dependency relationships are determined as follows: if the output of neuron i is the only input of neuron j, then neuron j is said to depend on neuron i; if the input of neuron j is the only output of neuron i, then neuron i is said to depend on neuron j. Once the dependency relationships are determined, the neurons in the network are sequentially used as initial nodes, and propagation occurs along the direction of the dependency relationship. Neurons traversed during propagation are grouped together. Neurons belonging to the same group need to be pruned simultaneously.
[0118] (2) Determine the importance of each group of neuron parameters. The principle of neuron pruning is to remove neuron structures that have the least impact on the model. Therefore, the norm of the deviation of the total loss function before and after pruning (which will be described in detail later) is used as the standard for measuring the importance of the neuron parameters in that group. The k-th neuron parameter of the i-th group is used as an example. For example, its impact on the model results (i.e., the importance estimate). It can be written as:
[0119] ;
[0120] In the formula, This indicates that the model is in the dataset The total loss function value on, This indicates that after pruning the k-th neuron in the i-th group, the result in the dataset... The total loss function value. This influence quantity is then applied... By performing a second-order Taylor expansion and using the second derivative of the Fisher information matrix to approximate the expansion, we can obtain the second-order importance estimate of this parameter:
[0121] ;
[0122] In the formula, This represents the total loss function value of the model. It represents a higher-order infinitesimal.
[0123] After obtaining the estimated influence values of each neuron parameter within the group using the above method, the estimated influence values of each neuron are statistically analyzed in the form of summation / product / maximum value, and used as the importance index values of each group.
[0124] (3) Sort the importance index values of each group and remove neurons in the corresponding group in descending order of parameter pruning rate. For example, if the entire neural network is divided into 10 groups of neurons and the parameter pruning rate is 0.2, then 2 groups of neurons need to be removed. Sort the 10 groups of neurons in descending order of importance index value and remove the 2 groups of neurons with the lowest importance index value. In addition, the optimal parameter pruning rate is determined through multiple tests. Specifically, different parameter pruning rates (such as 0, 0.1, 0.2, 0.4, 0.6, 0.8, etc.) are set to prune two models respectively, and then the performance of the model after pruning is tested using validation set data. The parameter pruning rate with the best balance between model complexity and accuracy is selected as the optimal parameter pruning rate.
[0125] A multi-objective loss function is designed based on the GradNorm weighting strategy. This multi-objective loss function includes the loss function for the conditional diffusion model and the loss function for the load identification model. The loss function for the conditional diffusion model includes both unconditional noise estimation and conditional noise estimation loss functions, while the loss function for the load identification model is the load identification loss function. Specifically, it includes:
[0126] (1) Design the unconditional noise estimation loss function The loss function requires that the noise estimation results of the conditional diffusion model under unconditional guidance be as close as possible to the artificial noise. They are similar. This loss function can be any form of regression loss function; taking the mean squared error function as an example... It can be calculated using the following formula:
[0127] ;
[0128] (2) Design conditions noise estimation loss function The loss function requires that the noise estimation result of the conditional diffusion model, when guided by conditional information, be as close as possible to the conditional noise. They are similar. This loss function can be any form of regression loss function; taking the mean squared error function as an example... It can be calculated using the following formula:
[0129] ;
[0130] (3) Design the load identification loss function The training loss function requires that the load identification model's load operation status classification results be as consistent as possible with the true load labels. This loss function can be any classification loss function form; for example, the cross-entropy loss function... It can be calculated using the following formula:
[0131] ;
[0132] In the formula, For the sample size, The number of sample categories; For 0-1 variables, if the sample Real categories and categories If they are the same, set the value to 1; otherwise, set the value to 0. For the sample Category The predicted probability.
[0133] (4) Design a multi-objective loss function (i.e., total loss function) based on the GradNorm strategy. To avoid the difference in magnitude between loss functions affecting the training performance of each task, the GradNorm strategy is used to assign weights to the loss functions to balance the importance of training for each task. It can be calculated using the following formula:
[0134] ;
[0135] G W max ( tt ) = max i [ G W i ( tt )] ;
[0136] ;
[0137] In the formula, tt represents the number of training rounds. For the t-th training round, the t-th Adaptive weights for a loss function, These are the parameter values of the last layer of the conditional diffusion model network. The gradients generated by each loss function at this layer. For the t-th training round, the t-th There are three loss functions. The first loss function is the unconditional noise estimation loss function, the second loss function is the conditional noise estimation loss function, and the third loss function is the load identification loss function.
[0138] The adaptive load feature repair module and the deep load feature extraction and recognition module are trained synchronously. Specifically, the load feature dataset (i.e., the acquired training dataset) is divided proportionally into training, validation, and test sets. The conditional diffusion model and load recognition model are trained using the training set. When the accuracy of the conditional diffusion model and load recognition model does not improve for M consecutive rounds in the validation set, it indicates that the total loss function meets the set requirements, and training of the conditional diffusion model and load recognition model is stopped, completing the initial training. After pruning the conditional diffusion model and load recognition model in the above manner, fine-tuning training is performed. After fine-tuning training, the performance of the conditional diffusion model and load recognition model is tested on the test set. Fine-tuning training is based on the parameters obtained in the initial training, and the step size of the optimizer in fine-tuning training is smaller than that set in the initial training.
[0139] Step 208: Obtain the actual load disturbance feature data, actual noise sequence, actual noise step size, and actual condition information in real time; input the actual noise sequence, actual noise step size, and actual condition information into the trained conditional diffusion model to obtain the actual noise estimate; use the actual noise estimate to denoise the actual load disturbance feature data to obtain the actual target load disturbance feature data; input the actual target load disturbance feature data into the trained load identification model to obtain the corresponding load type and operating status prediction results.
[0140] After each module completes training, the proposed methods and devices are applied to actual power consumption scenarios. The specific application process is as follows: the electrical data acquisition module is used to extract line voltage and current signals; the event detection and incremental extraction module is used to locate load events and extract load features; the trained conditional diffusion model is used for feature denoising and restoration; and the trained load identification model is used to achieve the final identification of load type and operating status.
[0141] The method in this embodiment is an adaptive load feature repair and online identification method based on a conditional diffusion model. First, a dual-tower event detection framework is designed to locate the moment of a load event and collect and extract high-frequency voltage and current data of the load in real time. A conditional diffusion model based on U-Net is constructed, using the load voltage waveform sequence and the pre-event base current sequence as conditions. A loss function combining unconditional noise estimation and conditional noise estimation is adopted. The conditional diffusion model is guided by conditional information to perform a reverse diffusion process, enabling the conditional diffusion model to fully learn its ability to resolve base noise and achieve adaptive repair of load current features. Finally, a neural network model architecture based on multi-scale feature extraction and a lightweight method are designed to achieve deep feature extraction and online type identification of the load.
[0142] The beneficial effects of the method of the present invention include:
[0143] The proposed dual-tower event detection framework and method are described. To ensure accurate localization of load events with varying transient times and characteristics, an adaptive threshold-based dual-tower event detection framework is proposed. Utilizing the abrupt changes of transient events and the trend of long transient events, a parallel framework is employed to locate and filter events step-by-step, ensuring the robustness and generalization of the detection method. This addresses the problems of insufficient detection accuracy and inaccurate localization in existing event detection methods when facing load events with different transient characteristics.
[0144] The proposed method is an adaptive load feature repair and denoising approach. To reduce the distortion of load feature extraction in complex power consumption scenarios, an adaptive load feature repair based on a conditional diffusion model is designed. After training, this method can be plugged into other load identification models in a plug-and-play manner and is widely applicable to various power consumption scenarios, exhibiting good versatility and scalability. It addresses the problem that in real-world complex power consumption scenarios with large-scale heterogeneous load aliasing and strong background noise fluctuations, the extracted target load features are prone to distortion and deformation, thus affecting the accuracy of identification.
[0145] This paper proposes a lightweight load deep feature extraction and recognition model architecture and its optimization method. To fully learn and mine the electricity consumption information implicit in load features, a lightweight load recognition model network architecture design method based on multi-scale feature extraction is proposed. Multi-size convolutional kernels are used to extract multi-scale electricity consumption information from the load. Sparse interactions and residual connections improve the learning efficiency of the conditional diffusion model for load features. Structured pruning methods are employed to optimize the model structure and parameters, reducing the computational load and complexity of the model, facilitating its deployment on terminals. While ensuring model accuracy and feature learning efficiency, it has a lower parameter and computational load compared to existing advanced AI-based load recognition models.
[0146] The proposed method integrates load feature restoration, deep feature extraction, and recognition into a single training approach. To reduce the training difficulty of the two models and improve training efficiency, a training function combining noise estimation and load recognition tasks is designed based on the GradNorm weighting strategy, achieving end-to-end model training.
[0147] It should be understood that although the steps in the flowcharts of the embodiments described above are shown sequentially according to the arrows, these steps are not necessarily executed in the order indicated by the arrows. Unless explicitly stated herein, there is no strict order restriction on the execution of these steps, and they can be executed in other orders. Moreover, at least some steps in the flowcharts of the embodiments described above may include multiple steps or multiple stages. These steps or stages are not necessarily completed at the same time, but can be executed at different times. The execution order of these steps or stages is not necessarily sequential, but can be performed alternately or in turn with other steps or at least some of the steps or stages of other steps.
[0148] Based on the same inventive concept, this application also provides a feature-repair-based load identification device for implementing the feature-repair-based load identification method described above. The solution provided by this device is similar to the implementation described in the above method; therefore, the specific limitations in one or more feature-repair-based load identification device embodiments provided below can be found in the limitations of the feature-repair-based load identification method described above, and will not be repeated here.
[0149] In one exemplary embodiment, such as Figure 2 As shown, a feature-based load identification device is provided, comprising: a data acquisition module, a training dataset construction module, a modeling module, and an identification module, wherein:
[0150] The data acquisition module is used to acquire noiseless current data of various types of individual loads in power consumption scenarios without electrical noise interference; in power consumption scenarios with electrical noise interference, it randomly generates load events of various types of individual loads, analyzes the power changes of the power grid lines to locate the time of the load event, and acquires the current data and power frequency voltage data of the corresponding types of individual loads to construct a load disturbance feature dataset; and acquires the bus current data for a given period of time before the load event time as the base data.
[0151] The training dataset construction module is used to calculate the difference between the current data and the noiseless current data in the load disturbance feature dataset to obtain the current noise. The current noise in the current data of the load disturbance feature dataset is amplified and Gaussian noise is added to obtain the noisy sequence. Based on the noisy sequence, the noisy step size, the condition information, the load disturbance feature dataset and the label, the training dataset is constructed. The condition information includes the base data and the power frequency voltage data, and the label includes the load type and operating status.
[0152] The modeling module is used to construct a conditional diffusion model and a load identification model. It trains the conditional diffusion model and load identification model using a training dataset. The noisy sequence, noisy step size, and conditional information are input into the conditional diffusion model to output a noise estimate. The noise estimate is then used to denoise the load disturbance feature dataset to obtain a target load disturbance feature dataset. This target load disturbance feature dataset is then input into the load identification model to output the load type and operating status prediction results. When the total loss function meets the set requirements, the conditional diffusion model and load identification model are pruned and retrained until training is complete. The total loss function consists of the loss functions of the conditional diffusion model and the load identification model.
[0153] The identification module is used to obtain real-time actual load disturbance feature data, actual noise sequence, actual noise step size, and actual condition information; input the actual noise sequence, actual noise step size, and actual condition information into the trained conditional diffusion model to obtain the actual noise estimate; use the actual noise estimate to denoise the actual load disturbance feature data to obtain the actual target load disturbance feature data; input the actual target load disturbance feature data into the trained load identification model to obtain the corresponding load type and operating status prediction results.
[0154] In an exemplary embodiment, the data acquisition module acquires current data and power frequency voltage data of a corresponding type of load cell, including: acquiring current data of the power grid line for multiple cycles before the load event time, and current data of the power grid line for the same number of cycles after the load event time; extracting current data of the power grid line at the same sampling point location within each cycle, and then aligning and subtracting the extracted current data of the power grid line to obtain the current data of the corresponding type of load cell; and acquiring power frequency voltage data of the power grid line within multiple cycles after the load event time to obtain the power frequency voltage data of the corresponding type of load cell.
[0155] In an exemplary embodiment, the data acquisition module includes load events, which include transient events and long transient events. Analyzing the power changes of the power grid lines to locate the load event time includes: acquiring the target time of the test period and the line power difference values corresponding to two adjacent times of the target time; if the absolute value of the line power difference value at the target time is greater than a first threshold, and the absolute value of the line power difference value at the target time is greater than the absolute value of the line power difference values at two adjacent times, then the generated load event is a transient event, and the target time is the load event time that generated the transient event; acquiring the line power difference sequence of the test period, and filtering the line power difference sequence to obtain the target line power difference. The sequence is divided into two parts: if the absolute value of the target line power difference at the first moment in the test period is greater than or equal to the second threshold, and the absolute value of the target line power difference at the previous moment is less than the second threshold, then the first moment is the start time of the event; if the absolute value of the target line power difference at the second moment in the test period is less than the second threshold, and the absolute value of the target line power difference at the previous moment is greater than or equal to the second threshold, then the second moment is the end time of the event; if the absolute value of the difference between the abnormal power corresponding to the previous moment and the abnormal power corresponding to the next moment is greater than the third threshold, then the generated load event is a long transient event, and the load event time includes the first moment and the second moment.
[0156] In an exemplary embodiment, in the data acquisition module, the first threshold is an adaptive threshold. The adaptive process of the first threshold includes: obtaining the maximum power differential threshold and the minimum power differential threshold; calculating the standard deviation of the line power differential sequence for the period to be measured; selecting the maximum value from the standard deviation and the minimum power differential threshold, and selecting the minimum value from the maximum value and the maximum power differential threshold to obtain the first threshold.
[0157] In an exemplary embodiment, the training dataset construction module constructs a training dataset by: after obtaining conditional information, masking the conditional information and using it as first conditional information, and using the directly obtained conditional information as second conditional information; a noisy sequence, a noisy step size, and the first conditional information constitute a first sample set, and the noisy sequence, the noisy step size, and the second conditional information constitute a second sample set; the first sample set and the second sample set constitute a training set for the conditional diffusion model; a load disturbance feature dataset and labels constitute a training set for the load identification model; and the training set of the conditional diffusion model and the training set of the load identification model constitute a training dataset.
[0158] In an exemplary embodiment, in the modeling module, the total loss function is obtained by weighting the loss function of the conditional diffusion model and the loss function of the load identification model, wherein the loss function of the conditional diffusion model includes an unconditional noise estimation loss function and a conditional noise estimation loss function.
[0159] Each module in the aforementioned feature-based load identification device can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in or independent of the processor in a computer device, or stored in the memory of a computer device as software, so that the processor can call and execute the operations corresponding to each module.
[0160] In one exemplary embodiment, a computer device is provided, which may be a terminal, and its internal structure diagram may be as follows: Figure 3 As shown, the computer device includes a processor, memory, input / output interfaces, a communication interface, a display unit, and an input device. The processor, memory, and input / output interfaces are connected via a system bus, and the communication interface, display unit, and input device are also connected to the system bus via the input / output interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system and computer programs. The internal memory provides an environment for the operation of the operating system and computer programs stored in the non-volatile storage media. The input / output interfaces are used for exchanging information between the processor and external devices. The communication interface is used for wired or wireless communication with external terminals; wireless communication can be achieved through Wi-Fi, mobile cellular networks, Near Field Communication (NFC), or other technologies. When executed by the processor, the computer program implements a feature-based load identification method. The display unit is used to form a visually visible image and can be a display screen, a projection device, or a virtual reality imaging device. The display screen can be an LCD screen or an e-ink screen. The input device of the computer device can be a touch layer covering the display screen, or buttons, a trackball, or a touchpad located on the computer device casing, or an external keyboard, touchpad, or mouse, etc. Those skilled in the art will understand that... Figure 3 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.
[0161] In one exemplary embodiment, a computer device is also provided, including a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described method embodiments. In one embodiment, a computer-readable storage medium is provided, on which a computer program is stored, which, when executed by a processor, implements the steps in the above-described method embodiments. In one embodiment, a computer program product is provided, including a computer program, which, when executed by a processor, implements the steps in the above-described method embodiments.
[0162] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of the relevant data must comply with relevant regulations.
[0163] Those skilled in the art will understand that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium, and when executed, it can include the processes of the embodiments of the above methods. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile memory and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM). The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, blockchain-based distributed databases. The processors involved in the embodiments provided in this application may be general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, artificial intelligence (AI) processors, etc., and are not limited to these.
[0164] The technical features of the above embodiments can be combined arbitrarily. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as the combination of these technical features does not contradict each other, it should be considered within the scope of this application. The above embodiments only illustrate several implementation methods of this application, and their descriptions are relatively specific and detailed, but they should not be construed as limiting the scope of this application. It should be noted that for those skilled in the art, several modifications and improvements can be made without departing from the concept of this application, and these all fall within the protection scope of this application. Therefore, the protection scope of this application should be determined by the appended claims.
Claims
1. A load identification method based on feature repair, characterized in that, The method includes: In power consumption scenarios without electrical noise interference, noiseless current data of various types of individual loads during operation is acquired; in power consumption scenarios with electrical noise interference, load events of various types of individual loads are randomly generated, the power changes of the power grid are analyzed to locate the time of the load event, and the current data and power frequency voltage data of the corresponding type of individual load are acquired to construct a load disturbance feature dataset; the bus current data of a given period before the time of the load event is acquired as the base data. The difference between the current data in the load disturbance feature dataset and the noiseless current data is calculated to obtain the current noise. The current noise in the current data in the load disturbance feature dataset is amplified and Gaussian noise is added to obtain a noisy sequence. Based on the noisy sequence, the noisy step size, the condition information, the load disturbance feature dataset, and the label, a training dataset is constructed. The condition information includes the base data and the power frequency voltage data, and the label includes the load type and operating status. A conditional diffusion model and a load identification model are constructed. The conditional diffusion model and the load identification model are trained using the training dataset. A noisy sequence, noisy step size, and conditional information are input into the conditional diffusion model to output a noise estimate. The noise estimate is used to denoise the load disturbance feature dataset to obtain a target load disturbance feature dataset. This target load disturbance feature dataset is then input into the load identification model to output a prediction result of the load type and operating status. When the total loss function meets the set requirements, the conditional diffusion model and the load identification model are pruned and then fine-tuned again until training is complete. The total loss function is composed of the loss function of the conditional diffusion model and the loss function of the load identification model. The system obtains real-time data on actual load disturbance characteristics, actual noise-adding sequences, actual noise-adding step sizes, and actual condition information. It then inputs the actual noise-adding sequences, actual noise-adding step sizes, and actual condition information into a trained conditional diffusion model to obtain actual noise estimates. The actual noise estimates are used to denoise the actual load disturbance characteristics data to obtain actual target load disturbance characteristics data. Finally, the actual target load disturbance characteristics data are input into a trained load identification model to obtain the corresponding load type and operating status prediction results.
2. The method according to claim 1, characterized in that, The acquisition of current data and power frequency voltage data for the corresponding type of load cell includes: Acquire the current data of the power grid lines for multiple cycles before the load event time, and the current data of the power grid lines for the same number of cycles after the load event time. After extracting the current data of the power grid line at the same sampling point in each cycle, the extracted current data of the power grid line is aligned and subtracted to obtain the current data of the corresponding type of load cell. The power frequency voltage data of the power grid line within multiple cycles after the load event time is obtained to obtain the power frequency voltage data of the corresponding type of load unit.
3. The method according to claim 1, characterized in that, The load events include transient events and long transient events. Analyzing the power changes of the power grid lines to pinpoint the timing of load events includes: Obtain the target time and the line power difference value corresponding to two adjacent times of the target time. If the absolute value of the line power difference value at the target time is greater than a first threshold, and the absolute value of the line power difference value at the target time is greater than the absolute value of the line power difference value at two adjacent times, then the generated load event is a transient event, and the target time is the load event time that generates the transient event. The line power differential sequence for the period to be tested is obtained, and the line power differential sequence is filtered to obtain the target line power differential sequence. If the absolute value of the target line power difference at the first moment in the test period is greater than or equal to the second threshold, and the absolute value of the target line power difference at the previous moment of the first moment is less than the second threshold, then the first moment is the event start moment. If the absolute value of the target line power difference at the second moment in the test period is less than the second threshold, and the absolute value of the target line power difference at the previous moment of the second moment is greater than or equal to the second threshold, then the second moment is the event end moment. If the absolute value of the difference between the abnormal power corresponding to the previous time step of the first time step and the abnormal power corresponding to the next time step of the second time step is greater than the third threshold, then the generated load event is a long transient event, and the load event time includes the first time step and the second time step.
4. The method according to claim 3, characterized in that, The first threshold is an adaptive threshold, and the adaptive process of the first threshold includes: Obtain the maximum power difference threshold and the minimum power difference threshold; Calculate the standard deviation of the line power differential sequence for the time period to be measured; The first threshold is obtained by selecting the maximum value from the standard deviation and the minimum power difference threshold, and selecting the minimum value from the maximum value and the maximum power difference threshold.
5. The method according to claim 1, characterized in that, Construct the training dataset, including: After obtaining the conditional information, the conditional information is masked and used as the first conditional information, and the directly obtained conditional information is used as the second conditional information; the noise-adding sequence, the noise-adding step size and the first conditional information constitute the first sample set, the noise-adding sequence, the noise-adding step size and the second conditional information constitute the second sample set, and the first sample set and the second sample set constitute the training set of the conditional diffusion model. The load disturbance feature dataset and labels constitute the training set of the load identification model; The training set of the conditional diffusion model and the training set of the load identification model constitute the training dataset.
6. The method according to claim 1, characterized in that, The total loss function is obtained by assigning weights to the loss function of the conditional diffusion model and the loss function of the load identification model, wherein the loss function of the conditional diffusion model includes an unconditional noise estimation loss function and a conditional noise estimation loss function.
7. A load identification device based on feature repair, characterized in that, The device includes: The data acquisition module is used to acquire noiseless current data of various types of individual loads during operation in power consumption scenarios without electrical noise interference; in power consumption scenarios with electrical noise interference, it randomly generates load events of various types of individual loads, analyzes the power changes of the power grid lines to locate the time of the load event, and acquires the current data and power frequency voltage data of the corresponding type of individual load to construct a load disturbance feature dataset; and acquires the bus current data of a given period before the time of the load event as the base data. The training dataset construction module is used to calculate the difference between the current data in the load disturbance feature dataset and the noiseless current data to obtain current noise. The current noise in the current data in the load disturbance feature dataset is amplified and Gaussian noise is added to obtain a noisy sequence. Based on the noisy sequence, the noisy step size, the condition information, the load disturbance feature dataset, and the label, a training dataset is constructed. The condition information includes the base data and the power frequency voltage data, and the label includes the load type and operating status. A modeling module is used to construct a conditional diffusion model and a load identification model. The model is trained using the training dataset. A noisy sequence, noisy step size, and conditional information are input into the conditional diffusion model to output a noise estimate. The noise estimate is used to denoise the load disturbance feature dataset to obtain a target load disturbance feature dataset. This target load disturbance feature dataset is then input into the load identification model to output a prediction result of the load type and operating status. When the total loss function meets a set requirement, the conditional diffusion model and the load identification model are pruned and retrained until training is complete. The total loss function is composed of the loss function of the conditional diffusion model and the loss function of the load identification model. The identification module is used to obtain actual load disturbance feature data, actual noise sequence, actual noise step size, and actual condition information in real time; input the actual noise sequence, actual noise step size, and actual condition information into the trained conditional diffusion model to obtain the actual noise estimate; use the actual noise estimate to denoise the actual load disturbance feature data to obtain the actual target load disturbance feature data; input the actual target load disturbance feature data into the trained load identification model to obtain the corresponding load type and operating status prediction results.
8. 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 6.
9. 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 6.
10. A computer program product, comprising a computer program, 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 6.
Citation Information
Patent Citations
Non-intrusive load identification method based on feature visualization
CN114169435A
High-fidelity space far-field time-sensitive target optical data set generation method
CN120105761A