A digital filter-based error compensation method and system for an electric energy meter and the electric energy meter
Patent Information
- Application Number
- CN202610905084.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-06-23
- Publication Date
- 2026-10-30
AI Technical Summary
但在分布式光伏逆变器、储能变流器、电动车充电机及变频负载集中接入的台区或充电结算场景中,电能表不能改变用户一次回路,不能要求接入负载输出标准波形,也不能借助外部标准源长期参与在线计量,只能依靠表内电压、电流采样通道及计量芯片完成实时测量;
本方案通过半采样间隔偏移与相干位号追踪,区分随采样节拍移动的混叠分量,从而补偿高频脉冲折入低频计量引起的误差;
Smart Images

Figure CN123009782A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of electricity metering technology, and more specifically, to an electricity meter error compensation method, system, and electricity meter based on digital filtering. Background Technology
[0002] In the error compensation processing of electricity meters, existing solutions mostly aim to suppress sampling noise, correct channel phase deviation and reduce energy accumulation error. Generally, the voltage and current sampling values are sent to the power calculation stage after being low-pass filtered, sliding filtered, harmonic decomposition or error table correction. However, in scenarios where distributed photovoltaic inverters, energy storage converters, electric vehicle chargers, and frequency conversion loads are centrally connected to the distribution area or charging settlement, the electricity meter cannot change the user's primary circuit, cannot require the connected load to output a standard waveform, and cannot participate in online metering for a long time with the help of an external standard source. It can only rely on the voltage and current sampling channels and metering chips inside the meter to complete real-time measurement. In this situation, the high-frequency pulses generated by the inverter and switching power supply will be folded into the low-frequency metering range due to the limitations of sampling frequency and sampling point. After digital filtering, they will appear as slow fluctuations similar to the actual load changes. On-site verification shows that when the sampling point of the same type of connected load changes slightly, the position and amplitude of the low-frequency fluctuations will change accordingly. Conventional filtering will still treat this part of the fluctuations as effective current to participate in the power accumulation, or weaken it together with the real power frequency component in the smoothing process. As a result, the aliasing error is difficult to eliminate as high-frequency noise and difficult to accurately measure as normal load. The technical problem this application aims to solve is: how to identify and compensate for the digital filtering error of the energy meter caused by high-frequency pulse aliasing entering the low-frequency metering range without changing the primary circuit or connecting an external standard source. Summary of the Invention
[0003] To overcome the aforementioned deficiencies in the prior art, embodiments of the present invention provide a method, system, and meter for compensating for electricity meter errors based on digital filtering. This method involves forming an original phase measurement electrical variable string and a half-sampling interval offset phase measurement electrical variable string in a shared sampling link between electricity meter testing or calibration and online metering. Local polynomial Fourier transform and cross-wavelet coherence operations are used to identify aliasing points that move with the sampling cycle. The original filtered current is then corrected according to the aliasing deduction ratio, and the metering results are recursively accumulated, thereby solving the problems mentioned in the background art.
[0004] To achieve the above objectives, the present invention provides the following technical solution: a method for compensating for electricity meter errors based on digital filtering, comprising: S1. Obtain the voltage and current sampling strings formed by the intelligent sensing system sharing the link between the electricity meter test or calibration and online metering in the metering cycle. Perform a sign product on adjacent voltage sampling values, write the positive and negative flipped tag number of the product into the power frequency half-cycle boundary table, and bind the voltage sampling value and current sampling value with the same tag number as a measurement electrical variable string. S2. According to the power frequency half-cycle boundary table, collect the measured electrical variables according to the original sampling beat in the odd-numbered half-cycles, and collect the measured electrical variables after moving the original sampling beat half a sampling interval along the half-cycle sampling direction in the even-numbered half-cycles. At the end, reset the sampling beat and output the original and offset phase measured electrical variable strings. S3. Perform local polynomial Fourier transform on the original and offset phase measurement electrical variable strings, map and read the measured electrical variables before and after the center along the original beat and offset beat with the sampling position number as the center, generate first and second phase compensation quantities according to the position number distance, and output two types of local spectrum strings by summing the complex exponential product. S4. Perform cross-wavelet coherence operation based on two types of local spectrum strings, generate complex wavelet coefficients with the position distance after the half-circle boundary as the pairing index, obtain cross-spectral values through conjugate product, obtain normalized base values through modulus square product, and generate coherent phase difference and occupancy value from cross-spectral values. S5. Perform bit tracking using coherent phase difference and occupancy value. Write positions with phase displacement of half a sampling interval and adjacent occupancy difference signs in the same direction into the aliasing landing string, and write positions with phase displacement of zero into the power frequency reserved bit string.
[0005] In a preferred embodiment, it further includes: S6. Based on the current contribution of the aliasing point string moving with the sampling cycle, the aliasing current deduction amount is generated by multiplying the complex wavelet coefficient modulus with the original filtered current value. After deduction, a compensation current string is formed. The compensation current string is multiplied with the voltage measurement variable of the same position number to obtain the instantaneous power string. The metering result is then recursively accumulated and output.
[0006] In a preferred embodiment, S1 includes: S11. Obtain the clock edge output by the sampling clock generator in the shared link between the smart sensing system for energy meter testing or calibration and online metering, generate the sampling bit number by incrementing the clock edge, read the voltage sampling value formed by the voltage sampling terminal when each sampling bit number arrives, and read the current sampling value formed by the current sampling terminal latched on the same clock edge, and output the bit number aligned with the sampling string. S12. Based on the sampling string aligned with the position number, take the voltage sampling value corresponding to the current sampling position number and the voltage sampling value corresponding to the next sampling position number as the product. Write the next sampling position number when the product sign is flipped relative to the previous product sign into the power frequency half-cycle boundary table, and write the sampling position numbers between two adjacent power frequency half-cycle boundaries into the same half-cycle position number segment. S13. Read the position number aligned sampling string bit by bit according to the half-cycle position number segment, use the sampling position number as the binding key, write the voltage sampling value corresponding to the binding key into the voltage bit, write the current sampling value corresponding to the binding key into the current bit, write the half-cycle position number segment to which the binding key belongs into the belonging bit, and output the measured electrical variable string.
[0007] In a preferred embodiment, S2 includes: S21. Read the starting boundary number and ending boundary number of this half-cycle according to the power frequency half-cycle boundary table. Subtract the starting boundary number from the ending boundary number and then subtract one to get the number of valid half-cycle numbers. Divide the number of valid half-cycle numbers by the number of original sampling interval numbers and write the quotient as the number of half-cycle samples. Starting from the last bit after the starting boundary, generate the same number of original sampling beats as the number of half-cycle samples by incrementing the number of original sampling interval numbers. Output the half-cycle beat table. S22. Based on the half-cycle clock table, retain the original sampling clock for odd-numbered half-cycles, and add half of the original sampling interval to the original sampling clock to generate the offset sampling clock for even-numbered half-cycles. Write the difference between the sequence number within the half-cycle of the offset sampling clock and the number of samples in the half-cycle as the number of out-of-bounds bits. When the number of out-of-bounds bits is zero, retain the offset sampling clock. When the number of out-of-bounds bits is one, write the bit number after the starting boundary of the next half-cycle into the reset correction bit and output the two-phase clock table. S23. Based on the dual-phase clock meter, drive the electrical measurement link to collect measured electrical variables. Write the measured electrical variables obtained from the original sampling clock into the original phase measured electrical variable string, and write the measured electrical variables obtained from the offset sampling clock into the offset phase measured electrical variable string. When the phase position of the same half-cycle corresponds to two offset sampling clocks, write the mapping sequence number according to the generation order of the offset sampling clocks, retain the measured electrical variables corresponding to the offset sampling clock with the mapping sequence number of one, and output the original phase measured electrical variable string and the offset phase measured electrical variable string.
[0008] In a preferred embodiment, S3 includes: S31. Based on the original phase measurement electrical variable string and the offset phase measurement electrical variable string, read the same sampling bit number, take the sampling bit number as the local operation center, read the adjacent measurement electrical variable on the left and the adjacent measurement electrical variable on the right along the original beat, and read the left mapped measurement electrical variable and the right mapped measurement electrical variable along the offset beat, and output the local bit number segment according to the bit number difference from each measurement electrical variable to the local operation center. S32. Perform local polynomial Fourier transform based on local position segments, write the position difference corresponding to each measured electrical variable into the first phase term, write the result of multiplying the position difference into the second phase term, use the first phase term to cancel the half-sampling interval shift between the original beat and the offset beat, use the second phase term to cancel the bending of the sampling landing point within half a cycle, and output the phase-compensated measured electrical variable string. S33. For the phase compensation measurement electrical variable string, multiply each phase compensation measurement electrical variable by the complex exponent kernel of the corresponding power frequency phase position, and then sum them according to the local operation center to obtain the original local spectrum value and the offset local spectrum value. Output the original local spectrum string and the offset local spectrum string in the order of sampling position number.
[0009] In a preferred embodiment, S4 includes: S41. Based on the two types of local spectrum strings generated by the measured electrical variables and the power frequency half-cycle boundary table, the sampling position number corresponding to the local spectrum value is subtracted from the starting boundary position number of the half-cycle to obtain the position number distance within the half-cycle. The original local spectrum value and the offset local spectrum value are bound by the same position number distance within the half-cycle as a pairing constraint, and the paired spectrum string is output. S42. Perform cross-wavelet coherence operation on the paired spectrum string. Take the position number distance within half a cycle as the wavelet center. Read the paired spectrum values before and after the wavelet center within the same half cycle. Generate the complex mother wavelet scale by sampling the position number of the power frequency cycle. Sum the original local spectrum value and the conjugate value of the complex mother wavelet to generate the original complex wavelet coefficients. Sum the offset local spectrum value and the conjugate value of the same complex mother wavelet to generate the offset complex wavelet coefficients. Output the complex wavelet coefficient string. S43. Based on the complex wavelet coefficient string, multiply the original complex wavelet coefficients by the conjugate value of the offset complex wavelet coefficients to obtain the cross spectrum value. Multiply the squares of the moduli of the two complex wavelet coefficients to obtain the normalized base. When the normalized base is zero, write the zero occupancy value and the zero phase difference. When the normalized base is not zero, divide the square of the cross spectrum value by the normalized base to obtain the coherent occupancy value. Perform four-quadrant arctangent on the imaginary part and real part of the cross spectrum value to obtain the coherent phase difference. Output the coherent phase difference string and the coherent occupancy string according to the pairing index.
[0010] In a preferred embodiment, S5 includes: S51. Read the coherent phase difference corresponding to each pairing index according to the coherent phase difference string, divide the coherent phase difference by the power frequency phase increment corresponding to the unit sampling interval to obtain the displacement grid number, multiply the displacement grid number by the sampling interval to generate the phase displacement amount, and output the phase displacement amount string. S52. Based on the coherent occupancy string, subtract the coherent occupancy value of the current pairing index from the coherent occupancy value of the next pairing index within the same power frequency half-cycle to generate a backward occupancy difference, subtract the coherent occupancy value of the previous pairing index from the coherent occupancy value of the current pairing index to generate a forward occupancy difference, and write the backward occupancy difference symbol and the forward occupancy difference symbol into the occupancy transfer symbol string. S53. Perform tag tracking on the measured electrical variables in the electrical measurement link using the phase displacement string and the occupancy transfer symbol string. Write the pairing index where the phase displacement is half a sampling interval and the backward occupancy difference symbol is consistent with the forward occupancy difference symbol into the aliasing landing string. Write the pairing index where the phase displacement is zero into the power frequency reserved bit string.
[0011] In a preferred embodiment, S6 includes: S61. Read the original complex wavelet coefficients and the offset complex wavelet coefficients under the same paired index according to the aliasing landing string. Write the absolute value of the difference between the original complex wavelet coefficient modulus and the offset complex wavelet coefficient modulus as the moving modulus. Write the sum of the original complex wavelet coefficient modulus and the offset complex wavelet coefficient modulus as the normalized modulus. When the normalized modulus is zero, write the zero deduction share. When the normalized modulus is non-zero, divide the moving modulus by the normalized modulus to get the aliasing deduction share. Output the deduction share string. S62. Based on the deduction share string and the original filter current string, perform the product operation of the original filter current value and the aliasing deduction share on the sampling bit number written into the aliasing landing string to obtain the aliasing current deduction amount. Write the zero deduction amount on the sampling bit number written into the power frequency reserved bit string, and generate the compensation current string by subtracting the aliasing current deduction amount of the same bit number from the original filter current value. S63. Read the voltage measurement variable of the same position number bit by bit according to the compensation current string, multiply the compensation current value and the voltage measurement variable to obtain the instantaneous power value, add the energy accumulation value of the previous sampling position number to the product of the instantaneous power value and the sampling interval to obtain the energy accumulation value of the current sampling position number, and output the metering result after the energy meter error compensation.
[0012] A digital filtering-based error compensation system for electricity meters includes a sampling binding module, a cycle offset module, a spectrum generation module, a coherence calculation module, a tag tracking module, and a compensation accumulation module. The sampling binding module is used to acquire the voltage and current sampling strings formed by the intelligent sensing system sharing the link between the electricity meter test or calibration and online metering within the metering cycle. It performs a sign product on adjacent voltage sampling values, writes the positive and negative flipped tag number of the product into the power frequency half-cycle boundary table, and binds the voltage sampling value and current sampling value with the same tag number into a measurement variable string. The beat offset module is used to collect measured electrical variables according to the original sampling beat in the odd-numbered half-cycles based on the power frequency half-cycle boundary table, and to collect measured electrical variables after moving the original sampling beat half a sampling interval along the half-cycle sampling direction in the even-numbered half-cycles. The sampling beat is reset at the end position, and the original and offset phase measured electrical variable strings are output. The spectrum generation module is used to perform local polynomial Fourier transform on the original and offset phase measurement electrical variable strings. It reads the measured electrical variables before and after the center along the original beat and offset beat with the sampling position number as the center, generates first and second phase compensation quantities according to the position number distance, and outputs two types of local spectrum strings by summing the complex exponential product. The coherent operation module performs cross-wavelet coherent operation based on two types of local spectrum strings. It generates complex wavelet coefficients with the position distance after the half-circle boundary as the pairing index. The cross spectrum value is obtained by conjugate product, and the normalized base value is obtained by modulus square product. The coherent phase difference and occupancy value are generated from the cross spectrum value. The tag tracking module is used to perform tag tracking with coherent phase difference and occupancy value. It writes the position where the phase displacement is half a sampling interval and the adjacent occupancy difference signs are in the same direction into the aliasing landing string, and writes the position where the phase displacement is zero into the power frequency reserved bit string. The compensation accumulation module is used to check the current contribution that moves with the sampling cycle based on the aliasing point string, generate the aliasing current deduction amount by multiplying the complex wavelet coefficient modulus with the original filtered current value, form a compensation current string after deduction, multiply the compensation current string with the voltage measurement variable of the same position number to obtain the instantaneous power string, and recursively accumulate and output the measurement result.
[0013] An electricity meter, comprising: An electricity meter, and a memory connected to the electricity meter; the memory is used to store a computer program; the electricity meter is used to call and execute the computer program in the memory to perform the method.
[0014] The technical effects and advantages of this invention are as follows: This scheme uses half-sampling interval offset and coherent bit tracking to distinguish aliasing components that move with the sampling cycle, thereby compensating for the error caused by high-frequency pulses being folded into low-frequency measurement. By placing test calibration and online metrology in a shared sampling link, two types of phase measurement electrical variable strings are formed, so that the error compensation is based on the same source sampling results, reducing the dependence on external standard sources; Perform beat generation on the power frequency half-cycle boundary table and double tag coordinates to provide tag reference for half-sampling interval offset and reset position, thereby mitigating the impact of mismatched beats on measurement. Introducing first-order and second-order phase terms into the local polynomial Fourier transform allows the sampling phase shift and the bending of the half-cycle sampling point to be incorporated into the calculation, thus improving the identification of aliasing positions. The coherent phase difference and coherent occupancy value are generated by cross-wavelet coherent operation, so that the aliasing point is separated from the power frequency reserved bit, reducing the situation where the real power frequency current is deducted. The original filtered current is corrected based on the aliasing subtraction ratio, and then recursively accumulated with the voltage measurement variable of the same position number to reduce the impact of aliasing current on the metering results. Attached Figure Description
[0015] Figure 1 This is a flowchart outlining the method steps of the present invention; Figure 2 This is a schematic diagram of the system module structure of the present invention. Detailed Implementation
[0016] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.
[0017] Refer to the instruction manual appendix Figure 1-2 The present invention provides a method for compensating for electricity meter errors based on digital filtering, comprising: S1. Obtain the voltage and current sampling strings formed by the intelligent sensing system sharing the link between the electricity meter test or calibration and online metering in the metering cycle. Perform a sign product on adjacent voltage sampling values, write the positive and negative flipped tag number of the product into the power frequency half-cycle boundary table, and bind the voltage sampling value and current sampling value with the same tag number as a measurement electrical variable string. This implementation focuses on the process of forming a measurement variable string in the shared link between the testing or calibration of an electricity meter and online metering. The intelligent sensing system is formed by connecting a voltage sampling terminal, a current sampling terminal, a sampling clock generator, and a sampling interface of the metering chip. The same voltage sampling terminal, the same current sampling terminal, and the same sampling clock generator are read in both the testing or calibration and online metering states. This implementation limits the arrival order of voltage and current sample values through sampling bit numbers, obtains the power frequency half-cycle boundary through the product of voltage signs, and then provides the same power frequency phase reference for subsequent original sampling cycles and offset sampling cycles through the half-cycle bit number segment. This implementation process includes the following steps: S11 is used to establish the corresponding position sequence relationship between voltage and current sample values. The sampling clock generator outputs the first clock edge at the start of the metering cycle. The metering chip sampling interface records the first clock edge as sampling position number one. Subsequently, the sampling position number is incremented by one for each clock edge. When each sampling position number arrives, the voltage sampling terminal output value is first written to the voltage sample value of the current sampling position number, and the current sampling terminal output value latched on the same clock edge is written to the current sample value of the current sampling position number. This forms a position number aligned sampling string with the sampling position number as the sequence key. When the current sampling position number lacks a voltage or current sample value, the current sampling position number is written to the missing sample record, does not participate in the power frequency half-cycle boundary determination, and is reserved in the position number aligned sampling string to ensure that the subsequent sampling position number is still incremented by the clock edge without changing the order of the subsequent sampling position numbers. S12 is used to obtain the power frequency half-cycle boundary table and half-cycle position number segment from the position number aligned sampling string; the metering chip reads the position number aligned sampling string bit by bit, and multiplies the voltage sample value corresponding to the current sampling position with the voltage sample value corresponding to the next sampling position; when the voltage sample value is positive, a positive sign is written; when the voltage sample value is negative, a negative sign is written; when the voltage sample value is zero, a zero sign is written; when the product sign is zero, it is not written to the power frequency half-cycle boundary table, and the chip continues to read the next sampling position until a non-zero product sign appears; the current non-zero product sign changes relative to the previous non-zero product sign. When the positive and negative values flip, the next sampling bit number is written into the power frequency half-cycle boundary table; when multiple positive and negative flipped bit numbers appear near the zero crossing, the metering chip writes the positive and negative flipped bit numbers into the candidate boundary queue in the order of the sampling bit numbers, and uses the bit number interval formed between adjacent candidate boundaries to check whether it can be accepted as a half-cycle bit number segment; positive and negative flipped bit numbers that cannot be accepted as a half-cycle bit number segment are written into the zero-point jitter record and are not entered into the power frequency half-cycle boundary table; the sampling bit numbers between two adjacent power frequency half-cycle boundaries are written into the same half-cycle bit number segment, which is used by S2 to generate the sampling clock of odd-numbered half-cycles and even-numbered half-cycles for reading; S13 is used to convert the tag number aligned sampling string into a measurement electrical variable string for subsequent local multinomial Fourier transform and cross-wavelet coherent operation. The metering chip reads the tag number aligned sampling string bit by bit according to the half-cycle tag number segment, uses the sampling tag number as the binding key, writes the voltage sampling value corresponding to the binding key into the voltage bit, writes the current sampling value corresponding to the binding key into the current bit, writes the half-cycle tag number segment to which the binding key belongs into the belonging bit, and combines the voltage bit, current bit, and belonging bit into the measurement electrical variable. When the binding key corresponds to a missing sampling record, the measurement electrical variable is written with a missing sampling mark. The missing sampling mark does not participate in the S2 sampling cycle acquisition and the S3 local operation segment reading. When the binding key does not fall into any half-cycle tag number segment, the measurement electrical variable is written with the boundary unassigned record. The boundary unassigned record is used for test or calibration status reading and is not written into the original phase measurement electrical variable string and the offset phase measurement electrical variable string. Through this implementation method, the intelligent sensing system organizes the voltage sampling value, current sampling value, sampling tag number and half-cycle affiliation in the shared link between the test or calibration and online metering into the same measurement electrical variable string without changing the connection relationship between the primary power circuit and the sampling terminal. This allows S2 to generate the original sampling cycle and the offset sampling cycle according to the power frequency half-cycle boundary table, and allows S3 to S6 to track the aliasing component and the power frequency retained component along the same sampling tag number. In practical applications: After the energy meter is connected to a transformer substation containing an inverter or charger, the sampling clock generator drives the voltage sampling terminal and the current sampling terminal step by step. The metering chip first forms a sampling string with the tag number aligned, and then writes it into the power frequency half-cycle boundary table according to the zero-crossing position of the voltage sampling value. Subsequently, the voltage sampling value, current sampling value and half-cycle tag number segment under each sampling tag number are written into the measured electrical variable string. When there is a zero value or jitter flip near the zero crossing, the zero value product is not written into the power frequency half-cycle boundary table, and the jitter flip tag number is written into the zero-point jitter record, so that the erroneous boundary does not enter the subsequent half-cycle sampling cycle generation process.
[0018] S2. According to the power frequency half-cycle boundary table, collect the measured electrical variables according to the original sampling beat in the odd-numbered half-cycles, and collect the measured electrical variables after moving the original sampling beat half a sampling interval along the half-cycle sampling direction in the even-numbered half-cycles. At the end, reset the sampling beat and output the original and offset phase measured electrical variable strings. This implementation method generates the original phase measurement electrical variable string and the offset phase measurement electrical variable string based on the power frequency half-cycle boundary table and the measurement electrical variable string output by S1. The processing principle is to first use the power frequency half-cycle boundary table to define the sampling clock position within each power frequency half-cycle, and then use double position coordinates to express half of the original sampling interval within the even-numbered half-cycles. This allows the offset sampling clock to obtain the measurement electrical variable that differs from the original sampling clock by half a sampling interval without changing the electrical measurement link connection relationship. When crossing the power frequency half-cycle boundary, the sampling clock is reset to the starting position of the next half-cycle. This implementation process includes the following steps: S21 is used to generate the original sampling clock from the power frequency half-cycle boundary table, so that the sampling position within each power frequency half-cycle has a boundary source and a tag number source. The metering chip reads the start and end boundary tag numbers of the current half-cycle according to the power frequency half-cycle boundary table, subtracts the start boundary tag number from the end boundary tag number, and then subtracts one to obtain the number of valid tag numbers for the half-cycle. The number of tag numbers for the original sampling interval is written by the sampling clock generator at the sampling clock generation terminal between two adjacent original sampling clocks in the current metering cycle. The metering chip divides the number of valid tag numbers for the half-cycle by the number of tag numbers for the original sampling interval and writes the quotient as the half-cycle. The sample count is recorded, and the remainder of the division is written into the half-cycle remainder record. Then, starting from the bit number after the starting boundary, an original sampling cycle is generated by adding the original sampling interval bit number each time. The generation stops when the number of generation reaches the half-cycle sample count, and the half-cycle sequence number, the half-cycle starting boundary bit number, the half-cycle ending boundary bit number, the half-cycle sample count, and the original sampling cycle are written into the half-cycle cycle table. If the half-cycle starting boundary bit number or the half-cycle ending boundary bit number is missing, the metering chip writes the half-cycle boundary missing record, and no original sampling cycle is generated for this half-cycle. The next power frequency half-cycle continues to be read according to the power frequency half-cycle boundary table. S22 is used to form a two-phase clock table in the half-cycle clock table, so that odd-numbered half-cycles inherit the original sampling clock, and even-numbered half-cycles form an offset sampling clock of half the original sampling interval and complete the end bit reset; the metering chip reads the half-cycle sequence number and the original sampling clock from the half-cycle clock table. For odd-numbered half-cycles, the original sampling clock is directly written into the two-phase clock table; for even-numbered half-cycles, the sampling bit number corresponding to the original sampling clock is multiplied by two to obtain twice the original clock bit number, and then the twice original clock bit number is added to the original sampling interval bit number to obtain twice the offset clock bit number, thereby expressing the original clock. The sampling cycle is shifted by half the original sampling interval along the half-cycle sampling direction. The metering chip subtracts the end boundary number of the current half-cycle from the twice-offset cycle number and multiplies it by two, writing the result as the boundary difference. When the boundary difference is negative, the twice-offset cycle number is written into the two-phase cycle table. When the boundary difference is zero or positive, the twice-offset cycle number is written into the out-of-bounds record, and the number after the start boundary of the next half-cycle is written into the reset correction bit. When the start boundary of the next half-cycle does not exist, the reset missing record is written, and the two-phase cycle table for the current metering cycle is generated at the end of the current half-cycle. S23 is used to obtain two types of phase measurement electrical variable strings based on the dual-phase time meter driving the electrical measurement link, and to handle the half-cycle phase position conflict generated after reset; when the sampling clock generator outputs the original sampling clock according to the dual-phase time meter, the voltage sampling terminal and the current sampling terminal complete latching on the same clock edge, and the metering chip writes the obtained measurement electrical variables into the original phase measurement electrical variable string; when the sampling clock generator outputs the offset sampling clock according to the dual-phase time meter, the voltage sampling terminal and the current sampling terminal complete latching on the offset sampling clock, and the metering chip writes the obtained measurement electrical variables into the offset phase measurement electrical variable string, and subtracts the current half-cycle from the offset clock position number by twice the offset clock position number. The starting boundary position is multiplied by two to obtain the half-cycle phase position. When the reset correction position and the next offset sampling cycle are mapped to the same half-cycle phase position, the metering chip writes the mapping sequence number according to the generation order of the offset sampling cycle into the dual-phase cycle table. The measured electrical variable corresponding to the offset sampling cycle with mapping sequence number one is written into the offset phase measured electrical variable string, and the measured electrical variable corresponding to the offset sampling cycle with mapping sequence number two is written into the repeat mapping record. If the voltage or current sample value is not obtained when the original sampling cycle or the offset sampling cycle arrives, it is written into the cycle missing record. The cycle missing record is not entered into the original phase measured electrical variable string and the offset phase measured electrical variable string. In this implementation, the start boundary number and end boundary number in the power frequency half-cycle boundary table are converted into a half-cycle beat table. The half-cycle beat table is converted into a two-phase beat table carrying the original sampling beat, the offset sampling beat, and the reset correction position. The two-phase beat table then drives the electrical measurement link to output the original phase measurement electrical variable string and the offset phase measurement electrical variable string, so that the subsequent local polynomial Fourier transform can read two types of phase inputs at the same power frequency half-cycle phase position. In practical applications: When the energy meter is connected to a power circuit containing the charger switching pulse, the metering chip first reads the starting and ending boundary numbers of the current half-cycle from the power frequency half-cycle boundary table to generate the original sampling cycle. Then, within the even-numbered half-cycles, it generates the offset sampling cycle through the coordinates of twice the number of points. When the offset sampling cycle falls outside the ending boundary of the current half-cycle, the metering chip writes the last bit of the starting boundary of the next half-cycle into the reset correction bit and handles the half-cycle phase position conflict caused by the reset according to the mapping sequence number, thereby obtaining the original phase measurement electrical variable string and the offset phase measurement electrical variable string for S3 to read.
[0019] S3. Perform local polynomial Fourier transform on the original and offset phase measurement electrical variable strings, map and read the measured electrical variables before and after the center along the original beat and offset beat with the sampling position number as the center, generate first and second phase compensation quantities according to the position number distance, and output two types of local spectrum strings by summing the complex exponential product. This implementation generates two types of local spectrum strings based on the original phase measurement electrical variable string and the offset phase measurement electrical variable string output by S2. The processing principle is to use the sampling position number as the local operation center, obtain the measurement electrical variables near the same power frequency phase from the mapping of the original sampling beat and the offset sampling beat, and then use the position number distance to form the first phase term and the second phase term, so that the translation amount caused by half of the original sampling interval and the bending amount of the sampling landing point within half a cycle enter the local polynomial Fourier transform. In this embodiment, the primary and secondary phase compensation values are generated according to local position segments; the sampling position of the local calculation center is denoted as c, the sampling position of the measured electrical variable is denoted as k, and the difference between k and c is denoted as position difference q; the number of sampling position numbers of the power frequency cycle is denoted as N, and the phase of the integer cycle is divided by N to obtain the power frequency phase increment p corresponding to the unit sampling interval; the primary phase compensation value is obtained by multiplying q by p, which is used to characterize the linear phase offset of the measured electrical variable relative to the local calculation center; the difference between the number of valid position numbers of the current half-cycle and the number of valid position numbers of the previous half-cycle is denoted as half-cycle position difference r, and r is divided by N and then multiplied by p to obtain the bending phase coefficient b; the secondary phase compensation value is obtained by multiplying q by itself and then multiplying by b, which is used to characterize the bending of the sampling landing point caused by the half-cycle boundary drift; the metering chip adds the primary and secondary phase compensation values to obtain the total phase compensation value, generates a complex exponent kernel based on the total phase compensation value, and performs phase compensation on the current position in the measured electrical variable through the complex exponent kernel to form a phase-compensated measured electrical variable string; The implementation process includes the following steps: S31 is used to construct a local position number segment, so that the original phase measurement electrical variable string and the offset phase measurement electrical variable string form a local operation input at the same sampling position number; the metering chip reads the current sampling position number from the original phase measurement electrical variable string and writes the current sampling position number as the local operation center; then, along the original sampling cycle, it reads the adjacent measurement electrical variables located to the left and right of the local operation center, and then along the offset sampling cycle, it maps and reads the mapped measurement electrical variables located to the left and right of the local operation center; the metering chip subtracts the local operation center from the sampling position number of each read measurement electrical variable to obtain the position number difference. The metering chip reads the adjacent measurement variables on the right side within the same half-cycle and generates a left-side filler by taking the opposite number of the tag number difference between the adjacent right-side measurement variables. When the local calculation center is near the half-cycle start boundary and lacks the adjacent right-side measurement variables, the metering chip reads the adjacent left-side measurement variables within the same half-cycle and generates a right-side filler by taking the opposite number of the tag number difference between the adjacent left-side measurement variables. The filler is only written to the local tag number segment and not to the original phase measurement variable string or the offset phase measurement variable string. S32 is used to convert the local position number segment into a phase-compensated measurement electrical variable string, causing the half-sampling interval to shift and the sampling point within half a cycle to bend, thus entering the local polynomial Fourier transform. The metering chip reads the position number difference in the local position number segment, multiplies the position number difference by the power frequency phase increment corresponding to the unit sampling interval to obtain the first phase term. The power frequency phase increment corresponding to the unit sampling interval is obtained by taking the reciprocal of the number of sampled position numbers corresponding to one power frequency cycle and multiplying it by the integer cycle phase. The metering chip multiplies the position number difference by itself, and then multiplies it by the phase increment corresponding to the difference in the number of valid position numbers of adjacent half cycles to obtain the second phase term. The difference in the number of valid position numbers of adjacent half cycles is obtained by taking the reciprocal of the number of sampled position numbers of the current half cycle and multiplying it by the phase increment corresponding to the difference in the number of valid position numbers of the current half cycle. The number is obtained by subtracting the number of valid positions in the first half-cycle from the number of positions. Then, the current position in the measured electrical variable is multiplied by the complex exponent corresponding to the first phase term, and then by the complex exponent corresponding to the second phase term to obtain the phase compensation current value. The phase compensation current value, along with the voltage position, sampling position number, and half-cycle belonging position in the same measured electrical variable, is written as the phase compensation measured electrical variable. When there are missing sampling marks in the local position number segment, the measured electrical variable corresponding to the missing sampling mark does not participate in phase compensation. When all local position number segments are missing sampling marks, the local calculation center writes the local spectrum missing record, and the local polynomial Fourier transform continues to be performed by the next sampling position number. S33 is used to merge the phase compensation measurement electrical variable strings into the original local spectrum string and the offset local spectrum string, for S4 to perform cross-wavelet coherence operation; the metering chip generates the power frequency phase position using the power frequency cycle sampling position number, which is obtained from the sampling position number difference between two adjacent in-direction power frequency half-cycle boundaries; for each local operation center, the metering chip multiplies the phase compensation current value in the phase compensation measurement electrical variable with the complex exponent kernel of the corresponding power frequency phase position, and performs complex summation according to the local operation center to obtain the original local spectrum value; under the same local operation center, the metering chip performs the same complex summation on the phase compensation measurement electrical variable from the offset sampling beat mapping source to obtain the offset local spectrum value; the original local spectrum value and the offset local spectrum value are written in the sampling position order to form the original local spectrum string and the offset local spectrum string respectively; if there is a local spectrum missing record in the local operation center, the original local spectrum string and the offset local spectrum string are written with a spectrum missing mark at the corresponding sampling position, and the spectrum missing mark does not participate in the pairing spectrum string generation of S4; In a set of implementation data, the data structure of the measured electrical variable string includes sampling position number, voltage position, current position, half-cycle sequence number, position distance within half-cycle, source marker, and missing sample marker; the data structures of the original local spectrum string and the offset local spectrum string both include local computation center, half-cycle sequence number, position distance within half-cycle, complex real part, complex imaginary part, and spectrum missing marker; the data structure of the complex wavelet coefficient string includes wavelet center, support position difference, original complex wavelet coefficient real part, original complex wavelet coefficient imaginary part, offset complex wavelet coefficient real part, offset complex wavelet coefficient imaginary part, and support missing marker. Note: The number of sampling positions N in the power frequency cycle is the number of sampling clock edges in each power frequency cycle; the local position segment reading width is the two sampling beats to the left and two sampling beats to the right of the local calculation center; the complex mother wavelet support segment is the three paired spectral values to the left of the wavelet center, the paired spectral value at the wavelet center position, and the three paired spectral values to the right; the power frequency phase increment corresponding to the unit sampling interval is obtained by dividing the integer phase by N; the complex mother wavelet scale is obtained by dividing the support position difference by N; the support position difference is the difference between the position distance within half a cycle of the paired spectral values in the wavelet support segment and the wavelet center. In addition, in a typical waveform containing inverter switching pulses, the power frequency voltage is a sine wave, and the current waveform is formed by the superposition of the power frequency current component and the switching pulse component. The original sampling beat at sampling position n reads the current fluctuation formed after the switching pulse is incorporated into the low-frequency metering interval. After the offset sampling beat is shifted back by half of the original sampling interval, the current fluctuation after the same switching pulse is incorporated is synchronously shifted back in the position distance within half a cycle. The metering chip generates the original local spectrum value and the offset local spectrum value in the local polynomial Fourier transform, and obtains the non-zero coherent phase difference and the occupancy in the same direction in the cross wavelet coherent operation. When the displacement code obtained by the coherent phase difference conversion is half a sampling interval, and the forward occupancy difference sign is consistent with the backward occupancy difference sign, the pairing index is written into the aliasing landing string. The power frequency current component maintains the same half-cycle phase position under the original sampling beat and the offset sampling beat, and the displacement code obtained by the coherent phase difference conversion is zero. The corresponding pairing index is written into the power frequency reserved bit string. In this implementation, the original phase measurement electrical variable string and the offset phase measurement electrical variable string formed by S2 are converted into the original local spectrum string and the offset local spectrum string under the same power frequency phase position. The phase shift caused by half of the original sampling interval is entered into the calculation through the first phase term, and the bending of the sampling point within half a cycle is entered into the calculation through the second phase term, so that S4 can compare the coherent phase difference and coherent occupancy value between the two types of local spectra around the same local calculation center. In practical applications: When the energy meter is connected to a circuit containing inverter switching pulses, S2 has already output the original phase measurement variable string and the offset phase measurement variable string. The metering chip reads the measurement variables near the original sampling beat and the offset sampling beat at each sampling position, generates a first-order phase term and a second-order phase term according to the position difference, and merges the measurement variables after processing by the complex exponential kernel into the original local spectrum value and the offset local spectrum value. If the local calculation center is close to the boundary of the power frequency half-cycle and lacks one side input, the metering chip generates a filler according to the position difference of the other side in the same half-cycle, so that the local polynomial Fourier transform can still provide the local spectrum input of the corresponding sampling position to S4 at the boundary position.
[0020] S4. Perform cross-wavelet coherence operation based on two types of local spectrum strings, generate complex wavelet coefficients with the position distance after the half-circle boundary as the pairing index, obtain cross-spectral values through conjugate product, obtain normalized base values through modulus square product, and generate coherent phase difference and occupancy value from cross-spectral values. This implementation generates a coherent phase difference string and a coherent occupancy string based on the original local spectrum string and the offset local spectrum string output by S3. The processing principle is to first map the two types of local spectrum values to the position distance within the same half-cycle using the power frequency half-cycle boundary table, and then form a complex mother wavelet scale using the number of position numbers sampled in the power frequency cycle. This allows the cross-wavelet coherent operation to complete cross-spectral accumulation and normalized base accumulation within the same wavelet support segment, thereby providing phase and occupancy basis for S5 to identify the aliasing landing point that moves with the sampling beat. The implementation process includes the following steps: S41 is used to bind the original local spectrum value and the offset local spectrum value into a paired spectrum string according to the position number distance within half a cycle. The metering chip reads the original local spectrum string, the offset local spectrum string, and the power frequency half-cycle boundary table. First, it looks up the starting boundary position number of the half-cycle corresponding to the sampling position number of the local spectrum value. Then, it subtracts the starting boundary position number of the half-cycle from the sampling position number of the local spectrum value to obtain the position number distance within half a cycle. When the original local spectrum value and the offset local spectrum value have the same position number distance within half a cycle, the metering chip writes the original local spectrum value to the original spectrum position, writes the offset local spectrum value to the offset spectrum position, and writes the position number distance within half a cycle to the pairing index to form a paired spectrum value and output the paired spectrum string. When there is a spectrum missing mark in the corresponding sampling position of the original local spectrum string or the offset local spectrum string, the corresponding position number distance within half a cycle is written to the paired missing record. The paired missing record is not included in the complex wavelet coefficient generation in S42. S42 is used to generate the original complex wavelet coefficients and the offset complex wavelet coefficients within the paired spectrum string; the metering chip uses the position distance within half a cycle as the wavelet center, reads the paired spectrum values located to the left and right of the wavelet center within the same power frequency half cycle, and writes the read paired spectrum values into the wavelet support segment; the number of sampling position numbers in the power frequency cycle is obtained by the sampling position number difference between the boundaries of two adjacent power frequency half cycles in the same direction, the position distance within half a cycle corresponding to each paired spectrum value in the wavelet support segment is subtracted from the wavelet center to obtain the support position number difference, and the support position number difference is divided by the number of sampling position numbers in the power frequency cycle to obtain the support position number difference. The scaled reference number is input into the complex mother wavelet function to form the complex mother wavelet value. The metrology chip multiplies each original local spectral value within the wavelet support segment with the corresponding complex mother wavelet conjugate value and performs complex summation around the wavelet center to obtain the original complex wavelet coefficients. Each offset local spectral value within the wavelet support segment is multiplied with the same complex mother wavelet conjugate value and performs complex summation around the wavelet center to obtain the offset complex wavelet coefficients. When there are paired missing records in the wavelet support segment, the paired missing records are not included in the complex summation, and a support missing marker is written into the complex wavelet coefficient string. In this embodiment, the complex mother wavelet function is the complex Morlet mother wavelet; the wavelet center is denoted as m, the distance between the position numbers within the half-cycle of the paired spectral values in the wavelet support segment is denoted as h, and the difference between h and m is denoted as the support position number difference s; the number of position numbers sampled in the power frequency cycle is denoted as N, and s is divided by N to obtain the scaled position number x; the complex mother wavelet value is obtained by multiplying the Gaussian envelope term and the complex oscillation term, where the Gaussian envelope term is a natural exponent term with x squared negative half as the exponent, and the complex oscillation term is obtained by multiplying the angular frequency parameter w with x. The product is generated by multiplying the real part of the complex oscillation term by x, and the imaginary part by x. The angular frequency parameter w is taken as 5 to 6 to ensure that the complex mother wavelet forms a stable oscillation support within one power frequency cycle sampling position number. The metering chip writes the real and imaginary parts of the complex mother wavelet value into the real and imaginary parts of the complex mother wavelet, respectively, and performs complex multiplication and complex summation on the original local spectrum value and the offset local spectrum value with the conjugate value of the complex mother wavelet, respectively, to generate the original complex wavelet coefficients and the offset complex wavelet coefficients. S43 is used to generate a coherent phase difference string and a coherent occupancy string from the complex wavelet coefficient string; the metering chip reads the original complex wavelet coefficients and the offset complex wavelet coefficients within the same wavelet support segment, multiplies each original complex wavelet coefficient by the conjugate value of the corresponding offset complex wavelet coefficient, and then performs accumulation to obtain the cross-spectral value; the metering chip performs accumulation on the squared modulus of the original complex wavelet coefficients within the wavelet support segment to obtain the accumulated original modulus square value, and performs accumulation on the squared modulus of the offset complex wavelet coefficients within the wavelet support segment to obtain the accumulated offset modulus square value, and then... Multiply the original modulus squared summation value with the offset modulus squared summation value to obtain the normalized base value; when the normalized base value is zero, the metering chip writes the zero occupancy value, zero phase difference and invalid coherence flag. The invalid coherence flag is read by S5 and not written into the aliasing landing point string and the power frequency reserved bit string; when the normalized base value is not zero, the metering chip divides the cross spectrum value modulus squared by the normalized base value to obtain the coherent occupancy value, and performs four-quadrant arctangent with the imaginary part and real part of the cross spectrum value to obtain the coherent phase difference. The coherent phase difference string and the coherent occupancy string are output according to the pairing index. In this implementation, the original local spectrum string and the offset local spectrum string are first limited to the position distance within the same half-cycle, and then complex wavelet coefficients are generated at the complex mother wavelet scale. Subsequently, the coherent phase difference and coherent occupancy value are formed by cross-spectral accumulation and modulus square accumulation within the wavelet support segment, so that S5 can read the phase displacement and occupancy transfer symbol corresponding to the pairing index. In practical applications: After the energy meter is connected to a circuit containing inverter switching pulses, the original local spectrum value and the offset local spectrum value output by S3 are bound as paired spectrum values at the same position number distance within the same half-cycle. The metering chip then generates a complex mother wavelet scale by sampling the position number at the power frequency cycle, and performs cross-wavelet coherence operation on the paired spectrum values on both sides of the wavelet center. When the normalized base is zero, the metering chip writes an invalid coherence flag and causes S5 to skip the corresponding paired index. When the normalized base is not zero, the metering chip outputs the coherent phase difference and coherent occupancy value for S5 to determine the aliasing landing point and the power frequency reserved bit.
[0021] S5. Perform position tracking with coherent phase difference and occupancy value. Write the positions where the phase displacement is half a sampling interval and the adjacent occupancy difference signs are in the same direction into the aliasing landing string, and write the positions where the phase displacement is zero into the power frequency reserved bit string. This implementation generates an aliasing drop point string and a power frequency reserved bit string based on the coherent phase difference string and coherent occupancy string output by S4. The processing principle is to first convert the coherent phase difference into a sampling clock displacement, then verify the displacement source using the transmission direction of the coherent occupancy value between adjacent paired indices, and then write the paired indices that move with half a sampling interval into the aliasing drop point string, and write the paired indices that have not experienced sampling clock displacement into the power frequency reserved bit string. This implementation process includes the following steps: S51 is used to convert the coherent phase difference into the number of displacement grids and the phase displacement amount, so that the phase result output by S4 is converted into the tag tracking amount at the sampling cycle level. The metering chip reads the coherent phase difference corresponding to each pairing index according to the coherent phase difference string, and reads the invalid coherent flag written by S4. Pairing indices with invalid coherent flags are written into invalid tracking records and are not entered into the phase displacement amount string. The power frequency phase increment corresponding to the unit sampling interval is obtained by taking the reciprocal of the number of sampling tags in the power frequency cycle and multiplying it by the integer phase. The metering chip divides the coherent phase difference by the power frequency phase increment corresponding to the unit sampling interval to obtain the number of displacement grids, then multiplies the number of displacement grids by the sampling interval to generate the phase displacement amount, and multiplies the number of displacement grids by two to obtain the double displacement code. When the double displacement code is one, it means that the phase displacement amount corresponds to half a sampling interval. When the double displacement code is zero, it means that the phase displacement amount is zero. The other double displacement codes are written into the displacement unclassified record and the phase displacement amount string is output. S52 is used to obtain the transmission direction of the coherent occupancy value within half a cycle, enabling S53 to distinguish between aliasing components and stationary components that move with the sampling cycle. Based on the coherent occupancy string, the metering chip reads the coherent occupancy values corresponding to the next paired index, the current paired index, and the previous paired index within the same power frequency half-cycle. The coherent occupancy value of the next paired index is subtracted from the coherent occupancy value of the current paired index to generate a backward occupancy difference, and the coherent occupancy value of the current paired index is subtracted from the coherent occupancy value of the previous paired index to generate a forward occupancy difference; backward occupancy... A positive difference is written with a positive backward sign; a negative backward occupancy difference is written with a negative backward sign; and a zero backward occupancy difference is written with a zero backward sign. A positive forward occupancy difference is written with a positive forward sign; a negative forward occupancy difference is written with a negative forward sign; and a zero forward occupancy difference is written with a zero forward sign. When both a positive backward sign and a positive forward sign, or both a negative backward sign and a negative forward sign, appear simultaneously, the metering chip writes a same-direction pass bit. When any occupancy difference sign is zero, the metering chip writes a stall pass bit and outputs an occupancy pass symbol string. S53 is used to convert the phase displacement string and the occupancy transfer symbol string into the aliasing landing string and the power frequency reserved bit string read by S6. The metering chip uses the pairing index as the read key and reads the double displacement code in the phase displacement string and the transfer bit in the occupancy transfer symbol string at the same time. When the double displacement code is one and the corresponding pairing index is written to the same direction transfer bit, the metering chip writes the pairing index, the position number distance within half a cycle and the corresponding measured electrical variable sampling position number into the aliasing landing string. When the double displacement code is zero and the corresponding pairing index is not written to the invalid tracking record, the metering chip writes the pairing index, the position number distance within half a cycle and the corresponding measured electrical variable sampling position number into the power frequency reserved bit string. The pairing index with a double displacement code that is neither one nor zero is written to the unclassified bit string, and the pairing index with a stagnation transfer bit is written to the stagnation record. The unclassified bit string and the stagnation record do not participate in the aliasing current deduction of S6. In this implementation, the coherent phase difference string is converted into a phase displacement string with double displacement encoding, and the coherent occupancy string is converted into an occupancy transmission symbol string. Subsequently, the double displacement encoding and the occupancy transmission symbol jointly determine the writing results of the aliasing landing string and the power frequency reserved bit string, so that S6 can read the aliasing current deduction basis and the power frequency current retention basis according to the sampling bit number. In practical applications: After the energy meter is connected to a circuit containing charger pulses, S4 outputs the coherent phase difference and coherent occupancy value under the same paired index. The metering chip first converts the coherent phase difference into a double displacement code, and then writes the difference sign of the coherent occupancy value between the previous paired index, the current paired index, and the next paired index into the occupancy transmission symbol string. When the double displacement code is one and the occupancy transmission symbol shows the same direction of transmission, the corresponding measured electrical variable sampling bit number is written into the aliasing landing point string. When the double displacement code is zero, the corresponding measured electrical variable sampling bit number is written into the power frequency reserved bit string.
[0022] S6. Based on the current contribution of the aliasing point string moving with the sampling cycle, generate the aliasing current deduction amount by multiplying the complex wavelet coefficient modulus with the original filtered current value. After deduction, a compensation current string is formed. Multiply the compensation current string with the voltage measurement variable of the same position number to obtain the instantaneous power string. Recursively accumulate and output the measurement result. This implementation generates a compensation current string based on the aliasing landing point string and the power frequency reserved bit string output by S5, and converts the compensation current string into the metering result after the energy meter error compensation. The processing principle is to first generate an aliasing deduction share by using the difference in modulus between the original complex wavelet coefficients and the offset complex wavelet coefficients under the same paired index, and then apply the aliasing deduction share to the original filtered current value so that the current contribution moving with the sampling cycle is deducted from the original filtered current string. Subsequently, the instantaneous power value is generated by measuring the electrical variable with the same position number voltage and recursively forming the accumulated energy value. The original filtered current string is generated from the current bits in the original phase measurement electrical variable string. The metering chip reads the original phase measurement electrical variable string in the order of sampling position number, records the current sampling position number as n, and writes the current bits corresponding to the current sampling position number and its adjacent sampling positions into the filtering window. Each current bit in the filtering window is multiplied by a preset filtering weight and then summed to obtain the original filtered current value corresponding to the current sampling position number n, and then written into the original filtered current string in the order of sampling position number. The preset filtering weight is given by the current digital filtering unit used for online metering of the energy meter, and the sum of all preset filtering weights is 1. When there is a missing sampling mark in the filtering window, the current bit corresponding to the missing sampling mark is not included in the summation, and is re-normalized according to the preset filtering weight corresponding to the remaining current bits to generate the original filtered current value of the current sampling position number. The original filtered current string and the original phase measurement electrical variable string maintain the same sampling position number index, so that S62 can perform aliasing current deduction according to the sampling position number in the aliasing point string. The implementation process includes the following steps: S61 is used to convert the aliasing point string into a subtraction share string, enabling S62 to obtain the aliasing current subtraction amount according to the sampling bit number. The metering chip reads the pairing index corresponding to each aliasing point according to the aliasing point string, and reads the original complex wavelet coefficients and offset complex wavelet coefficients under the same pairing index from the complex wavelet coefficient string output by S4. The metering chip performs square root extraction on the sum of the squares of the real and imaginary parts of the original complex wavelet coefficients to obtain the original complex wavelet coefficient modulus, and performs square root extraction on the sum of the squares of the real and imaginary parts of the offset complex wavelet coefficients to obtain the offset complex wavelet coefficient modulus. Then, the original complex wavelet coefficient modulus is subtracted. The absolute value of the difference obtained from the offset complex wavelet coefficient magnitude is written as the moving magnitude. The original complex wavelet coefficient magnitude is added to the offset complex wavelet coefficient magnitude and written as the normalized magnitude. When the normalized magnitude is zero, the metering chip writes a zero deduction share and a deduction invalid record to the corresponding pairing index. When the normalized magnitude is non-zero, the metering chip divides the moving magnitude by the normalized magnitude to obtain the aliasing deduction share and outputs the deduction share string according to the pairing index. When there is a pairing index corresponding to an invalid tracking record, an unclassified bit string record, or a stagnant record in the aliasing landing string, a zero deduction share is written to the corresponding pairing index and it does not participate in the generation of aliasing current deduction. S62 is used to apply the deduction share string to the original filtered current string to form the compensation current value corresponding to each sampling bit number. The original filtered current string is formed by the current bits in the original phase measurement electrical variable string through the digital filtering unit of the metering chip. The digital filtering unit is the same as the current digital filtering path used in the online metering of the energy meter. The original filtered current string corresponds one-to-one with the original phase measurement electrical variable string according to the sampling bit number. The metering chip reads the deduction share string and the original filtered current string. For the sampling bit number written into the aliasing landing string, the original filtered current value of the same bit number is multiplied by the aliasing deduction share to obtain the aliasing current deduction amount. The sampling bit number written into the power frequency reserved bit string is written with a zero deduction amount. The sampling bit number written into the unclassified bit string, the stagnant record, or the invalid deduction record is written with a zero deduction amount and an abnormal reserved record. Then the metering chip subtracts the aliasing current deduction amount of the same bit number from the original filtered current value to obtain the compensation current value, and outputs the compensation current string according to the sampling bit number. S63 is used to convert the compensation current string into an energy accumulation result, so that the current contribution after error compensation enters the energy meter's metering output; the metering chip reads the voltage measurement variable with the same position number bit by bit according to the compensation current string. The voltage measurement variable is formed by the voltage bit in the measurement variable string through the same voltage digital filtering path as online metering; the metering chip multiplies the compensation current value with the voltage measurement variable with the same position number to obtain the instantaneous power value; the sampling interval is obtained by the time length between two adjacent original sampling beats at the sampling clock generator. Offset sampling beats only change the sampling time position and do not change the sampling interval; the energy accumulation value of the previous sampling position number of the first sampling position number of the metering round is read as the energy accumulation value of the last position of the previous metering round, and the energy accumulation value of the previous sampling position number of the test or calibration starting round is written as zero; the metering chip adds the energy accumulation value of the previous sampling position number to the product of the instantaneous power value and the sampling interval to obtain the energy accumulation value of the current sampling position number, and outputs the metering result after energy meter error compensation according to the sampling position number; In this implementation, the evidence of sampling beat movement in the aliasing landing point string is converted into a subtraction share string. The subtraction share string is further applied to the original filtered current string to generate a compensation current string. The compensation current string is multiplied with the voltage measurement electrical variable of the same position number and then enters the energy accumulation process, so that the contribution of aliasing current that moves with the sampling beat is no longer used as the power frequency metering current in the metering result. In practical applications: After the energy meter is connected to a circuit containing inverter switching pulses, S5 writes the pairing index, which moves with half a sampling interval, into the aliasing landing point string. In S6, the metering chip reads the original complex wavelet coefficients and offset complex wavelet coefficients under the same pairing index, first calculates the aliasing deduction share, and then deducts the aliasing current deduction amount from the original filtered current value according to the sampling position number. For the sampling position number corresponding to the power frequency reserved bit string, unclassified bit string, and stagnant record, the metering chip writes the zero deduction amount and retains the original filtered current value. Then, it multiplies the compensation current value with the voltage measurement variable of the same position number and recursively accumulates it according to the sampling interval to form the metering result after energy meter error compensation.
[0023] Furthermore, the present invention also includes an energy meter error compensation system based on digital filtering, the system comprising a sampling binding module, a clock offset module, a spectrum generation module, a coherence calculation module, a tag tracking module, and a compensation accumulation module: The sampling binding module is used to acquire the voltage and current sampling strings formed by the intelligent sensing system sharing the link between the electricity meter test or calibration and online metering within the metering cycle. It performs a sign product on adjacent voltage sampling values, writes the positive and negative flipped tag number of the product into the power frequency half-cycle boundary table, and binds the voltage sampling value and current sampling value with the same tag number into a measurement variable string. The beat offset module is used to collect measured electrical variables according to the original sampling beat in the odd-numbered half-cycles based on the power frequency half-cycle boundary table, and to collect measured electrical variables after moving the original sampling beat half a sampling interval along the half-cycle sampling direction in the even-numbered half-cycles. The sampling beat is reset at the end position, and the original and offset phase measured electrical variable strings are output. The spectrum generation module is used to perform local polynomial Fourier transform on the original and offset phase measurement electrical variable strings. It reads the measured electrical variables before and after the center along the original beat and offset beat with the sampling position number as the center, generates first and second phase compensation quantities according to the position number distance, and outputs two types of local spectrum strings by summing the complex exponential product. The coherent operation module performs cross-wavelet coherent operation based on two types of local spectrum strings. It generates complex wavelet coefficients with the position distance after the half-circle boundary as the pairing index. The cross spectrum value is obtained by conjugate product, and the normalized base value is obtained by modulus square product. The coherent phase difference and occupancy value are generated from the cross spectrum value. The tag tracking module is used to perform tag tracking with coherent phase difference and occupancy value. It writes the position where the phase displacement is half a sampling interval and the adjacent occupancy difference signs are in the same direction into the aliasing landing string, and writes the position where the phase displacement is zero into the power frequency reserved bit string. The compensation accumulation module is used to check the current contribution that moves with the sampling cycle based on the aliasing point string, generate the aliasing current deduction amount by multiplying the complex wavelet coefficient modulus with the original filtered current value, form a compensation current string after deduction, multiply the compensation current string with the voltage measurement variable of the same position number to obtain the instantaneous power string, and recursively accumulate and output the measurement result.
[0024] An electricity meter, comprising: An electricity meter, and a memory connected to the electricity meter; the memory is used to store a computer program; the electricity meter is used to call and execute the computer program in the memory to perform the method.
[0025] Working Principle: This scheme first uses an intelligent sensing system in the shared link between the electricity meter testing or calibration and online metering to collect voltage and current sampling strings. The positive and negative reversals of the voltage sampling values determine the power frequency half-cycle boundary, and the voltage and current sampling values under the same sampling position are bound as a measurement variable string. Then, sampling is performed according to the original sampling cycle in odd-numbered half-cycles, and in even-numbered half-cycles, the sampling cycle is shifted by half a sampling interval before sampling, forming the original phase measurement variable string and the offset phase measurement variable string. Next, two types of local spectrum strings are obtained through local polynomial Fourier transform, and the phase difference and occupancy change of the two types of spectra at the same half-cycle position are compared through cross-wavelet coherence operation, thereby identifying the aliasing points that shift with the sampling cycle and the power frequency reserved positions that do not shift with the sampling cycle. Finally, the aliasing current deduction is calculated based on the aliasing points, subtracted from the original filtered current to obtain the compensation current string, which is then multiplied by the voltage measurement variable at the same position and recursively accumulated to output the compensated metering result. At power consumption sites where distributed photovoltaic inverters, electric vehicle chargers, or frequency converters are connected, high-frequency switching pulses are folded into the low-frequency metering range due to the sampling point limitation of the electricity meter, appearing as actual load changes. When using this solution, the electricity meter does not need to change the primary circuit or connect an external standard source. Instead, it allows adjacent half-cycles to form the original sampling and half-interval offset sampling in its own sampling link. The actual power frequency consumption remains basically unchanged under the two sampling cycles, while the fluctuations caused by high-frequency pulse aliasing move with the sampling cycle. Based on this, the electricity meter identifies the moving part as an aliasing contribution and deducts it from the current measurement, while retaining the non-moving part as the actual power frequency current. Thus, even when there is pulse interference from inverters or chargers, the electricity meter can still obtain compensated electricity metering results.
[0026] The above description is merely 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 within the protection scope of the present invention.
Claims
1. A method for compensating for energy meter errors based on digital filtering, characterized in that, include: S1. Obtain the voltage and current sampling strings formed by the intelligent sensing system sharing the link between the electricity meter test or calibration and online metering in the metering cycle. Perform a sign product on adjacent voltage sampling values, write the positive and negative flipped tag number of the product into the power frequency half-cycle boundary table, and bind the voltage sampling value and current sampling value with the same tag number as a measurement electrical variable string. S2. According to the power frequency half-cycle boundary table, collect the measured electrical variables according to the original sampling beat in the odd-numbered half-cycles, and collect the measured electrical variables after moving the original sampling beat half a sampling interval along the half-cycle sampling direction in the even-numbered half-cycles. At the end, reset the sampling beat and output the original and offset phase measured electrical variable strings. S3. Perform local polynomial Fourier transform on the original and offset phase measurement electrical variable strings, map and read the measured electrical variables before and after the center along the original beat and offset beat with the sampling position number as the center, generate first and second phase compensation quantities according to the position number distance, and output two types of local spectrum strings by summing the complex exponential product. S4. Perform cross-wavelet coherence operation based on two types of local spectrum strings, generate complex wavelet coefficients with the position distance after the half-circle boundary as the pairing index, obtain cross-spectral values through conjugate product, obtain normalized base values through modulus square product, and generate coherent phase difference and occupancy value from cross-spectral values. S5. Perform bit tracking using coherent phase difference and occupancy value. Write positions with phase displacement of half a sampling interval and adjacent occupancy difference signs in the same direction into the aliasing landing string, and write positions with phase displacement of zero into the power frequency reserved bit string.
2. The method for compensating for energy meter errors based on digital filtering according to claim 1, characterized in that: Also includes: S6. Based on the current contribution of the aliasing point string moving with the sampling cycle, the aliasing current deduction amount is generated by multiplying the complex wavelet coefficient modulus with the original filtered current value. After deduction, a compensation current string is formed. The compensation current string is multiplied with the voltage measurement variable of the same position number to obtain the instantaneous power string. The metering result is then recursively accumulated and output.
3. The method for compensating for energy meter errors based on digital filtering according to claim 2, characterized in that, S1 includes: S11. Obtain the clock edge output by the sampling clock generator in the shared link between the smart sensing system for energy meter testing or calibration and online metering, generate the sampling bit number by incrementing the clock edge, read the voltage sampling value formed by the voltage sampling terminal when each sampling bit number arrives, and read the current sampling value formed by the current sampling terminal latched on the same clock edge, and output the bit number aligned with the sampling string. S12. Based on the sampling string aligned with the position number, take the voltage sampling value corresponding to the current sampling position number and the voltage sampling value corresponding to the next sampling position number as the product. Write the next sampling position number when the product sign is flipped relative to the previous product sign into the power frequency half-cycle boundary table, and write the sampling position numbers between two adjacent power frequency half-cycle boundaries into the same half-cycle position number segment. S13. Read the position number aligned sampling string bit by bit according to the half-cycle position number segment, use the sampling position number as the binding key, write the voltage sampling value corresponding to the binding key into the voltage bit, write the current sampling value corresponding to the binding key into the current bit, write the half-cycle position number segment to which the binding key belongs into the belonging bit, and output the measured electrical variable string.
4. The method for compensating for energy meter errors based on digital filtering according to claim 3, characterized in that, S2 includes: S21. Read the starting boundary number and ending boundary number of this half-cycle according to the power frequency half-cycle boundary table. Subtract the starting boundary number from the ending boundary number and then subtract one to get the number of valid half-cycle numbers. Divide the number of valid half-cycle numbers by the number of original sampling interval numbers and write the quotient as the number of half-cycle samples. Starting from the last bit after the starting boundary, generate the same number of original sampling beats as the number of half-cycle samples by incrementing the number of original sampling interval numbers. Output the half-cycle beat table. S22. Based on the half-cycle clock table, retain the original sampling clock for odd-numbered half-cycles, and add half of the original sampling interval to the original sampling clock to generate the offset sampling clock for even-numbered half-cycles. Write the difference between the sequence number within the half-cycle of the offset sampling clock and the number of samples in the half-cycle as the number of out-of-bounds bits. When the number of out-of-bounds bits is zero, retain the offset sampling clock. When the number of out-of-bounds bits is one, write the bit number after the starting boundary of the next half-cycle into the reset correction bit and output the two-phase clock table. S23. Based on the dual-phase clock meter, drive the electrical measurement link to collect measured electrical variables. Write the measured electrical variables obtained from the original sampling clock into the original phase measured electrical variable string, and write the measured electrical variables obtained from the offset sampling clock into the offset phase measured electrical variable string. When the phase position of the same half-cycle corresponds to two offset sampling clocks, write the mapping sequence number according to the generation order of the offset sampling clocks, retain the measured electrical variables corresponding to the offset sampling clock with the mapping sequence number of one, and output the original phase measured electrical variable string and the offset phase measured electrical variable string.
5. The method for compensating for energy meter errors based on digital filtering according to claim 4, characterized in that, S3 includes: S31. Based on the original phase measurement electrical variable string and the offset phase measurement electrical variable string, read the same sampling bit number, take the sampling bit number as the local operation center, read the adjacent measurement electrical variable on the left and the adjacent measurement electrical variable on the right along the original beat, and read the left mapped measurement electrical variable and the right mapped measurement electrical variable along the offset beat, and output the local bit number segment according to the bit number difference from each measurement electrical variable to the local operation center. S32. Perform local polynomial Fourier transform based on local position segments, write the position difference corresponding to each measured electrical variable into the first phase term, write the result of multiplying the position difference into the second phase term, use the first phase term to cancel the half-sampling interval shift between the original beat and the offset beat, use the second phase term to cancel the bending of the sampling landing point within half a cycle, and output the phase-compensated measured electrical variable string. S33. For the phase compensation measurement electrical variable string, multiply each phase compensation measurement electrical variable by the complex exponent kernel of the corresponding power frequency phase position, and then sum them according to the local operation center to obtain the original local spectrum value and the offset local spectrum value. Output the original local spectrum string and the offset local spectrum string in the order of sampling position number.
6. The method for compensating for energy meter errors based on digital filtering according to claim 5, characterized in that, S4 includes: S41. Based on the two types of local spectrum strings generated by the measured electrical variables and the power frequency half-cycle boundary table, the sampling position number corresponding to the local spectrum value is subtracted from the starting boundary position number of the half-cycle to obtain the position number distance within the half-cycle. The original local spectrum value and the offset local spectrum value are bound by the same position number distance within the half-cycle as a pairing constraint, and the paired spectrum string is output. S42. Perform cross-wavelet coherence operation on the paired spectrum string. Take the position number distance within half a cycle as the wavelet center. Read the paired spectrum values before and after the wavelet center within the same half cycle. Generate the complex mother wavelet scale by sampling the position number of the power frequency cycle. Sum the original local spectrum value and the conjugate value of the complex mother wavelet to generate the original complex wavelet coefficients. Sum the offset local spectrum value and the conjugate value of the same complex mother wavelet to generate the offset complex wavelet coefficients. Output the complex wavelet coefficient string. S43. Based on the complex wavelet coefficient string, multiply the original complex wavelet coefficients by the conjugate value of the offset complex wavelet coefficients to obtain the cross spectrum value. Multiply the squares of the moduli of the two complex wavelet coefficients to obtain the normalized base. When the normalized base is zero, write the zero occupancy value and the zero phase difference. When the normalized base is not zero, divide the square of the cross spectrum value by the normalized base to obtain the coherent occupancy value. Perform four-quadrant arctangent on the imaginary part and real part of the cross spectrum value to obtain the coherent phase difference. Output the coherent phase difference string and the coherent occupancy string according to the pairing index.
7. The method for compensating for energy meter errors based on digital filtering according to claim 6, characterized in that, S5 includes: S51. Read the coherent phase difference corresponding to each pairing index according to the coherent phase difference string, divide the coherent phase difference by the power frequency phase increment corresponding to the unit sampling interval to obtain the displacement grid number, multiply the displacement grid number by the sampling interval to generate the phase displacement amount, and output the phase displacement amount string. S52. Based on the coherent occupancy string, subtract the coherent occupancy value of the current pairing index from the coherent occupancy value of the next pairing index within the same power frequency half-cycle to generate a backward occupancy difference, subtract the coherent occupancy value of the previous pairing index from the coherent occupancy value of the current pairing index to generate a forward occupancy difference, and write the backward occupancy difference symbol and the forward occupancy difference symbol into the occupancy transfer symbol string. S53. Perform tag tracking on the measured electrical variables in the electrical measurement link using the phase displacement string and the occupancy transfer symbol string. Write the pairing index where the phase displacement is half a sampling interval and the backward occupancy difference symbol is consistent with the forward occupancy difference symbol into the aliasing landing string. Write the pairing index where the phase displacement is zero into the power frequency reserved bit string.
8. The method for compensating for energy meter errors based on digital filtering according to claim 7, characterized in that, S6 includes: S61. Read the original complex wavelet coefficients and the offset complex wavelet coefficients under the same paired index according to the aliasing landing string. Write the absolute value of the difference between the original complex wavelet coefficient modulus and the offset complex wavelet coefficient modulus as the moving modulus. Write the sum of the original complex wavelet coefficient modulus and the offset complex wavelet coefficient modulus as the normalized modulus. When the normalized modulus is zero, write the zero deduction share. When the normalized modulus is non-zero, divide the moving modulus by the normalized modulus to get the aliasing deduction share. Output the deduction share string. S62. Based on the deduction share string and the original filter current string, perform the product operation of the original filter current value and the aliasing deduction share on the sampling bit number written into the aliasing landing string to obtain the aliasing current deduction amount. Write the zero deduction amount on the sampling bit number written into the power frequency reserved bit string, and generate the compensation current string by subtracting the aliasing current deduction amount of the same bit number from the original filter current value. S63. Read the voltage measurement variable of the same position number bit by bit according to the compensation current string, multiply the compensation current value and the voltage measurement variable to obtain the instantaneous power value, add the energy accumulation value of the previous sampling position number to the product of the instantaneous power value and the sampling interval to obtain the energy accumulation value of the current sampling position number, and output the metering result after the energy meter error compensation.
9. A digital filtering-based energy meter error compensation system, used to implement the digital filtering-based energy meter error compensation method according to any one of claims 1-8, the system comprising a sampling binding module, a clock offset module, a spectrum generation module, a coherence calculation module, a tag tracking module, and a compensation accumulation module, characterized in that: The sampling binding module is used to acquire the voltage and current sampling strings formed by the intelligent sensing system sharing the link between the electricity meter test or calibration and online metering within the metering cycle. It performs a sign product on adjacent voltage sampling values, writes the positive and negative flipped tag number of the product into the power frequency half-cycle boundary table, and binds the voltage sampling value and current sampling value with the same tag number into a measurement variable string. The beat offset module is used to collect measured electrical variables according to the original sampling beat in the odd-numbered half-cycles based on the power frequency half-cycle boundary table, and to collect measured electrical variables after moving the original sampling beat half a sampling interval along the half-cycle sampling direction in the even-numbered half-cycles. The sampling beat is reset at the end position, and the original and offset phase measured electrical variable strings are output. The spectrum generation module is used to perform local polynomial Fourier transform on the original and offset phase measurement electrical variable strings. It reads the measured electrical variables before and after the center along the original beat and offset beat with the sampling position number as the center, generates first and second phase compensation quantities according to the position number distance, and outputs two types of local spectrum strings by summing the complex exponential product. The coherent operation module performs cross-wavelet coherent operation based on two types of local spectrum strings. It generates complex wavelet coefficients with the position distance after the half-circle boundary as the pairing index. The cross spectrum value is obtained by conjugate product, and the normalized base value is obtained by modulus square product. The coherent phase difference and occupancy value are generated from the cross spectrum value. The tag tracking module is used to perform tag tracking with coherent phase difference and occupancy value. It writes the position where the phase displacement is half a sampling interval and the adjacent occupancy difference signs are in the same direction into the aliasing landing string, and writes the position where the phase displacement is zero into the power frequency reserved bit string. The compensation accumulation module is used to check the current contribution that moves with the sampling cycle based on the aliasing point string, generate the aliasing current deduction amount by multiplying the complex wavelet coefficient modulus with the original filtered current value, form a compensation current string after deduction, multiply the compensation current string with the voltage measurement variable of the same position number to obtain the instantaneous power string, and recursively accumulate and output the measurement result.
10. An electricity meter, comprising an electricity meter error compensation system based on digital filtering as described in claim 9, characterized in that: An electricity meter, and a memory connected to the electricity meter; the memory is used to store a computer program; the electricity meter is used to call and execute the computer program in the memory to perform the method as claimed in any one of claims 1-8.
