A fundamental wave and harmonic wave combined metering method and system for an electric energy meter and the electric energy meter

CN122901760APending Publication Date: 2026-10-13MIDDLE SOUTH METER
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611142612.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-30
Publication Date
2026-10-13

AI Technical Summary

Technical Problem

[0003]传统基波谐波联合计量以采样时钟、工频周期、分量提取及分次功率累计作为主要运作基础,电压通道与电流通道在硬件链路、互感器响应、采样保持和转换时序方面可能存在微小延迟,若仅按统一采样序列参与运算,通道间真实对应关系难以在每个触发点上被直接校验,轻载低功率因数或畸变负荷场景中,微小相位偏移容易放大为有功功率偏差;同时,按工频周期划分计量窗口时,电网频率波动、过零点抖动、非整周期采样会使窗口边界与真实基波相位产生偏离,离散傅里叶类处理虽可提取分量,但分量提取对窗口完整性和相位一致性依赖较高;谐波含量较高时,电压电流波形峰值数量和位置可能与理想正弦波明显不同,单纯依赖固定阶次或固定窗口统计,容易出现基波能量与谐波能量归属边界不清

Benefits of technology

本发明中,通过比较同一触发脉冲下电压电流采样时间戳,形成同步采样点序列,降低通道延迟与采样抖动影响,按电压过零点换算基波相位坐标,提升频率波动下窗口定位精度,比较峰值点数与谐波阶次划分基波谐波序列,并按相位角差值配准乘积点对,减少跨窗泄漏和分次电能归属偏差,使同窗能量累计更准确、可追溯性更强。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122901760A_ABST
    Figure CN122901760A_ABST
Patent Text Reader

Abstract

The present application relates to the technical field of electric power metering detection, in particular to a kind of electric energy meter fundamental wave harmonic joint metering method, system and electric energy meter, comprising the following steps: acquisition voltage current digital sampling value, compare with the same impulse timestamp to form synchronous sampling point sequence, according to voltage zero-crossing point conversion fundamental wave phase coordinates, compare peak point number with harmonic order division fundamental wave and harmonic sequence, correct current phase, accumulate voltage current product to establish same window electric energy record.In the present application, by comparing the voltage current sampling timestamp under the same trigger pulse, the synchronous sampling point sequence is formed, the influence of channel delay and sampling jitter is reduced, the fundamental wave phase coordinates are converted according to the voltage zero-crossing point, the window positioning accuracy under frequency fluctuation is improved, the fundamental wave harmonic sequence is divided by comparing the peak point number with the harmonic order, and the product point pairs are matched according to the phase angle difference value, the cross-window leakage and the partial energy attribution deviation are reduced, so that the same window energy accumulation is more accurate and the traceability is stronger.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of power metering and testing technology, and in particular to a method, system, and meter for combined fundamental and harmonic metering of electricity. Background Technology

[0002] The field of power metering and testing technology refers to the technical field of measuring, verifying, recording, and analyzing parameters such as voltage, current, power, electrical energy, power quality, and the operating status of electricity meters. It includes voltage and current sampling, power calculation, electrical energy accumulation, metering error verification, harmonic component identification, metering data storage, and comparison of test results. Voltage and current sampling values ​​are obtained using current transformers or sampling circuits. The sampling sequence is determined by a sampling clock. The metering window is divided according to the power frequency cycle. The root mean square value, phase, active power, reactive power, and fractional electrical energy are calculated for the discrete voltage and current values ​​within the window. The metering results are compared according to the verification procedures or calibration data. The traditional method of fundamental and harmonic joint metering of electricity meters refers to the method for recording fundamental and harmonic electrical energy in the power grid, which exist separately and need to be recorded within the same metering period. It is based on voltage sampling value, current sampling value, sampling frequency, fundamental frequency, metering period, harmonic number, fundamental voltage and current components, harmonic voltage and current components, active power components, and accumulated electrical energy value. It is accomplished through synchronous voltage and current sampling, determination of fundamental period, discrete Fourier calculation, extraction of fundamental components, extraction of harmonic components, calculation of active power in stages, accumulation of fundamental electrical energy, accumulation of harmonic electrical energy, and storage of metering data.

[0003] Traditional fundamental and harmonic joint metering relies primarily on sampling clocks, power frequency cycles, component extraction, and power accumulation in stages. However, slight delays may exist between voltage and current channels in terms of hardware links, transformer responses, sample-and-hold timing, and conversion sequences. If only a uniform sampling sequence is used for calculation, the true correspondence between channels cannot be directly verified at each trigger point. In light-load, low-power-factor, or distorted load scenarios, minute phase shifts can easily be amplified into active power deviations. Furthermore, when dividing the metering window by power frequency cycle, grid frequency fluctuations, zero-crossing jitter, and non-integer-cycle sampling can cause the window boundary to deviate from the true fundamental phase. While discrete Fourier transform processing can extract components, component extraction is highly dependent on window integrity and phase consistency. When harmonic content is high, the number and location of voltage and current waveform peaks may differ significantly from an ideal sine wave. Simply relying on fixed-order or fixed-window statistics can easily lead to unclear boundaries between fundamental and harmonic energy attribution. For example, when the rectifier load causes the third and fifth harmonics to be enhanced, if the current peak value shifts while the voltage fundamental window is still accumulated according to the fixed sampling point, the energy recording of each power may have cross-window leakage, and the stability of the detection result comparison will decrease. Summary of the Invention

[0004] To achieve the above objectives, the present invention adopts the following technical solution: a method for combined fundamental and harmonic metering of an electricity meter, comprising the following steps: S1: Collect the digital sampled value of the voltage output voltage of the voltage sampling circuit, the digital sampled value of the current output current of the current transformer, and the sampling timestamp generated by the synchronous sampling analog-to-digital converter. Compare the sampling timestamps corresponding to the digital sampled voltage values ​​and the digital sampled current values ​​under the same sampling trigger pulse to generate a synchronous sampling point sequence. S2: Call the synchronous sampling point sequence, the positive zero-crossing point of the voltage, and the number of sampling points between adjacent positive zero-crossing points of the voltage, calculate the position of the sampling point number within the fundamental period, convert the position into the fundamental phase angle, and obtain the fundamental phase coordinate sampling sequence. S3: Based on the fundamental phase coordinate sampling sequence, metering processing unit, number of voltage peak points, number of current peak points, and harmonic order, compare the number of peak points and harmonic order within the same fundamental period. According to the fundamental voltage sampling points, fundamental current sampling points, positive zero-crossing points of voltage, positive zero-crossing points of current, voltage peak points, and current peak points in the fundamental phase coordinate sampling sequence, calculate the fundamental voltage phase angle and fundamental current phase angle under the same fundamental phase coordinate, and generate the fundamental sampling sequence and harmonic sampling sequence. S4: Based on the fundamental voltage sampling sequence, fundamental current sampling sequence, fundamental metering register, positive zero-crossing point of voltage, positive zero-crossing point of current, peak point of voltage, and peak point of current in the fundamental sampling sequence and harmonic sampling sequence, calculate the difference between the phase angle of fundamental voltage and the phase angle of fundamental current under the same fundamental phase coordinate. Compare the phase angle difference with the phase angle limit corresponding to the sampling period. When the phase angle difference exceeds the phase angle limit corresponding to the sampling period, move the sampling point number of the fundamental current sampling sequence according to the positive and negative directions of the phase angle difference to generate a phase registration product sampling point pair. S5: Call the phase registration product sampling point pair, the fundamental sampling sequence and the harmonic sampling sequence, the active energy register, the harmonic energy register, and the sampling period, and accumulate the product of the fundamental voltage and current and the product of the sampling period, and the product of the harmonic voltage and current and the sampling period to establish a fundamental and harmonic co-window energy record.

[0005] As a further embodiment of the present invention, the synchronous sampling point sequence includes a sampling point index, a trigger pulse identifier, a timestamp difference, and a synchronization validity identifier; the fundamental phase coordinate sampling sequence includes a phase coordinate value, a period assignment identifier, a phase interval number, and a phase sorting identifier; the fundamental sampling sequence and harmonic sampling sequence include a fundamental voltage sequence, a fundamental current sequence, a harmonic voltage sequence, and a harmonic current sequence; the phase registration product sampling point pair includes a registration voltage point number, a registration current point number, a point-to-point phase deviation, and a point-to-point validity identifier; the fundamental and harmonic co-window energy record includes a fundamental energy value, a harmonic energy value, a co-window start and end identifier, and a register update identifier.

[0006] As a further aspect of the present invention, the process of comparing the sampling timestamp corresponding to the digital voltage sample value and the sampling timestamp corresponding to the digital current sample value under the same sampling trigger pulse to generate a synchronous sampling point sequence includes setting a time deviation limit between the sampling timestamp corresponding to the digital voltage sample value and the sampling timestamp corresponding to the digital current sample value. When the time deviation limit is not greater than half of one of the sampling periods, the corresponding digital voltage sample value and the digital current sample value are marked as valid sampling points in the same synchronous sampling point sequence.

[0007] As a further aspect of the present invention, the specific steps of S1 are as follows: S101: Collects the digital sampled value of the output voltage of the voltage sampling circuit, the digital sampled value of the output current of the current transformer, and the sampling timestamp generated by the synchronous sampling analog-to-digital converter. Based on the sampling trigger pulse number, it performs equal-value registration on the voltage sampled value, current sampled value and sampling timestamp to generate a trigger pulse association table. S102: Based on the trigger pulse association table, retrieve the voltage sampling timestamp and current sampling timestamp under the same sampling trigger pulse number, unify the counting period of the two timestamps, calculate the timestamp offset value of the corresponding sampling trigger pulse number, and obtain the same trigger timestamp difference table. S103: Call the same trigger timestamp difference table, collect the sampling period configuration value of the synchronous sampling analog-to-digital converter, calculate the allowable threshold of timestamp difference, compare the timestamp offset value of the sampling trigger pulse number with the allowable threshold of timestamp difference, retain the records that do not exceed the threshold and concatenate them according to the sampling sequence number to generate a synchronous sampling point sequence.

[0008] As a further aspect of the present invention, the specific steps of S2 are as follows: S201: Call the synchronous sampling point sequence, the positive zero-crossing point of the voltage, and the number of sampling points between adjacent positive zero-crossing points of the voltage. Based on the positive zero-crossing point of the voltage, calibrate the fundamental period boundary, determine the period interval to which the synchronous sampling point number belongs, arrange the sampling point number and the period interval identifier in the trigger order, and generate a period interval index table. S202: Based on the period interval index table, retrieve the number of sampling points and the sampling point number between adjacent positive zero crossing points of voltage, calculate the position of the sampling point number within the fundamental period, convert the global sampling point number into a periodic position identifier, and obtain the fundamental period position value. S203: Call the fundamental period sequence value, calculate the fundamental phase angle based on the number of sampling points between adjacent positive zero crossings of the voltage, associate the fundamental phase angle with the corresponding sampling point number in the synchronous sampling point sequence, and generate the fundamental phase coordinate sampling sequence.

[0009] As a further aspect of the present invention, the specific steps of S3 are as follows: S301: Based on the fundamental phase coordinate sampling sequence, metering processing unit, number of voltage peak points, number of current peak points, and harmonic order, the metering processing unit is called to periodically group the sampling points according to the fundamental phase angle, determine the period affiliation of the number of voltage peak points and the number of current peak points, configure the period number, number of peak points, and harmonic order into records, and generate a period peak order table. S302: According to the periodic peak order table, retrieve the number of voltage peak points, the number of current peak points and the harmonic order within the same fundamental period, compare the configuration relationship between the number of peak points and the harmonic order, mark the matching fundamental order record as the fundamental label, mark the matching harmonic order record as the harmonic label, and obtain the order attribute identification table. S303: Call the order attribute identifier table, for the order attribute identifier associated with the sampling points in the fundamental phase coordinate sampling sequence, filter the sampling points corresponding to the fundamental label and the sampling points corresponding to the harmonic label, and serialize and arrange the sampling point values, phase angles and period numbers according to the attribute labels respectively to generate the fundamental sampling sequence and the harmonic sampling sequence.

[0010] As a further aspect of the present invention, the specific steps of S4 are as follows: S401: Based on the fundamental voltage sampling sequence, fundamental current sampling sequence, fundamental metering register, positive zero-crossing point of voltage, positive zero-crossing point of current, peak point of voltage, and peak point of current in the fundamental sampling sequence and harmonic sampling sequence, calculate the difference between the fundamental voltage phase angle and the fundamental current phase angle under the same fundamental phase coordinate, and obtain the fundamental phase angle difference table. S402: Based on the fundamental phase angle difference table, call the phase angle limit corresponding to the sampling period in the fundamental metering register, compare the phase angle difference with the phase angle limit corresponding to the sampling period, mark the record that exceeds the phase angle limit as a shift state, and mark the record that does not exceed the phase angle limit as a hold state, and generate a phase limit state table. S403: Call the phase limit status table, identify the positive and negative directions of the phase angle difference for the shift status record, move the sampling point number of the fundamental current sampling sequence according to the positive and negative directions, and pair the moved fundamental current sampling point with the fundamental voltage sampling point under the same fundamental phase coordinate to generate a phase registration product sampling point pair.

[0011] As a further aspect of the present invention, the specific steps of S5 are as follows: S501: Call the phase registration product sampling point pair, the fundamental sampling sequence and harmonic sampling sequence, the active energy register, the harmonic energy register, and the sampling period. Based on the sampling point pair number, associate the fundamental voltage sampling value and the fundamental current sampling value, calculate the fundamental voltage-current product, and bind the product value with the sampling period to obtain the fundamental period product value. S502: Based on the fundamental frequency period product value, call the fundamental frequency sampling sequence and the harmonic sampling sequence, associate the harmonic voltage sampling value and the harmonic current sampling value according to the harmonic sequence identifier, calculate the harmonic voltage and current product, and bind the harmonic product value with the sampling period to generate the harmonic period product value; S503: Call the fundamental period product value and the harmonic period product value, accumulate the fundamental period product value and the harmonic period product value according to the active power register and the harmonic power register respectively, register the accumulation results according to the same sampling window number, and establish the fundamental and harmonic window power record.

[0012] A fundamental and harmonic combined metering system for electricity meters, comprising: The timestamp verification module collects the digital sampled values ​​of the voltage output from the voltage sampling circuit, the digital sampled values ​​of the current output from the current transformer, and the sampling timestamps generated by the synchronous sampling analog-to-digital converter. It compares the sampling timestamps corresponding to the digital sampled voltage values ​​and the sampling timestamps corresponding to the digital sampled current values ​​under the same sampling trigger pulse to generate a synchronous sampling point sequence. The phase angle conversion module calls the synchronous sampling point sequence, the positive zero-crossing point of the voltage, and the number of sampling points between adjacent positive zero-crossing points of the voltage to calculate the position of the sampling point number within the fundamental period, convert the position into the fundamental phase angle, and obtain the fundamental phase coordinate sampling sequence. The order windowing module, based on the fundamental phase coordinate sampling sequence, the metering processing unit, the number of voltage peak points, the number of current peak points, and the harmonic order, calculates the fundamental voltage phase angle and fundamental current phase angle under the same fundamental phase coordinate according to the fundamental voltage sampling points, fundamental current sampling points, voltage positive zero crossing points, current positive zero crossing points, voltage peak points, and current peak points in the fundamental phase coordinate sampling sequence. It compares the number of peak points and the harmonic order within the same fundamental period to generate the fundamental sampling sequence and the harmonic sampling sequence. The phase registration module calculates the difference between the fundamental voltage phase angle and the fundamental current phase angle under the same fundamental phase coordinate based on the fundamental voltage sampling sequence, fundamental current sampling sequence, fundamental metering register, positive zero-crossing point of voltage, positive zero-crossing point of current, voltage peak point, and current peak point in the fundamental sampling sequence and harmonic sampling sequence. It compares the phase angle difference with the phase angle limit corresponding to the sampling period. When the phase angle difference exceeds the phase angle limit corresponding to the sampling period, it moves the sampling point number of the fundamental current sampling sequence according to the positive and negative directions of the phase angle difference to generate a phase registration product sampling point pair. The peer-to-peer (PTP) metering module calls the phase registration product sampling point pair, the fundamental wave sampling sequence and harmonic sampling sequence, the active energy register, the harmonic energy register, and the sampling period, and accumulates the product of the fundamental wave voltage and current and the product of the sampling period, and the product of the harmonic voltage and current and the sampling period to establish a PTP peer-to-peer energy record.

[0013] Compared with the prior art, the advantages and positive effects of the present invention are as follows: In this invention, by comparing the voltage and current sampling timestamps under the same trigger pulse, a synchronous sampling point sequence is formed, reducing the impact of channel delay and sampling jitter. The fundamental phase coordinates are converted according to the voltage zero-crossing point, improving the window positioning accuracy under frequency fluctuations. The fundamental harmonic sequence is divided by comparing the number of peak points and the harmonic order, and the product point pairs are registered according to the phase angle difference, reducing cross-window leakage and the deviation of energy attribution in each phase, making the energy accumulation in the same window more accurate and more traceable. Attached Figure Description

[0014] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0015] Figure 1 This is a schematic diagram of the steps of the present invention; Figure 2 This is a detailed schematic diagram of S1 of the present invention; Figure 3 This is a detailed schematic diagram of S2 of the present invention; Figure 4 This is a detailed schematic diagram of S3 of the present invention; Figure 5 This is a detailed schematic diagram of S4 of the present invention; Figure 6 This is a detailed schematic diagram of S5 of the present invention; Figure 7 This is a system module diagram of the present invention. Detailed Implementation

[0016] The technical solution of the present invention will now be described with reference to the accompanying drawings.

[0017] To make the technical problems, technical solutions and advantages of the present invention clearer, a detailed description will be given below in conjunction with the accompanying drawings and specific embodiments.

[0018] Please see Figure 1 This invention provides a method for combined fundamental and harmonic metering of electricity meters, comprising the following steps: S1: Collect the digital sampled value of the voltage output voltage of the voltage sampling circuit, the digital sampled value of the current output current of the current transformer, and the sampling timestamp generated by the synchronous sampling analog-to-digital converter. Compare the sampling timestamps corresponding to the digital sampled voltage value and the digital sampled current value under the same sampling trigger pulse to generate a synchronous sampling point sequence. S2: Call the synchronous sampling point sequence, the positive zero-crossing point of the voltage, and the number of sampling points between adjacent positive zero-crossing points of the voltage. Calculate the position of the sampling point number within the fundamental period, convert the position into the fundamental phase angle, and obtain the fundamental phase coordinate sampling sequence. S3: Based on the fundamental phase coordinate sampling sequence, metering processing unit, number of voltage peak points, number of current peak points, and harmonic order, compare the number of peak points and harmonic order within the same fundamental period. Based on the fundamental voltage sampling points, fundamental current sampling points, positive zero-crossing points of voltage, positive zero-crossing points of current, voltage peak points, and current peak points in the fundamental phase coordinate sampling sequence, calculate the fundamental voltage phase angle and fundamental current phase angle under the same fundamental phase coordinate, and generate the fundamental sampling sequence and harmonic sampling sequence. S4: Based on the fundamental voltage sampling sequence, fundamental current sampling sequence, fundamental metering register, positive zero-crossing point of voltage, positive zero-crossing point of current, peak point of voltage, and peak point of current in the fundamental sampling sequence and harmonic sampling sequence, calculate the difference between the phase angle of fundamental voltage and the phase angle of fundamental current under the same fundamental phase coordinate. Compare the phase angle difference with the phase angle limit corresponding to the sampling period. When the phase angle difference exceeds the phase angle limit corresponding to the sampling period, move the sampling point number of the fundamental current sampling sequence according to the positive and negative directions of the phase angle difference to generate a phase registration product sampling point pair. S5: Call the phase registration product sampling point pair, fundamental sampling sequence and harmonic sampling sequence, active energy register, harmonic energy register, and sampling period, accumulate the product of fundamental voltage and current and the product of sampling period, and the product of harmonic voltage and current and the product of sampling period, and establish the fundamental and harmonic co-window energy record.

[0019] The synchronous sampling point sequence includes a sampling point index, trigger pulse identifier, timestamp difference, and synchronization validity identifier; the fundamental phase coordinate sampling sequence includes phase coordinate values, period assignment identifier, phase interval number, and phase sorting identifier; the fundamental and harmonic sampling sequences include a fundamental voltage sequence, a fundamental current sequence, a harmonic voltage sequence, and a harmonic current sequence; the phase registration product sampling point pair includes a registration voltage point number, a registration current point number, a point-to-point phase deviation, and a point-to-point validity identifier; the fundamental and harmonic co-window energy record includes the fundamental energy value, harmonic energy value, co-window start and end identifiers, and register update identifiers.

[0020] Please see Figure 2 The specific steps of S1 are as follows: S101: Collects the digital sampled value of the output voltage of the voltage sampling circuit, the digital sampled value of the output current of the current transformer, and the sampling timestamp generated by the synchronous sampling analog-to-digital converter. Based on the sampling trigger pulse number, it performs equal-value registration on the voltage sampled value, current sampled value and sampling timestamp to generate a trigger pulse association table. The AC input voltage is 220V, the current input is 5A, and the sampling frequency is configured at 12800Hz, corresponding to 256 sampling points per fundamental cycle under 50Hz operating conditions. This 256-point cycle sampling configuration provides an engineering reference for digital power sampling scenarios. The voltage digital sample value is recorded using a 16-bit integer, with a full-scale range of 32767, corresponding to a peak voltage of 311V before sampling. The current digital sample value is also recorded using a 16-bit integer, with a full-scale range corresponding to a peak current of 7.07A. During actual sampling, after the arrival of the 1056th sampling trigger pulse, the voltage digital sample value 31245 is read, the current digital sample value 16452 is read, the voltage sampling timestamp is read at 528600 nanoseconds, and the current sampling timestamp is read at 528610 nanoseconds. The sampling trigger pulse number serves as the registration key value, which refers to the common number of the same trigger pulse in the voltage sampling, current sampling, and timestamp records. The data source is the incremental counting result of the trigger count register. Subsequently, the three types of data under the same number are written to the same row of records. If a voltage or current sample value is missing under a certain number, the record corresponding to that number is deleted. The voltage digital sample value 31302, the current digital sample value 16510, the voltage sampling timestamp 529100 nanoseconds, and the current sampling timestamp 529118 nanoseconds corresponding to sampling trigger pulse number 1057 are all written to the valid record area when all four data items exist. Before the sample value enters the record area, abrupt change removal is performed on three consecutive sampling points. If the change in adjacent voltage digital sample values ​​exceeds 6% of the full scale, the point is marked as a change point, and the average of the previous and next valid sample values ​​is taken as the replacement value. In the example, the voltage digital sample value at sampling point 1058 is 31400, the voltage digital sample value at sampling point 1059 abnormally jumps to 12000, and the voltage digital sample value at sampling point 1060 is 31480. The average of 31400 and 31480 is 31440, and this value is written back to sampling point 1059. After the equalization registration is completed, a trigger pulse association table is formed in ascending order of the sampling trigger pulse number. The fields record the sampling trigger pulse number, voltage digital sample value, current digital sample value, voltage sampling timestamp, and current sampling timestamp in sequence.

[0021] S102: Based on the trigger pulse association table, retrieve the voltage sampling timestamp and current sampling timestamp under the same sampling trigger pulse number, unify the counting period of the two timestamps, calculate the timestamp offset value of the corresponding sampling trigger pulse number, and obtain the same trigger timestamp difference table. Both voltage and current sampling timestamps are recorded in nanoseconds. During unified processing, the timing references of the two timestamps are first calibrated for consistency, ensuring that the voltage and current sampling timestamps are under the same nanosecond time reference. Then, the difference between the two is calculated. The timestamp offset value refers to the absolute value of the time difference between the voltage and current sampling timestamps under the same sampling trigger pulse number; the data source is the synchronous sampling timestamp recording area. In the example, the voltage sampling timestamp of sampling trigger pulse number 1056 is 528600 nanoseconds, and the current sampling timestamp is 528610 nanoseconds. Taking the absolute value of the difference between the two timestamps yields a timestamp offset of 10 nanoseconds. The voltage sampling timestamp of sampling trigger pulse number 1057 is 529100 nanoseconds, and the current sampling timestamp is 529118 nanoseconds, resulting in a timestamp offset of 18 nanoseconds. The voltage sampling timestamp of sampling trigger pulse number 1058 is 529600 nanoseconds, and the current sampling timestamp is 529645 nanoseconds, resulting in a timestamp offset of 45 nanoseconds. If the time interval between adjacent sampling trigger pulse numbers is not within the range of 75 microseconds to 82 microseconds, the record corresponding to that number is not included in the timestamp offset statistics. In the embodiment, the time interval between numbers 1062 and 1063 is 91 microseconds; this number range is marked as having an abnormal interval and is removed from the difference table.

[0022] Table 1. Difference between trigger timestamps

[0023] As shown in Table 1, all four records have completed time difference adjustment within the same counting period. The execution node of this operation is to generate a timestamp offset value based on the difference between the voltage sampling timestamp and the current sampling timestamp, thereby triggering the subsequent threshold comparison operation.

[0024] S103: Call the same trigger timestamp difference table, collect the sampling period configuration value of the synchronous sampling analog-to-digital converter, calculate the allowable threshold of timestamp difference, compare the timestamp offset value of the sampling trigger pulse number with the allowable threshold of timestamp difference, retain the records that do not exceed the threshold and concatenate them according to the sampling sequence number to generate a synchronous sampling point sequence; The sampling frequency is 12800 Hz, the single sampling period is 78.125 microseconds, and the allowable threshold for timestamp difference is 1 / 1000 of the sampling period, resulting in 78 nanoseconds. The threshold setting process was completed using 48 hours of continuous sampling experimental data. In the experiment, when the sampling offset was between 20 and 80 nanoseconds, the calculated phase angle error was between 0.02 and 0.08 degrees; when the sampling offset was between 100 and 160 nanoseconds, the phase angle error was between 0.18 and 0.31 degrees. Therefore, this embodiment uses 78 nanoseconds as the allowable threshold and writes this value into the threshold configuration area. Subsequently, timestamp offset values ​​are read one by one and compared with 78 nanoseconds. Record number 1056 has a timestamp offset of 10 nanoseconds, which does not exceed the threshold and is retained; record number 1057 has a timestamp offset of 18 nanoseconds, which does not exceed the threshold and is retained; record number 1058 has a timestamp offset of 45 nanoseconds, which does not exceed the threshold and is retained; record number 1059 has a timestamp offset of 56 nanoseconds, which does not exceed the threshold and is retained; record number 1065 has a timestamp offset of 92 nanoseconds, which exceeds the threshold and is deleted. During deletion, the voltage digital sample value, current digital sample value, and two timestamps under that number are simultaneously removed. The retained records are renumbered in ascending order of the sampling trigger pulse number to generate a synchronous sampling point sequence. In the example, 256 raw records were continuously collected. After threshold comparison, 252 records were retained, and 4 records were deleted, resulting in an effective record ratio of 98.44%. Compared with the process without timestamp threshold filtering, the average number of phase-limit-exceeding records per hour over 24 hours was 14; after this processing, the average number of phase-limit-exceeding records per hour was 3. The experimental results show that the number of records exceeding the limit after threshold filtering is reduced by 78.57% compared to the unfiltered process. The execution node of this operation is that the record concatenation operation is triggered when the timestamp offset value does not exceed 78 nanoseconds, and the record deletion operation is triggered when the timestamp offset value exceeds 78 nanoseconds. The sequence of synchronous sampling points is obtained by arranging the retained records in order.

[0025] Please see Figure 3 The specific steps of S2 are as follows: S201: Call the synchronous sampling point sequence, the positive zero-crossing point of the voltage, and the number of sampling points between adjacent positive zero-crossing points of the voltage. Based on the positive zero-crossing point of the voltage, calibrate the fundamental period boundary, determine the period interval to which the synchronous sampling point number belongs, arrange the sampling point number and the period interval identifier in the trigger order, and generate a period interval index table. A positive zero-crossing point refers to a sampling position where the voltage sample value changes from negative to positive and the subsequent three consecutive sampling points all remain positive. The data source is the voltage digital sample value in the synchronous sampling point sequence. In this embodiment, the voltage digital sample value is -128 at sampling point 0200, 15 at sampling point 0201, 42 at sampling point 0202, and 76 at sampling point 0203, satisfying the negative-to-positive and continuous positive value verification conditions. Sampling point 0201 is then calibrated as the positive zero-crossing point. If sampling point 0202 changes back to a negative value, the zero-crossing calibration of sampling point 0201 is canceled. The number of sampling points between adjacent positive zero-crossing points is obtained by the difference in the sequence numbers of two adjacent positive zero-crossing points. In this embodiment, the first positive zero-crossing point is located at sampling point 0201, and the second positive zero-crossing point is located at sampling point 0458, with 257 sampling points between the two positions. The 50Hz energy metering scenario falls under the category of AC active energy metering, and the relevant static active energy metering standards cover both 50Hz and 60Hz networks. Therefore, this embodiment uses 256 sampling points under 50Hz input conditions as a reference for the number of cycles, allowing the number of valid cycle sampling points to be between 252 and 260. Subsequently, the fundamental frequency cycle boundary is calibrated according to the positive zero-crossing point of the voltage. Sampling points 0201 to 0457 are calibrated as cycle number 0001, and sampling points 0458 to 0714 are calibrated as cycle number 0002. Sampling point 0320, located between 0201 and 0457, is written as cycle number 0001; sampling point 0600, located between 0458 and 0714, is written as cycle number 0002. All sampling points are arranged according to the triggering order to form a cycle interval index table. The operation is executed when the positive zero-crossing of the voltage is successfully identified twice in a row and the number of sampling points between adjacent zero-crossings is in the range of 252 to 260, triggering the period interval identifier writing operation.

[0026] S202: Based on the period interval index table, retrieve the number of sampling points and the sampling point number between adjacent positive zero crossing points of voltage, calculate the position of the sampling point number within the fundamental period, convert the global sampling point number into the periodic position identifier, and obtain the fundamental period position value. The intra-cycle sequence identifier refers to the relative position of a sampling point within its fundamental period. The data source is the sampling point number and the corresponding period's starting sampling point number. In this example, the starting sampling point number for period 0001 is 0201, and the ending sampling point number is 0457, corresponding to 257 sampling points. Sampling point 0201 is written as intra-cycle sequence number 0001, sampling point 0202 as intra-cycle sequence number 0002, and sampling point 0457 as intra-cycle sequence number 0257. In the example, sampling point 0320 is located in period 0001. Converting the sequence distance between sampling point 0320 and the period's starting sampling point 0201 into an intra-cycle position yields an intra-cycle sequence value of 120. Sampling point 0400 is located in the same period, yielding an intra-cycle sequence value of 200. Sampling point 0600 is located in period 0002, with the period's starting sampling point being 0458, yielding an intra-cycle sequence value of 143. After the conversion is completed, the global sampling point number, period number, and period sequence value are written into the fundamental period sequence value recording area. Before performing the sequence conversion, a consistency check is performed on the sampling intervals within the period. If five consecutive sampling intervals are all within the range of 78 microseconds to 79 microseconds, the current period participates in the sequence conversion; if any one sampling interval exceeds 84 microseconds or is lower than 72 microseconds, the current period is added to the abnormal period list. In the embodiment, the five consecutive sampling intervals within period number 0003 are 78.1 microseconds, 78.0 microseconds, 78.2 microseconds, 78.1 microseconds, and 78.2 microseconds, respectively, and participate in the sequence conversion; the period number 0004 contains an 88.0 microsecond interval and is removed from subsequent processing. The execution node of this operation is triggered when the period interval is valid and the sampling interval is within the preset range.

[0027] S203: Call the fundamental period sequence value, calculate the fundamental phase angle based on the number of sampling points between adjacent positive zero crossings of the voltage, associate the fundamental phase angle with the corresponding sampling point number in the synchronous sampling point sequence, and generate the fundamental phase coordinate sampling sequence. The fundamental phase angle refers to the angular position of each sampling point relative to the positive zero-crossing point of the voltage within one fundamental cycle. The data source is the sequence value within the cycle and the number of sampling points between adjacent positive zero-crossing points. In this embodiment, cycle number 0001 contains 257 sampling points, dividing 360 degrees evenly into 257 sequence points, with each sequence point interval approximately 1.40 degrees. Sampling point 0201 is sequence position 0001 within the cycle, corresponding to 0 degrees; sampling point 0320 is sequence position 0120 within the cycle, corresponding to 168.0 degrees; and sampling point 0400 is sequence position 0200 within the cycle, corresponding to 280.0 degrees. Before writing the phase angle, a jump check is performed on the phase difference between adjacent sampling points. If the phase difference between two adjacent sampling points exceeds 3 degrees, the missing sampling point is read from the original sampling buffer, and a compensation value is generated using the average of the two valid sampling values ​​before and after it. In the example, sampling point 0330 corresponds to a phase angle of 182.0 degrees, and sampling point 0332 corresponds to a phase angle of 184.8 degrees, with a phase difference of 2.8 degrees, exceeding the preset phase difference limit between adjacent sampling points. After reading the original sampling buffer, it was found that there was a missing trigger record for sampling point 0331 between sampling points 0330 and 0332. The voltage digital sampling values ​​before and after, 31200 and 30920 respectively, were averaged to obtain 31060, and the compensated sampling point was written into the phase coordinate sampling sequence. After the conversion, the sampling point number, period number, period position value, voltage sampling value, current sampling value, and fundamental phase angle were written into the fundamental phase coordinate sampling sequence. Sampling point 0600 is located at period number 0002, corresponding to period position 0143, and the converted fundamental phase angle is 200.2 degrees. The execution node of this operation is that the phase coordinate writing operation is triggered after the period position value completes the angle conversion, and the output result is used as the input for peak quantity identification and order attribute calibration.

[0028] Please see Figure 4 The specific steps of S3 are as follows: S301: Based on the fundamental phase coordinate sampling sequence, metering processing unit, number of voltage peak points, number of current peak points, and harmonic order, the metering processing unit is called to periodically group the sampling points according to the fundamental phase angle, determine the period affiliation of the number of voltage peak points and the number of current peak points, configure the period number, number of peak points, and harmonic order into records, and generate a period peak order table. The number of voltage peak points and current peak points are determined by the slope direction of the digital sampled values. Specifically, the digital sampled value from the previous sampling point to the current sampling point increases, while the digital sampled value from the current sampling point to the next sampling point decreases. If the amplitude of the current sampling point's digital sampled value exceeds 1.30 times the effective digital sampled value of the period, the current sampling point is designated as a peak point. This effective digital sampled value is obtained by taking the square root of the average of all voltage digital sampled values ​​within the same period. This conversion process is only used for peak point determination and is not written into the output sequence. In this embodiment, the effective digital sampled value of the voltage at period number 0001 is 23190, and the peak point determination threshold is 30147. The current voltage digital sampled value is 32703, the previous point is 32576, and the next point is 32555, satisfying the peak point determination condition. The harmonic order is derived from the harmonic order configuration record. In this embodiment, the configuration record is written sequentially for the 1st, 3rd, and 5th harmonics. In electricity metering scenarios, the accuracy levels of static active power metering cover 0.1, 0.2, and 0.5. Engineering tests can set up order identification and energy accumulation recording under this accuracy constraint. Within cycle number 0001, one voltage peak point and one current peak point are detected and recorded with a 1st-order configuration; within cycle number 0002, three voltage peak points and three current peak points are detected and recorded with a 3rd-order configuration; within cycle number 0003, five voltage peak points and five current peak points are detected and recorded with a 5th-order configuration.

[0029] Table 2. Peak Order of Periods

[0030] As shown in Table 2, the number of peak points and the configuration order have been recorded according to the periodic numbering. The execution node of this operation is that after the fundamental phase coordinate sampling sequence has completed periodic grouping, the number of peak points and the configuration order are written together into the periodic peak order table, thereby triggering the order attribute identification determination.

[0031] S302: Based on the periodic peak order table, retrieve the number of voltage peak points, the number of current peak points, and the harmonic order within the same fundamental period. Compare the configuration relationship between the number of peak points and the harmonic order. Mark the matching fundamental order record as the fundamental label and the matching harmonic order record as the harmonic label to obtain the order attribute identification table. The matching determination adopts a quantity consistency rule, that is, if the number of voltage peak points is equal to the number of current peak points, and the number of both peak points is consistent with the configured order, the corresponding record of that period is labeled with the corresponding order attribute. If the number of peak points is 1 and the configured order is 1, a fundamental frequency label is written; if the number of peak points is 3 and the configured order is 3, a 3rd harmonic label is written; if the number of peak points is 5 and the configured order is 5, a 5th harmonic label is written. In the example, the number of voltage peak points in period 0001 is 1, the number of current peak points is 1, and the configured order is 1. After all three items are consistent, a fundamental frequency label is written. The number of voltage peak points in period 0002 is 3, the number of current peak points is 3, and the configured order is 3. A 3rd harmonic label is written. The number of voltage peak points in period 0003 is 5, the number of current peak points is 5, and the configured order is 5. A 5th harmonic label is written. If period number 0004 has 3 voltage peak points, 2 current peak points, and a configuration order of 3, then the two peak point counts are inconsistent. This record is written to the invalid order flag and will not be included in subsequent sampling sequence filtering. In the order attribute flag table, each record retains the period number, configuration order, number of voltage peak points, number of current peak points, and attribute label. In the experimental control, when both peak point count and order configuration are used for judgment, there are 6 miscalibrated records within 1000 periods; when only the number of voltage peak points is used for judgment, there are 21 miscalibrated records within 1000 periods. This experimental result shows that the miscalibration rate after joint judgment changes from 2.10% to 0.60%. The execution node of this operation is that the attribute label writing operation is triggered when the number of peak points and the order configuration are consistent, and the invalid record isolation operation is triggered when they are inconsistent.

[0032] S303: Call the order attribute identifier table, associate the order attribute identifiers of the sampling points in the fundamental phase coordinate sampling sequence with the sampling points corresponding to the fundamental label and the sampling points corresponding to the harmonic label, and serialize and arrange the sampling point values, phase angles and period numbers according to the attribute labels to generate the fundamental sampling sequence and the harmonic sampling sequence. When a sampling point belongs to the fundamental frequency tag, the voltage sample value, current sample value, fundamental frequency phase angle, and period number of that sampling point are extracted and written into the fundamental frequency sampling sequence in ascending order of sampling point number. When a sampling point belongs to the 3rd or 5th harmonic tag, it is written into the harmonic sampling sequence using the same fields, and the corresponding order is additionally recorded. If the period record of a sampling point is an invalid order identifier, then that sampling point is not written into the fundamental frequency sampling sequence or the harmonic sampling sequence. In the example, period number 0001 is written into the fundamental frequency tag, and sampling point 0320 corresponds to a voltage sample value of 219.8 volts, a current sample value of 4.81 amperes, and a fundamental frequency phase angle of 168.0 degrees. This sampling point is written into the fundamental frequency sampling sequence. Period number 0002 is written into the 3rd harmonic tag, and sampling point 0600 corresponds to a harmonic voltage sample value of 6.6 volts, a harmonic current sample value of 0.38 amperes, and a fundamental frequency phase angle of 200.2 degrees. This sampling point is written into the harmonic sampling sequence, and the order is recorded as 3. Period number 0003 is written to the 5th harmonic tag, and sampling point 0805 corresponds to a harmonic voltage sampling value of 4.1 volts and a harmonic current sampling value of 0.21 amperes, and is written to the 5th harmonic sampling sequence. After screening, the number of sampling points is checked for the two types of sequences. The fundamental wave sampling sequence should have 252 to 260 sampling points within one effective period, and the number of sampling points for the harmonic sampling sequence is also based on the number of effective points in its period. In this embodiment, the fundamental wave sampling sequence records 252 sampling points in period number 0001, which meets the requirement that the number of sampling points in the effective period is between 252 and 260, so it continues to participate in the subsequent phase registration process; if the number of sampling points in the fundamental wave sampling sequence within the corresponding period is less than 252, then the period is marked as a period with insufficient sampling points and does not participate in the subsequent phase registration and energy accumulation. The execution node of this operation is that after the attribute tag is written, the sampling point splitting and arrangement operation is triggered, and the fundamental wave sampling sequence and the harmonic sampling sequence are output.

[0033] Please see Figure 5 The specific steps of S4 are as follows: S401: Based on the fundamental voltage sampling sequence, fundamental current sampling sequence, fundamental metering register, positive zero-crossing point of voltage, positive zero-crossing point of current, peak point of voltage, and peak point of current in the fundamental sampling sequence and harmonic sampling sequence, calculate the difference between the fundamental voltage phase angle and the fundamental current phase angle under the same fundamental phase coordinate, and obtain the fundamental phase angle difference table. The fundamental voltage phase angle is determined by the positive zero-crossing point and the voltage peak point, while the fundamental current phase angle is determined by the positive zero-crossing point and the current peak point. In this embodiment, the positive zero-crossing point of the voltage is located at sampling point 0201, and the voltage peak point is located at sampling point 0265; the positive zero-crossing point of the current is located at sampling point 0206, and the current peak point is located at sampling point 0270. There are 256 sampling points within the period, and the angle interval between each sampling point is 1.40625 degrees. In the example, the positive zero-crossing point of the current lags behind the positive zero-crossing point of the voltage by 5 sampling points. Multiplying these 5 sampling points by the angle interval between sampling points yields a fundamental phase angle difference of 7.03125 degrees. The peak point of the current also lags behind the peak point of the voltage by 5 sampling points, resulting in a final conversion of 7.03125 degrees. If the two results are consistent, they are written into the fundamental phase angle difference table. If the difference between the two results exceeds 0.5 degrees, the two adjacent peak points within the same period are read for re-verification, with the positive zero-crossing conversion result as the main record and the peak point conversion result as the verification record. The fundamental phase angle difference table retains the period number, voltage positive zero-crossing point number, current positive zero-crossing point number, voltage peak point number, current peak point number, phase angle difference, and difference direction. In the embodiment, the difference direction of period number 0001 is current lag, with a difference of 7.03125 degrees; the difference direction of period number 0002 is current lag, with a difference of 5.625 degrees; and the difference direction of period number 0003 is current lead, with a difference of 2.8125 degrees. The execution node of this operation is that after the difference between the voltage phase angle and the current phase angle is generated, the phase limit comparison operation is triggered, and the fundamental phase angle difference table is output.

[0034] S402: Based on the fundamental phase angle difference table, call the phase angle limit corresponding to the sampling period in the fundamental metering register, compare the phase angle difference with the phase angle limit corresponding to the sampling period, mark the record that exceeds the phase angle limit as a shift state, and mark the record that does not exceed the phase angle limit as a hold state, and generate a phase limit state table. The phase angle difference for each cycle is compared with a limit. The phase angle limit corresponding to the sampling cycle refers to the maximum phase deviation allowed without moving the sampling point at the current sampling frequency. The data source is the sampling cycle configuration value and the number of sampling points in the fundamental cycle. In this embodiment, there are 256 sampling points per fundamental cycle, with each sampling point corresponding to 1.40625 degrees. The phase angle limit is set to the angle of one sampling point, i.e., 1.40625 degrees. This limit was set through a 24-hour control experiment. When the limit is less than 0.7 degrees, frequent shifts occur, with 462 shift records within 1000 cycles; when the limit is 1.40625 degrees, there are 118 shift records within 1000 cycles; when the limit is 2.8125 degrees, there are 47 unprocessed phase deviation records within 1000 cycles. Therefore, 1.40625 degrees is used as the limit in this embodiment. Subsequently, the phase angle difference is compared with the phase angle limit one by one. The phase angle difference for period 0001 is 7.03125 degrees, exceeding 1.40625 degrees, so a shift state is written. The phase angle difference for period 0002 is 5.625 degrees, exceeding the limit, so a shift state is written. The phase angle difference for period 0003 is 2.8125 degrees, exceeding the limit, so a shift state is written. If the phase angle difference for period 0004 is 0.9 degrees, it does not exceed the limit, so a hold state is written. During state writing, the direction of the difference is recorded synchronously; current lag is written in the lag direction, and current lead is written in the lead direction. In the experimental results, after using the 1.40625-degree limit for state determination, the average residual angle after phase registration within 1000 periods is 0.32 degrees; when multiplying directly without limit determination, the average residual angle is 3.94 degrees. This result shows that the average residual angle after limit determination is reduced by 91.88% compared to the undetermined process. The operation is executed when the phase angle difference exceeds the limit, triggering a shift state write, and when the phase angle difference does not exceed the limit, triggering a hold state write.

[0035] S403: Call the phase limit status table, identify the positive and negative directions of the phase angle difference for the shift status record, move the sampling point number of the fundamental current sampling sequence according to the positive and negative directions, and pair the moved fundamental current sampling point with the fundamental voltage sampling point under the same fundamental phase coordinate to generate a phase registration product sampling point pair; The positive direction is defined as the current sampling phase lagging behind the voltage sampling phase, and the negative direction is defined as the current sampling phase leading the voltage sampling phase. In the embodiment, the phase angle difference of period number 0001 is 7.03125 degrees, with the direction being current lag. The angle interval of a single sampling point is 1.40625 degrees. 7.03125 degrees is converted to 5 sampling points. Then, the fundamental current sampling sequence is shifted forward by 5 sampling points, pairing the current sampling points with the voltage sampling points in the same phase coordinate. In the example, the fundamental voltage sampling point 0320 corresponds to a phase angle of 168.0 degrees, and the original fundamental current sampling point 0320 corresponds to a phase angle of 160.96875 degrees, resulting in a lag of 5 sampling points. After the shift, the data from the original fundamental current sampling point 0325 is read and paired with the fundamental voltage sampling point 0320. If the direction of period number 0003 indicates current leading and the phase angle difference is 2.8125 degrees, it is converted into 2 sampling points, and the fundamental current sampling sequence is shifted backward by 2 sampling points. The state record is maintained without moving the sampling point sequence number; they are directly paired according to the same sampling point sequence number. After the shift, a boundary check is performed on the pairing result. If the current sampling point sequence number after the shift exceeds the current period's end sequence number, the corresponding current sampling point is read from the same phase position of the next period; if the shifted sequence number is less than the current period's start sequence number, the corresponding current sampling point is read from the same phase position of the previous period. In the embodiment, sampling point 0456 at the end of period number 0001 is moved forward by 5 sampling points and then 0461 is read. This point is located at the beginning of period number 0002, so it is written as a cross-period pairing identifier according to the same phase rule. The execution node of this operation is that the shift state and the difference direction jointly trigger the current sampling point sequence number shift operation, outputting the phase registration product sampling point pair.

[0036] Please see Figure 6 The specific steps of S5 are as follows: S501: Call the phase registration product sampling point pair, fundamental sampling sequence and harmonic sampling sequence, active energy register, harmonic energy register, and sampling period. Based on the sampling point pair number, associate the fundamental voltage sampling value and the fundamental current sampling value, calculate the fundamental voltage and current product, and bind the product value with the sampling period to obtain the fundamental period product value. The fundamental voltage-current product refers to the instantaneous power sample obtained by multiplying the voltage sample value and the shifted current sample value under the same fundamental phase coordinate. The data source is the phase registration product sampling point pair. In the embodiment, the voltage input is taken as a 220V AC rated scenario, and the current input is taken as a 5A AC rated scenario. This type of scenario belongs to AC active energy metering application, and the relevant metering specifications cover AC network active energy measurement. In the example, sampling point 0001 corresponds to a fundamental voltage sample value of 219.8 volts, and after shifting, the fundamental current sample value is 4.81 amperes. Multiplying these two sample values ​​yields a fundamental voltage-current product of 1057.24 watts. Sampling point 0002 corresponds to a fundamental voltage sample value of 221.0 volts, and after shifting, the fundamental current sample value is 4.79 amperes, resulting in a fundamental voltage-current product of 1058.59 watts. Sampling point 0003 corresponds to a fundamental voltage sample value of 218.6 volts, and after shifting, the fundamental current sample value is 4.83 amperes, resulting in a fundamental voltage-current product of 1055.84 watts. Each product value is then bound to a sampling period of 78.125 microseconds and written to the fundamental period product value recording area. During binding, the sampling window number, period number, sampling point pair number, fundamental voltage sample value, fundamental current sample value, fundamental voltage-current product value, and sampling period are retained. The sampling window number refers to the sequential number of the continuous energy accumulation window, and the data source is a window count that increments by 1 every 256 valid fundamental frequency sampling points. In this embodiment, the aforementioned three sampling point pairs all belong to sampling window number 0001. The operation execution node is that after the phase registration product sampling point pair is formed, the product calculation is triggered, and the product value is bound to the sampling period to output the fundamental frequency period product value.

[0037] S502: Based on the fundamental frequency period product value, call the fundamental frequency sampling sequence and the harmonic sampling sequence, associate the harmonic voltage sampling value and the harmonic current sampling value according to the harmonic sequence identifier, calculate the harmonic voltage and current product, and bind the harmonic product value with the sampling period to generate the harmonic period product value; Harmonic sequence identifiers refer to the 3rd or 5th order labels written in the order attribute identifier table. The data source is the matching result of the number of periodic peak points and the configured order. In the embodiment, the 3rd order harmonic sampling sequence records sampling points 0600, 0601, and 0602, and the 5th order harmonic sampling sequence records sampling points 0805, 0806, and 0807. Each harmonic sampling point retains the phase angle, period number, and sampling window number. In the example, the 3rd order harmonic sampling point 0600 corresponds to a harmonic voltage sampling value of 6.6 volts and a harmonic current sampling value of 0.38 amperes. Multiplying the two sampling values, we get the 3rd order harmonic voltage and current product of 2.51 watts; sampling point 0601 corresponds to a harmonic voltage sampling value of 6.2 volts and a harmonic current sampling value of 0.35 amperes, resulting in 2.17 watts; sampling point 0602 corresponds to a harmonic voltage sampling value of 5.9 volts and a harmonic current sampling value of 0.33 amperes, resulting in 1.95 watts. The 5th harmonic sampling point 0805 corresponds to a harmonic voltage sampling value of 4.1 volts and a harmonic current sampling value of 0.21 amperes, yielding 0.86 watts; sampling point 0806 corresponds to a harmonic voltage sampling value of 3.8 volts and a harmonic current sampling value of 0.20 amperes, yielding 0.76 watts. After completing the product calculation for each order, the harmonic product value is bound to the sampling period of 78.125 microseconds to generate the harmonic period product value. The bound record fields are, in order: sampling window number, period number, harmonic order, sampling point number, harmonic voltage sampling value, harmonic current sampling value, harmonic voltage-current product value, and sampling period. The execution node of this operation is triggered after the harmonic sequence identifier is associated, outputting the harmonic period product value, and maintaining the same sampling window number as the fundamental period product value.

[0038] S503: Call the fundamental period product value and the harmonic period product value, accumulate the fundamental period product value and the harmonic period product value according to the active energy register and the harmonic energy register respectively, register the accumulation results according to the same sampling window number, and establish the fundamental and harmonic window energy record; The accumulation process multiplies each product value under the same sampling window number with the sampling period, then sums the results corresponding to all sampling points within the same window, and converts them into watt-hours (Wh). In this embodiment, sampling window number 0001 contains 252 valid sampling points, with a sampling period of 78.125 microseconds and an average fundamental voltage-current product of 1057.2 watts. After converting each of the 252 product values ​​with the sampling period and summing them, the fundamental energy is 0.00578 Wh. In the harmonic energy accumulation, the average product of the 3rd harmonic voltage and current for sampling window number 0001 is 2.21 watts, and the average product of the 5th harmonic voltage and current is 0.81 watts. The product values ​​of the 252 sets of 3rd harmonics were converted and summed according to the sampling period, yielding 0.0000121 watt-hours of 3rd harmonic energy. The product values ​​of the 252 sets of 5th harmonics were converted and summed according to the sampling period, yielding 0.0000044 watt-hours of 5th harmonic energy. Subsequently, the fundamental energy, 3rd harmonic energy, and 5th harmonic energy were registered according to the sampling window number 0001 to form a fundamental harmonic co-window energy record.

[0039] Table 3. Classmate Energy Record Sheet

[0040] As shown in Table 3, the fundamental and harmonic energy under the same sampling window number has been registered. In the experimental comparison, the average energy deviation within 100 sampling windows was 0.42% for the process without phase registration; after phase registration before the current accumulation process, the average energy deviation within 100 sampling windows was 0.08%. This experimental result shows that the average energy deviation changed from 0.42% to 0.08%. The execution node of this operation is triggered by the aggregation of the fundamental and harmonic period product values ​​under the same window number, which triggers the energy register write operation and outputs the fundamental and harmonic energy records for the same window.

[0041] Please see Figure 7 A fundamental and harmonic combined metering system for electricity meters, comprising: The timestamp verification module collects the digital sampled values ​​of the voltage output from the voltage sampling circuit, the digital sampled values ​​of the current output from the current transformer, and the sampling timestamps generated by the synchronous sampling analog-to-digital converter. It compares the sampling timestamps corresponding to the digital voltage sampled values ​​and the sampling timestamps corresponding to the digital current sampled values ​​under the same sampling trigger pulse to generate a synchronous sampling point sequence. The phase angle conversion module calls the synchronous sampling point sequence, the positive zero-crossing point of the voltage, and the number of sampling points between adjacent positive zero-crossing points of the voltage to calculate the position of the sampling point number within the fundamental period, convert the position into the fundamental phase angle, and obtain the fundamental phase coordinate sampling sequence. The order windowing module, based on the fundamental phase coordinate sampling sequence, metering processing unit, number of voltage peak points, number of current peak points, and harmonic order, compares the number of peak points and harmonic order within the same fundamental period. Based on the fundamental voltage sampling points, fundamental current sampling points, positive zero-crossing points of voltage, positive zero-crossing points of current, voltage peak points, and current peak points in the fundamental phase coordinate sampling sequence, it calculates the fundamental voltage phase angle and fundamental current phase angle under the same fundamental phase coordinate, respectively, and generates the fundamental sampling sequence and harmonic sampling sequence. The phase registration module calculates the difference between the fundamental voltage phase angle and the fundamental current phase angle under the same fundamental phase coordinate based on the fundamental voltage sampling sequence, fundamental current sampling sequence, fundamental metering register, positive zero-crossing point of voltage, positive zero-crossing point of current, voltage peak point, and current peak point in the fundamental sampling sequence and harmonic sampling sequence. It compares the phase angle difference with the phase angle limit corresponding to the sampling period. When the phase angle difference exceeds the phase angle limit corresponding to the sampling period, it moves the sampling point number of the fundamental current sampling sequence according to the positive and negative directions of the phase angle difference to generate a phase registration product sampling point pair. The peer-to-peer (PTP) metering module calls the phase registration product sampling point pair, the fundamental wave sampling sequence and the harmonic sampling sequence, the active energy register, the harmonic energy register, and the sampling period. It accumulates the product of the fundamental wave voltage and current and the product of the sampling period, as well as the product of the harmonic voltage and current and the sampling period, to establish a PTP and harmonic peer-to-peer energy record.

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

Claims

1. A method for combined fundamental and harmonic metering of an electricity meter, characterized in that, Includes the following steps: S1: Collect the digital sampled value of the voltage output voltage of the voltage sampling circuit, the digital sampled value of the current output current of the current transformer, and the sampling timestamp generated by the synchronous sampling analog-to-digital converter. Compare the sampling timestamps corresponding to the digital sampled voltage values ​​and the digital sampled current values ​​under the same sampling trigger pulse to generate a synchronous sampling point sequence. S2: Call the synchronous sampling point sequence, the positive zero-crossing point of the voltage, and the number of sampling points between adjacent positive zero-crossing points of the voltage, calculate the position of the sampling point number within the fundamental period, convert the position into the fundamental phase angle, and obtain the fundamental phase coordinate sampling sequence. S3: Based on the fundamental phase coordinate sampling sequence, metering processing unit, number of voltage peak points, number of current peak points, and harmonic order, compare the number of voltage peak points, the number of current peak points, and the harmonic order within the same fundamental period. According to the fundamental voltage sampling points, fundamental current sampling points, positive zero-crossing points of voltage, positive zero-crossing points of current, voltage peak points, and current peak points in the fundamental phase coordinate sampling sequence, calculate the fundamental voltage phase angle and fundamental current phase angle under the same fundamental phase coordinate, and generate the fundamental sampling sequence and harmonic sampling sequence. S4: Based on the fundamental voltage sampling sequence, fundamental current sampling sequence, fundamental metering register, positive zero-crossing point of voltage, positive zero-crossing point of current, peak point of voltage, and peak point of current in the fundamental sampling sequence and harmonic sampling sequence, calculate the difference between the phase angle of fundamental voltage and the phase angle of fundamental current under the same fundamental phase coordinate. Compare the phase angle difference with the phase angle limit corresponding to the sampling period. When the phase angle difference exceeds the phase angle limit corresponding to the sampling period, move the sampling point number of the fundamental current sampling sequence according to the positive and negative directions of the phase angle difference to generate a phase registration product sampling point pair. S5: Call the phase registration product sampling point pair, the fundamental sampling sequence and the harmonic sampling sequence, the active energy register, the harmonic energy register, and the sampling period, and accumulate the product of the fundamental voltage and current and the product of the sampling period, and the product of the harmonic voltage and current and the sampling period to establish a fundamental and harmonic co-window energy record.

2. The method for combined fundamental and harmonic metering of electricity meters according to claim 1, characterized in that, The synchronous sampling point sequence includes a sampling point index, a trigger pulse identifier, a timestamp difference, and a synchronization validity identifier; the fundamental phase coordinate sampling sequence includes phase coordinate values, a period assignment identifier, a phase interval number, and a phase sorting identifier; the fundamental and harmonic sampling sequences include a fundamental voltage sequence, a fundamental current sequence, a harmonic voltage sequence, and a harmonic current sequence; the phase registration product sampling point pair includes a registration voltage point number, a registration current point number, a point-to-point phase deviation, and a point-to-point validity identifier; the fundamental and harmonic co-continuity energy record includes a fundamental energy value, a harmonic energy value, a co-continuity start and end identifier, and a register update identifier.

3. The method for combined fundamental and harmonic metering of electricity meters according to claim 1, characterized in that: The process of comparing the sampling timestamps corresponding to the digital voltage sampled values ​​and the digital current sampled values ​​under the same sampling trigger pulse to generate a synchronous sampling point sequence includes setting a time deviation limit between the sampling timestamps corresponding to the digital voltage sampled values ​​and the sampling timestamps corresponding to the digital current sampled values. When the time deviation limit is not greater than half of one of the sampling periods, the corresponding digital voltage sample value and the digital current sample value are marked as valid sampling points in the same synchronous sampling point sequence.

4. The method for combined fundamental and harmonic metering of electricity meters according to claim 1, characterized in that, The specific steps of S1 are as follows: S101: Collects the digital sampled value of the output voltage of the voltage sampling circuit, the digital sampled value of the output current of the current transformer, and the sampling timestamp generated by the synchronous sampling analog-to-digital converter. Based on the sampling trigger pulse number, it performs equal-value registration on the voltage sampled value, current sampled value and sampling timestamp to generate a trigger pulse association table. S102: Based on the trigger pulse association table, retrieve the voltage sampling timestamp and current sampling timestamp under the same sampling trigger pulse number, unify the counting period of the two timestamps, calculate the timestamp offset value of the corresponding sampling trigger pulse number, and obtain the same trigger timestamp difference table. S103: Call the same trigger timestamp difference table, collect the sampling period configuration value of the synchronous sampling analog-to-digital converter, calculate the allowable threshold of timestamp difference, compare the timestamp offset value of the sampling trigger pulse number with the allowable threshold of timestamp difference, retain the records that do not exceed the threshold and concatenate them according to the sampling sequence number to generate a synchronous sampling point sequence.

5. The method for combined fundamental and harmonic metering of electricity meters according to claim 1, characterized in that, The specific steps of S2 are as follows: S201: Call the synchronous sampling point sequence, the positive zero-crossing point of the voltage, and the number of sampling points between adjacent positive zero-crossing points of the voltage. Based on the positive zero-crossing point of the voltage, calibrate the fundamental period boundary, determine the period interval to which the synchronous sampling point number belongs, arrange the sampling point number and the period interval identifier in the trigger order, and generate a period interval index table. S202: Based on the period interval index table, retrieve the number of sampling points and the sampling point number between adjacent positive zero crossing points of voltage, calculate the position of the sampling point number within the fundamental period, convert the global sampling point number into a periodic position identifier, and obtain the fundamental period position value. S203: Call the fundamental period sequence value, calculate the fundamental phase angle based on the number of sampling points between adjacent positive zero crossings of the voltage, associate the fundamental phase angle with the corresponding sampling point number in the synchronous sampling point sequence, and generate the fundamental phase coordinate sampling sequence.

6. The method for combined fundamental and harmonic metering of electricity meters according to claim 1, characterized in that, The specific steps for S3 are as follows: S301: Based on the fundamental phase coordinate sampling sequence, metering processing unit, number of voltage peak points, number of current peak points, and harmonic order, the metering processing unit is called to periodically group the sampling points according to the fundamental phase angle, determine the period affiliation of the number of voltage peak points and the number of current peak points, configure the period number, number of peak points, and harmonic order into records, and generate a period peak order table. S302: According to the periodic peak order table, retrieve the number of voltage peak points, the number of current peak points and the harmonic order within the same fundamental period, compare the configuration relationship between the number of peak points and the harmonic order, mark the matching fundamental order record as the fundamental label, mark the matching harmonic order record as the harmonic label, and obtain the order attribute identification table. S303: Call the order attribute identifier table, for the order attribute identifier associated with the sampling points in the fundamental phase coordinate sampling sequence, filter the sampling points corresponding to the fundamental label and the sampling points corresponding to the harmonic label, and serialize and arrange the sampling point values, phase angles and period numbers according to the attribute labels respectively to generate the fundamental sampling sequence and the harmonic sampling sequence.

7. The method for combined fundamental and harmonic metering of electricity meters according to claim 1, characterized in that, The specific steps of S4 are as follows: S401: Based on the fundamental voltage sampling sequence, fundamental current sampling sequence, fundamental metering register, positive zero-crossing point of voltage, positive zero-crossing point of current, peak point of voltage, and peak point of current in the fundamental sampling sequence and harmonic sampling sequence, calculate the difference between the fundamental voltage phase angle and the fundamental current phase angle under the same fundamental phase coordinate, and obtain the fundamental phase angle difference table. S402: Based on the fundamental phase angle difference table, call the phase angle limit corresponding to the sampling period in the fundamental metering register, compare the phase angle difference with the phase angle limit corresponding to the sampling period, mark the record that exceeds the phase angle limit as a shift state, and mark the record that does not exceed the phase angle limit as a hold state, and generate a phase limit state table. S403: Call the phase limit status table, identify the positive and negative directions of the phase angle difference for the shift status record, move the sampling point number of the fundamental current sampling sequence according to the positive and negative directions, and pair the moved fundamental current sampling point with the fundamental voltage sampling point under the same fundamental phase coordinate to generate a phase registration product sampling point pair.

8. The method for combined fundamental and harmonic metering of electricity meters according to claim 1, characterized in that, The specific steps of S5 are as follows: S501: Call the phase registration product sampling point pair, the fundamental sampling sequence and harmonic sampling sequence, the active energy register, the harmonic energy register, and the sampling period. Based on the sampling point pair number, associate the fundamental voltage sampling value and the fundamental current sampling value, calculate the fundamental voltage-current product, and bind the product value with the sampling period to obtain the fundamental period product value. S502: Based on the fundamental frequency period product value, call the fundamental frequency sampling sequence and the harmonic sampling sequence, associate the harmonic voltage sampling value and the harmonic current sampling value according to the harmonic sequence identifier, calculate the harmonic voltage and current product, and bind the harmonic product value with the sampling period to generate the harmonic period product value; S503: Call the fundamental period product value and the harmonic period product value, accumulate the fundamental period product value and the harmonic period product value according to the active power register and the harmonic power register respectively, register the accumulation results according to the same sampling window number, and establish the fundamental and harmonic window power record.

9. A combined fundamental and harmonic metering system for electricity meters, characterized in that, The system is used to implement the fundamental and harmonic joint metering method for an electricity meter according to any one of claims 1-8, the system comprising: The timestamp verification module collects the digital sampled values ​​of the voltage output from the voltage sampling circuit, the digital sampled values ​​of the current output from the current transformer, and the sampling timestamps generated by the synchronous sampling analog-to-digital converter. It compares the sampling timestamps corresponding to the digital sampled voltage values ​​and the sampling timestamps corresponding to the digital sampled current values ​​under the same sampling trigger pulse to generate a synchronous sampling point sequence. The phase angle conversion module calls the synchronous sampling point sequence, the positive zero-crossing point of the voltage, and the number of sampling points between adjacent positive zero-crossing points of the voltage to calculate the position of the sampling point number within the fundamental period, convert the position into the fundamental phase angle, and obtain the fundamental phase coordinate sampling sequence. The order windowing module, based on the fundamental phase coordinate sampling sequence, the metering processing unit, the number of voltage peak points, the number of current peak points, and the harmonic order, compares the number of peak points and the harmonic order within the same fundamental period. Based on the fundamental voltage sampling points, fundamental current sampling points, positive zero-crossing points of voltage, positive zero-crossing points of current, voltage peak points, and current peak points in the fundamental phase coordinate sampling sequence, it calculates the fundamental voltage phase angle and fundamental current phase angle under the same fundamental phase coordinate, respectively, and generates the fundamental sampling sequence and the harmonic sampling sequence. The phase registration module calculates the difference between the fundamental voltage phase angle and the fundamental current phase angle under the same fundamental phase coordinate based on the fundamental voltage sampling sequence, fundamental current sampling sequence, fundamental metering register, positive zero-crossing point of voltage, positive zero-crossing point of current, voltage peak point, and current peak point in the fundamental sampling sequence and harmonic sampling sequence. It compares the phase angle difference with the phase angle limit corresponding to the sampling period. When the phase angle difference exceeds the phase angle limit corresponding to the sampling period, it moves the sampling point number of the fundamental current sampling sequence according to the positive and negative directions of the phase angle difference to generate a phase registration product sampling point pair. The peer-to-peer (PTP) metering module calls the phase registration product sampling point pair, the fundamental wave sampling sequence and harmonic sampling sequence, the active energy register, the harmonic energy register, and the sampling period, and accumulates the product of the fundamental wave voltage and current and the product of the sampling period, as well as the product of the harmonic voltage and current and the sampling period, to establish a PTP and harmonic peer-to-peer energy record.

10. A combined fundamental and harmonic metering energy meter, characterized in that, It includes a voltage sampling circuit, a current transformer, a synchronous sampling analog-to-digital converter, a metering processing unit, an active energy register, and a harmonic energy register. The metering processing unit is used to perform the steps of the combined metering method for fundamental and harmonic waves of an electricity meter as described in any one of claims 1 to 8.