Intelligent electric energy meter supporting three-phase unbalanced load error compensation

CN123029259APending Publication Date: 2026-11-03QINGDAO EASTSOFT COMM TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611283062.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-24
Publication Date
2026-11-03

AI Technical Summary

Technical Problem

Existing smart meters cannot provide real-time closed-loop compensation for dynamic metering errors in three-phase unbalanced load scenarios due to neutral line reference drift and phase-to-phase coupling.

Method used

Adaptive error compensation is achieved by employing a three-phase voltage sensor, current sensor, neutral current sensor, phase-to-phase compensation circuit, streaming memory sensing buffer, analog-to-digital converter, real-time clock module, communication interface module, and control chip, combined with a linear approximation kernel mapping spatiotemporal convolution compensation model, Kirchhoff constrained gradient projection algorithm, and Euler graph network flow maximum flow-minimum cut load topology matching algorithm.

Benefits of technology

It eliminates the systematic impact of zero-line reference drift on measurement results in real time, dynamically suppresses inter-phase coupling errors, and ensures measurement stability and accuracy under conditions of continuous change in three-phase imbalance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123029259A_ABST
    Figure CN123029259A_ABST
Patent Text Reader

Abstract

The application provides a kind of intelligent electric energy meter supporting three-phase unbalanced load error compensation, belong to the technical field of intelligent electric meter, the input characteristic tensor is constructed by collecting three-phase voltage, current and zero line current, after reducing memory occupation by block sparse compression, it is sent into control chip, linear approximation kernel mapping space-time convolution compensation model is used to extract space-time characteristics and dynamically generate convolution kernel weight, gradient projection convergence algorithm under Kirchhoff constraint is executed in the phase of back propagation to limit parameter update to physically feasible solution hyperplane, through Euler diagram network flow maximum flow-minimum cut load topology matching algorithm, error core branch is positioned in real time and phase-to-phase energy transfer matrix is generated, finally, phase-to-phase compensation circuit is driven to complete physical level topology reconstruction and output each phase real-time error compensation quantity, solve the technical problem that dynamic measurement error of intelligent electric energy meter cannot be real-time closed-loop compensation due to zero line reference drift and phase-to-phase coupling in three-phase unbalanced load scene.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of smart meter technology, and more specifically, relates to a smart energy meter that supports three-phase unbalanced load error compensation. Background Technology

[0002] In the field of smart meters, the metering of electricity in three-phase four-wire power grids has long relied on fixed compensation coefficients and empirical correction methods. Under load balancing conditions, traditional metering schemes achieve metering by independent sampling of each phase and superimposing fixed error correction coefficients, covering power distribution systems in industrial plants, commercial buildings, and residential areas. However, in actual operating conditions where the three-phase imbalance continuously changes, the difference in load impedance between phases causes significant fluctuations in the neutral current, resulting in dynamic drift of the neutral reference potential. This creates coupling disturbances between the phase-to-phase mutual inductance channels, and the fixed compensation coefficients cannot track this dynamic process, leading to a systematic deviation of the metering results from the true value. Existing methods mainly include hardware compensation circuits based on offline calibration, software correction based on lookup tables, and signal processing schemes based on traditional filters. All of these schemes are designed under the premise of a fixed load topology, unable to identify real-time changes in the unbalanced topology, and unable to embed physical constraints into the update process of compensation parameters. In other words, existing technologies suffer from the technical problem of being unable to provide real-time closed-loop compensation for dynamic metering errors caused by neutral reference drift and phase-to-phase coupling in three-phase unbalanced load scenarios. Summary of the Invention

[0003] In view of this, the present invention provides a smart energy meter that supports three-phase unbalanced load error compensation, which can solve the technical problem in the prior art that the dynamic metering error of smart energy meters in three-phase unbalanced load scenarios cannot be compensated in real time due to neutral line reference drift and phase coupling.

[0004] This invention is implemented as follows: This invention provides a smart energy meter that supports three-phase unbalanced load error compensation, including a three-phase voltage sensor group, a three-phase current sensor group, a neutral current sensor, a phase-to-phase compensation circuit, a streaming memory sensing buffer, an analog-to-digital converter group, a real-time clock module, a communication interface module, a power management module, and a control chip. The control chip is equipped with a three-phase unbalanced error compensation calculation module, which performs the following steps:

[0005] The instantaneous voltage and current values ​​of phases A, B, and C, as well as the instantaneous neutral current value, are collected to form an input feature tensor. The real-time clock module then timestamps each frame of the feature tensor.

[0006] Block-based sparse compression is performed on the input feature tensor, and the compressed feature tensor is sent to the control chip via a streaming memory-aware buffer.

[0007] The compressed feature tensor is input into the linear approximation kernel mapping spatiotemporal convolution compensation model. The front layer generates convolution kernel weight coefficients in real time based on the three-phase phase difference and power factor. The cascaded gating unit determines whether the feature variance of the current frame is lower than the dynamic threshold. If it is lower than the dynamic threshold, the higher-order nonlinear layer is skipped and directly pushed to the output layer.

[0008] In the backpropagation update stage of the linear approximation kernel mapping spatiotemporal convolution compensation model, the gradient projection convergence algorithm under Kirchhoff constraints is executed to project the original gradient tensor onto the physical feasible solution hyperplane and forcibly correct the gradient components that deviate from the physical constraint space.

[0009] The Euler graph network flow maximum flow-minimum cut load topology matching algorithm is executed to transform the current distribution of the three-phase four-wire power grid into a directed graph network flow model, solve the minimum cut set under unbalanced load in real time, locate the core branch that causes metering error, and generate the phase-to-phase energy transfer matrix.

[0010] The adaptive physical scaling factor is calculated based on the interphase energy transfer matrix. The adaptive physical scaling factor is then substituted into the loss function to dynamically adjust the scaling weights of the gradients of phases A, B, and C.

[0011] The error compensation amount for each phase output by the linear approximation kernel mapping spatiotemporal convolution compensation model is sent to the interphase compensation circuit, driving the interphase compensation circuit to complete physical-level topology reconstruction. At the same time, the three-phase metering results are uploaded via the communication interface module.

[0012] Specifically, the input feature tensor refers to a matrix tensor composed of six channels, namely the instantaneous values ​​of three-phase voltage and three-phase current, with several continuous sampling points in each channel. The step gradient is obtained through differential operations between adjacent sampling points, and the difference window length is determined by performing root mean square error statistical analysis on different difference window lengths one by one on a three-phase unbalance simulation platform.

[0013] Specifically, the block sparse compression refers to dividing the sampling points into several sub-blocks according to a preset sub-block length, calculating the energy proportion for each sub-block, and marking sub-blocks with energy proportions lower than the block sparse compression threshold as redundant blocks and removing them from the calculation path. The remaining sub-blocks are sent to the subsequent calculation layer in the form of sparse indexes. The block sparse compression threshold is determined by statistical regression analysis of experimental data covering four types of working conditions: purely resistive loads, inductive loads, capacitive loads, and mixed loads.

[0014] The dynamic threshold specifically refers to the judgment threshold of the characteristic variance of the sliding window. It is determined by statistically analyzing the changes in measurement error before and after skipping the higher-order nonlinear layer under four experimental conditions with three-phase imbalance of 0%, 20%, 40%, and 60%, and taking the maximum variance value corresponding to the error change rate being lower than the upper limit of the error change rate as the upper limit of the threshold.

[0015] Specifically, the physically feasible solution hyperplane refers to the constraint surface formed by Kirchhoff's current law and the three-phase power conservation law. The gradient projection operator sets the gradient components that exceed the hyperplane to zero, so that the parameter update always converges within the physically valid parameter space.

[0016] Specifically, the directed graph network flow model refers to mapping power nodes, A-phase load nodes, B-phase load nodes, C-phase load nodes, and neutral wire nodes as vertices of a graph, and mapping three-phase conductors and mutual inductance channels as directed edges. The capacity of the directed edges is determined by the rated current carrying capacity of the conductors and the real-time current limit. The maximum flow value and minimum cut set are solved iteratively by alternating between augmented path algorithm and pre-flow propulsion technology.

[0017] Specifically, the adaptive physical scaling factor refers to the gradient scaling factor determined by comparing the convergence speed of the measurement error of each phase under different scaling factors through multiple experiments, using the ratio of the mean to the standard deviation of the effective value of the three-phase current as the unbalance measurement index.

[0018] The linear approximation kernel mapping spatiotemporal convolution compensation model consists of an input mapping layer, a linear attention approximation layer, a group of dynamic weight convolutional layers, a cascaded gating layer, and an output compensation layer connected in series. The input mapping layer maps the original feature tensor to a low-dimensional random kernel space through a learnable linear projection matrix.

[0019] The linear attention approximation layer decomposes the high-dimensional query-key multiplication into a combination of two low-dimensional matrix multiplications using a random kernel function. The connection weights between neurons are dynamically generated by the kernel function mapping results rather than stored as fixed weight tensors.

[0020] The dynamic weighted convolutional layer group contains several cascaded one-dimensional temporal convolutional units. The kernel weight coefficients of each convolutional unit are generated in real time by the front layer based on the three-phase phase difference and power factor of the current frame. The kernel size and convolution stride are determined through grid search experiments.

[0021] The cascaded gating layer consists of several series gating units. The update step size of the gating state vector is adjusted by the state decay factor, which is determined by ablation experiments on the gradient stability of the model under different three-phase imbalances.

[0022] The output compensation layer contains three parallel fully connected units, which correspond to the error compensation outputs of phases A, B, and C, respectively. The size of the independent memory partition of each phase has a linear proportional relationship with the imbalance index of each phase, and the number of buffer frames of the streaming memory-aware buffer has an inverse proportional function relationship with the dynamic threshold.

[0023] Among them, the training dataset of the linear approximation kernel mapping spatiotemporal convolution compensation model is collected in stages according to multiple levels of imbalance, including high-frequency waveform data of three-phase voltage, three-phase current, and neutral current, as well as synchronous standard metering labels. After being segmented and normalized according to a preset frame format, it is divided into training set, validation set and test set.

[0024] Among them, the training of the linear approximation kernel mapping spatiotemporal convolution compensation model uses the weighted sum of the mean square error loss function and the adaptive physical scaling factor weighted loss function as the total loss function. The adaptive moment estimation optimizer is used to update the parameters, and the gradient projection convergence algorithm under Kirchhoff constraints is executed once after each parameter update.

[0025] This also includes an adaptive learning rate adjustment function, which uses the ratio of the standard deviation to the mean of the three-phase current effective values ​​as an indicator of three-phase imbalance. ,when Use the baseline learning rate The range of values ​​is ;when When adopted , The range is ;when When adopted , The range is ;when When adopted , The range is , The range is The above coefficients were all determined through systematic experiments covering the entire unbalance range.

[0026] This invention employs a linear approximation kernel mapping spatiotemporal convolution compensation model, combined with a gradient projection convergence algorithm under Kirchhoff constraints and an Eulerian graph network flow maximum flow-minimum cut load topology matching algorithm. Physical constraints are directly embedded into the model parameter update process, ensuring that the compensation parameters always converge within the physically valid interval, thereby eliminating the systematic impact of neutral reference drift on the metering results. Kirchhoff constraints force each round of gradient updates to be confined within the hyperplane formed by the conservation of three-phase current and power, blocking parameter update paths that violate physical rules, ensuring that the error compensation amount output by the model always remains consistent with the actual physical state of the circuit. The Eulerian graph network flow algorithm locates the core branch causing the imbalance in real time within each metering cycle, generates an interphase energy transfer matrix, and drives the interphase compensation circuit to complete physical-level topology reconstruction, upgrading open-loop compensation to closed-loop compensation based on real-time topology identification, thus dynamically suppressing interphase coupling errors. In summary, this invention solves the technical problem mentioned in the background art of the inability to provide real-time closed-loop compensation for dynamic metering errors caused by neutral reference drift and interphase coupling in smart meters under three-phase unbalanced load scenarios. Attached Figure Description

[0027] Figure 1 This is a structural diagram of the smart energy meter that supports three-phase unbalanced load error compensation according to the present invention.

[0028] Figure 2 This is a flowchart of the execution steps of the three-phase unbalanced error compensation calculation module.

[0029] Figure 3 The graph shows the mean square error of the validation set of the linear approximation kernel mapping spatiotemporal convolution compensation model under different imbalances, as a function of training epochs.

[0030] Figure 4 The graph shows the piecewise variation of the learning rate for the adaptive learning rate adjustment function within the three-phase imbalance range of 0% to 60%.

[0031] Figure 5 This diagram illustrates the core error branches and interphase energy transfer matrix identified by the Eulerian graph network flow maximum-minimum cut algorithm under a 40% imbalance condition.

[0032] Figure 6 This is a comparison curve showing the variation of three-phase metering error with unbalance under different unbalance conditions.

[0033] Figure 7 This is a graph showing the change in conditional jump trigger rate of the cascaded gating layer with dynamic threshold under different feature variances. Detailed Implementation

[0034] To make the objectives, technical solutions, and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below.

[0035] like Figure 1As shown, this invention provides a smart energy meter supporting three-phase unbalanced load error compensation, comprising: a three-phase voltage sensor group, a three-phase current sensor group, a neutral current sensor, a phase-to-phase compensation circuit, a streaming memory sensing buffer, an analog-to-digital converter group, a real-time clock module, a communication interface module, a power management module, and a control chip. The three-phase voltage sensor group includes a three-way voltage divider resistor network, which is connected in series between the live wire input terminals of phases A, B, and C and the three voltage sampling input terminals of the analog-to-digital converter group. The three-phase current sensor group includes three toroidal magnetic core current transformers, which are respectively mounted on phases A, B, and C. On the C-phase conductor, the signal output terminals of the three toroidal magnetic core current transformers are electrically connected to the three current sampling input terminals of the analog-to-digital converter group, respectively. The neutral current sensor is a single toroidal magnetic core current transformer, mounted on the neutral conductor, and its signal output terminal is electrically connected to the neutral current sampling input terminal of the analog-to-digital converter group. The digital output terminal of the analog-to-digital converter group is electrically connected to the data input terminal of the control chip, and the compensation control output terminal of the control chip is electrically connected to the control input terminal of the inter-phase compensation circuit. The inter-phase compensation circuit is connected in series in the three-phase energy metering circuit and is used to perform physical-level topology reconfiguration based on the inter-phase energy transfer matrix output by the control chip. The structure includes: the data input terminal of the streaming memory sensing buffer is electrically connected to the digital output terminal of the analog-to-digital converter group; the data output terminal of the streaming memory sensing buffer is electrically connected to the buffered data input terminal of the control chip; the streaming memory sensing buffer is used to perform block sparse compression on the high-frequency sampled data stream before transmitting it to the control chip; the real-time clock module is electrically connected to the control chip via a serial bus and is used to provide timestamps for the sampling sequence; the communication interface module is electrically connected to the control chip via a serial bus and is used to transmit power metering results to external systems; the power management module is connected to the control chip, the three-phase voltage sensor group, the three-phase current sensor group, and the neutral current sensor group. The sensor, phase-to-phase compensation circuit, streaming memory sensing buffer, analog-to-digital converter group, real-time clock module, and communication interface module are electrically connected to provide stable operating voltage for the above components. The control chip is equipped with a three-phase unbalanced error compensation calculation module, which uses the three-phase AC / DC voltage, three-phase AC / DC current and their step gradient as input features. It drives the linear approximate kernel mapping spatiotemporal convolution compensation model through the Kirchhoff constraint gradient projection convergence algorithm and the Euler graph network maximum flow-minimum cut load topology matching algorithm. This completes the dynamic zero-point drift elimination and metering error compensation under the three-phase unbalanced load scenario, and outputs the real-time error compensation amount of each phase and the phase-to-phase energy transfer matrix.

[0036] Furthermore, such as Figure 2 The diagram shows the execution steps of the three-phase imbalance error compensation calculation module, including the following steps:

[0037] S01. Collect the instantaneous voltage and current values ​​of phases A, B, and C, as well as the instantaneous neutral current value, to form an input feature tensor with a dimension of 6×1000, and have the real-time clock module timestamp each frame of the feature tensor.

[0038] S02. Perform block-based sparse compression on the input feature tensor, project high-frequency noise redundant components to the orthogonal latent space and discard them. The compressed feature tensor is sent to the control chip through a streaming memory-aware buffer, reducing memory usage to 20% to 35% of the original frame.

[0039] S03. Input the compressed feature tensor into the feature extraction layer of the linear approximation kernel mapping spatiotemporal convolution compensation model. The pre-layer generates the weight coefficients of the current convolution kernel instantaneously based on the three-phase phase difference and power factor. The cascaded gating unit determines whether the feature variance of the current frame is lower than the dynamic threshold. If it is lower than the dynamic threshold, the higher-order nonlinear layer is skipped and directly pushed to the output layer.

[0040] S04. In the backpropagation update stage of the linear approximation kernel mapping spatiotemporal convolution compensation model, the gradient projection convergence algorithm under Kirchhoff constraints is executed to project the original gradient tensor onto the physical feasible solution hyperplane constructed by the three-phase current Kirchhoff law and the power conservation law, and to forcibly correct the gradient components that deviate from the physical constraint space.

[0041] S05. Execute the Euler graph network flow maximum flow-minimum cut load topology matching algorithm to transform the current distribution of the three-phase four-wire power grid into a directed graph network flow model, solve the minimum cut set under unbalanced load in real time, locate the core branch that causes metering error, and generate the phase-to-phase energy transfer matrix.

[0042] S06. Based on the interphase energy transfer matrix, calculate the adaptive physical scaling factor, substitute the adaptive physical scaling factor into the loss function, and dynamically adjust the scaling weights of the gradients of phases A, B, and C to ensure balanced backpropagation of gradients across multiple tasks.

[0043] S07. The error compensation amount of each phase output by the linear approximation kernel mapping spatiotemporal convolution compensation model is sent to the phase-to-phase compensation circuit to drive the phase-to-phase compensation circuit to complete the physical-level topology reconstruction. At the same time, the three-phase metering results are uploaded through the communication interface module.

[0044] Specifically, the 6×1000 dimension input feature tensor refers to a matrix tensor composed of 6 channels, including instantaneous values ​​of three-phase voltage and instantaneous values ​​of three-phase current, with 1000 continuous sampling points per channel. The step gradient is obtained through differential operations between adjacent sampling points. The difference window length is 1 to 5 sampling points, and the specific value is determined by performing root mean square error statistical analysis on 5 to 20 difference window lengths one by one on a laboratory three-phase unbalance simulation platform.

[0045] Specifically, block sparse compression refers to dividing 1000 sampling points into several sub-blocks of 20-50 points each, calculating the energy percentage for each sub-block, marking sub-blocks with energy percentages lower than a dynamic threshold as redundant blocks and removing them from the calculation path, and sending the remaining sub-blocks into the subsequent calculation layer in the form of a sparse index; the dynamic threshold is determined by collecting experimental data covering four types of operating conditions: purely resistive load, inductive load, capacitive load, and mixed load, and conducting multiple rounds of statistical regression analysis on the relationship between the energy percentage of different sub-blocks and the final measurement error, with an initial range of 3% to 8% of the total energy recommended.

[0046] Specifically, the dynamic threshold refers to the judgment threshold of the characteristic variance of the sliding window, used to control whether the cascaded gating unit skips the higher-order nonlinear layer. The dynamic threshold is determined by statistically analyzing the change in measurement error before and after skipping the higher-order nonlinear layer under four experimental conditions with three-phase imbalance of 0%, 20%, 40%, and 60%. The maximum variance value corresponding to the error change rate being less than 0.1% is taken as the upper limit of the threshold, with a suggested range of [range missing]. (Normalized variance unit), the specific value will be determined after experimental verification.

[0047] Specifically, the adaptive physical scaling factor refers to the gradient scaling coefficient calculated in real time based on the three-phase unbalance. It is used to adjust the backpropagation weights of the error components of each phase in the loss function, preventing the gradient of the high-current phase from dominating the update process. The adaptive physical scaling factor is calculated as follows: the ratio of the mean to the standard deviation of the effective values ​​of the three-phase currents is used as the unbalance quantification index. Through multiple experiments comparing the convergence speed of the measurement errors of each phase under different scaling coefficients, a reasonable range for the scaling coefficient is determined. A suggested range is... .

[0048] Specifically, the physically feasible solution hyperplane refers to the constraint surface formed by Kirchhoff's current law for three-phase currents (i.e., the algebraic sum of the currents of phase A, phase B, and phase C equals the zero line current) and the three-phase power conservation law. The gradient projection operator sets the gradient components that exceed this hyperplane to zero, so that the parameter update always converges within the physically valid parameter space.

[0049] Specifically, the directed graph network flow model refers to mapping power nodes, A-phase load nodes, B-phase load nodes, C-phase load nodes, and neutral wire nodes as vertices of a graph, and mapping three-phase conductors and mutual inductance channels as directed edges. The capacity of the directed edges is determined by the rated current carrying capacity of the conductors and the real-time current limit. The maximum flow value and minimum cut set are solved iteratively by alternating between augmented path algorithm and pre-flow propulsion technology.

[0050] The specific structure of the linear approximation kernel mapping spatiotemporal convolution compensation model is as follows: Based on deep learning, the model consists of five parts connected in series: an input mapping layer, a linear attention approximation layer, a group of dynamically weighted convolutional layers, a cascaded gating layer, and an output compensation layer. The input mapping layer will... The original feature tensor is mapped to a dimension of through a learnable linear projection matrix. The model employs a low-dimensional random kernel space, with the number of kernel basis vectors ranging from 64 to 128. The specific number was determined through comparative experiments on the error convergence curves of the model on a three-phase imbalance test set under different kernel basis numbers. The linear attention approximation layer abandons the traditional fully connected attention matrix, using a random kernel function to decompose the high-dimensional query-key multiplication into a combination of two low-dimensional matrix multiplications. This reduces the time complexity of attention computation from quadratic to linear. The connection weights between neurons are dynamically generated by the kernel function mapping result instead of storing fixed weight tensors. This mechanism allows the model to maintain millisecond-level inference latency even with long sequences of 1000 sampling points. The dynamic weighted convolutional layer group contains 3-5 cascaded one-dimensional temporal convolutional units. The kernel weight coefficients of each convolutional unit are instantaneously generated by the preceding layer based on the three-phase phase difference and power factor of the current frame. This means that parameter transfer between layers is driven by the data stream rather than pre-stored. The kernel size is 3-7 sampling points, and the stride is 1-2 sampling points. Specific values ​​were determined through grid search experiments on an experimental platform using different kernel sizes and strides. The cascaded gating layer consists of 3 cascaded gating units. Each gating unit calculates the feature variance within the current sliding window in real time. When the feature variance falls below a dynamic threshold, a conditional jump is triggered, directly routing the feature stream to the output compensation layer, skipping the remaining higher-order nonlinear computation units. The data loop routing strategy is controlled by the gating state vector, and the update stride of the gating state vector is adjusted by a state decay factor, with the state decay factor ranging from [value missing]. The specific values ​​were determined through multiple ablation experiments on the gradient stability of the model under different three-phase imbalances. The output compensation layer contains three parallel fully connected units, corresponding to the error compensation outputs of phases A, B, and C, respectively. In terms of memory allocation, phases A, B, and C each occupy independent memory partitions. The size of the memory partitions is linearly proportional to the imbalance index of each phase. The phase with higher imbalance is allocated a larger memory partition to ensure that the feature cache of that phase is not truncated in high imbalance scenarios. In terms of memory allocation, the number of buffered frames of the streaming memory-aware buffer is inversely proportional to the dynamic threshold in S03. The lower the dynamic threshold, the more buffered frames are allocated to ensure that more frame data can be completely retained for subsequent kernel mapping under low threshold conditions. The model incorporates a gradient projection convergence algorithm under Kirchhoff constraints during the training phase. In the gradient update step of backpropagation, it performs physically feasible solution hyperplane projection on the gradient tensors of all layers to eliminate gradient components that violate physical rules, ensuring that all convolutional kernel weights and gating unit parameters always strictly converge to the physically valid interval during training and online adaptive updates.

[0051] The steps for establishing the training dataset of the linear approximation kernel mapping spatiotemporal convolution compensation model specifically include: setting up three-phase loads at seven levels (0%, 10%, 20%, 30%, 40%, 50%, and 60%) on a three-phase unbalance simulation platform; collecting high-frequency waveform data of three-phase voltage, three-phase current, and neutral current for at least 30 minutes at each level; and simultaneously recording the actual electrical energy metering value of each phase as a label using standard metering equipment; and then processing the collected data according to... The frame format is segmented, and each frame is normalized. The normalization interval is taken as... The dataset was divided into training, validation, and test sets in a ratio of 7:2:1.

[0052] The training steps of the linear approximation kernel mapping spatiotemporal convolution compensation model specifically include: using the weighted sum of the mean squared error loss function and the adaptive physical scaling factor weighted loss function as the total loss function, with the weighting coefficients determined in real time by the imbalance quantification index; and using an adaptive moment estimation optimizer to update the parameters, with an initial learning rate of [value missing]. The specific values ​​were determined by comparing the convergence speed and overfitting degree under different initial learning rates on the validation set. After each parameter update, a Kirchhoff-constrained gradient projection convergence algorithm was executed to project the gradient tensor of the current round onto the hyperplane of the physically feasible solution before updating the weights. The number of training rounds was 50 to 200, and the early stopping condition was that the mean square error of the validation set did not decrease for 10 consecutive rounds.

[0053] The technical effects of the linear approximation kernel mapping spatiotemporal convolution compensation model are as follows: the linear attention approximation mechanism reduces the computational complexity of long sequence feature interaction from quadratic to linear, enabling edge computing chips to complete feature extraction of 1000 high-frequency sampling sequences within millisecond latency; the dynamic weight generation mechanism enables the convolution kernel to adapt instantaneously according to the three-phase phase difference and power factor, eliminating the need to store fixed weight tensors and thus significantly reducing memory usage; the conditional jump mechanism of the cascaded gating layer automatically skips high-order nonlinear layers under low rate of change conditions, further reducing computational power consumption; and the gradient projection convergence algorithm under Kirchhoff constraints forces all parameter updates to be limited to the physical legal space, fundamentally eliminating the systematic error introduced by the zero-line reference offset, and ensuring the long-term metrological stability of the model under real conditions of continuous change in three-phase imbalance.

[0054] The technical effect of the Euler graph network flow maximum flow-minimum cut load topology matching algorithm is as follows: By transforming the current distribution problem of a three-phase four-wire power grid into a directed graph network flow model, the algorithm can locate the core branches that cause imbalance and metering error in real time during each metering cycle. The generated interphase energy transfer matrix provides accurate topology reconstruction instructions for the interphase compensation circuit, thereby upgrading the traditional open-loop compensation method that relies on empirical compensation coefficients to closed-loop compensation based on physical topology constraints. This effectively suppresses dynamic metering deviations caused by the coupling of interphase mutual inductance and neutral line resistance, and ensures the consistency and stability of metering errors of each phase under highly unbalanced conditions.

[0055] The following is the design of the adaptive learning rate adjustment function: Define the three-phase imbalance index. The ratio of the standard deviation to the mean of the three-phase current RMS value is given by the adaptive learning rate adjustment function based on... The range of values ​​for the learning rate parameter of the linear approximation kernel mapping spatiotemporal convolution compensation model. Perform segmented adjustment: when At that time, the baseline learning rate was used. (range of values) Specifically, this was determined through cross-validation experiments on convergence speed and measurement error under low imbalance conditions. At that time, adopt The learning rate is linearly amplified, where the coefficient is... The recommended scope is Specifically, it was determined through multiple rounds of experimental analysis on the relationship between the gradient update step size and the validation set error curve under moderate imbalance conditions; when At that time, adopt Perform constant magnification, where The recommended scope is Specifically, this was achieved by testing different operating conditions with an imbalance of 30% to 60%. The convergence stability of the value was determined after ablation experiments; when At that time, adopt Exponential decay adjustment is performed, where The recommended scope is , The recommended scope is Specifically, the effect of suppressing gradient explosion and activation saturation under high imbalance conditions was determined through experimental calibration; the adaptive learning rate adjustment function was executed once before each round of parameter updates, and the adjusted value was output in real time. The value drives the adaptive moment estimation optimizer to complete the weight update for this round with the corresponding learning rate.

[0056] in, As the baseline learning rate, This is an index of three-phase imbalance. This is the linear amplification factor for the moderate imbalance range. This is a constant multiplier coefficient for the medium to high imbalance range. This represents the initial magnification factor in the high imbalance range. This refers to the exponential decay coefficient in the high unbalance range. The specific values ​​of all the above coefficients must be determined through systematic experiments covering the entire unbalance range on a three-phase unbalance simulation experimental platform, and the suggested ranges should not be directly copied.

[0057] As an optional implementation, the above solution also provides an energy metering system based on a microcontroller that supports three-phase unbalanced load error compensation. The microcontroller is equipped with a readable storage medium that stores program instructions. When the program instructions are run in the microcontroller, they call the interface data of the analog-to-digital converter group, the streaming memory sensing buffer, and the phase-to-phase compensation circuit, and execute all the steps of the three-phase unbalanced load error compensation calculation module to complete the calculation of three-phase unbalanced load error compensation and the generation and distribution of the phase-to-phase energy transfer matrix.

[0058] The specific implementation of step S01 is as follows: The three-phase voltage sensor group collects instantaneous voltage values ​​from the live wire input terminals of phases A, B, and C respectively through a three-way voltage divider resistor network; the three-phase current sensor group induces instantaneous current values ​​from the three-phase conductors respectively through three toroidal magnetic core current transformers; and the neutral wire current sensor collects the instantaneous neutral wire current value through a single toroidal magnetic core current transformer mounted on the neutral wire. The above six analog signals are converted from analog to digital by an analog-to-digital converter group, forming a system with six channels of instantaneous three-phase voltage and current values, each channel containing 1000 continuous sampling points, and a dimension of [missing information]. The matrix tensor is used as the input feature tensor, and the step gradient is obtained through differential operations on adjacent sampling points. The difference window length is 1 to 5 sampling points, and the specific value is determined by performing root mean square error statistical analysis on each difference window length on a three-phase unbalanced simulation platform. The real-time clock module timestamps each frame of feature tensor through a serial bus to ensure the accuracy of subsequent multi-frame alignment and timing analysis.

[0059] The specific implementation method of step S02 is: for The input feature tensor undergoes block-based sparse compression. The 1000 sampling points are divided into several sub-blocks of 20-50 points each. The energy percentage of each sub-block is calculated. Sub-blocks with energy percentages below the block-based sparse compression threshold are marked as redundant and removed from the computation path. The remaining sub-blocks are retained as sparse indexes for use by subsequent computation layers. The block-based sparse compression threshold is determined through multiple rounds of statistical regression analysis on the relationship between the energy percentage of different sub-blocks and the final measurement error, using experimental data collected under four operating conditions: purely resistive load, inductive load, capacitive load, and mixed load. An initial range of 3%–8% of the total energy is recommended. After compression, memory usage is reduced to 20%–35% of the original frame. The compressed feature tensor is transmitted to the control chip via a streaming memory-aware buffer, effectively reducing the impact of high-frequency sampling data on the control chip's memory bus.

[0060] The specific implementation of step S03 is as follows: the compressed feature tensor enters the input mapping layer of the linear approximation kernel mapping spatiotemporal convolution compensation model, and the learnable linear projection matrix is ​​used to... The original feature tensor is mapped to a dimension of The system uses a low-dimensional random kernel space with 64–128 sets of kernel basis vectors. It then enters a linear attention approximation layer, where a random kernel function decomposes the high-dimensional query-key multiplication into two low-dimensional matrix multiplications, reducing the computational complexity of attention from quadratic to linear. The neuron connection weights are dynamically generated based on the kernel function mapping. The dynamic weight convolutional layer group contains 3–5 cascaded one-dimensional temporal convolutional units. The kernel weight coefficients of each unit are generated in real-time by the preceding layer based on the current frame's three-phase phase difference and power factor. The kernel size is 3–7 sampling points, and the stride is 1–2 sampling points; the specific values ​​are determined through grid search experiments. The cascaded gating layer consists of three cascaded gating units. Each gating unit calculates the feature variance within the current sliding window in real time. The recommended dynamic threshold range is 0.02 to 0.08 (normalized variance units). When the feature variance is lower than the dynamic threshold, a conditional jump is triggered, and the feature flow is directly routed to the output compensation layer, skipping the remaining higher-order nonlinear calculation units. The gating state attenuation factor ranges from 0.85 to 0.99.

[0061] The specific implementation of step S04 is as follows: In the backpropagation update stage of the linear approximation kernel mapping spatiotemporal convolution compensation model, a gradient projection convergence algorithm under Kirchhoff constraints is executed. The physically feasible solution hyperplane is composed of Kirchhoff's current law for three-phase currents (i.e., the algebraic sum of phase A current, phase B current, and phase C current equals the zero-line current) and the three-phase power conservation law. The gradient projection operator performs projection operations on the gradient tensors of all layers, setting the gradient components that exceed the physically feasible solution hyperplane to zero, and retaining only the gradient components located within the physically valid interval for parameter updates. This algorithm is executed once in each parameter update step of backpropagation, ensuring that the convolution kernel weights and gating unit parameters always strictly converge to the physically valid interval during training and online adaptive updates, fundamentally blocking the path of systematic error introduced by zero-line reference offset.

[0062] The specific implementation of step S05 is as follows: The Eulerian graph network flow maximum-minimum cut load topology matching algorithm is executed to transform the current distribution of the three-phase four-wire power grid into a directed graph network flow model. Power supply nodes, A-phase load nodes, B-phase load nodes, C-phase load nodes, and neutral wire nodes are mapped as vertices of the graph, and the three-phase conductors and mutual inductance channels are mapped as directed edges. The capacity of the directed edges is determined by both the conductor's rated current carrying capacity and the real-time current limit. The augmented path algorithm and pre-current propagation technique are used iteratively to solve for the maximum flow value and minimum cut set in real time within each metering cycle, accurately locating the core branches causing metering errors, and finally generating an inter-phase energy transfer matrix, providing precise instructions for subsequent compensation circuit topology reconstruction.

[0063] The specific implementation of step S06 is as follows: Based on the interphase energy transfer matrix, the ratio of the standard deviation to the mean of the three-phase current effective values ​​is used as the quantification index for three-phase imbalance. An adaptive physical scaling factor is calculated, with a suggested range of 0.5 to 3.0. The adaptive physical scaling factor is substituted into the total loss function, which is a weighted sum of the mean square error loss function and the weighted loss function based on the adaptive physical scaling factor. The weighting coefficients are determined in real-time by the imbalance quantification index, dynamically adjusting the scaling weights of the gradients for phases A, B, and C to prevent the gradient of the high-current phase from dominating the update process and ensuring backpropagation of gradient equilibrium across multiple tasks. The adaptive learning rate adjustment function is executed once before each round of parameter updates, based on the three-phase imbalance index. The learning rate is segmented and adjusted based on the range of values, and the adjusted learning rate drives the adaptive moment estimation optimizer to complete the weight update for this round.

[0064] The specific implementation of step S07 is as follows: The output compensation layer contains three parallel fully connected units, corresponding to the error compensation outputs of phases A, B, and C, respectively. Each phase occupies an independent memory partition, and the size of the memory partition has a linear proportional relationship with the unbalance index of each phase. The control chip sends the real-time error compensation amount of each phase to the inter-phase compensation circuit. The inter-phase compensation circuit performs physical-level topology reconstruction according to the inter-phase energy transfer matrix, driving the compensation action of each phase. At the same time, the three-phase metering results are uploaded to the external system via the serial bus through the communication interface module.

[0065] It should be noted that the key technologies of this invention include: The Kirchhoff-constrained gradient projection convergence algorithm embeds physical constraints into the parameter update process, ensuring that model weights always converge within the physically valid range. This eliminates the systematic error introduced by zero-line reference drift from the source of parameter updates, a capability that traditional offline calibration compensation schemes cannot achieve. The Euler graph network flow maximum flow-minimum cut load topology matching algorithm upgrades empirical open-loop compensation to closed-loop compensation based on real-time topology identification. Within each metering cycle, it dynamically locates the core error branch and generates accurate topology reconstruction instructions, enabling the phase coupling error to be eliminated synchronously with topology changes. The linear approximation kernel mapping spatiotemporal convolution compensation model's linear attention approximation mechanism and dynamic weight generation mechanism work synergistically to complete long-sequence feature extraction within millisecond delays, while eliminating the need to store fixed weight tensors. When these three technologies work together, the physical constraint layer ensures parameter validity, the topology identification layer ensures the accuracy of compensation instructions, and the feature extraction layer ensures real-time inference capability. Together, they form a complete dynamic closed-loop compensation link, achieving long-term metering stability under continuously changing three-phase imbalance conditions—an overall effect that cannot be achieved by a single technology.

[0066] It should be noted that in a three-phase power grid, when the load of one or two phases suddenly changes or the load type changes from resistive to inductive or capacitive, the power factor and phase difference of each phase change dramatically in a very short time. Traditional fixed-weight compensation models cannot detect this sudden change, and the update of compensation parameters lags behind the change in load state, resulting in a continuous deviation between the compensation amount and the actual error.

[0067] The aforementioned technical problems arise because the parameters of the fixed-weight model are determined offline and are not updated or are updated only at a very low frequency during online operation. When a sudden load change causes an instantaneous jump in phase difference and power factor, the distribution of the model's input features deviates from the data distribution during offline training. The compensation amount output by the model is still based on the parameter estimates of the old state, making it difficult for the accumulated error to converge on its own. Simultaneously, the three-phase gradient amplitudes differ significantly under sudden load conditions. If a uniform learning rate is used, the gradient of the large-current phase dominates the parameter update direction, while the compensation accuracy of the small-current phase continues to deteriorate. Conventional adaptive optimizers struggle to achieve synchronous convergence under multi-phase unbalanced gradient conditions.

[0068] The usual solutions to the aforementioned technical problems are to increase the sampling frequency to accelerate state perception or to increase the model update frequency to shorten parameter lag time. However, increasing the sampling frequency significantly increases data traffic, which is difficult for the memory bus and computing power of edge computing chips to handle; increasing the update frequency makes gradient updates more frequently affected by multi-phase unbalanced gradients, which exacerbates parameter oscillations and does not solve the fundamental problem of parameter updates deviating from physical constraints. This invention effectively solves this technical problem. At the feature extraction level, the front layer of the linear approximation kernel mapping spatiotemporal convolution compensation model generates convolution kernel weight coefficients in real time based on the three-phase phase difference and power factor of the current frame, enabling the model to perceive the current load state in each inference cycle and output compensation amounts matching the current state without waiting for global parameter updates. At the gradient balancing level, the adaptive physical scaling factor dynamically scales the gradient weights of each phase based on real-time unbalance quantification indicators, preventing the high-current phase from dominating the update process and ensuring synchronous convergence of compensation accuracy for each phase. At the constraint level, the Kirchhoff-constrained gradient projection convergence algorithm forcibly confines the gradient to the physically feasible solution hyperplane in each update round, ensuring that rapid updates under abrupt load conditions do not violate physical rules and that the parameter update path remains valid. These three mechanisms work together to enable the system to respond quickly to state changes during transient load abrupt changes while ensuring stable convergence of compensation parameters within physical constraints. This solves the technical challenge of coexisting compensation lag and gradient imbalance in traditional schemes under abrupt load abrupt changes.

[0069] The present invention can solve the above-mentioned technical problems. The fundamental reason is that it transforms physical constraints from external correction to parameter update rules inside the model, and directly applies compensation commands to the physical circuit through real-time topology recognition.

[0070] In traditional compensation schemes, the compensation coefficients are determined offline, and the model parameter update process is not constrained by physical laws. Therefore, when the three-phase imbalance changes dynamically, the parameter update direction may deviate from the physically valid interval, and the accumulated error cannot self-correct. This invention introduces a gradient projection convergence algorithm under Kirchhoff constraints. In the gradient update step of each round of backpropagation, the gradient tensors of all layers are projected onto the physically feasible solution hyperplane composed of the Kirchhoff laws of three-phase current and the power conservation law. Gradient components exceeding this hyperplane are forcibly set to zero, ensuring that the convolutional kernel weights and gating unit parameters strictly converge to the physically valid interval during training and online adaptive updates. This mechanism eliminates the systematic error introduced by the zero-line reference offset from the source of parameter updates, rather than performing post-processing correction at the output.

[0071] At the load topology identification level, this invention employs an Eulerian graph network flow maximum-minimum cut load topology matching algorithm to transform the current distribution problem of a three-phase four-wire power grid into a directed graph network flow model. Power supply nodes, each phase load node, and the neutral node are mapped as graph vertices, while the three-phase conductors and mutual inductance channels are mapped as directed edges. The edge capacity is constrained by both the conductor's rated current carrying capacity and the real-time current. Through alternating iterations of augmented path algorithm and pre-current propagation technology, the algorithm solves for the minimum cut set in real-time within each metering cycle, accurately locating the core branches causing metering errors and generating an interphase energy transfer matrix. This matrix directly drives the interphase compensation circuit to perform physical-level topology reconstruction, upgrading the traditional open-loop compensation relying on empirical coefficients to closed-loop compensation based on real-time topology constraints, effectively suppressing dynamic metering deviations caused by the coupling between interphase mutual inductance and neutral resistance.

[0072] At the feature extraction level, the linear approximation kernel mapping spatiotemporal convolution compensation model decomposes the high-dimensional attention matrix into two low-dimensional matrix multiplications using a random kernel function, reducing the computational complexity from quadratic to linear. This enables edge computing chips to complete feature extraction of high-frequency sampling sequences within millisecond latency. The dynamic weight generation mechanism generates convolution kernel weights in real time based on the three-phase phase difference and power factor of the current frame, eliminating the need to store fixed weight tensors and allowing the model to track real-time changes in the load topology. The cascaded gating layer automatically skips high-order nonlinear computation units under low rate-of-change conditions, reducing computational power consumption and ensuring real-time performance. The synergistic effect of these mechanisms enables the present invention to achieve dynamic zero-point drift elimination and real-time closed-loop compensation for measurement errors under real-world conditions of continuously changing three-phase imbalance.

[0073] The following provides a specific embodiment 1 of the present invention, and the specific implementation of each step in this embodiment 1 is described in detail below.

[0074] The specific implementation method of step S01 is as follows.

[0075] The system collects instantaneous voltage and current values ​​for phases A, B, and C, as well as the instantaneous neutral current value, for a total of 6 signal channels. Each channel collects 1000 continuous sampling points, forming a structure with dimensions of [dimension not specified]. Input feature tensor The first three rows represent the instantaneous voltage sequences of phases A, B, and C, respectively, while the fourth to sixth rows represent the instantaneous current sequences of phases A, B, and C, respectively. The step gradient is obtained through differential operations between adjacent sampling points, with the differential window length set to... The sampling point, the first Channel 1 The formula for the difference gradient of a point is expressed as follows:

[0076] ;

[0077] In the formula, For the first Channel 1 The instantaneous value of each sampling point. For the corresponding differential gradient, The difference window length, For channel indexing, This is the index for the sampling points. The specific values ​​were determined by performing root mean square statistical analysis on the error of each of the 5 to 20 differential window lengths on a three-phase unbalanced simulation platform. The real-time clock module is the feature tensor for each frame. Enter timestamp This ensures the timing alignment of the sampling sequence.

[0078] The specific implementation method of step S02 is as follows.

[0079] For input feature tensor Perform block-based sparse compression. Divide the 1000 sampling points into blocks. Points are divided into The first sub-block Each sub-block is denoted as ,in For the sub-block index. Calculate the first... Energy percentage of each sub-block The formula is expressed as follows:

[0080] ;

[0081] In the formula, For the first The first sub-block Channel 1 The sampled value of the point, This represents the total number of sub-blocks. The number of sampling points per block This is a dimensionless ratio; both the numerator and denominator are the sum of squares of sampled values, with consistent dimensions. Energy percentage. Below the dynamic threshold The sub-blocks are marked as redundant blocks and removed from the computation path, while the remaining sub-blocks are sent to subsequent computation layers in the form of sparse indexes. By collecting experimental data covering four types of operating conditions—purely resistive load, inductive load, capacitive load, and mixed load—multiple rounds of statistical regression analysis were conducted to determine the relationship between the energy proportion of different sub-blocks and the final measurement error. An initial range of 3% to 8% of the total energy is recommended. After compression, memory usage is reduced to 20% to 35% of the original frame.

[0082] The specific implementation method of step S03 is as follows.

[0083] The compressed feature tensor is projected onto a low-dimensional random kernel space through the input mapping layer. The linear projection formula is as follows:

[0084] ;

[0085] In the formula, This is the splicing tensor of the effective sub-blocks retained after compression. To retain the total number of sampling points, For learnable linear projection matrices, The bias matrix, For low-dimensional kernel space dimensions, empirical values ​​range from 64 to 128. This is the mapping result. The linear attention approximation layer decomposes the query-key multiplication into two low-dimensional matrix multiplications using a random kernel function. The attention output formula is expressed as follows:

[0086] ;

[0087] In the formula, For querying the matrix, The key matrix, For value matrices, For random kernel function mapping, As the attention output matrix, this mechanism reduces the time complexity of attention computation from quadratic to linear. The dynamically weighted convolutional layer group contains 3 to 5 cascaded one-dimensional temporal convolutional units, the... The kernel weights of each convolutional unit The front-end layer determines the three-phase phase difference of the current frame. With power factor Instantaneous generation, expressed by the following formula:

[0088] ;

[0089] In the formula, For the first Layer weight generation function, This is a three-phase phase difference vector, with three components corresponding to the phase differences of phases A, B, and C, respectively. This is a three-phase power factor vector, with three components corresponding to the power factors of phases A, B, and C, respectively. For convolutional layer index, This represents the total number of convolutional layers. The kernel size is set to 3 to 7 sampling points, and the stride is set to 1 to 2 sampling points. The cascaded gating layer consists of three cascaded gating units, each of which calculates the feature variance within the current sliding window. ,when When skipping higher-order nonlinear layers, it is directly pushed to the output layer. For dynamic thresholding, a range of 0.02 to 0.08 (normalized variance units) is recommended. Gated state vector. The update formula is expressed as follows:

[0090] ;

[0091] In the formula, For the first The time-gated state vector This is the state decay factor, with empirical values ​​ranging from 0.85 to 0.99. For the first Variance of sliding window features at different times. For time indexing. In the above formula and All are normalized dimensionless quantities with unified dimensions.

[0092] The specific implementation method of step S04 is as follows.

[0093] During the backpropagation update phase, the gradient projection convergence algorithm under Kirchhoff constraints is executed. The physically feasible solution hyperplane is constrained by Kirchhoff's current law for three-phase currents. Together with the three-phase power conservation law, it constitutes the whole. , , These are the instantaneous current values ​​for phases A, B, and C, respectively. This represents the instantaneous value of the neutral current. (Constraint matrix) It is composed of the superposition of Kirchhoff's current law constraint row and the power conservation law constraint row. For the number of constraint equations, Let be the parameter dimension. The gradient projection operator sets the gradient components that extend beyond the hyperplane to zero. The projection formula is as follows:

[0094] ;

[0095] In the formula, For the original gradient tensor, The gradient tensor after projection. For orthogonal projection operators, Components that violate physical constraints are set to zero. Gradient after projection. Replace the original gradient to complete this round of weight updates, ensuring that the parameters always converge within the physically valid space. and Same dimensions It is a dimensionless constraint coefficient matrix, and the dimensions on both sides of the projection operator are consistent.

[0096] The specific implementation method of step S05 is as follows.

[0097] Perform the Eulerian graph network flow maximum-minimum cut load topology matching algorithm. Map the three-phase four-wire power grid as a directed graph. Vertex set Includes power nodes Phase A load node Phase B load node C-phase load node and neutral node Directed edge set It consists of three-phase conductors and mutual inductance path, side capacity The current carrying capacity of the conductor is determined by both the rated current carrying capacity of the conductor and the real-time current limit, as expressed by the following formula:

[0098] ;

[0099] In the formula, For the edge The rated current carrying capacity of the conductor For the edge The real-time measured current limit value, both are in the dimension of current. The dimensions are consistent with this. The maximum flow value is solved by iteratively applying the augmented path algorithm and the pre-flow propulsion technique. with minimal cut set The location of the core branch causing measurement errors. Interphase energy transfer matrix. According to minimal cut set Result generation, elements Indicates the first Facing each other The energy transfer of a phase is expressed by the following formula:

[0100] ;

[0101] In the formula, For the first Xiangzai The instantaneous voltage value at time t. for Time by the first Phase flow direction Instantaneous value of phase current, The duration of a metering cycle, Its dimension is energy. For integration time variable, The time variable for integration is denoted as... To distinguish it from the timestamp in step S01 .

[0102] The specific implementation method of step S06 is as follows.

[0103] Based on the interphase energy transfer matrix Calculate the three-phase imbalance index The formula is expressed as follows:

[0104] ;

[0105] In the formula, The standard deviation of the effective values ​​of the three-phase current. The average value of the three-phase current. This is a dimensionless ratio, with both the numerator and denominator having the dimension of electric current, resulting in a unified ratio dimension. (Adaptive physical scaling factor) Used to adjust the first The gradient scaling weights are expressed by the following formula:

[0106] ;

[0107] In the formula, For the first RMS value of phase current This is the scaling adjustment factor, with an empirical range of 0.5 to 3.0, determined experimentally. The coefficient is a dimensionless coefficient, where the dimensions of the numerator and denominator are both in the dimension of electric current. Multiplying by the dimensionless coefficient... Dimensional unification is achieved. Total loss function. The mean squared error loss and the adaptive physical scaling factor weighted loss are summed by a weighted formula as follows:

[0108] ;

[0109] In the formula, For mean square error loss, For the first Phase error component loss, and The weighting coefficients are derived from the imbalance index. Make a decision in real time. , , All dimensions are the square dimension of error. , , All are dimensionless coefficients with uniform dimensions. The adaptive learning rate adjustment function is based on... Segmented adjustment of learning rate :when At that time, the baseline learning rate was used. The range of experience values ​​is to ;when When the formula is used, it is expressed as follows:

[0110] ;

[0111] In the formula, This is the linear amplification factor, with empirical values ​​ranging from 1.5 to 3.0. and Same dimensions, inside parentheses It is a dimensionless quantity, with unified dimensions; when When the formula is used, it is expressed as follows:

[0112] ;

[0113] In the formula, It is a constant multiplier coefficient, with an empirical value range of 2.0 to 5.0; it is a dimensionless coefficient with uniform dimensions. When the formula is used, it is expressed as follows:

[0114] ;

[0115] In the formula, This is the initial magnification factor for the high imbalance range, with an empirical value range of 4.0 to 6.0. This is the exponential decay coefficient, with empirical values ​​ranging from 2.0 to 5.0. It is a dimensionless quantity. This is a dimensionless exponential term with uniform dimensions. All the above coefficients must be determined through systematic experiments covering the entire unbalance range.

[0116] The specific implementation method of step S07 is as follows.

[0117] The linear approximation kernel maps the per-phase error compensation amount output by the spatiotemporal convolution compensation model. ( The data is sent to the interphase compensation circuit, which then drives the interphase compensation circuit to adjust the energy transfer matrix according to the interphase energy transfer matrix. Complete the physical-level topology reconstruction and upload the three-phase metering results to the external system via the communication interface module to complete the closed-loop compensation process.

[0118] To better understand and implement this invention, the following is a specific application scenario of this invention, Example 2:

[0119] This embodiment uses a three-phase four-wire low-voltage power distribution system as a background to verify the error compensation effect of the present invention under dynamic changes in three-phase unbalance. The rated line voltage of the power distribution system is 380V, the rated frequency is 50Hz, and the three-phase load consists of a combination of purely resistive loads, inductive loads, and mixed loads. The unbalance is gradually increased from 0% to 60% during the experiment, with a total of 7 levels set, and the continuous sampling time for each level is not less than 30 minutes.

[0120] The sampling system consists of a three-phase voltage and current sensor group composed of a three-way voltage divider resistor network and three toroidal magnetic core current transformers. A single toroidal magnetic core current transformer is mounted on the neutral conductor for neutral current acquisition. The analog-to-digital converter group is set to a sampling rate of 50kHz per channel, acquiring 1000 sampling points per frame, forming a dimension of... The input feature tensor corresponds to a sampling time window of 20ms, covering a complete power frequency cycle. The real-time clock module timestamps each frame of the feature tensor with microsecond-level precision, ensuring multi-frame alignment.

[0121] In step S02, the 1000 sampling points are divided into 40 sub-blocks of 25 points each. The block sparse compression threshold is set to 5% of the total energy. Experiments have verified that under inductive load conditions, about 23% of the sub-blocks are marked as redundant blocks. After compression, the memory usage is reduced to 28% of the original frame, which is close to 29% under pure resistive load conditions and close to 26% under mixed load conditions. This shows that block sparse compression has good robustness to load type.

[0122] The structure of the linear approximation kernel mapping spatiotemporal convolution compensation model is as follows. The input mapping layer passes through a dimension of... The learnable linear projection matrix maps the input feature tensor to a low-dimensional random kernel space, with 96 sets of kernel basis vectors. The linear attention approximation layer decomposes the high-dimensional query-key matrix twice using a random kernel function. Low-dimensional matrix multiplication reduces the computational complexity of attention from Down to The inference latency remains in the millisecond range for 1000-point long sequences. The dynamic weighted convolutional layer group consists of four cascaded one-dimensional temporal convolutional units, with a kernel size of 5 sampling points and a stride of 1 sampling point. The kernel weights of each convolutional unit are generated in real-time by the preceding layer based on the three-phase phase difference and power factor of the current frame. The cascaded gating layer consists of three cascaded gating units, with a dynamic threshold of 0.05 (normalized variance units) and a state decay factor of 0.92. The output compensation layer contains three parallel fully connected units, outputting the real-time error compensation amounts for phases A, B, and C, respectively. The size of each phase's independent memory partition is linearly proportional to the phase imbalance index, and the number of buffered frames is inversely proportional to the dynamic threshold. When the dynamic threshold is 0.05, the number of buffered frames is set to 8 frames.

[0123] During the model training phase, the training dataset was collected at seven imbalance levels: 0%, 10%, 20%, 30%, 40%, 50%, and 60%. Each level's collection time was no less than 30 minutes. The data was divided into training, validation, and test sets in a 7:2:1 ratio, and the normalization interval was [missing information]. The total loss function is a weighted sum of the mean squared error loss function and the adaptive physical scaling factor weighted loss function. An adaptive moment estimation optimizer is used, with a maximum training epoch of 200 epochs, to verify that the set mean squared error does not decrease for 10 consecutive epochs as an early stopping condition. Figure 3 As shown, with the increase of training rounds, the mean square error curve of the validation set decreases significantly faster after the gradient projection convergence algorithm under Kirchhoff constraints is introduced. Moreover, under the high imbalance condition, the inflection point of the convergence curve tending to flatten appears earlier, indicating that the embedding of physical constraints effectively suppresses the component of the gradient in the physical illegal direction and accelerates the parameter convergence process.

[0124] The parameters of the adaptive learning rate adjustment function, after experimental calibration, are as follows: Baseline learning rate Pick Linear amplification factor Take 2.0, constant magnification factor Set the initial magnification factor to 3.0. Take 5.0, exponential decay coefficient Take 3.0. For example... Figure 4 As shown, during the process of the imbalance gradually increasing from 0% to 60%, the learning rate curve successively experiences a stable phase, a linearly increasing phase, a constant rate phase, and an exponentially decaying phase. The switching points of each stage and the three-phase imbalance index are also shown. The interval boundaries strictly correspond, ensuring the stability of model parameter updates under different imbalances.

[0125] The Euler graph network maximum flow-minimum cut load topology matching algorithm constructs a directed graph within each metering cycle, with power nodes, phase A load nodes, phase B load nodes, phase C load nodes, and neutral node as vertices, and the three-phase conductors and mutual inductance channels as directed edges. The capacity of the directed edges is limited by both the rated current carrying capacity and the real-time current. Under the condition of 40% imbalance, the algorithm identifies the branch from phase B to the neutral line as the core branch of the current minimum cut set, such as... Figure 5 As shown, the transfer weight from phase B to phase A in the generated interphase energy transfer matrix is ​​0.18, and the transfer weight from phase B to phase C is 0.12. This matrix directly drives the interphase compensation circuit to complete topology reconstruction.

[0126] The calculation results of the adaptive physics scaling factor are shown in Table 1:

[0127] Table 1. Values ​​of Adaptive Physical Scale Factor under Different Imbalance Degrees

[0128]

[0129] As shown in Table 1, the scaling factor of phase B increases continuously with the increase of the three-phase imbalance, while the scaling factors of phases A and C show opposite trends. This indicates that the adaptive physical scaling factor can accurately capture the degree of imbalance of each phase and dynamically allocate gradient weights to prevent the dominant parameters of the high-imbalance phase from being updated.

[0130] The results of the changes in measurement error at each stage are shown in Table 2:

[0131] Table 2 Comparison of Measurement Errors of Each Phase under Different Unbalance Degrees

[0132]

[0133] like Figure 6 As shown, with the gradual increase of the three-phase imbalance, the metering error curves of each phase show a slow upward trend, but the increase is significantly lower than that of the baseline scheme without closed-loop compensation. Under the condition of 60% imbalance, the metering error of phase B remains at 0.23%, and its upward trend tends to level off after the imbalance exceeds 40%. This is because the Euler graph network flow algorithm identifies more core error branches under high imbalance and synchronously drives the reconstruction of the inter-phase compensation circuit, so that the compensation strength increases synchronously with the increase of imbalance.

[0134] The equivalent structure of the linear approximation kernel mapping spatiotemporal convolution compensation model is described below. Alternative structure one is a temporal convolutional network structure, consisting of an input mapping layer, multiple causal dilation one-dimensional convolutional layers, and an output compensation layer. The input is... The feature tensor, after extracting multi-scale temporal features through causal dilated convolutional layers, outputs the error compensation for each phase. The Kirchhoff-constrained gradient projection convergence algorithm performs physically feasible solution hyperplane projection on the gradients of all convolutional layers after each round of backpropagation. The loss function and adaptive physical scaling factor weighting mechanism are consistent with the main scheme. Alternative structure two is a gated recurrent unit network, consisting of an input mapping layer, multiple gated recurrent unit layers, and an output compensation layer connected in series. The input is fed frame by frame. The feature tensor and gated recurrent unit layer store temporal dependencies using hidden state vectors. The output layer consists of three parallel fully connected units that output the three-phase error compensation amounts respectively. The gradient projection convergence algorithm is also executed after each round of backpropagation to ensure that the parameters converge within the physically valid interval. The feature extraction dimensions and loss function convergence objectives of the two alternative structures are highly consistent with the main scheme, which are equivalent replacements that can be implemented by ordinary people in this field without creative labor.

[0135] It should be noted that the variables involved in this invention are explained in detail in Tables 3 and 4.

[0136] Table 3. Variable Explanation Table (Part 1)

[0137]

[0138] Table 4. Variable Explanation Table (Part Two)

[0139]

[0140] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in the present invention should be included within the scope of protection of the present invention.

Claims

1. A smart energy meter supporting three-phase unbalanced load error compensation, characterized in that, It includes a three-phase voltage sensor group, a three-phase current sensor group, a neutral current sensor, a phase-to-phase compensation circuit, a streaming memory sensing buffer, an analog-to-digital converter group, a real-time clock module, a communication interface module, a power management module, and a control chip. The control chip has a three-phase unbalanced error compensation calculation module, which performs the following steps: The instantaneous voltage and current values ​​of phases A, B, and C, as well as the instantaneous neutral current value, are collected to form an input feature tensor. The real-time clock module timestamps each frame of the feature tensor. Block-based sparse compression is performed on the input feature tensor, and the compressed feature tensor is sent to the control chip via a streaming memory-aware buffer. The compressed feature tensor is input into the linear approximation kernel mapping spatiotemporal convolution compensation model. The front layer generates convolution kernel weight coefficients in real time based on the three-phase phase difference and power factor. The cascaded gating unit determines whether the feature variance of the current frame is lower than the dynamic threshold. If it is lower than the dynamic threshold, the higher-order nonlinear layer is skipped and directly pushed to the output layer. In the backpropagation update stage of the linear approximation kernel mapping spatiotemporal convolution compensation model, the gradient projection convergence algorithm under Kirchhoff constraints is executed to project the original gradient tensor onto the physical feasible solution hyperplane and forcibly correct the gradient components that deviate from the physical constraint space. The Euler graph network flow maximum flow-minimum cut load topology matching algorithm is executed to transform the current distribution of the three-phase four-wire power grid into a directed graph network flow model, solve the minimum cut set under unbalanced load in real time, locate the core branch that causes metering error, and generate the phase-to-phase energy transfer matrix. The adaptive physical scaling factor is calculated based on the interphase energy transfer matrix. The adaptive physical scaling factor is then substituted into the loss function to dynamically adjust the scaling weights of the gradients of phases A, B, and C. The error compensation amount for each phase output by the linear approximation kernel mapping spatiotemporal convolution compensation model is sent to the interphase compensation circuit, driving the interphase compensation circuit to complete physical-level topology reconstruction. At the same time, the three-phase metering results are uploaded via the communication interface module.

2. The smart energy meter supporting three-phase unbalanced load error compensation according to claim 1, characterized in that, The input feature tensor specifically refers to a matrix tensor composed of six channels, namely the instantaneous values ​​of three-phase voltage and three-phase current, with several continuous sampling points in each channel. The step gradient is obtained through differential operations between adjacent sampling points, and the difference window length is determined by performing root mean square error statistical analysis on different difference window lengths one by one on a three-phase unbalance simulation platform.

3. The smart energy meter supporting three-phase unbalanced load error compensation according to claim 2, characterized in that, The block sparse compression specifically refers to dividing the sampling points into several sub-blocks according to a preset sub-block length, calculating the energy proportion for each sub-block, and marking sub-blocks with energy proportions lower than the block sparse compression threshold as redundant blocks and removing them from the calculation path. The remaining sub-blocks are sent to the subsequent calculation layer in the form of sparse indexes. The block sparse compression threshold is determined by statistical regression analysis of experimental data covering four types of working conditions: purely resistive loads, inductive loads, capacitive loads, and mixed loads.

4. The smart energy meter supporting three-phase unbalanced load error compensation according to claim 3, characterized in that, The dynamic threshold specifically refers to the judgment threshold of the characteristic variance of the sliding window. It is determined by statistically analyzing the changes in measurement error before and after skipping the higher-order nonlinear layer under four experimental conditions with three-phase imbalance of 0%, 20%, 40%, and 60%, and taking the maximum variance value corresponding to the error change rate being lower than the upper limit of the error change rate as the upper limit of the threshold.

5. The smart energy meter supporting three-phase unbalanced load error compensation according to claim 4, characterized in that, The physically feasible solution hyperplane refers specifically to the constraint surface formed by Kirchhoff's current law and the three-phase power conservation law. The gradient projection operator sets the gradient components that exceed this hyperplane to zero, so that the parameter updates always converge within the physically valid parameter space.

6. The smart energy meter supporting three-phase unbalanced load error compensation according to claim 5, characterized in that, The directed graph network flow model specifically refers to mapping power nodes, A-phase load nodes, B-phase load nodes, C-phase load nodes, and neutral wire nodes as vertices of a graph, and mapping three-phase conductors and mutual inductance channels as directed edges. The capacity of the directed edges is determined by the rated current carrying capacity of the conductors and the real-time current limit. The maximum flow value and minimum cut set are solved iteratively by alternating augmented path algorithm and pre-flow propulsion technology.

7. The smart energy meter supporting three-phase unbalanced load error compensation according to claim 6, characterized in that, The adaptive physical scaling factor specifically refers to the gradient scaling factor determined by comparing the convergence speed of the measurement error of each phase under different scaling factors through multiple experiments, using the ratio of the mean to the standard deviation of the effective value of the three-phase current as the unbalance measurement index.

8. The smart energy meter supporting three-phase unbalanced load error compensation according to claim 7, characterized in that, The linear approximation kernel mapping spatiotemporal convolution compensation model consists of an input mapping layer, a linear attention approximation layer, a group of dynamic weight convolutional layers, a cascaded gating layer, and an output compensation layer connected in series. The input mapping layer maps the original feature tensor to a low-dimensional random kernel space through a learnable linear projection matrix.

9. The smart energy meter supporting three-phase unbalanced load error compensation according to claim 8, characterized in that, The linear attention approximation layer decomposes the high-dimensional query-key multiplication into a combination of two low-dimensional matrix multiplications using a random kernel function. The connection weights between neurons are dynamically generated by the kernel function mapping results rather than stored as fixed weight tensors.

10. The smart energy meter supporting three-phase unbalanced load error compensation according to claim 9, characterized in that, The dynamic weighted convolutional layer group contains several cascaded one-dimensional temporal convolutional units. The kernel weight coefficients of each convolutional unit are generated in real time by the front layer based on the three-phase phase difference and power factor of the current frame. The kernel size and convolution stride are determined through grid search experiments.