Distributed Single-Modal Small Model Data Synchronization Method Applied to Smart Electric Energy Meters
Through the dynamic closed-loop system of cloud simulation-edge verification-parameter iteration, the problem of poor adaptability of the smart energy meter model in a dynamic environment is solved, the model is lightweight, energy consumption optimization and continuous adaptation is realized, and the performance and stability of the smart energy meter are improved.
Patent Information
- Application Number
- CN202510788818.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-13
- Publication Date
- 2025-08-05
- Estimated Expiration
- 2045-06-13
AI Technical Summary
The model training of traditional smart power meters has simulation environment distortion, static compression defects, unidirectional migration defects and energy consumption control defects, resulting in poor adaptability of the model, significant performance attenuation, and inability to continuously optimize in the dynamic environment.
A distributed single-modal small model data synchronization method is adopted, and a dynamic closed-loop system with cloud simulation-edge verification-parameter iteration is used to build a high-fidelity training environment using programmable power supplies, combined with the end-side feedback dynamic optimization of simulation parameters, lightweight models are generated, and model iterative optimization is performed through the blocked gradient backhaul mechanism.
The model is continuously adapted to the dynamic environment, improved generalization and adaptability, reduced model size and energy consumption, and ensured the stability of equipment and resource utilization efficiency.
Smart Images

Figure CN120317150B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of smart grid edge computing technology, and specifically to a distributed single-modal small model data synchronization method, device and storage medium based on dynamic closed-loop optimization and applied to smart electricity meters. The method is suitable for migrating and deploying deep learning models to resource-constrained smart electricity meters in smart grid scenarios. Background Art
[0002] As smart grids transform towards digitalization and intelligence, smart electricity meters, as terminal sensing devices, need to have localized AI capabilities such as electricity usage behavior analysis and anomaly detection. However, due to limitations in device computing power, storage resources, and power supply stability, traditional electricity meters are generally not capable of direct model training.
[0003] In existing technologies, cloud-based training and then one-way deployment to terminals are generally adopted. However, this approach still has the following problems in actual use:
[0004] Simulation environment distortion defect: Traditional cloud-based training uses fixed parameters to simulate the electricity meter environment, and cannot dynamically simulate complex scenarios such as voltage fluctuations and load mutations under real working conditions, resulting in significant performance deviations in the training model when it is actually deployed.
[0005] Static compression defects: Existing model compression technology uses a fixed compression ratio scheme. During the compression process, no dynamic parameter mapping with the target device is established, which can easily cause the loss of key features.
[0006] One-way migration flaw: Traditional deployment processes lack a reverse feedback mechanism for end-side verification data. When environmental parameter drift occurs, model retraining cannot be triggered, resulting in continuous degradation of model performance.
[0007] Energy consumption control defects: The existing model update mechanism does not take into account the particularity of the power supply of the electricity meter. Frequent updates of large-volume models can easily lead to the risk of overload of the equipment power module.
[0008] Therefore, in summary, traditional cloud-based training methods have problems such as poor model environment adaptability, significant performance degradation after deployment, and inability to continuously optimize.
[0009] To this end, this application specifically proposes a distributed single-mode small model data synchronization method applied to smart electricity meters to solve the above technical problems. Summary of the Invention
[0010] The main purpose of the present invention is to provide a distributed single-modal small model data synchronization method applied to smart electricity meters, construct a dynamic closed-loop system of "cloud simulation-edge verification-parameter iteration", covering key technologies such as cloud-based high-fidelity simulation training, model lightweight compression, end-side adaptive verification and cloud-based parameter iterative optimization. Through the bidirectional data flow between the end and the cloud, a closed-loop optimization link is formed, breaking through the static defects of traditional unidirectional deployment, and realizing continuous adaptation of the model to the dynamic environment, so as to solve the technical problems of model adaptation caused by the dynamic environment and resource constraints of the smart electricity meter terminal equipment proposed in the background technology.
[0011] The present invention adopts the following technical solutions to solve the above technical problems:
[0012] A distributed single-mode small model data synchronization method applied to a smart electric energy meter comprises:
[0013] S1. Build a high-fidelity training environment based on a programmable power supply, dynamically optimize simulation parameters based on device-side feedback, and train an initial power anomaly detection model.
[0014] S2. Model the trained model based on the device profile and generate a lightweight model through bidirectional adaptive compression.
[0015] S3. Deploy a lightweight model at the electricity meter end and monitor performance degradation characteristics;
[0016] S4. Feedback the environmental offset back to the cloud through the block gradient feedback mechanism, and iteratively correct the model parameters in the cloud.
[0017] S5. Use feedback data to trigger secondary training in the cloud, and cyclically update the model until both accuracy and power consumption converge.
[0018] Preferably, the specific operation process of step S1 includes:
[0019] S11. Configure the initial output mode of the programmable power supply based on the electrical specifications of the target energy meter (e.g., rated voltage, sampling frequency) to simulate a steady-state power supply environment as a model training environment.
[0020] S12. Receive voltage harmonic distortion and load mutation event data uploaded by end-side devices in real time, adjust the power supply output waveform, and add random perturbations that match actual operating conditions (e.g., ±10% voltage fluctuations) to build a power anomaly detection model.
[0021] S13. Collect simulated electricity usage data in a dynamic simulation environment. Parameter optimization is performed based on pre-set abnormal patterns, including power theft waveforms and equipment failure characteristics. Dynamically reconstruct power fluctuation curves (e.g., simulating harmonic components during voltage dips) to achieve parameter resonance between the simulation environment and real-world scenarios. A mixed training set with noise labels is generated.
[0022] S14. Use the temporal convolutional network (TCN) architecture to train the power anomaly detection model and simultaneously record the correlation mapping relationship between environmental parameters and model weights.
[0023] Preferably, the preset abnormal mode in step S13 is set to generate an abnormal waveform containing environmental disturbances through a programmable power supply, and the mathematical expression is:
[0024]
[0025] in, is a dynamic coupling waveform, used to represent the time The synthetic signal after the influence of the superimposed environmental parameters is For time Standard abnormal waveforms including voltage sag and harmonic distortion, is the environmental disturbance intensity coefficient, 、 、 Respectively expressed as The amplitude, frequency, and phase angle of the subharmonics, Expressed as time Gaussian white noise when It is the maximum harmonic order of the harmonic component superposition process.
[0026] Preferably, in the parameter optimization process of step S13, random time offset and amplitude scaling are applied to the original waveform to enhance the training data, as follows:
[0027]
[0028] in, is the waveform data after parameter optimization, is the amplitude scaling factor, is the time offset, is random impulse noise.
[0029] Preferably, the specific operation process of step S2 includes:
[0030] S21. Extract the electricity meter's hardware parameters (CPU frequency, memory remaining) and runtime status (task queue length, instantaneous power consumption) and construct a dynamically updated device capability assessment matrix as a device profile.
[0031] S22. Implement differentiated compression strategies for different layers of the model based on device profiles: Use layered quantization compression (4-bit quantization) for compute-intensive convolutional layers based on device profiles, and implement weight pruning (20% weight pruning) for storage-sensitive fully connected layers based on device profiles.
[0032] S23. Introduce a device resource constraint loss function to perform environment-aware knowledge distillation. When it is detected that the target device memory usage exceeds the limit, the distillation intensity of non-critical feature layers is automatically reduced, and anomaly detection sensitive nodes are prioritized.
[0033] Preferably, the specific operation process of implementing the differentiated compression strategy for different layers of the model in step S22 includes:
[0034] L1. Build a device capability scoring model based on the device profile, represented by a hardware resource scoring function:
[0035]
[0036]
[0037] in, It is expressed as a comprehensive score of equipment capability, and the specific score value is within 0-1. and Represents the weight coefficients of CPU and memory respectively, and Represents the real-time idle resources of CPU and memory respectively, and Represents the total resources of CPU and memory respectively;
[0038] L2. For computationally intensive convolutional layers, layered quantization compression is used based on the comprehensive scoring of device capabilities, as follows:
[0039]
[0040] in, Expressed as Layer quantization bit width;
[0041] L3. The fully connected layer that is sensitive to storage performs weight pruning based on the comprehensive scoring results of device capabilities, including:
[0042]
[0043] in, For the Layer pruning ratio, is the maximum allowed pruning ratio.
[0044] Preferably, the specific operation process of step S3 includes:
[0045] S31. Utilize the idle periods of the energy meter to transmit model parameters in blocks over the Bluetooth Low Energy channel, avoiding storage overload caused by centralized writes and enabling safe incremental deployment.
[0046] S32. During model inference, synchronously collect parameters such as voltage RMS, ambient temperature, and memory usage, and construct a time-environment-performance correlation log to achieve multi-dimensional environmental monitoring.
[0047] S33. Compare the model output with the benchmark meter results to identify sudden increases in false alarm rates under specific circumstances (e.g., when the voltage drops to 85% of the rated value) and mark them as feature offset hotspots.
[0048] Preferably, the specific operation process of step S4 includes:
[0049] S41. Sort the model weight gradients associated with the feature offset hotspots by their influence weight scores and divide them into a specified number of data blocks (e.g., each block contains 5% of the key gradients). The influence score of the weight gradient is calculated as follows:
[0050]
[0051] in, For the The importance score of the weight gradient, is the gradient value obtained by back propagation, is the total number of weight gradients of the model;
[0052] S42. Based on the power supply cycle of the energy meter (such as the low-load period before and after the mains zero point), select the device's idle window to upload gradient data block by block, reducing the peak power consumption of a single return by 50%;
[0053] S43. Using the environment-related back-propagation algorithm, the convolution kernel weights that are strongly correlated with voltage fluctuations are adjusted first, and compensatory corrections are made to the power disturbance parameters of the simulation environment.
[0054] Preferably, the specific operation process of step S5 includes:
[0055] S51. Using feedback from more than a specified number of edge devices on the same feature offset, the cloud triggers local retraining of the affected model layer (e.g., the voltage sag response module) and cyclic model updates to avoid computational redundancy caused by a full model update.
[0056] S52. Calculate the mean average precision (MAP) and standard deviation of the end-side model for the last three iterations. When the MAP improvement rate is less than 1% and the fluctuation range is less than 0.5%, the model is considered to have reached convergence and the model update cycle is terminated.
[0057] Preferably, the triggering condition for triggering the training in step S51 is:
[0058]
[0059] in, To report the number of failed devices, is the total number of feedback devices, For the The original device weight value of each device, For the The change in the original device weight of each device, is the threshold of the failure device ratio, is the threshold value of the total weight change, is the number of model weights.
[0060] Preferably, the convergence determination formula for determining whether the model has reached a convergence state in step S52 is:
[0061]
[0062] in, Expressed as the average accuracy of the last three iterations, Expressed as the standard deviation of the accuracy of the last three iterations, it is used to measure the volatility of model performance. It is expressed as the average accuracy of the model verified on the client side after the kth iteration;
[0063] when Greater than a specified threshold and Convergence is determined when the value is less than another specified threshold.
[0064] In another aspect, the present invention further discloses a computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, the processor executes the steps of the above method.
[0065] On the other hand, the present invention further discloses a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the above method.
[0066] As can be seen from the above technical solution, the present invention provides a distributed single-mode small model data synchronization method for smart energy meters. Compared with the existing technology, the present invention has the following advantages:
[0067] 1. By setting up a dynamic simulation system based on a programmable power supply in a cloud-based training environment, the present invention can receive real-time voltage / current characteristic feedback from the end-side electric energy meter and dynamically adjust the power supply fluctuation parameters, thereby achieving parameter resonance between the simulation environment and the actual working conditions, thereby improving the consistency between the cloud-based training data and the deployment environment, thereby significantly enhancing the generalization and adaptability of the model.
[0068] 2. By setting a "device capability profile-compression parameter" mapping model in the model compression stage, the present invention can dynamically adjust the knowledge distillation intensity according to the real-time resource occupancy rate of the target electricity meter, thereby reducing the model volume while controlling the loss of anomaly detection accuracy within a specified range, thereby achieving balanced optimization of model lightweighting and performance.
[0069] 3. By setting up a block gradient return mechanism in the end-cloud collaborative framework, the present invention can split the complete gradient data into small blocks and optimize the transmission timing, and control the energy consumption of a single return to below the specified threshold of the device power supply margin, while retaining a higher proportion of key correction information to avoid device power supply overload and ensure model update efficiency.
[0070] 4. By setting up an incremental learning framework in end-cloud collaborative learning, the present invention can perform local optimization on only the performance degradation module based on hotspot analysis verified on the end side, thereby reducing the time consumption of secondary training, while ensuring the stability of the global model, reducing the waste of cloud computing power and improving resource utilization efficiency.
[0071] 5. This invention forms a dynamic closed-loop system of "cloud simulation-edge verification-parameter iteration" through bidirectional data flow between the end and the cloud, breaking through the static defects of traditional one-way deployment and realizing the continuous adaptation of the model to the dynamic environment.
[0072] It should be understood that the content described in this section is not intended to identify the key or important features of the embodiments of the present invention, nor is it intended to limit the scope of the present invention. Other features of the present invention will become easy to understand through the following description. Of course, it is not necessary to achieve all of the above-mentioned advantages simultaneously in order to implement any product of the present invention. BRIEF DESCRIPTION OF THE DRAWINGS
[0073] The accompanying drawings, which constitute part of this application, are intended to provide a further understanding of the present invention. The exemplary embodiments of the present invention and their descriptions are intended to explain the present invention and do not constitute an undue limitation of the present invention. In the accompanying drawings:
[0074] Figure 1 It is a schematic diagram of the overall process operation of the present invention;
[0075] Figure 2 Schematic diagram of the model construction and training process of the present invention. DETAILED DESCRIPTION
[0076] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the embodiments described are only part of the embodiments of the present invention, not all of the embodiments. In the absence of conflict, the embodiments in this application and the features in the embodiments can be combined with each other. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention.
[0077] In the embodiment, see Figures 1 to 2 .
[0078] like Figure 1 and Figure 2 As shown, the embodiment of the present invention proposes a distributed single-mode small model data synchronization method applied to a smart electric energy meter, comprising the following steps:
[0079] S1. Cloud-based dynamic simulation: This involves building a high-fidelity training environment based on a programmable power supply, dynamically optimizing simulation parameters based on device-side feedback, and training an initial power anomaly detection model. The specific process includes:
[0080] S11. Configure the initial output mode of the programmable power supply based on the electrical specifications of the target energy meter (e.g., rated voltage, sampling frequency) to simulate a steady-state power supply environment as a model training environment.
[0081] S12. Receive voltage harmonic distortion and load mutation event data uploaded by end-side devices in real time, adjust the power supply output waveform, and add random perturbations that match actual operating conditions (e.g., ±10% voltage fluctuations) to build a power anomaly detection model.
[0082] S13. Collect simulated electricity usage data in a dynamic simulation environment. Parameter optimization is performed based on pre-set abnormal patterns, including power theft waveforms and equipment failure characteristics. Dynamically reconstruct power fluctuation curves (e.g., simulating harmonic components during voltage dips) to achieve parameter resonance between the simulation environment and real-world scenarios. A mixed training set with noise labels is generated.
[0083] At this time, the preset abnormal mode is set to generate an abnormal waveform containing environmental disturbances through the programmable power supply. The mathematical expression is:
[0084]
[0085] in, is a dynamic coupling waveform, used to represent the time The synthetic signal after the influence of the superimposed environmental parameters is For time Standard abnormal waveforms including voltage sag and harmonic distortion, is the environmental disturbance intensity coefficient (value range is 0.1-0.3), 、 、 Respectively expressed as The amplitude, frequency, and phase angle of the subharmonics, Expressed as time Gaussian white noise (mean 0, variance ), is the maximum harmonic order in the superposition process of harmonic components;
[0086] At this time, by modulating multi-frequency harmonic components and noise, the complex electromagnetic environment of a real electricity meter can be simulated.
[0087] In addition, during the parameter optimization process, random time offset and amplitude scaling are applied to the original waveform to enhance the training data.
[0088]
[0089] in, is the waveform data after parameter optimization, is the amplitude scaling factor (obeying uniform distribution ), is the time offset (obeying normal distribution , is the signal period), is a random pulse noise (the probability density function is );
[0090] Therefore, data diversity can be enhanced at this time to improve the generalization ability of the model.
[0091] S14. Use the temporal convolutional network (TCN) architecture to train the power anomaly detection model and simultaneously record the correlation mapping relationship between environmental parameters and model weights.
[0092] It can be explained at this point that since traditional cloud-based training uses fixed-parameter simulation, resulting in poor model generalization, here a programmable power supply is used to receive real-time end-side operating condition data and dynamically reconstruct the power supply fluctuation curve (such as the harmonic components during simulated voltage drops), so that the simulation environment and the real scene form parameter resonance, and the consistency between training data and the deployment environment is improved by more than 60%.
[0093] In summary, by setting up a dynamic simulation system based on a programmable power supply in a cloud-based training environment, it is possible to receive real-time voltage / current characteristic feedback from the end-side electricity meter and dynamically adjust the power supply fluctuation parameters, thereby achieving parameter resonance between the simulation environment and the actual working conditions. This improves the consistency between the cloud-based training data and the deployment environment, thereby significantly enhancing the generalization and adaptability of the model.
[0094] S2. The trained model is remodeled based on the device profile and a lightweight model is generated through bidirectional adaptive compression. The specific operation process includes:
[0095] S21. Extract the electricity meter's hardware parameters (CPU frequency, memory remaining) and runtime status (task queue length, instantaneous power consumption) and construct a dynamically updated device capability assessment matrix as a device profile.
[0096] S22. Implement differentiated compression strategies for different layers of the model based on device profiles: Use layered quantization compression (4-bit quantization) for compute-intensive convolutional layers based on device profiles, and implement weight pruning (20% weight pruning) for storage-sensitive fully connected layers based on device profiles.
[0097] The specific operation process of implementing differentiated compression strategies for different layers of the model at this time includes:
[0098] L1. Build a device capability scoring model based on the device profile, represented by a hardware resource scoring function:
[0099]
[0100]
[0101] At this time, the scoring results are used to dynamically adjust the compression strategy. The lower the score, the higher the compression rate.
[0102] in, It is expressed as a comprehensive score of equipment capability, and the specific score value is within 0-1. and Represents the weight coefficients of CPU and memory respectively, and Represents the real-time idle resources of CPU and memory respectively, and Represents the total resources of CPU and memory respectively;
[0103] L2. For computationally intensive convolutional layers, layered quantization compression is used based on the comprehensive scoring of device capabilities, as follows:
[0104]
[0105] in, Expressed as Layer quantization bit width, and in the specific implementation process, retain high precision for high-scoring devices, and use extreme quantization for low-scoring devices;
[0106] L3. The fully connected layer that is sensitive to storage performs weight pruning based on the comprehensive scoring results of device capabilities, including:
[0107]
[0108] in, For the Layer pruning ratio, The maximum allowed pruning ratio (default 0.3), and the pruning ratio is negatively correlated with the device score;
[0109] S23. Introduce a device resource constraint loss function to perform environment-aware knowledge distillation. When it is detected that the target device memory usage exceeds the limit, the distillation intensity of non-critical feature layers is automatically reduced, and anomaly detection sensitive nodes are prioritized.
[0110] It can be explained at this point that since existing compression technology uses static strategies, it is easy to cause the loss of key features. Therefore, here we use device profiling to perceive the end-side resource status in real time and dynamically adjust compression parameters (such as quantization bit width and pruning ratio). When the model volume is reduced by 70%, the loss of anomaly detection accuracy is controlled within 3%.
[0111] In summary, by setting the "device capability profile-compression parameter" mapping model in the model compression stage, the knowledge distillation intensity can be dynamically adjusted according to the real-time resource occupancy rate of the target electricity meter, thereby reducing the model volume while controlling the loss of anomaly detection accuracy within a specified range, thereby achieving balanced optimization of model lightweighting and performance.
[0112] S3. Deploy a lightweight model on the electricity meter and monitor performance degradation characteristics. The specific operation process includes:
[0113] S31. Utilize the idle periods of the energy meter to transmit model parameters in blocks over the Bluetooth Low Energy channel, avoiding storage overload caused by centralized writes and enabling safe incremental deployment.
[0114] S32. During model inference, synchronously collect parameters such as voltage RMS, ambient temperature, and memory usage, and construct a time-environment-performance correlation log to achieve multi-dimensional environmental monitoring.
[0115] The distillation loss function is set, and the model complexity is adjusted by introducing a joint loss function with device resource constraints to achieve environmental perception knowledge distillation. for:
[0116]
[0117] The hardware constraints for:
[0118]
[0119] in, Model for teachers With student models The KL divergence of the output is used to measure the difference in the probability distribution between the student model output and the teacher model output, prompting the student model to imitate the prediction behavior of the teacher model and retain key features; is the constraint weight coefficient (default 1.0), which is used to balance the knowledge distillation loss (LKL) and the hardware resource constraint loss ( )’s weight; The memory usage safety threshold (default 0.8); The actual memory occupied by the student model S when running on the end device; The total available memory of the target device is used to calculate the memory usage ratio and determine whether it exceeds the safety threshold. When the memory usage exceeds the safety threshold, the model complexity is forced to be reduced.
[0120] S33. Compare the model output with the benchmark meter results to identify sudden increases in false alarm rates under specific circumstances (e.g., when the voltage drops to 85% of the rated value) and mark them as feature offset hotspots.
[0121] S4. Feedback the environmental offset back to the cloud through the block gradient feedback mechanism, where the model parameters are iteratively corrected. The specific operation process includes:
[0122] S41. Sort the model weight gradients associated with the feature offset hotspots by their influence weight scores and divide them into a specified number of data blocks (e.g., each block contains 5% of the key gradients). The influence score of the weight gradient is calculated as follows:
[0123]
[0124] in, For the The importance score of the weight gradient, is the gradient value obtained by back propagation, is the total number of weight gradients of the model;
[0125] S42. Based on the power supply cycle of the energy meter (such as the low-load period before and after the mains zero point), select the device's idle window to upload gradient data block by block, reducing the peak power consumption of a single return by 50%;
[0126] The energy consumption of a single transmission Related to the data block size:
[0127]
[0128] in, is the data block size (unit: KB); It is a nonlinear energy consumption index (measured value is about 1.3-1.5); is the transmission time; It is the device-related energy consumption benchmark coefficient, used to characterize the hardware energy efficiency.
[0129] S43. Using the environment-related back-propagation algorithm, the convolution kernel weights that are strongly correlated with voltage fluctuations are adjusted first, and compensatory corrections are made to the power disturbance parameters of the simulation environment.
[0130] At this time, the back propagation algorithm uses the gradient descent formula, which is:
[0131]
[0132] in, is the learning rate, which is used to control the parameter update step size, is the gradient of the loss function L with respect to the model weight W. It is necessary to introduce the environmental compensation factor into the gradient descent formula, so:
[0133]
[0134] in, is the environmental coupling coefficient (value ranges from 0.1 to 0.5), is the loss function for the environment parameters The partial derivative of is used to reflect the impact of environmental changes (such as voltage deviation rate) on model performance. is the terminal side environmental parameter (such as voltage deviation rate), is the gradient of the loss function L with respect to the model weight W.
[0135] At this point, it can be explained that since the traditional feedback mechanism directly returns complete gradient data, it is easy to cause device power overload. Therefore, through gradient blockization and transmission timing optimization, the energy consumption of a single return is controlled to less than 20% of the device power margin, while retaining more than 95% of the key correction information.
[0136] In summary, by setting up a block gradient return mechanism in the end-cloud collaborative framework, the complete gradient data can be split into small blocks and the transmission timing can be optimized. The energy consumption of a single return can be controlled below the specified threshold of the device power supply margin, while retaining a higher proportion of key correction information to avoid device power overload and ensure model update efficiency.
[0137] S5. Use feedback data to trigger secondary training in the cloud, cyclically updating the model until both accuracy and power consumption converge. The specific operation process includes:
[0138] S51. When more than 30% of the end-side devices report the same type of feature offset, the cloud triggers local retraining of the affected model layer (such as the voltage sag response module) and cyclically updates the model to avoid computational redundancy caused by a full model update.
[0139] The trigger conditions for triggering training at this time are:
[0140]
[0141] in, To report the number of failed devices, is the total number of feedback devices, For the The original device weight value of each device, For the The change in the original device weight of each device, is the threshold of the failure device ratio, is the threshold value of the total weight change, is the number of model weights;
[0142] S52. Calculate the mean average precision (MAP) and standard deviation of the on-device model for the last three iterations. When the MAP improvement is less than 1% and the fluctuation range is less than 0.5%, the model is considered to have reached convergence and the model update cycle is terminated.
[0143] At this time, the convergence judgment formula for determining whether the model has reached a convergent state is:
[0144]
[0145] in, Expressed as the average accuracy of the last three iterations, Expressed as the standard deviation of the accuracy of the last three iterations, it is used to measure the volatility of model performance. It is expressed as the average accuracy of the model verified on the client side after the kth iteration;
[0146] when and Convergence is determined when .
[0147] At this point, it can be explained that since existing technologies require frequent full model updates, resulting in a waste of cloud computing power, this is why we use hotspot analysis based on device-side feedback to incrementally optimize only the performance degradation module, reducing the secondary training time by 65% while ensuring global model stability.
[0148] In summary, by setting up an incremental learning framework in end-cloud collaborative learning, it is possible to perform local optimization on performance-degrading modules based on hotspot analysis verified on the end side, thereby reducing the time required for secondary training while ensuring global model stability, reducing cloud computing power waste, and improving resource utilization efficiency.
[0149] In addition, it can be summarized that during actual use, this method forms a dynamic closed-loop system of "cloud simulation-edge verification-parameter iteration" through bidirectional data flow between the end and the cloud, breaking through the static defects of traditional one-way deployment and realizing continuous adaptation of the model to the dynamic environment. The constructed dynamic simulation environment makes the match degree between cloud training data and real scenes reach 92%, which is 40% higher than the traditional method; the volume of the lightweight model is only 30% of the original model, but the accuracy loss of key anomaly detection tasks is ≤3%; the energy consumption of model iteration is reduced by 58% (through block feedback and incremental training), and the end-side inference accuracy converges to more than 98.5% within 3 cycles.
[0150] In a specific embodiment, in order to verify the technical effect of the present invention, the following two groups of control experiments were designed:
[0151] (1) Deployment environment:
[0152] Hardware parameters:
[0153] Energy meter: ARM Cortex-M4 processor (100 MHz), 512 KB RAM, power supply voltage 220 V ± 15%.
[0154] Cloud: NVIDIA A100 GPU cluster, simulation environment uses Keysight APS programmable power system
[0155] Test dataset:
[0156] Anomaly detection dataset: Contains six typical types of electricity anomalies (electricity theft, equipment failure, harmonic pollution, etc.), a total of 50,000 time series waveforms, and a time resolution of 1 ms.
[0157] Environmental disturbance data: 3,000 sets of voltage fluctuation events (swells / sags, harmonic distortion) collected from industrial areas serve as simulation environment input.
[0158] At this time there are:
[0159] (1) Experimental group: The closed-loop optimization method described in the present invention was deployed on 100 smart electricity meters (model DL-2023), covering urban residential areas (steady-state environment) and industrial areas (dynamic and complex environment).
[0160] (2) Control group: The traditional one-way deployment solution (fixed parameter training in the cloud + static compression) was used and deployed to 100 electricity meters of the same model, with the same environmental distribution as the experimental group.
[0161] (2) Test indicators and comparison methods:
[0162]
[0163] (III) Key test scenario design:
[0164] (1) Scenario 1: Model generalization capability in dynamic environments
[0165] Test conditions: A random voltage sag (220V to 180V, 100ms duration) and third harmonic distortion (THD = 15%) were injected into an industrial power meter.
[0166] Experimental group process:
[0167] The cloud generates a dynamic coupling waveform through the mathematical expression of the dynamic coupling waveform ,in , Hz.
[0168] Perform environmental perception distillation and set (Memory safety threshold).
[0169] End-side verification triggers the update of environment-related parameters ( ).
[0170] Results comparison:
[0171] Experimental group and control group
[0172]
[0173] Experimental group and control group
[0174]
[0175] Analysis: The experimental group improved the model's recognition accuracy for voltage sag scenarios by 14.3% through a dynamic simulation environment and parameter resonance mechanism.
[0176] (2) Scenario 2: Long-term stability of resource-constrained devices
[0177] Test conditions: 72 hours of continuous operation, simulating a high-load state for the electricity meter (CPU usage > 80%, memory remaining < 20%).
[0178] Verification of innovative points in the experimental group:
[0179] The device profile model dynamically adjusts the compression strategy: , activates extreme quantization (2 bits).
[0180] Block gradient return: Setting KB, , ensuring the energy consumption of a single return mJ.
[0181] Results comparison:
[0182] Number of model crashes Experimental group Number of model crashes Control group
[0183]
[0184] Average update energy consumption experimental group (control group)
[0185]
[0186] Analysis: The experimental group's device profile-driven compression and block-based transmission mechanism maintained stability even when resources were tight, reducing energy consumption by 68.9%.
[0187] (3) Scenario 3: Verification of closed-loop convergence efficiency
[0188] Test conditions: In a steady-state residential environment, the model is required to achieve 98% accuracy within 3 iterations.
[0189] Experimental group process:
[0190] Convergence determination: sliding window calculation and .
[0191] Incremental training trigger: When , When , only 20% of the model parameters are retrained.
[0192] Results comparison:
[0193] Convergence iterations experimental group control group did not converge
[0194]
[0195] Cloud computing power consumption experimental group (control group full model training)
[0196]
[0197] Analysis: The experimental group reduced computing power consumption by 65.4% through the intelligent convergence mechanism and met real-time requirements.
[0198] (IV) Test conclusion:
[0199]
[0200] This test verified the significant advantages of the method in real scenarios and provided a reliable technical path for the edge AI deployment of smart electricity meters.
[0201] In another aspect, the present invention further discloses a computer-readable storage medium storing a computer program, wherein when the computer program is executed by a processor, the processor executes the steps of the above method.
[0202] On the other hand, the present invention further discloses a computer device, comprising a memory and a processor, wherein the memory stores a computer program, and when the computer program is executed by the processor, the processor executes the steps of the above method.
[0203] In another embodiment provided in the present application, a computer program product containing instructions is also provided. When the computer is run on the computer, the computer executes any of the distributed single-modal small model data synchronization methods applied to smart electricity meters in the above embodiments.
[0204] It is understandable that the system provided by the embodiment of the present invention corresponds to the method provided by the embodiment of the present invention, and the explanation, examples and beneficial effects of the relevant contents can refer to the corresponding parts of the above method.
[0205] The embodiment of the present application further provides an electronic device, comprising a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other via the communication bus.
[0206] Memory for storing computer programs;
[0207] The processor is configured to implement the above-mentioned distributed single-mode small model data synchronization method applied to the smart electric energy meter when executing the program stored in the memory.
[0208] The communication bus mentioned in the above electronic device can be a peripheral component interconnect standard bus or an extended industry standard architecture bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc.
[0209] The communication interface is used for communication between the above electronic device and other devices.
[0210] The memory may include a random access memory, or a non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.
[0211] The above-mentioned processor can be a general-purpose processor, including a central processing unit, a network processor, etc.; it can also be a digital signal processor, an application-specific integrated circuit, a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, or a discrete hardware component.
[0212] It should also be noted that electronic devices also include terminal devices, which can also be called terminals, user equipment, mobile stations, mobile terminals, etc. Terminal devices can be mobile phones, smart TVs, wearable devices, tablet computers, computers with wireless transceiver functions, virtual reality terminal devices, augmented reality terminal devices, wireless terminals in industrial control, wireless terminals in unmanned driving, wireless terminals in remote surgery, wireless terminals in smart grids, wireless terminals in transportation safety, wireless terminals in smart cities, wireless terminals in smart homes, etc. The embodiments of this application do not limit the specific technology and specific device form used by the terminal devices.
[0213] In the above embodiments, all or part of the embodiments can be implemented using software, hardware, firmware, or any combination thereof. When implemented using software, all or part of the embodiments can be implemented in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the processes or functions described in the embodiments of this application are generated in whole or in part. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions can be stored in a computer-readable storage medium or transmitted from one computer-readable storage medium to another. For example, the computer instructions can be transmitted from one website, computer, server, or data center to another website, computer, server, or data center via wired or wireless means. The computer-readable storage medium can be any available medium that can be accessed by a computer, or a data storage device such as a server or data center that integrates one or more available media. The available medium can be magnetic media (e.g., floppy disks, hard disks, magnetic tapes), optical media, or semiconductor media.
[0214] The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the scope of protection of the present invention.
[0215] In addition, it should be noted that if directional indication is involved in the embodiment of the present invention, the directional indication is only used to explain the relative position relationship, movement status, etc. between the various components under a certain specific posture. If the specific posture changes, the directional indication will also change accordingly.
[0216] In addition, if there are descriptions involving "first", "second", etc. in the embodiments of the present invention, the descriptions of "first", "second", etc. are only for descriptive purposes and cannot be understood as indicating or suggesting their relative importance or implicitly indicating the number of the indicated technical features. Therefore, the features defined as "first" and "second" may explicitly or implicitly include at least one of such features. In addition, the meaning of "and / or" appearing throughout the text includes three parallel schemes. Taking "A and / or B" as an example, it includes scheme A, or scheme B, or schemes in which A and B are satisfied at the same time. In addition, in the embodiments of the present invention, "multiple" refers to more than two. In addition, the technical solutions between the various embodiments can be combined with each other, but it must be based on the ability of ordinary technicians in this field to implement. When the combination of technical solutions is mutually contradictory or cannot be implemented, it should be deemed that such a combination of technical solutions does not exist and is not within the scope of protection required by the present invention.
Claims
1. A distributed single-mode small model data synchronization method applied to smart electric energy meters, characterized in that: include: S1. Build a high-fidelity training environment based on a programmable power supply, dynamically optimize simulation parameters based on device-side feedback, and train an initial power anomaly detection model. S2. Model the trained model based on the device profile and generate a lightweight model through bidirectional adaptive compression. S3. Deploy a lightweight model at the electricity meter end and monitor performance degradation characteristics; S4. Feedback the environmental offset back to the cloud through the block gradient feedback mechanism, and iteratively correct the model parameters in the cloud. S5. Use feedback data to trigger secondary training in the cloud, and cyclically update the model until both accuracy and power consumption converge. The specific operation process of the S2 step includes: S21. Extract the hardware parameters and runtime status of the energy meter and construct a dynamically updated device capability evaluation matrix as a device profile; S22. Implement differentiated compression strategies for different layers of the model based on device profiles: Apply layered quantization compression to compute-intensive convolutional layers and perform weight pruning on storage-sensitive fully connected layers based on device profiles. S23. Introducing a device resource constraint loss function for context-aware knowledge distillation. When the target device's memory usage is detected to be excessive, the distillation intensity of non-critical feature layers is automatically reduced, prioritizing the retention of nodes sensitive to anomaly detection. The specific operation process of implementing the differentiated compression strategy for different layers of the model in step S22 includes: L1. Build a device capability scoring model based on the device profile, represented by a hardware resource scoring function: in, It is expressed as a comprehensive score of equipment capability, and the specific score value is within 0-1. and Represents the weight coefficients of CPU and memory respectively, and Represents the real-time idle resources of CPU and memory respectively, and Represents the total resources of CPU and memory respectively; L2. For computationally intensive convolutional layers, layered quantization compression is used based on the comprehensive scoring of device capabilities, as follows: in, Expressed as Layer quantization bit width; L3. The fully connected layer that is sensitive to storage performs weight pruning based on the comprehensive scoring results of device capabilities, including: in, For the Layer pruning ratio, is the maximum allowed pruning ratio.
2. The distributed single-mode small model data synchronization method for smart electric energy meters according to claim 1, characterized in that: The specific operation process of step S1 includes: S11. Configure the initial output mode of the programmable power supply according to the electrical specifications of the target electricity meter to simulate a steady-state power supply environment as a model training environment; S12. Receive voltage harmonic distortion and load mutation event data uploaded by the end-side device in real time, adjust the power supply output waveform, and add random disturbances that match the actual operating conditions to build a power anomaly detection model; S13. Collect simulated electricity usage data in a dynamic simulation environment, optimize parameters based on preset abnormal patterns including electricity theft waveforms and equipment failure characteristics, and generate a mixed training set with noise labels; S14. Use a temporal convolutional network architecture to train a power consumption anomaly detection model, and simultaneously record the correlation mapping relationship between environmental parameters and model weights.
3. The distributed single-mode small model data synchronization method for smart electric energy meters according to claim 2, characterized in that: The preset abnormal mode in step S13 is set to generate an abnormal waveform containing environmental disturbances through a programmable power supply, and the mathematical expression is: in, is a dynamic coupling waveform, used to represent the time The synthetic signal after the influence of the superimposed environmental parameters is For time Standard abnormal waveforms including voltage sag and harmonic distortion, is the environmental disturbance intensity coefficient, 、 、 Respectively expressed as The amplitude, frequency, and phase angle of the subharmonics, Expressed as time Gaussian white noise when It is the maximum harmonic order of the harmonic component superposition process.
4. The distributed single-mode small model data synchronization method for a smart electric energy meter according to claim 3, characterized in that: During the parameter optimization process of step S13, random time offset and amplitude scaling are applied to the original waveform to enhance the training data, as follows: in, is the waveform data after parameter optimization, is the amplitude scaling factor, is the time offset, is random impulse noise.
5. The distributed single-mode small model data synchronization method for smart electric energy meters according to claim 1, characterized in that: The specific operation process of the S4 step includes: S41. Sort the model weight gradients associated with the feature offset hotspots by influence weight influence score and divide them into a specified number of data blocks. The influence score calculation formula of the weight gradient is: in, For the The importance score of the weight gradient, is the gradient value obtained by back propagation, is the total number of weight gradients of the model; S42. Combined with the power supply cycle of the energy meter, select the device idle window to upload gradient data block by block; S43. Using the environment-related back-propagation algorithm, the convolution kernel weights that are strongly correlated with voltage fluctuations are adjusted first, and compensatory corrections are made to the power disturbance parameters of the simulation environment.
6. The distributed single-mode small model data synchronization method for smart electric energy meters according to claim 1, characterized in that: The specific operation process of step S5 includes: S51. Using more than a specified number of edge devices to report the same type of feature offset, trigger the cloud to initiate local retraining of the affected model layers and cyclically update the model to avoid computational redundancy caused by full model updates. S52. Calculate the average precision (MAP) and standard deviation (SD) of the end-side model for the last three iterations. When the MAP improvement rate is less than a specified threshold and the fluctuation range is less than another specified threshold, the model is determined to have reached convergence and the model update cycle is terminated.
7. The distributed single-mode small model data synchronization method applied to a smart electric energy meter according to claim 6, characterized in that: The triggering conditions for triggering the training in step S51 are: in, To report the number of failed devices, is the total number of feedback devices, For the The original device weight value of each device, For the The change in the original device weight of each device, is the threshold of the failure device ratio, is the threshold value of the total weight change, is the number of model weights.
8. The distributed single-mode small model data synchronization method for smart electric energy meters according to claim 6, characterized in that: The convergence determination formula for determining whether the model has reached a convergence state in step S52 is: in, Expressed as the average accuracy of the last three iterations, Expressed as the standard deviation of the accuracy of the last three iterations, it is used to measure the volatility of model performance. It is expressed as the average accuracy of the model verified on the client side after the kth iteration; when Greater than a specified threshold and Convergence is determined when the value is less than another specified threshold.
Citation Information
Patent Citations
Start-stop unit optimization method for responding to frequency modulation market demand in real time
CN118353097A
Knowledge distillation optimization method guided by adaptive noise sample in end-cloud collaborative environment
CN119005293A