A large model cross-end transfer compression method and device for smart electric energy meters

Through device feature-aware compression, dynamic adapter injection and collaborative differential transmission, the problem of inefficient model cross-end migration caused by device heterogeneity in smart power meter clusters is solved, and efficient model cross-end migration and real-time abnormality detection are achieved.

CN120321130BActive Publication Date: 2025-08-26CSG SMART SCI&TECH CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510788677.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-06-13
Publication Date
2025-08-26
Estimated Expiration
2045-06-13

AI Technical Summary

Technical Problem

The prior art cannot effectively solve the problem of inefficient model compression, transmission and operation due to equipment heterogeneity in smart power meters clusters, especially the complexity of model cross-end migration between low-power terminals and high-computing equipment is difficult to balance.

Method used

Using the methods of device feature-aware compression, dynamic adapter injection, and collaborative differential transmission, the feature fingerprint is generated through quantitative modeling, the model structure is dynamically adjusted, and the closed-loop process of terminal feature analysis-hierarchical dynamic compression-cluster collaborative distribution-online fine-tuning and calibration is built to achieve accurate adaptation between the model and the terminal environment.

Benefits of technology

It improves resource utilization, reduces false alarm rate, improves model compression efficiency and transmission efficiency, ensures the accuracy requirements of critical tasks, and adapts to real-time calibration in complex environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120321130B_ABST
    Figure CN120321130B_ABST
Patent Text Reader

Abstract

The present invention discloses a large-model cross-end transfer and compression method applied to smart electricity meters, comprising: S1. Quantitatively modeling the hardware characteristics of the terminal device, and simultaneously generating a feature fingerprint to guide model compression based on the quantitative data; S2. Dynamically adjusting the compression strategy of each layer of the model structure after quantitative modeling based on the fingerprint to maximize resource utilization while ensuring accuracy; S3. Implementing efficient distribution of cluster-level model updates by building a device topology-aware transmission network; S4. Injecting a lightweight adaptation module into the terminal to quickly eliminate feature differences between devices and complete precise adaptation of the model to the terminal environment. The present invention constructs a full-process closed loop of "terminal feature analysis-layered dynamic compression-cluster collaborative distribution-online fine-tuning and calibration" through the three core technologies of device feature-aware compression, dynamic adapter injection, and collaborative differential transmission, which can achieve a breakthrough in the bottleneck of cross-end model migration for heterogeneous terminal clusters.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of smart grid edge computing technology, and specifically to a large model cross-end transfer and compression method and device applied to smart electricity meters, which is suitable for collaborative anomaly detection and dynamic model optimization of smart electricity meter groups. Background Art

[0002] Anomaly detection and model optimization for smart meter clusters are core technologies for intelligent power systems. Traditional methods rely primarily on centralized cloud-based processing, using uniformly deployed deep learning models to analyze meter data and identify faults. However, with the heterogeneity of terminal devices (e.g., differences in processor architecture, wide range of memory capacity, and varying sensor accuracy) and the expansion of deployment scale, existing technologies face significant challenges. On the one hand, cloud-based models are difficult to directly adapt to low-power terminals (e.g., Cortex-M7, RISC-V), resulting in low model compression, transmission, and operation efficiency. On the other hand, hardware differences between terminal devices (e.g., computing power ranging from 0.1TOPS to 2TOPS, and memory ranging from 256KB to 2GB) further exacerbate the complexity of cross-terminal model migration. Therefore, a cross-terminal migration and compression method for large power models is urgently needed for heterogeneous terminals to balance model performance and terminal resource constraints.

[0003] To address the above issues, existing technologies generally use static layered compression technology and collaborative distillation technology to solve them. However, although static layered compression technology can adjust the model through preset parameters (such as fixed pruning rate and unified quantization bit width), it lacks the ability to perceive the dynamic characteristics of the terminal (computing power, memory, sensor accuracy); at the same time, although collaborative distillation technology can rely on edge gateways for sub-graph generation and parameter synchronization, it does not solve the problem of model performance degradation caused by inconsistent feature distribution between devices (such as ADC accuracy differences); in addition, there are conventional transmission optimization operations. Although attempts are made to reduce redundant traffic through model distribution strategies, multi-hop routing and difference aggregation mechanisms are not designed in combination with the device topology structure.

[0004] Therefore, the core limitation of these methods is that they cannot dynamically perceive terminal heterogeneity and adaptively adjust compression strategies, resulting in low resource utilization, poor group collaboration efficiency, and large feature alignment errors.

[0005] In addition, in the existing technology, static layered compression technology and collaborative distillation technology are two typical solutions. For example: (1) Static layered compression technology generally achieves model lightweighting through global pruning (such as a fixed 50% pruning rate), unified quantization (such as 8-bit fixed-point quantization) and unicast transmission (MQTT protocol independently sends the model). However, its defects are: since the pruning rate of high-computing power equipment (above 1TOPS) is limited to a preset ratio, it is easy to cause 60% of computing resources to be idle. In addition, it is also prone to technical problems such as memory mismatch and redundant transmission; (2) Collaborative distillation technology generally achieves group optimization through edge gateway generation of lightweight subgraphs, gradient aggregation and version management. However, its defects are: it is easy to have problems such as feature drift, excessive energy consumption, and convergence hysteresis. During the convergence hysteresis process, the group model requires more than 20 rounds of iterations to stabilize, and is not applicable to delay-sensitive scenarios.

[0006] Therefore, the above technical solutions all have problems such as low efficiency and excessive energy consumption when facing device heterogeneity, dynamic changes in resources and group collaboration needs, and are unable to support the real-time anomaly detection needs of large-scale smart electricity meter clusters.

[0007] To this end, this application specifically proposes a large model cross-end transfer and compression method applied to smart electricity meters to solve the above technical problems. Summary of the Invention

[0008] The main purpose of the present invention is to provide a large-model cross-end transfer compression method applied to smart electricity meters. Through the three core technologies of device feature perception compression, dynamic adapter injection, and collaborative differential transmission, a full-process closed loop of "terminal feature analysis-layered dynamic compression-cluster collaborative distribution-online fine-tuning and calibration" is constructed to solve the technical problems raised in the background technology.

[0009] The present invention adopts the following technical solutions to solve the above technical problems:

[0010] A large model cross-end transfer and compression method for smart electric energy meters, comprising:

[0011] S1. Quantify and model the hardware characteristics of the terminal device and generate a feature fingerprint to guide model compression based on the quantitative data;

[0012] S2. Dynamically adjust the compression strategy for each layer of the model structure after quantitative modeling based on fingerprints, including: using feature fingerprint analysis to identify the computationally intensive layers, memory-sensitive layers, and precision-sensitive layers of the model structure;

[0013] The following operations are performed sequentially: dynamically adjusting the pruning rate of compute-intensive layers based on the device computing power index, performing differentiation and quantization operations on memory-sensitive layers, and performing hybrid quantization on precision-sensitive layers to preserve FP16 accuracy in key channels, ensuring that the harmonic feature extraction error is less than 0.5%;

[0014] S3. Build a device topology-aware transport network to efficiently distribute cluster-level model updates.

[0015] S4. Inject a lightweight adaptation module into the terminal to quickly eliminate feature differences between devices and achieve precise adaptation of the model to the terminal environment.

[0016] Preferably, during the quantitative modeling process in S1, the cloud parses and calculates device parameters including computing power index, memory adaptability, and precision correction factor to construct a multi-dimensional feature vector, complete the modeling and quantitative operation, and uses a hierarchical clustering algorithm to divide terminals with similar features into homogeneous groups, wherein:

[0017] The calculation formula for the computing power index is:

[0018]

[0019] in, is the processor main frequency of the terminal device, is the number of cores of the terminal device, is the number of instructions per cycle of the terminal device;

[0020] The calculation formula for memory adaptability evaluation is:

[0021]

[0022] in, is the available memory of the terminal, is the baseline model parameter, is the total amount of terminal memory, and Indicates that there is sufficient memory. Indicates insufficient memory;

[0023] The calculation formula of the precision correction factor is:

[0024]

[0025] in, is the ADC rms noise, is the ADC resolution.

[0026] Preferably, the specific operation process of performing the operation in S2 includes:

[0027] The pruning rate of the computationally intensive layer is dynamically adjusted according to the computing power index of the device. The pruning rate calculation formula is:

[0028]

[0029] in, Indicates the highest computing power device in the cluster value, For this computing device Value, there are constraints: ;

[0030] Differentiation and quantization operations on the memory-sensitive layer. At this time, the memory-sensitive layer quantization bit width allocation for:

[0031]

[0032] in, is the maximum memory adaptability value in the cluster, The memory adaptability value of the computing power device has a lower limit constraint: , It is a bottom symbol, used to indicate that it is not greater than The largest integer;

[0033] The mixed quantization precision sensitive layer has:

[0034]

[0035] in, is the quantization step size, which is used to retain the FP16 accuracy of the key channels and Forces hybrid quantization to be enabled.

[0036] Preferably, the specific operation process of executing model update distribution through the transmission network in S3 includes:

[0037] S31. Select a terminal with edge computing capabilities as a proxy node in each device group;

[0038] S32. Compare the new and old model versions on the cloud, extract the parameter changes at each layer, and only retain the core parameters with a change greater than 2%.

[0039] S33. Based on the geographical distribution of the device groups and the quality of the communication links, a multi-hop transmission path is constructed, in which the proxy node receives the complete update package first, and then broadcasts it to the group members via the local area network. When transmitting across groups, the optimal path with ≤3 relay hops is selected to avoid network congestion;

[0040] S34. After receiving the update package, the terminal uses hash verification and rollback mechanism until the error rate is less than 0.01% to ensure transmission integrity.

[0041] Preferably, the specific transmission process for the transmission network in S3 to perform efficient data transmission includes:

[0042] L1. Generate difference parameter matrix, with nodes and The matrix generation formula between is:

[0043]

[0044] in, and Represents nodes respectively and The new and old model parameter matrix between them;

[0045] Afterwards only keep Parameters;

[0046] L2. Calculate the transmission priority using the following formula:

[0047]

[0048] in, Indicates the transmission priority, Represented as device groups Number of hops to the cloud, Represented as device groups The size of Represented as a group Frobenius norm of the parameter difference matrix, where N is the total number of device groups;

[0049] L3. The proxy node performs differential aggregation, including:

[0050]

[0051]

[0052] in, Expressed as the difference parameter after aggregation, It is represented by the largest magnitude of the selected single device difference parameters. indivual, Represented as a device Device difference parameters during transmission, Represented as a collection of device groups, It is a bottom symbol, used to indicate that it is not greater than The maximum integer.

[0053] Preferably, the specific operation process of the lightweight adaptation module in S4 to eliminate feature differences includes:

[0054] S41. Generate adapter weight matrix based on device feature fingerprint, the formula is:

[0055]

[0056] in, is the adapter weight matrix after weight initialization, Indicates that the input is a device feature vector Two-layer fully connected network;

[0057] S42. After the terminal loads the compression model, it freezes the backbone network parameters and iteratively adjusts the adapter;

[0058] During the adjustment process, adjustments are made based on the adapter's loss function, which is:

[0059]

[0060] in, is the adapter’s loss function, is the balance coefficient, and it decays linearly from 1.0 to 0.7. is the cross entropy loss function, is the adapter weight matrix after the last round of adjustment, the initial is 0, is the square of the L2 norm;

[0061] During the adjustment process, local historical data is used for forward reasoning and loss calculation, and overfitting is prevented by limiting the gradient update amplitude;

[0062] S43. Dynamically modify the feature activation threshold according to real-time environmental parameters, where the threshold adjustment rule is:

[0063]

[0064] in, is the basic feature activation threshold, To update the adjusted feature activation threshold, is the temperature sensitivity coefficient, is the nominal temperature, The implementation temperature.

[0065] Preferably, the method further includes S5: regularly reporting operational indicators including model inference latency, memory usage, and false alarm rate through the terminal, analyzing cluster-level data through the cloud, identifying devices with abnormal performance, and dynamically adjusting compression parameters for the next round based on the feedback data. The specific operation process for dynamically adjusting compression parameters for the next round based on the feedback data includes:

[0066] S51. Construct the compression strategy iteration formula:

[0067]

[0068] in, is the weight of the operating indicator;

[0069] S52. Optimize the transmission path, using the transmission path evaluation as the optimization criterion, there are;

[0070]

[0071] in, For the evaluation of the optimized transmission path, For path hop bandwidth path, is the maximum bandwidth path allowed by the path, For path The end-to-end delay of each hop, is the maximum allowed end-to-end delay.

[0072] 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.

[0073] 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.

[0074] As can be seen from the above technical solution, the present invention provides a large-scale cross-end transfer and compression method for smart electric energy meters. Compared with the existing technology, the present invention has the following advantages:

[0075] 1. The present invention can dynamically adapt to terminal heterogeneity by setting terminal hardware parameter quantization modeling and clustering grouping mechanism in device feature fingerprint coding, thereby improving resource utilization and reducing false alarm rate, and providing differentiated model compression strategies for heterogeneous device clusters.

[0076] 2. By setting computing power-oriented compression, memory-oriented compression and precision-preserving compression strategies in layered dynamic compression, the present invention can maximize the utilization of terminal computing resources and memory resources, thereby improving model compression efficiency and improving the resource utilization of high-computing power devices to ensure the accuracy requirements of key tasks (such as harmonic detection).

[0077] 3. The present invention can reduce redundant communication traffic and compress cluster update time by setting up proxy node election, differential parameter extraction and topology routing optimization mechanisms in collaborative differential transmission, thereby facilitating the efficient distribution and deployment of large-scale cluster models.

[0078] 4. By setting up lightweight adapter injection and dynamic threshold adjustment strategies in online fine-tuning calibration, the present invention can quickly eliminate feature differences between devices, suppress feature alignment errors within 5%, and greatly reduce the group false alarm rate, making it easier to adapt to real-time calibration needs in complex environments.

[0079] 5. By setting up a performance indicator collection and compression strategy iteration mechanism in the closed-loop feedback optimization, the present invention can dynamically optimize the model compression parameters to improve the quantization accuracy of the high false alarm rate device group and achieve a dynamic balance between model performance and terminal resource constraints.

[0080] 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

[0081] 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:

[0082] Figure 1 It is a schematic diagram of the overall process of the present invention;

[0083] Figure 2 Detailed operational flow diagram of the present invention;

[0084] Figure 3 Schematic diagram of the data processing flow of the present invention. DETAILED DESCRIPTION

[0085] 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.

[0086] In the embodiment, see Figures 1 to 3 .

[0087] like Figures 1 to 3The large-scale cross-end transfer and compression method for smart electric energy meters proposed in the embodiment of the present invention uses three core technologies: device feature-aware compression, dynamic adapter injection, and collaborative differential transmission. It builds a full-process closed loop of "terminal feature analysis - layered dynamic compression - cluster collaborative distribution - online fine-tuning and calibration", including the following steps:

[0088] S1. Quantitatively model the hardware characteristics of the terminal device, and at the same time, generate a feature fingerprint to guide model compression based on the quantitative data to construct the device feature fingerprint encoding.

[0089] During the terminal feature collection process, each electricity meter actively reports its hardware configuration parameters, including key attributes such as processor architecture (ARM / RISC-V), memory capacity (256KB-2GB), ADC sampling accuracy (12-16bit), and communication module type (4G / HPLC).

[0090] During the quantitative modeling process, the cloud analyzes and calculates device parameters including computing power index, memory adaptability, and precision correction factor to construct a multi-dimensional feature vector, complete the modeling and quantitative operation, and uses a hierarchical clustering algorithm to divide terminals with similar characteristics into homogeneous groups, where:

[0091] The computing power index is the theoretical peak computing power (TOPS) calculated based on the processor's main frequency and instruction set. The calculation formula is:

[0092]

[0093] in, is the processor main frequency of the terminal device (unit: GHz), is the number of cores of the terminal device, The number of instructions per cycle of the terminal device (1.5 for ARM Cortex-M7 and 1.2 for RISC-V);

[0094] Memory adaptability is used to evaluate deployment feasibility based on the ratio of model parameters to memory capacity. The evaluation formula is:

[0095]

[0096] in, The available memory of the terminal (unit: KB), is the number of parameters of the benchmark model (unit: KB), is the total amount of terminal memory, and Indicates that there is sufficient memory. Indicates insufficient memory;

[0097] The accuracy correction factor is used to calibrate the signal acquisition error based on the ADC resolution and noise figure. The calculation formula is:

[0098]

[0099] in, is the ADC rms noise (unit: LSB), is the ADC resolution (e.g. 12 bits corresponds to 4096 LSBs).

[0100] It should also be noted that during the device clustering process, a hierarchical clustering algorithm can be used to divide terminals with similar characteristics into homogeneous groups (such as high computing power group, low memory group, etc.), providing a basis for subsequent differentiated compression.

[0101] At this time, by setting the terminal hardware parameter quantification modeling and clustering grouping mechanism in the device feature fingerprint encoding, it is possible to dynamically adapt to the terminal heterogeneity, thereby improving resource utilization and reducing the false alarm rate, and providing differentiated model compression strategies for heterogeneous device clusters.

[0102] S2. Dynamically adjust the compression strategy of each layer of the model structure after quantitative modeling based on fingerprints to maximize resource utilization while ensuring accuracy.

[0103] The specific operation process of dynamic compression strategy adjustment includes:

[0104] S21. Feature fingerprints serve as model-sensitive layers, used to analyze and identify computationally intensive layers (such as the LSTM time series prediction layer), memory-sensitive layers (such as the fully connected classification layer), and precision-sensitive layers (such as the harmonic detection head) in the model structure after quantitative modeling.

[0105] S22. Sequentially perform the following operations: dynamically adjust the pruning rate of the compute-intensive layer based on the device computing power index, differentiate and quantize the memory-sensitive layer, and perform hybrid quantization on the precision-sensitive layer. Hybrid quantization of the precision-sensitive layer is used to preserve the FP16 accuracy of the key channels and ensure that the harmonic feature extraction error is less than 0.5%. The specific operation process includes:

[0106] (1) Computational power-oriented compression: Dynamically adjust the pruning rate of the computationally intensive layer according to the device computing power index (pruning rate of high computing power devices ≤ 40%, low computing power devices ≤ 70%), where the pruning rate calculation formula is:

[0107]

[0108] in, Indicates the highest computing power device in the cluster Value (unit: TOPS), For this computing device Value, there are constraints: ;

[0109] (2) Memory-oriented compression: Differentiation and quantization of memory-sensitive layers (8-bit quantization for high-memory devices and 4-bit mixed quantization for low-memory devices). At this time, the quantization bit width allocation of the memory-sensitive layer for:

[0110]

[0111] in, is the maximum memory adaptability value in the cluster, The memory adaptability value of the computing power device has a lower limit constraint: (4-bit quantization);

[0112] (3) Precision-preserving compression: Hybrid quantization precision-sensitive layer (preserving FP16 precision of key channels in the precision-sensitive layer to ensure that the harmonic feature extraction error is less than 0.5%), with:

[0113]

[0114] in, is the quantization step size, which is used to retain the FP16 accuracy of the key channels and Force hybrid quantization to be enabled when

[0115] S23. Insert a micro learnable adapter (parameter count < 500) at the model input / output to compensate for sensor differences between devices.

[0116] In one specific embodiment, a hierarchical compression mechanism driven by device feature fingerprints is constructed. The pruning rate (20-70%) and quantization bit width (4-16 bits) are dynamically adjusted based on the terminal computing power (0.1-2TOPS), memory margin (30-512KB), and sensor accuracy (±0.5-2LSB). This increases the computing utilization rate of high-end devices to over 80%, and the model loading success rate of low-end devices to >98%. Therefore, by setting computing power-oriented compression, memory-oriented compression, and precision-preserving compression strategies in hierarchical dynamic compression, the utilization of terminal computing resources and memory resources can be maximized. For example, in a heterogeneous device cluster, the average model compression rate reaches 85%, and the resource utilization rate of high-computing power devices is increased to 82%, thereby improving model compression efficiency and improving the resource utilization of high-computing power devices to ensure the accuracy requirements of critical tasks (such as harmonic detection).

[0117] S3. Build a device topology-aware transport network to achieve efficient distribution of cluster-level model updates.

[0118] The specific operation process of executing model update distribution through the transmission network includes:

[0119] S31. Select a terminal with edge computing capabilities (e.g., a device with ≥512KB of memory) in each device group as a proxy node.

[0120] S32. Compare the new and old model versions on the cloud, extract the parameter changes at each layer, and only retain the core parameters with a change greater than 2%.

[0121] S33. Based on the geographical distribution of the device groups and the quality of the communication links, a multi-hop transmission path is constructed, in which the proxy node receives the complete update package first, and then broadcasts it to the group members via the local area network. When transmitting across groups, the optimal path with ≤3 relay hops is selected to avoid network congestion;

[0122] S34. After receiving the update package, the terminal uses hash verification and rollback mechanism until the error rate is less than 0.01% to ensure transmission integrity.

[0123] The specific transmission process used by the transmission network to perform efficient data transmission at this time includes:

[0124] L1. Generate difference parameter matrix, with nodes and The matrix generation formula between is:

[0125]

[0126] in, and Represents nodes respectively and The new and old model parameter matrix between them;

[0127] Afterwards only keep Parameters;

[0128] L2. Calculate the transmission priority using the following formula:

[0129]

[0130] in, Indicates the transmission priority, Represented as device groups Number of hops to the cloud (if the gateway is a relay ), Represented as device groups The size of Represented as a group Frobenius norm of the parameter difference matrix, where N is the total number of device groups;

[0131] L3. The proxy node performs differential aggregation, including:

[0132]

[0133]

[0134] in, Expressed as the difference parameter after aggregation, It is represented by the largest magnitude of the selected single device difference parameters. indivual, Represented as a device Device difference parameters during transmission, Represented as a collection of device groups.

[0135] In a specific embodiment, a topology-aware collaborative transmission protocol is designed. Through proxy node differential aggregation and multi-hop routing optimization, the cluster model update time is compressed from 47 minutes to 18 minutes, and the communication traffic is reduced to 38% of the traditional solution. Therefore, by setting up proxy node election, differential parameter extraction and topology routing optimization mechanisms in collaborative differential transmission, redundant communication traffic can be reduced and the cluster update time can be compressed, which facilitates the ultimate realization of efficient distribution and deployment of large-scale cluster models.

[0136] S4. Inject a lightweight adaptation module into the terminal to quickly eliminate feature differences between devices and achieve precise adaptation of the model to the terminal environment.

[0137] The specific operation process of the lightweight adaptation module to eliminate feature differences includes:

[0138] S41. Generate an adapter weight matrix based on the device feature fingerprint. For example, configure a stronger feature filter coefficient for a high-noise device. The formula is:

[0139]

[0140] in, is the adapter weight matrix after weight initialization, with dimension , Indicates that the input is a device feature vector Two-layer fully connected network;

[0141] S42. After the terminal loads the compression model, it freezes the backbone network parameters and performs three rounds of iterative fine-tuning on the adapter.

[0142] During iterative fine-tuning, adjustments are made based on the adapter's loss function, which is:

[0143]

[0144] in, is the adapter’s loss function, is the balance coefficient, and it decays linearly from 1.0 to 0.7. is the cross entropy loss function, is the adapter weight matrix after the last round of adjustment, the initial is 0, is the square of the L2 norm;

[0145] During the adjustment process, local historical data (storage capacity < 10MB) is used for forward reasoning and loss calculation, and overfitting is prevented by limiting the gradient update amplitude (learning rate ≤ 0.001);

[0146] S43. Dynamically modify the feature activation threshold based on real-time environmental parameters (temperature, humidity). For example, for every 1°C increase in temperature, the voltage sag detection threshold is lowered by 0.5%. In this case, the threshold adjustment rule is:

[0147]

[0148] in, is the basic feature activation threshold, To update the adjusted feature activation threshold, is the temperature sensitivity coefficient (there is a typical value ), is the nominal temperature (usually 25°C), The implementation temperature.

[0149] In one specific embodiment, a lightweight dynamic adapter (with parameters less than 500) is injected at the model input / output, and the adaptation parameters are initialized using the device feature fingerprint. The feature distribution alignment error is suppressed to below 5% within three rounds of fine-tuning, and the group false alarm rate is reduced from 24% to 8%. At the same time, a constrained fine-tuning algorithm is developed to freeze the model backbone network and only optimize the adapter parameters, reducing the fine-tuning energy consumption of the Cortex-M7 device from 1.2J to 0.3J, and compressing the peak memory usage to 82% of the safety threshold. Therefore, by setting the lightweight adapter injection and dynamic threshold adjustment strategy in the online fine-tuning calibration, the feature differences between devices can be quickly eliminated, the feature alignment error can be suppressed to less than 5%, and the group false alarm rate can be greatly reduced, making it easier to adapt to real-time calibration needs in complex environments.

[0150] S5. Regularly report operational indicators such as model inference latency, memory usage, and false alarm rate through the terminal. Analyze cluster-level data through the cloud to identify devices with abnormal performance (such as inference latency exceeding 2 standard deviations of the mean). Dynamically adjust the next round of compression parameters based on the feedback data. For example, increase the key layer quantization accuracy to 6 bits for groups of devices with high false alarm rates.

[0151] The specific operation process of dynamically adjusting the next round of compression parameters based on feedback data includes (taking the group false alarm rate as an example):

[0152] S51. Construct the compression strategy iteration formula:

[0153]

[0154]

[0155] in, is the weight of the group false alarm rate (operation indicator), For Group The false alarm rate, is the cluster average false alarm rate, and When the group The key layer pruning rate is reduced by 10%;

[0156] S52. Optimize the transmission path, using the transmission path evaluation as the optimization criterion, there are;

[0157]

[0158] in, For the evaluation of the optimized transmission path, For path hop bandwidth path, is the maximum bandwidth path allowed by the path, For path The end-to-end delay of each hop, is the maximum allowed end-to-end delay.

[0159] At this time, by setting up a performance indicator collection and compression strategy iteration mechanism in the closed-loop feedback optimization, the model compression parameters can be dynamically optimized to improve the quantization accuracy of the device group with high false alarm rate, and achieve a dynamic balance between model performance and terminal resource constraints.

[0160] Therefore, in summary, this method can systematically solve the four major problems of device heterogeneity adaptation, group transmission optimization, feature drift suppression and resource constraint breakthrough, achieve a breakthrough in the bottleneck of cross-terminal model migration of heterogeneous terminal clusters, and thus provide reliable technical support for the large-scale deployment of smart electricity meter clusters.

[0161] In a further specific embodiment, the present application is compared with other traditional compression transfer methods. By performing the update and inference process of the smart energy meter heterogeneous cluster model as a technical comparison scenario, there are:

[0162] The equipment scale in the test environment setting is: 1,000 smart electricity meters (including three types of hardware configurations), namely:

[0163] High-end group (300 units): ARM Cortex-A53 / 1GHz, 1GB RAM, 16-bit ADC

[0164] Standard set (500 units): RISC-V / 800MHz, 512MB RAM, 14-bit ADC

[0165] Low-end group (200 units): Cortex-M7 / 480MHz, 256MB RAM, 12-bit ADC

[0166] The task goal at this time is to deploy the ResNet-18 harmonic detection model (original size 178MB) and complete cluster-wide model updates and real-time anomaly detection.

[0167] Comparison of schemes and results analysis include:

[0168] (1) Comparison of model compression efficiency

[0169]

[0170] Traditional solutions use a uniform pruning rate (50%) and 8-bit quantization for all devices, resulting in wasted computing power on high-end devices and insufficient memory on low-end devices. This invention achieves device-level optimization by dynamically allocating the pruning rate (40% for high-end devices and 70% for low-end devices) and the quantization bit width (8-bit for high-end devices and 4-bit for low-end devices).

[0171] (2) Cluster update efficiency comparison

[0172]

[0173] The traditional solution uses MQTT unicast full update model, which generates 72% redundant traffic. This invention builds topology routing, and the proxy node receives the update package first (only the difference parameters are transmitted). ), and through multi-hop broadcast distribution, the transmission efficiency of high-configuration group proxy nodes is increased by 3 times.

[0174] (3) Comparison of detection accuracy consistency

[0175]

[0176] The traditional solution does not compensate for the ADC precision difference between devices (12-16 bits), which leads to the input feature distribution offset. This invention injects a dynamic adapter (parameter quantity < 500) and adjusts the activation threshold. , which adaptively improves the characteristic filtering strength of high-noise equipment by 30%.

[0177] (4) Comparison of client-side resource consumption

[0178]

[0179] Traditional solutions require fine-tuning of all parameters (10 rounds of iterations). However, this invention reduces the inference latency of the low-end group from 189ms to 82ms by constraining the fine-tuning range (only optimizing adapter parameters) and combining it with a hybrid quantization strategy.

[0180] In further data results, it can be seen from the comparison that this method is superior to the traditional solution:

[0181] (1) Dynamic compression gain:

[0182] Optimization of pruning rate in high-matching group: (Traditional solutions require 50% of the total cost)

[0183] Low-profile group quantization bit width: (Traditional solutions are unified into 8 bits)

[0184] (2) Improved transmission efficiency:

[0185] Proxy node differential aggregation: (Total number of difference parameters for a single device: 1080)

[0186] Priority routing: (High-profile groups are given priority for transmission)

[0187] (3) Accuracy consistency assurance:

[0188] Dynamic threshold adjustment: (The threshold is lowered by 18% at 40°C)

[0189] Feature alignment error: high and low (After adapter compensation)

[0190] In summary, this method significantly outperforms traditional solutions in core indicators such as compression rate (+13%), transmission efficiency (-61.7% time consumption), accuracy consistency (-66.7% false alarm rate), and resource economy (-75% energy consumption), providing a feasible cross-terminal migration solution for heterogeneous terminal clusters (smart meters) in smart grids.

[0191] 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.

[0192] 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.

[0193] 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 large-model cross-end transfer and compression methods applied to smart electricity meters in the above embodiments.

[0194] 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.

[0195] 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.

[0196] Memory for storing computer programs;

[0197] The processor is used to implement the above-mentioned large model cross-end transfer compression method applied to the smart electric energy meter when executing the program stored in the memory.

[0198] 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.

[0199] The communication interface is used for communication between the above electronic device and other devices.

[0200] 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.

[0201] 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.

[0202] It should also be noted that electronic devices also include terminal devices, which can also be referred to as 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 technologies and specific device forms used by terminal devices.

[0203] 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 (e.g., coaxial cable, optical fiber, digital subscriber line) or wireless (e.g., infrared, wireless, microwave, etc.) 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 disk, hard disk, tape), optical media, or semiconductor media (e.g., solid-state drive).

[0204] 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.

[0205] In addition, it should be noted that if the embodiments of the present invention involve directional indications (such as up, down, left, right, front, back, etc.), the directional indications are only used to explain the relative position relationship, movement status, etc. between the components in a certain specific posture. If the specific posture changes, the directional indications will also change accordingly.

[0206] 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 large model cross-end transfer and compression method applied to smart electric energy meters, characterized in that: include: S1. Quantify and model the hardware characteristics of the terminal device and generate a feature fingerprint to guide model compression based on the quantitative data; S2. Dynamically adjust the compression strategy for each layer of the model structure after quantitative modeling based on fingerprints, including: using feature fingerprint analysis to identify the computationally intensive layers, memory-sensitive layers, and precision-sensitive layers of the model structure; The following operations are performed sequentially: dynamically adjusting the pruning rate of compute-intensive layers based on the device computing power index, performing differentiation and quantization operations on memory-sensitive layers, and performing hybrid quantization on precision-sensitive layers to preserve FP16 accuracy in key channels, ensuring that the harmonic feature extraction error is less than 0.5%. Finally, a micro-learnable adapter is inserted at the model input / output to compensate for sensor differences between devices. S3. Build a device topology-aware transport network to efficiently distribute cluster-level model updates. S4. Inject a lightweight adaptation module into the terminal to quickly eliminate feature differences between devices and achieve precise adaptation of the model to the terminal environment.

2. The large-scale model cross-end transfer and compression method for smart electric energy meters according to claim 1, characterized in that: During the quantitative modeling process in S1, the cloud parses and calculates device parameters including computing power index, memory adaptability, and precision correction factor to construct a multi-dimensional feature vector, complete the modeling and quantitative operation, and uses a hierarchical clustering algorithm to divide terminals with similar characteristics into homogeneous groups, where: The calculation formula for memory adaptability evaluation is: in, is the available memory of the terminal, is the baseline model parameter, is the total amount of terminal memory, and Indicates that there is sufficient memory. Indicates insufficient memory; The calculation formula of the precision correction factor is: in, is the ADC rms noise, is the ADC resolution.

3. The large-scale model cross-end transfer and compression method for smart electric energy meters according to claim 2, characterized in that: The specific operation process of performing the operation in S2 includes: The pruning rate of the computationally intensive layer is dynamically adjusted according to the computing power index of the device. The pruning rate calculation formula is: in, Indicates the highest computing power device in the cluster value, For this computing device Value, there are constraints: ; Differentiation and quantization operations on the memory-sensitive layer. At this time, the memory-sensitive layer quantization bit width allocation for: in, is the maximum memory adaptability value in the cluster, The memory adaptability value of the computing power device has a lower limit constraint: , It is a bottom symbol, used to indicate that it is not greater than The largest integer; The mixed quantization precision sensitive layer has: in, is the quantization step size, which is used to retain the FP16 accuracy of the key channels and Forces hybrid quantization to be enabled.

4. The large-scale model cross-end transfer and compression method for smart electric energy meters according to claim 1, characterized in that: The specific operation process of executing model update distribution through the transmission network in S3 includes: S31. Select a terminal with edge computing capabilities as a proxy node in each device group; S32. Compare the new and old model versions on the cloud, extract the parameter changes at each layer, and only retain the core parameters with a change greater than 2%. S33. Based on the geographical distribution of the device groups and the quality of the communication links, a multi-hop transmission path is constructed, in which the proxy node receives the complete update package first, and then broadcasts it to the group members via the local area network. When transmitting across groups, the optimal path with ≤3 relay hops is selected to avoid network congestion; S34. After receiving the update package, the terminal uses hash verification and rollback mechanism until the error rate is less than 0.01% to ensure transmission integrity.

5. The large-scale model cross-end transfer and compression method for smart electric energy meters according to claim 1, characterized in that: The specific transmission process for the transmission network in S3 to perform efficient data transmission includes: L1. Generate difference parameter matrix, with nodes and The matrix generation formula between is: in, and Represents nodes respectively and The new and old model parameter matrix between them; Afterwards only keep Parameters; L2. Calculate the transmission priority using the following formula: in, Expressed as transmission priority, Represented as device groups Number of hops to the cloud, Represented as device groups The size of Represented as a group Frobenius norm of the parameter difference matrix, where N is the total number of device groups; L3. The proxy node performs differential aggregation, including: in, Expressed as the difference parameter after aggregation, It is represented by the largest magnitude among the selected single device difference parameters. indivual, Represented as a device Device difference parameters during transmission, Represented as a collection of device groups, It is a bottom symbol, used to indicate that it is not greater than The maximum integer.

6. The large-scale model cross-end transfer and compression method for smart electric energy meters according to claim 1, characterized in that: The specific operation process of the lightweight adaptation module in S4 to eliminate feature differences includes: S41. Generate adapter weight matrix based on device feature fingerprint, the formula is: in, is the adapter weight matrix after weight initialization, Indicates that the input is a device feature vector Two-layer fully connected network; S42. After the terminal loads the compression model, it freezes the backbone network parameters and iteratively adjusts the adapter; During the adjustment process, adjustments are made based on the adapter's loss function, which is: in, is the adapter’s loss function, is the balance coefficient, and it decays linearly from 1.0 to 0.

7. is the cross entropy loss function, is the adapter weight matrix after the last round of adjustment, the initial is 0, is the square of the L2 norm; During the adjustment process, local historical data is used for forward reasoning and loss calculation, and overfitting is prevented by limiting the gradient update amplitude; S43. Dynamically modify the feature activation threshold according to real-time environmental parameters, where the threshold adjustment rule is: in, is the basic feature activation threshold, To update the adjusted feature activation threshold, is the temperature sensitivity coefficient, is the nominal temperature, The implementation temperature.

7. The large-scale model cross-end transfer and compression method for smart electric energy meters according to claim 3, characterized in that: It also includes S5: regularly reporting operating indicators such as model inference latency, memory usage, and false alarm rate through the terminal, analyzing cluster-level data through the cloud, identifying devices with abnormal performance, and dynamically adjusting the next round of compression parameters based on feedback data.

8. The large-scale model cross-end transfer and compression method for smart electric energy meters according to claim 7, characterized in that: The specific operation process of dynamically adjusting the next round of compression parameters according to the feedback data in S5 includes: S51. Construct the compression strategy iteration formula: in, is the weight of the operating indicator; S52. Optimize the transmission path, using the transmission path evaluation as the optimization criterion, there are; in, For the evaluation of the optimized transmission path, For path hop bandwidth path, is the maximum bandwidth path allowed by the path, For path The end-to-end delay of each hop, is the maximum allowed end-to-end delay.

9. A computer device, characterized in that: The method comprises 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 method according to any one of claims 1 to 8.

Citation Information

Patent Citations

  • Topology identification model compression method, system and equipment based on fusion terminal

    CN119005263A

  • Industrial equipment real-time monitoring system based on edge computing

    CN119644972A