A power meter pulse calibration system and method based on RS485 interface multiplexing

CN122883078APending Publication Date: 2026-10-09CHINA ELECTRIC POWER RESEARCH INSTITUTE CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610907073.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-06-23
Publication Date
2026-10-09

AI Technical Summary

Technical Problem

[0005]本发明提出一种基于RS485接口复用的电能表脉冲检定系统及方法,以解决现有电能表 RS485 接口通信与脉冲检定功能相互独立、接口无法复用,存在接线繁琐、设备适配性差、检定与通信作业冲突的问题

Benefits of technology

[0018]本发明技术方案提供了一种基于RS485接口复用的电能表脉冲检定系统及方法,系统包括电能表、外部转换板以及上位机;电能表内部设置MCU、计量模块、RS485收发芯片、电子选择开关及收发使能控制电路;电子选择开关的输入端分别连接MCU的通信发送管脚TX、计量模块的脉冲信号输出端;电子选择开关的输出端连接RS485收发芯片的DI管脚;RS485收发芯片配置有对外的RS485 A、B差分接口端子;外部转换板接入在电能表RS485 A、B差分接口端子与检定台体脉冲输入端之间;上位机分别与电能表的RS485 A、B差分接口、外部转换板的控制接口通信连接。本发明技术方案通过构建由电能表、外部转换板及上位机构成的复用式检定架构,搭建起 RS485 接口一体化复用硬件基础,克服了传统电能表通信与脉冲检定接口相互独立、需额外接线改造、作业冲突、适配性差的缺陷,有效简化检定接线结构、兼容多场景检定作业,为实现 RS485 接口分时复用、脉冲检定与设备通信无冲突协同工作提供可靠硬件支撑。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122883078A_ABST
    Figure CN122883078A_ABST
Patent Text Reader

Abstract

The application discloses a kind of based on RS485 interface multiplexing electric energy meter pulse verification system and method, system includes electric energy meter, external conversion board and host computer;The electric energy meter is internally provided with MCU, measurement module, RS485 transceiver chip, electronic selection switch and transceiver enable control circuit;The input of the electronic selection switch is respectively connected with the communication sending pin TX of the MCU, the pulse signal output end of the measurement module;The output of the electronic selection switch is connected with the DI pin of the RS485 transceiver chip;The RS485 transceiver chip is configured with external RS485 A, B differential interface terminal;The external conversion board is accessed between electric energy meter RS485 A, B differential interface terminal and verification platform body pulse input end;The host computer is respectively connected with the RS485 A, B differential interface of the electric energy meter, the control interface of the external conversion board is communicated.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of metering equipment testing technology, and more specifically, to a pulse calibration system and method for energy meters based on RS485 interface multiplexing. Background Technology

[0002] As the core metering instrument for trade settlement and electricity consumption monitoring in the power system, the accuracy of electricity meters needs to be ensured through regular verification. Traditional meter verification methods mainly rely on the dedicated pulse output terminals of the electricity meter (such as photoelectric pulse port, electrical pulse output port, and clock pulse output port) to collect the pulses from the electricity meter and compare them with the pulses of a standard meter to calculate the error.

[0003] However, existing technologies have the following drawbacks: (1) The wiring is complicated and inefficient when testing the electricity meter: the test requires simultaneous connection of RS485 communication line, voltage / current test line and dedicated pulse acquisition line. The parallel wiring of multiple terminals is prone to errors and takes a long time.

[0004] (2) The large number of auxiliary terminals in the electricity meter leads to a complex structure and high cost. Summary of the Invention

[0005] This invention proposes a pulse calibration system and method for energy meters based on RS485 interface multiplexing, in order to solve the problems of existing energy meters where RS485 interface communication and pulse calibration functions are independent, the interface cannot be reused, and there are problems such as cumbersome wiring, poor equipment compatibility, and conflicts between calibration and communication operations.

[0006] To address the aforementioned problems, according to one aspect of the present invention, a pulse calibration system for an energy meter based on RS485 interface multiplexing is provided, characterized in that the system includes an energy meter, an external conversion board, and a host computer; The energy meter internally includes an MCU, a metering module, an RS485 transceiver chip, an electronic selector switch, and a transceiver enable control circuit. The input terminal of the electronic selector switch is connected to the communication transmit pin TX of the MCU and the pulse signal output terminal of the metering module, respectively. The output terminal of the electronic selector switch is connected to the DI pin of the RS485 transceiver chip. The RS485 transceiver chip is equipped with external RS485 A and B differential interface terminals. The external conversion board is connected between the RS485 A and B differential interface terminals of the energy meter and the pulse input terminal of the calibration platform. The host computer is communicatively connected to the RS485 A and B differential interfaces of the energy meter and the control interface of the external conversion board.

[0007] Preferably, the energy meter operates in communication mode by default. After power-on, the electronic selection switch is enabled by default to connect the TX pin of the MCU and the DI pin of the RS485 transceiver chip, realizing conventional RS485 communication. The host computer controls the electronic selection switch to switch the path by issuing a pulse verification switching command, so that the pulse signal output by the metering module is connected to the DI pin of the RS485 transceiver chip, and the RS485 A and B differential interface terminals are multiplexed to output differential pulse signals. The transmit / receive enable control circuit automatically switches the transmit / receive state of the RS485 transceiver chip according to the input state of the DI pin: when the pulse is valid, the transmit enable is turned on and the receive enable is turned off, and differential pulses are output through the RS485 A and B terminals; when the pulse is invalid, the transmit enable is turned off and the receive enable is turned on, and the bus is released for short-term communication with the host computer. The external conversion board acquires RS485 A and B differential signals and restores them to standard pulse signals, which are then output to the calibration platform. Simultaneously, it provides real-time feedback on the pulse operating status to the host computer. The host computer implements interlock control between communication and pulse calibration based on the pulse operating status feedback from the conversion board, thereby completing the pulse calibration operation of the energy meter.

[0008] Preferably, the energy meter is equipped with a pulse source selection unit. The input terminal of the pulse source selection unit is connected to any multiple pulse signals from active energy pulses, reactive energy pulses, and clock pulses, and the output terminal is connected to the pulse input terminal of the electronic selection switch. The energy meter selects the corresponding pulse source by matching the pulse source selection unit according to the pulse type field in the pulse verification switching command issued by the host computer, thereby completing the pulse signal path switching.

[0009] Preferably, the electronic selector switch performs a safe switching procedure when switching paths, including: Determine if the RS485 bus is in an idle state; When the RS485 bus is idle, disable or release the RS485 transmit enable; Switch the electronic selection switch to the target signal path; Wait for the preset stabilization time Ts; Restore the RS485 transceiver chip to normal working condition; Where Ts satisfies: Ts ≥ Tsw + Tsettle Where Tsw is the maximum operating time of the electronic selector switch, and Tsettle is the settling time of the RS485 transceiver chip and the input terminal of the external conversion board.

[0010] Preferably, the control interface of the external conversion board includes DTR control pins and DSR status feedback pins; The DTR control pin is used to receive control signals from the host computer and switch the access and disconnection status of the pulse output path of the external conversion board; the DSR status feedback pin is used to provide real-time feedback to the host computer on the pulse validity, invalidity, or bus idle status corresponding to the current RS485 differential signal. The host computer uses the DTR control pin and DSR status feedback pin to achieve hardware interlock between communication and pulse verification, thus preventing communication frames from being mistakenly identified as verification pulses.

[0011] Preferably, the external conversion board has a built-in polarity configuration unit and a hysteresis filter unit; The polarity configuration unit is used to configure the correspondence between the RS485 differential voltage VAB and the pulse active state, adapt to the A and B pin definitions of different chips, and support adaptive matching of high and low level pulses. The hysteresis filter unit is configured with a pulse validity determination threshold Vth_on, a pulse release determination threshold Vth_off, a valid confirmation filtering time Tf_on, and a release confirmation filtering time Tf_off; the pulse state switch is determined only when the differential signal continuously meets the corresponding state duration, thus filtering bus noise and glitches.

[0012] Preferably, the external conversion board has a built-in pulse widening circuit that automatically widens the output pulse to a preset standard width when the effective width of the input pulse is less than the minimum recognition width of the calibration platform.

[0013] Preferably, the host computer is configured with a pulse ineffective window communication mechanism, including: The host computer sends an RS485 short frame communication command only when the external conversion board feedbacks an invalid pulse through the DSR pin and is in a communication-enabled state, and the remaining idle time meets the condition Tframe + Tguard ≤ Tidle. Where Tframe is the communication frame transmission duration, Tguard is the total system delay margin, and Tidle is the remaining idle time of the pulse.

[0014] Preferably, the energy meter is equipped with a mode hold timer. After entering the pulse verification mode, the mode hold timer is started to count down. If the preset hold time Tmode does not receive a recovery communication command, renewal command, or status query command, the energy meter exits the pulse verification mode, automatically resets the electronic selection switch path, and restores the default RS485 communication mode.

[0015] Preferably, the system is equipped with a pulse integrity verification and anomaly recovery mechanism, including: The host computer and external conversion board monitor anomalies in real time, including pulse period deviation, pulse effective width, pulse number deviation, and bus occupancy status. Based on the anomaly monitoring results, pulse jamming, pulse loss, and bus abnormal faults are identified. When an anomaly is detected, the host computer executes a graded recovery process that includes disconnecting from the pulse path, releasing the RS485 bus, retrying to send the recovery command, and triggering an over-limit alarm, ensuring the stability of batch verification.

[0016] Preferably, the electricity meter extended dedicated communication command frame includes a meter address field, a command type field, a pulse type field, a pulse polarity field, a verification hold time field, and an authorization verification field. The electricity meter will only respond to the pulse verification switching command when the command frame address matches the electricity meter address, the command frame verification is correct, the authorization authentication is successful, the meter is currently in the verification allowed state, and there is no critical parameter writing operation being performed. This will prevent accidental triggering of the verification mode.

[0017] Based on another aspect of the present invention, the present invention provides a method for pulse verification of an electricity meter based on the above-described system, the method comprising: S1. When the energy meter is powered on and initialized, the electronic selector switch is turned on by default to connect the MCU's communication transmitting pin TX and the RS485 transceiver chip's DI pin, and the energy meter is working in communication mode. S2. The host computer sends a pulse verification switching command carrying the pulse type to the energy meter via the RS485 bus. The pulse verification switching command includes the pulse type. The energy meter verifies the received pulse verification switching command. After the S3 pulse verification switching command passes the test, the energy meter will connect the pulse signal of the corresponding pulse type to the DI pin of the RS485 transceiver chip, so that the RS485 A and B terminals follow the real-time level of the pulse signal and output the corresponding differential pulse signal. S4. The upper computer controls the DTR pin output pulse path of the external conversion board to connect to the control level, so that the external conversion board converts the acquired RS485A and B differential pulse signals into standard pulse signals to the calibration bench. S5. The calibration platform collects standard pulse signals and calculates the power error based on the standard pulse signals; S6. During the verification process, the external conversion board monitors the differential status of RS485 A and B terminals in real time and continuously feeds back the pulse valid or invalid status to the host computer through the DSR pin. The host computer strictly follows the communication interlock rules. When the DSR pin indicates that the pulse is valid, it is prohibited to send any communication frame. The host computer can only send a short frame communication command when the DSR pin indicates that the pulse is invalid and the remaining idle time of the pulse meets the conditions for sending a communication frame. S7. After the calibration platform completes the calibration, the host computer confirms that the DSR pin is in the pulse inactive off state, and then controls the DTR pin to output the pulse path away from the control level, so that the pulse output path of the external conversion board is disconnected. S8. The host computer sends a recovery communication command to the energy meter via the RS485 bus. After receiving the recovery communication command, the energy meter controls the electronic selection switch to reconnect the TX pin of the MCU and the DI pin of the RS485 transceiver chip, so that the energy meter returns to the normal RS485 communication mode. S9. During the verification process, if the energy meter experiences an abnormal reset or power-on, the electronic selector switch will automatically return to the default communication state where the TX pin of the MCU and the DI pin of the RS485 transceiver chip are connected; S10. After the energy meter enters the pulse verification mode, the verification mode holding timer is started. If no recovery communication command, renewal command or status query command is received within the preset holding time Tmode, the energy meter will automatically exit the pulse verification mode and control the electronic selection switch to restore the communication path between the TX pin of the MCU and the DI pin of the RS485 transceiver chip. S11. During the verification process, the external conversion board continuously monitors the status of RS485 A and B differential signals, and monitors the duration of the pulse valid state and the duration of the pulse invalid state in real time. If the duration of the pulse valid state exceeds the preset maximum valid duration Tw_max, or the duration of the pulse invalid state exceeds the preset no pulse duration Tno_pulse, the external conversion board reports the verification abnormality to the host computer through DSR status feedback, serial port status word or alarm signal. S12. After receiving the abnormal status reported by the external conversion board, the host computer controls the DTR pin to output the pulse path to leave the control level; during the RS485 bus idle state or pulse non-valid window period, it issues a communication recovery command to drive the energy meter to switch back to the default communication mode. S13. The host computer records the number of times the recovery communication command is sent. If the recovery communication command is sent Nretry times and no valid response is obtained, the current pulse calibration is determined to be faulty, the current calibration process is stopped, and an abnormal prompt is output.

[0018] This invention provides a pulse calibration system and method for an energy meter based on RS485 interface multiplexing. The system includes an energy meter, an external conversion board, and a host computer. The energy meter internally includes an MCU, a metering module, an RS485 transceiver chip, an electronic selector switch, and a transceiver enable control circuit. The input of the electronic selector switch is connected to the TX pin of the MCU and the pulse signal output of the metering module. The output of the electronic selector switch is connected to the DI pin of the RS485 transceiver chip. The RS485 transceiver chip is equipped with external RS485 A and B differential interface terminals. The external conversion board is connected between the RS485 A and B differential interface terminals of the energy meter and the pulse input terminal of the calibration platform. The host computer is communicatively connected to the RS485 A and B differential interfaces of the energy meter and the control interface of the external conversion board. The technical solution of this invention constructs a multiplexed verification architecture consisting of an energy meter, an external conversion board, and a host computer, establishing an integrated multiplexed hardware foundation for the RS485 interface. This overcomes the shortcomings of traditional energy meter communication and pulse verification interfaces being independent, requiring additional wiring modifications, causing operational conflicts, and exhibiting poor adaptability. It effectively simplifies the verification wiring structure, is compatible with verification operations in multiple scenarios, and provides reliable hardware support for realizing time-division multiplexing of the RS485 interface and conflict-free collaborative operation of pulse verification and equipment communication. Attached Figure Description

[0019] Exemplary embodiments of the present invention can be more fully understood by referring to the following figures: Figure 1 This is a schematic diagram illustrating the principle of a pulse calibration scheme for a multiplexed 485 terminal in an energy meter according to an embodiment of the present invention. Figure 2 This is a waveform logic diagram of the internal signals of the conversion board according to an embodiment of the present invention. Detailed Implementation

[0020] Exemplary embodiments of the invention will now be described with reference to the accompanying drawings. However, the invention may be embodied in many different forms and is not limited to the embodiments described herein. These embodiments are provided to fully and completely disclose the invention and to fully convey its scope to those skilled in the art. The terminology used in the exemplary embodiments illustrated in the drawings is not intended to limit the invention. In the drawings, the same units / elements are referred to by the same reference numerals.

[0021] Unless otherwise stated, the terms used herein (including technical terms) have their common meaning as understood by one of ordinary skill in the art. Furthermore, it is understood that terms defined in commonly used dictionaries should be understood to have a meaning consistent with the context of their relevant field, and not to be interpreted as having an idealized or overly formal meaning.

[0022] This invention proposes a pulse meter testing scheme based on the RS485 interface terminals of an energy meter. By hardware multiplexing the RS485 interface (A and B terminals), it achieves parallel pulse signal acquisition and communication functions, eliminating the need for dedicated pulse terminals and additional wiring, thus simplifying the testing process and improving efficiency and compatibility. This invention does not simply connect traditional pulse signals directly to the RS485 terminals. Instead, it utilizes an internal electronic selection switch within the energy meter, RS485 differential pulse output, external conversion board pulse restoration, DTR / DSR interlock control, pulse ineffective window communication, and an automatic anomaly recovery mechanism to construct a communication / pulse multiplexing testing architecture suitable for automated energy meter testing scenarios. This architecture can balance normal RS485 communication, pulse testing, testing platform compatibility, and anomaly recovery without adding dedicated pulse terminals to the energy meter.

[0023] The verification system of the present invention comprises three parts: a multiplexing circuit for the energy meter side interface, an external conversion board, and a host computer / verification platform control process.

[0024] Figure 1 This is a schematic diagram illustrating the principle of a pulse calibration scheme for a power meter using a multiplexed 485 terminal according to an embodiment of the present invention.

[0025] This invention provides a pulse calibration system for an energy meter based on RS485 interface multiplexing. The system includes an energy meter, an external conversion board, and a host computer. The electricity meter internally includes an MCU, a metering module, an RS485 transceiver chip, an electronic selector switch, and a transceiver enable control circuit. The input of the electronic selector switch is connected to the TX pin of the MCU and the pulse signal output of the metering module, respectively. The output of the electronic selector switch is connected to the DI pin of the RS485 transceiver chip. The RS485 transceiver chip is equipped with external RS485A and B differential interface terminals. The external conversion board is connected between the RS485 A and B differential interface terminals of the energy meter and the pulse input terminal of the calibration bench. The host computer communicates with the RS485 A and B differential interfaces of the energy meter and the control interface of the external conversion board.

[0026] Preferably, the energy meter operates in communication mode by default. After power-on, the electronic selector switch automatically connects the TX pin of the MCU and the DI pin of the RS485 transceiver chip to achieve conventional RS485 communication. The host computer controls the electronic selector switch to switch the path by sending a pulse verification switching command, so that the pulse signal output by the metering module is connected to the DI pin of the RS485 transceiver chip, and the RS485 A and B differential interface terminals are multiplexed to output differential pulse signals. The transmit / receive enable control circuit automatically switches the transmit / receive state of the RS485 transceiver chip according to the input state of the DI pin: when the pulse is valid, the transmit enable is turned on and the receive enable is turned off, and differential pulses are output through the RS485 A and B terminals; when the pulse is invalid, the transmit enable is turned off and the receive enable is turned on, and the bus is released for short-term communication with the host computer. The external conversion board acquires RS485 A and B differential signals and restores them to standard pulse signals, which are then output to the calibration platform. Simultaneously, it provides real-time feedback on the pulse operating status to the host computer. Based on the pulse operating status feedback from the conversion board, the host computer implements interlock control between communication and pulse calibration, thus completing the pulse calibration operation of the energy meter.

[0027] This invention provides a multiplexing circuit for the interface on the side of an energy meter. The energy meter of this invention internally includes an MCU, an RS485 transceiver chip, an electronic selector switch, and a transceiver enable control circuit. The input terminals of the electronic selector switch are respectively connected to the TX pin of the MCU's communication transmitter and the pulse signal output terminal of the energy meter's metering module. The output terminal of the electronic selector switch is connected to the DI pin of the RS485 transceiver chip. The A and B differential terminals of the RS485 transceiver chip serve as the external RS485 interface terminals of the energy meter.

[0028] The electricity meter has at least two operating modes: 1. Communication Mode: An electronic selector switch connects the TX pin of the MCU to the DI pin of the RS485 transceiver chip, enabling the energy meter to communicate normally with the host computer via the RS485 interface. The energy meter enters communication mode by default each time it is powered on.

[0029] 2. Pulse calibration mode Pulse verification mode: The electronic selector switch selects one of the active energy pulse, reactive energy pulse or clock pulse signal output by the energy meter metering module and connects it to the DI pin of the RS485 transceiver chip, so that the pulse state is converted into a differential level state output through the RS485 A / B terminals.

[0030] To avoid the RS485 bus being in a prolonged transmit-occupied state during pulse calibration, this invention employs a pulse-driven transmit / receive enable control method. Specifically, when the pulse signal connected to the DI pin is in a pulse-active state, the transmit enable terminal DE of the RS485 transceiver chip is set to active, and the receive enable terminal RE is set to inactive or high-impedance state. The RS485 A and B terminals output differential signals corresponding to the pulse-active state. When the pulse signal is inactive, the RS485 transceiver chip releases the transmit enable or enters the receive-enabled state, allowing the host computer to send short-frame communication commands to the energy meter within the pulse-inactive window.

[0031] When the pulse signal is active low, the DI pin is low, and the RS485 A and B terminals output the first differential state. When the pulse is inactive, the DI pin returns to a high level or an idle level, and the RS485 A and B terminals return to the second differential state or a bus idle state. The first and second differential states can be configured according to the A and B pin definitions of the selected RS485 transceiver chip. In one embodiment, a pulse active state is represented by A low and B high, while a pulse inactive state is represented by A high, B low, or a bus idle state.

[0032] The energy meter of this invention can be configured with pulse polarity parameters to support either low-level active pulses or high-level active pulses. When the pulse polarity changes, the energy meter adjusts the polarity of the input signal from the electronic selector switch or configures inverting logic via the MCU to ensure that the differential state output from the RS485 A and B terminals is consistent with the pulse determination logic of the conversion board.

[0033] Preferably, the energy meter is equipped with a pulse source selection unit. The input terminal of the pulse source selection unit is connected to any multiple pulse signals from active energy pulses, reactive energy pulses, and clock pulses, and the output terminal is connected to the pulse input terminal of the electronic selection switch. The host computer issues a pulse verification switching command. Based on the pulse type field in the pulse verification switching command, the energy meter selects the corresponding pulse source through the pulse source selection unit to complete the pulse signal path switching.

[0034] Preferably, when the electronic selector switch switches a path, a safe switching procedure is performed, including: Determine if the RS485 bus is in an idle state; When the RS485 bus is idle, disable or release the RS485 transmit enable; Switch the electronic selection switch to the target signal path; Wait for the preset stabilization time Ts; Restore the RS485 transceiver chip to normal working condition; Where Ts satisfies: Ts ≥ Tsw + Tsettle Where Tsw is the maximum operating time of the electronic selector switch, and Tsettle is the settling time of the RS485 transceiver chip and the input terminal of the external conversion board.

[0035] This invention enables multi-source pulse selection and safe switching. The energy meter incorporates a pulse source selection unit. The input terminals of this unit are connected to active energy pulse signals, reactive energy pulse signals, clock pulse signals, or other verification pulse signals, while the output terminal is connected to the pulse input terminal of an electronic selector switch. When the host computer sends a pulse verification switching command, the command frame includes a pulse type field, and the energy meter selects the corresponding pulse source based on this field.

[0036] To prevent erroneous pulses from being generated during the switching between communication mode and pulse verification mode, the energy meter performs a safety switching procedure before switching the electronic selector switch, including: 1) Determine if the RS485 bus is currently in an idle state; 2) Disable or release RS485 transmit enable; 3) Switch the electronic selector switch to the target signal path; 4) Wait for the preset stabilization time Ts; 5) Allow the RS485 transceiver chip to enter transmit, receive, or automatic switching state according to the target mode.

[0037] Where Ts satisfies: Ts ≥ Tsw + Tsettle In the formula, Tsw is the maximum operating time of the electronic selector switch, and Tsettle is the settling time of the RS485 transceiver chip input and the conversion board input. This safe switching procedure avoids glitch pulses generated during the switching of the electronic selector switch, preventing false counting on the calibration bench.

[0038] Preferably, the control interface of the external conversion board includes DTR control pins and DSR status feedback pins; The DTR control pin is used to receive control signals from the host computer and switch the access and disconnection status of the pulse output path of the external conversion board; the DSR status feedback pin is used to provide real-time feedback to the host computer on the pulse validity, invalidity, or bus idle status corresponding to the current RS485 differential signal. The host computer uses the DTR control pin and DSR status feedback pin to achieve hardware interlock between communication and pulse verification, so as to prevent communication frames from being misidentified as verification pulses.

[0039] Preferably, the external conversion board has a built-in polarity configuration unit and a hysteresis filter unit; The polarity configuration unit is used to configure the correspondence between the RS485 differential voltage VAB and the pulse active state, adapting to the A and B pin definitions of different chips and supporting adaptive matching of high and low level pulses. The hysteresis filter unit is configured with a pulse validity determination threshold Vth_on, a pulse release determination threshold Vth_off, a valid confirmation filtering time Tf_on, and a release confirmation filtering time Tf_off; the pulse state switch is determined only when the differential signal continuously meets the corresponding state duration, thus filtering bus noise and glitches.

[0040] Preferably, the external conversion board has a built-in pulse widening circuit that automatically widens the output pulse to a preset standard width when the effective width of the input pulse is less than the minimum recognition width of the calibration platform.

[0041] The external conversion board of this invention is connected between the RS485 A and B terminals of the energy meter and the pulse input terminal of the calibration bench. The conversion board includes an RS485 differential signal receiving circuit, an isolation shaping circuit, a pulse output circuit, a pulse status monitoring circuit, and an RS232 control / status interface.

[0042] The RS232 control / status interface of this invention is not limited to a physical RS232 interface, but can also be a USB-to-serial virtual control interface, a host computer GPIO interface, an industrial control interface, or other equivalent control interfaces. The DTR pin or equivalent control signal is used to control the connection or disconnection of the pulse output path on the conversion board, and the DSR pin or equivalent status signal is used to provide feedback to the host computer on the pulse status corresponding to the current RS485 A and B differential signals.

[0043] The converter board may include the following functional units: Differential receiving unit: used to detect the differential voltage VAB between RS485 A and B terminals and output the logic state corresponding to the differential polarity; Polarity configuration unit: used to configure the correspondence between A and B differential signals and pulse active states, so that the conversion board can be compatible with the A and B pin definitions of different RS485 chips; Filtering and shaping unit: used to perform delay confirmation, glitch filtering, Schmitt shaping and pulse width preservation on the logic signal output by the differential receiving unit; Isolation output unit: used to output pulse signals to the calibration bench through optocoupler, digital isolator or relay isolation; Status monitoring unit: used to determine pulse valid status, pulse invalid status, bus idle status and abnormal occupation status, and feeds back to the host computer through DSR or equivalent status signal; Path control unit: Used to control the connection or disconnection of the pulse output path according to the DTR or equivalent control signal; Protection unit: Provides RS485 bus surge protection, electrostatic discharge protection, current limiting protection, and input impedance matching to adapt to the electromagnetic environment of the verification site.

[0044] When the DTR is at the pulse path access control level, the conversion board allows the RS485 differential pulse to be converted and output to the calibration bench. When the DTR is at the pulse path out of control level, even if there is a communication waveform on the RS485 A and B terminals, the conversion board will not output a valid pulse to the calibration bench, thereby avoiding the communication frame being misidentified as a calibration pulse.

[0045] Preferably, the host computer is configured with a pulse non-valid window communication mechanism, including: The host computer sends an RS485 short frame communication command only when the external conversion board feedbacks an invalid pulse through the DSR pin and is in a communication-enabled state, and the remaining idle time meets the condition Tframe + Tguard ≤ Tidle. Where Tframe is the communication frame transmission duration, Tguard is the total system delay margin, and Tidle is the remaining idle time of the pulse.

[0046] Preferably, the energy meter is set with a mode hold timer. After entering the pulse verification mode, the mode hold timer is started to count down. If the preset hold time Tmode does not receive a recovery communication command, renewal command, or status query command, the energy meter exits the pulse verification mode, automatically resets the electronic selection switch path, and restores the default RS485 communication mode.

[0047] Preferably, the system is equipped with a pulse integrity verification and anomaly recovery mechanism, including: The host computer and external conversion board monitor anomalies in real time, including pulse period deviation, pulse effective width, pulse number deviation, and bus occupancy status. Based on the anomaly monitoring results, pulse jamming, pulse loss, and bus abnormal faults are identified. When an anomaly is detected, the host computer executes a graded recovery process that includes disconnecting from the pulse path, releasing the RS485 bus, retrying to send the recovery command, and triggering an over-limit alarm, ensuring the stability of batch verification.

[0048] Preferably, the electricity meter extends a dedicated communication command frame, which includes a meter address field, a command type field, a pulse type field, a pulse polarity field, a verification hold time field, and an authorization verification field. The electricity meter will only respond to the pulse verification switching command when the command frame address matches the electricity meter address, the command frame verification is correct, the authorization authentication is successful, the meter is currently in the verification allowed state, and there is no critical parameter writing operation being performed. This will prevent accidental triggering of the verification mode.

[0049] This invention provides an interlock control method for communication and pulse verification. To prevent RS485 A and B terminals from simultaneously carrying communication frames and pulse signals, this invention sets up interlock control logic for communication and pulse verification. The interlock control logic includes internal mode interlocking of the energy meter, pulse path interlocking of the conversion board, and timing interlocking of transmission from the host computer.

[0050] This invention provides a mode switching interlock: When pulse verification is required, the host computer first sends a pulse verification switching command to the energy meter via RS485 communication. After receiving the command and passing the verification, the energy meter enters the pulse verification preparation state. In the pulse verification preparation state, the energy meter first releases the RS485 transmit enable, then controls the electronic selection switch to connect the specified pulse source to the DI pin of the RS485 transceiver chip, and enters the pulse verification state after waiting for a preset stabilization time Ts.

[0051] Subsequently, the host computer controls the DTR pin or equivalent control signal output of the conversion board to output the first control level, so that the pulse output path of the conversion board is connected, and the test bench begins to receive the pulse signal multiplexed from the RS485 A and B terminals.

[0052] When communication needs to be restored, the host computer first reads the DSR pin or equivalent status signal of the conversion board. When the DSR indicates that the current state is pulse inactive and this state continues for a preset acknowledgment time Tc, the host computer controls the DTR to output a second control level, disconnecting the pulse output path of the conversion board. Then, within the pulse inactive window, the host computer sends a communication restoration command to the energy meter via RS485. Upon receiving the communication restoration command, the energy meter controls the electronic selector switch to reconnect the MCU's TX pin to the RS485 transceiver chip's DI pin, restoring normal RS485 communication.

[0053] This invention provides a pulse ineffective window communication mechanism: In pulse calibration mode, if communication using pulse intervals is required, the host computer will only send a communication frame when the conversion board detects that the pulse is in an invalid state and the DSR pin is in a communication-enabled state. Let the duration of the pulse invalid state be Tidle, the communication frame transmission time be Tframe, and the reserved protection time be Tguard. Then, communication frame transmission is allowed when the following conditions are met: Tframe + Tguard ≤ Tidle Tguard is used to compensate for the response delay of the conversion board, the transmission delay of the RS485 bus, the action delay of the electronic selection switch inside the energy meter, the enable switching delay of the RS485 transceiver chip, and the scheduling delay of the host computer software.

[0054] The communication frame transmission time Tframe can be calculated using the following formula: Tframe = Nbyte × Nbit / Baud In the formula, Nbyte is the number of bytes in the communication frame, Nbit is the actual number of bits transmitted per byte, Nbit includes start bit, data bit, parity bit and stop bit, and Baud is the RS485 communication baud rate.

[0055] To ensure communication reliability, Tguard can be determined by the following formula: Tguard ≥ Tde-off + Tre-on + Tline + Tconv + Tmcu + Tmargin In the formula, Tde-off is the RS485 transmit enable / disable delay, Tre-on is the RS485 receive enable / open delay, Tline is the bus transmission and stabilization delay, Tconv is the conversion board status detection delay, Tmcu is the energy meter internal processing delay, and Tmargin is the reserved safety margin.

[0056] If Tframe + Tguard ≤ Tidle is not satisfied, the host computer will delay sending the communication frame until the next pulse that meets the condition is not in an effective time window.

[0057] This invention provides a communication conflict avoidance mechanism: When the DSR indicates a valid pulse, the host computer prohibits the transmission of RS485 communication frames. When the DSR indicates a invalid pulse but the duration has not yet reached Tc, the host computer continues to wait. Only when the DSR indicates a invalid pulse and continues to reach Tc, and the remaining idle time predicted based on the historical pulse period meets the conditions for transmitting the communication frame, will the host computer allow the transmission of the communication frame.

[0058] Let Tp be the period between two consecutive valid pulse edges, Tw be the valid pulse width, and Tidle_used be the duration of the current pulse's invalid state. Then, the remaining idle time Tidle_remain can be estimated as follows: Tidle_remain = Tp - Tw - Tidle_used When the following conditions are met: Tframe + Tguard ≤ Tidle_remain When the time is right, the host computer allows the transmission of communication frames; otherwise, it waits for the next pulse in an invalid window.

[0059] The above interlock control can prevent the communication frame from being mistaken for a pulse by the conversion board, and can also prevent the host computer from occupying the RS485 bus when the energy meter outputs a pulse, causing communication failure or pulse loss.

[0060] This invention provides a method for pulse signal determination and reconstruction: The conversion board determines the pulse status based on the differential voltage between the RS485 A and B terminals. Let the differential voltage be: VAB = VA - VB Where VA is the voltage at terminal A and VB is the voltage at terminal B.

[0061] Because different RS485 transceiver chips or different manufacturers may use different A and B naming conventions, the conversion board is configured with a polarity parameter P. When P = 0, VAB is in the negative direction, exceeding the threshold indicates a valid pulse; when P = 1, VAB is in the positive direction, exceeding the threshold also indicates a valid pulse. This ensures compatibility with the differential polarity definitions of different RS485 chips.

[0062] In one implementation of a low-level active pulse, when the pulse is active, the RS485 bus behaves as A low and B high. At this time: VAB = VA - VB ≤ -Vth_on The conversion board determines the candidate pulse to be valid; when VAB satisfies: VAB ≥ -Vth_off If the pulse is within a preset invalid range, the conversion board determines it to be in an invalid state. Here, Vth_on is the pulse validity threshold, Vth_off is the pulse release threshold, and it satisfies the following: Vth_on>Vth_off>0 By setting Vth_on and Vth_off to form a differential hysteresis interval, the repeated pulse state transitions caused by RS485 bus noise can be avoided.

[0063] To prevent false triggering due to glitches, the converter board is configured with an effective confirmation filter time Tf_on and a release confirmation filter time Tf_off. The converter board outputs an effective pulse only when the differential voltage continuously meets the pulse effective condition for a period of time greater than or equal to Tf_on; the converter board releases the pulse output only when the differential voltage continuously meets the pulse ineffective condition for a period of time greater than or equal to Tf_off.

[0064] This invention provides pulse state determination logic: When the current state is pulse invalid, and the time for which VAB continuously meets the pulse valid condition is ≥ Tf_on, the conversion board switches to pulse valid state and outputs a valid pulse to the calibration bench. When the current state is pulse valid, and the time for which VAB continuously meets the pulse invalid condition is ≥ Tf_off, the conversion board switches to pulse invalid state and releases pulse output; When the VAB is in the hysteresis range or the duration does not meet the filtering time requirement, the conversion board remains unchanged from the previous state.

[0065] To ensure that the pulse is not swallowed by the filtering algorithm, the effective width Tin of the input pulse should satisfy: Tin ≥ Tf_on + Tf_off + Tout_min In the formula, Tout_min is the minimum output pulse width that the calibration platform can reliably recognize. If the effective width of the input pulse is less than the above condition, the conversion board can maintain the output pulse width at the preset width Tout_set through a monostable holding circuit or software pulse widening method, and satisfy: Tout_set ≥ Tout_min The external conversion board of this invention can be configured with a pulse polarity self-learning function. After the host computer enters the pulse calibration mode, it collects the changing direction of the RS485 A and B differential signals within a preset learning time Tlearn. Based on the direction of the first stable differential pulse, it determines the polarity configuration parameter P and uses this parameter for subsequent pulse determination. If no valid differential pulse is detected within Tlearn, the conversion board maintains the original polarity configuration or reports a pulse abnormality.

[0066] This invention provides a method for calculating verification error: The external conversion board restores the differential pulses output from the multiplexed RS485 A and B terminals into pulse signals that the calibration bench can recognize. The calibration bench then performs error calculations according to the conventional energy meter calibration method. Let the number of output pulses from the energy meter under test be Nx, and the pulse constant of the energy meter under test be Cx. The number of output pulses from the standard meter be Ns, and the pulse constant of the standard meter be Cs. Then, the measured energy Ex of the energy meter under test and the measured energy Es of the standard meter are respectively: Ex = Nx / Cx Es = Ns / Cs The relative error δ of the tested electricity meter is: δ = [(Ex - Es) ​​ / Es] × 100% Right now: δ = {[(Nx / Cx) - (Ns / Cs)] / (Ns / Cs)} × 100% The units of Cx and Cs can be imp / kWh or imp / kvarh, depending on the type of active or reactive energy verification.

[0067] Using the above method, the calibration platform does not need to be connected to the dedicated pulse terminal of the electricity meter; pulse acquisition and error calibration can be completed using the original RS485 A and B terminals of the electricity meter.

[0068] This invention provides a method for pulse integrity verification and anomaly recovery: To improve the reliability of the verification, this invention also includes a pulse integrity check and anomaly recovery mechanism. The conversion board or host computer determines whether the current verification is abnormal based on the pulse period, pulse width, pulse quantity, and bus status.

[0069] Let the time interval between the effective edges of two consecutive pulses be Tp, and the effective pulse width be Tw. Under stable load conditions, if M consecutive pulse periods satisfy: |Tp(i) - Tp_avg|>εp × Tp_avg Then, the pulse period is judged to be abnormal; where Tp(i) is the i-th pulse period, Tp_avg is the average value of the previous several pulse periods, and εp is the allowable period deviation coefficient.

[0070] If the duration of the active pulse state (Tw) exceeds the preset maximum active pulse width (Tw_max), it is determined that there may be a problem with the RS485 bus being continuously occupied, the electronic selector switch being malfunctioning, or the pulse signal being stuck. If the duration of the inactive pulse state exceeds the preset maximum waiting time (Tno_pulse), and the calibration platform is in the calibration condition where pulse output is expected, it is determined that there may be a problem with pulse loss or pulse path disconnection.

[0071] Tno_pulse can be determined based on the test load power and the energy meter pulse constant. Let the test power be Ptest (kW) and the energy meter pulse constant be Cx (imp / kWh), then the theoretical pulse frequency fx is: fx = Ptest × Cx / 3600 The theoretical pulse period Ttheory is: Ttheory = 1 / fx = 3600 / (Ptest × Cx) Configurable settings: Tno_pulse = K × Ttheory Where K is the timeout coefficient, and K is greater than 1.

[0072] When any of the following anomalies are detected, the host computer executes the anomaly recovery procedure: DSR maintains pulse validity for an extended period of time; The DSR remains in an invalid pulse state for an extended period and fails to detect the expected pulse. The electricity meter did not respond after the command to restore communication was sent; The RS485 bus is continuously occupied or there is a communication conflict; The number of pulses output by the converter board deviates from the expected number of pulses by more than the threshold.

[0073] The fault recovery process includes: Control the DTR output pulse path to be removed from the control level; Waiting for the RS485 bus to return to idle; Resend the recovery communication command within the pulse's ineffective window; If the number of retries exceeds Nretry, report the verification error to the verification platform or host computer. If the electricity meter does not receive a valid communication command after the preset pulse verification hold time Tmode has elapsed, it will automatically revert to the default communication mode.

[0074] By using pulse integrity verification and anomaly recovery mechanisms, the electricity meter or conversion board can be prevented from remaining in an abnormal state for a long time, thereby improving the reliability of the batch automated verification process.

[0075] This invention provides communication command frames and permission verification: This invention extends pulse calibration control commands into the communication protocol of electricity meters. The control commands include at least pulse calibration switching commands, communication recovery commands, pulse type selection commands, pulse polarity configuration commands, status query commands, and fault reset commands.

[0076] The pulse calibration switching command includes, but is not limited to, the following fields: Table address field; Command type field; Pulse type field; Pulse polarity field; Verification retention time field; Validation fields; Authentication field.

[0077] Among them, the pulse type field is used to indicate whether the current output is an active pulse, reactive pulse, clock pulse or other verification pulse; the pulse polarity field is used to indicate whether it is active low or active high; and the verification hold time field is used to limit the maximum time for the energy meter to hold the pulse verification mode.

[0078] To prevent accidental operation from causing the electricity meter to enter pulse verification mode, the electricity meter will only respond to the pulse verification switching command when the following conditions are met: The command frame address matches the electricity meter address; Command frame verification is correct; Authentication successful; Currently in a state where verification is permitted; There are currently no write operations for critical metering parameters being executed.

[0079] If any of the above conditions are not met, the electricity meter will refuse to enter the pulse verification mode and will remain in the default communication state.

[0080] The energy meter of this invention starts a mode hold timer after entering pulse calibration mode. When the mode hold time reaches Tmode and no valid renewal command or communication recovery command is received, the energy meter automatically exits the pulse calibration mode, and the electronic selector switch returns to the default communication state where the MCU TX and RS485 transceiver chip DI pins are connected.

[0081] The present invention provides a pulse calibration system for energy meters based on RS485 interface multiplexing, comprising: 1. RS485 interface terminal multiplexing structure The protective energy meter uses an internal electronic selector switch to selectively connect the MCU communication TX signal and the metering pulse signal to the RS485 transceiver chip DI pin, thus enabling the same set of RS485 A and B terminals to be used for both normal communication and output verification pulses.

[0082] 2. Pulse output method based on RS485 differential signal The protection system converts the active pulses, reactive pulses, or clock pulses of the energy meter into differential signal outputs on RS485 terminals A and B, and uses the A and B differential level states to characterize the effective or ineffective state of the pulses.

[0083] 3. External conversion plate structure The protection is provided by a conversion board between the RS485 A and B terminals of the energy meter and the calibration bench. The conversion board includes an RS485 differential receiving circuit, an isolation shaping circuit, a pulse output circuit, a pulse status monitoring circuit, and an RS232 control / status interface, which is used to restore the RS485 differential pulses into pulse signals that can be recognized by the calibration bench.

[0084] 4. Method for switching between communication mode and pulse detection mode The control process for protecting the electricity meter is to switch to pulse verification mode or restore communication mode by means of extended communication commands when it is powered on.

[0085] 5. Pulse status monitoring and communication interlock mechanism The protection conversion board feeds back the pulse valid / invalid status to the host computer through the DSR pin. The host computer decides whether to send an RS485 communication frame based on this status and controls the connection or disconnection of the pulse path of the conversion board through the DTR pin to avoid the communication signal and pulse signal conflict.

[0086] 6. Pulse Ineffective Window Communication Mechanism The protection method in pulse verification mode is a control method in which the host computer sends a communication frame only during the period when the pulse is not valid and the communication frame transmission time meets the preset time condition.

[0087] 7. RS485 transmit / receive enable automatic commutation circuit This paper presents a circuit design for protecting the RS485 chip's RE / DE transceiver enable pin, which automatically switches between receive and transmit states based on the DI input state. Specifically, it describes the implementation method where the chip automatically enters transmit mode when DI is a pulse active level and allows receive communication when DI is inactive.

[0088] 8. Compatible with the pulse recovery output mode of the calibration bench. The protection conversion board converts RS485 differential pulses into electrical pulses, photoelectric pulses, or clock pulses for output, enabling existing calibration benches to complete the error calibration of electricity meters without modification.

[0089] 9. Abnormal recovery and default safe state The protection meter will automatically revert to RS485 communication mode after power failure, reset, or power restoration, preventing the meter from maintaining pulse calibration mode for extended periods and thus affecting on-site communication and maintenance safety control.

[0090] 10. An integrated verification system consisting of an electricity meter, conversion board, host computer, and verification platform. The protection includes the complete pulse calibration system, which consists of the electricity meter side terminal multiplexing circuit, external conversion board, host computer control program, and calibration platform pulse acquisition module.

[0091] 11. Pulse-driven RS485 transmit / receive enable control method In pulse detection mode, the RS485 transceiver chip is not always in the transmitting state. Instead, it automatically controls the transmit enable and receive enable according to the pulse's valid and invalid states, enabling differential pulse output during the valid pulse period and allowing RS485 communication during the invalid pulse period.

[0092] 12. Differential pulse polarity configuration or adaptive recognition mechanism The protection conversion board uses a technical solution to configure or self-learn to identify the effective direction of the differential pulse according to the A and B pin definitions of different RS485 chips, so as to be compatible with different implementations when the pulse is active: A low and B high or A high and B low.

[0093] 13. Differential Threshold Hysteresis and Filtering Shaping Method The protection converter board uses a technical solution based on Vth_on, Vth_off, Tf_on, and Tf_off to perform hysteresis detection and filtering confirmation on RS485 differential pulses, in order to prevent erroneous pulse output caused by bus noise, communication glitches, or switching transients.

[0094] 14. Automatic recovery mechanism for verification mode timeout The safety control mechanism ensures that after the energy meter enters the pulse verification mode, it starts a mode hold timer. If no valid renewal command or communication recovery command is received within the preset time, it will automatically revert to the default RS485 communication mode.

[0095] 15. Pulse integrity verification and anomaly recovery mechanism The protection conversion board or host computer determines the detection anomaly based on the pulse period, pulse width, pulse number, DSR status, and RS485 bus occupancy status, and performs an anomaly recovery process by disconnecting the pulse path from the DTR, sending a recovery communication command, retrying, or triggering an alarm.

[0096] 16. Pulse Path Error Prevention Mechanism This protection mechanism, which disconnects the pulse output path of the conversion board via DTR or equivalent control signals during communication mode or communication recovery, prevents the RS485 communication frame from being mistakenly identified as a pulse by the testing platform.

[0097] 17. Communication command permission verification mechanism The safety control scheme protects the electricity meter from responding to the pulse verification switching command only when the address matches, the command verification is correct, the authorization authentication is successful, and the meter is in a verification-allowed state.

[0098] The present invention has the following technical effects: (1) Reduce the number of auxiliary terminals and wiring. This invention reuses RS485 A and B terminals as pulse output terminals, which reduces the need for dedicated pulse output terminals or the reliance on dedicated pulse terminals in the energy meter. During testing, there is no need to connect a separate pulse acquisition line, reducing the complexity of manual wiring and the probability of incorrect wiring.

[0099] (2) Improve the efficiency of automated verification The host computer of this invention can switch between communication mode and pulse verification mode via communication commands, eliminating the need for manual plugging and unplugging of pulse lines. For batch verification scenarios, this reduces the time spent on meter installation, wiring, disconnection, and verification, thereby improving the efficiency of the verification pipeline.

[0100] (3) Avoid communication and pulse output conflicts The conversion board of this invention provides feedback on the pulse status through the DSR pin. The host computer sends communication frames based on the DSR status and the pulse ineffective time window, and controls the pulse path to disconnect through the DTR pin, thereby avoiding false detection, false counting or communication failure caused by simultaneous transmission of communication frames and pulse signals through the RS485 terminal.

[0101] (4) Compatible with existing calibration benches The output of the conversion board of this invention can still provide the electrical pulse, photoelectric pulse or clock pulse forms commonly used in the calibration platform. Therefore, there is no need to make major modifications to the existing calibration platform. Only the addition of the conversion board is required to realize RS485 terminal multiplexing calibration.

[0102] (5) Improve the structural integration of electricity meters The energy meter of this invention maintains the communication mode by default upon power-on, meeting the existing needs for meter reading, parameter setting, and maintenance; it only enters the pulse verification mode after receiving a dedicated switching command, without affecting the normal field communication function of the energy meter.

[0103] (6) Reduce hardware and maintenance costs This invention reduces the need for dedicated pulse terminals, pulse output drive circuits, and related terminal structures in electricity meters, which is beneficial for simplifying the terminal blocks of electricity meters, optimizing the housing structure, and reducing production and assembly costs.

[0104] This invention provides a method for pulse verification of an energy meter based on an RS485 interface multiplexing-based energy meter pulse verification system. The method includes: S1. When the energy meter is powered on and initialized, the electronic selector switch is turned on by default to connect the MCU's communication transmission pin TX and the RS485 transceiver chip's DI pin, and the energy meter is working in communication mode. S2. The host computer sends a pulse verification switching command carrying the pulse type to the energy meter via the RS485 bus. The pulse verification switching command includes the pulse type. The energy meter verifies the received pulse verification switching command. After the S3 pulse verification switching command passes the test, the energy meter will connect the pulse signal of the corresponding pulse type to the DI pin of the RS485 transceiver chip, so that the RS485 A and B terminals follow the real-time level of the pulse signal and output the corresponding differential pulse signal. S4. The upper computer controls the DTR pin output pulse path of the external conversion board to connect to the control level, so that the external conversion board converts the acquired RS485A and B differential pulse signals into standard pulse signals to the calibration bench. S5. The calibration platform collects standard pulse signals and calculates the power error based on the standard pulse signals; S6. During the verification process, the external conversion board monitors the differential status of RS485 A and B terminals in real time and continuously feeds back the pulse valid or invalid status to the host computer through the DSR pin. The host computer strictly follows the communication interlock rules. When the DSR pin indicates that the pulse is valid, it is prohibited to send any communication frame. The host computer can only send a short frame communication command when the DSR pin indicates that the pulse is invalid and the remaining idle time of the pulse meets the conditions for sending a communication frame. S7. After the calibration platform completes the calibration, the host computer confirms that the DSR pin is in the pulse inactive off state, and then controls the DTR pin to output the pulse path away from the control level, so that the pulse output path of the external conversion board is disconnected. S8. The host computer sends a recovery communication command to the energy meter via the RS485 bus. After receiving the recovery communication command, the energy meter controls the electronic selection switch to reconnect the TX pin of the MCU and the DI pin of the RS485 transceiver chip, so that the energy meter returns to the normal RS485 communication mode. S9. During the verification process, if the energy meter experiences an abnormal reset or power-on, the electronic selector switch will automatically return to the default communication state where the TX pin of the MCU and the DI pin of the RS485 transceiver chip are connected; S10. After the energy meter enters the pulse verification mode, the verification mode holding timer is started. If no recovery communication command, renewal command or status query command is received within the preset holding time Tmode, the energy meter will automatically exit the pulse verification mode and control the electronic selection switch to restore the communication path between the TX pin of the MCU and the DI pin of the RS485 transceiver chip. S11. During the verification process, the external conversion board continuously monitors the status of RS485 A and B differential signals, and monitors the duration of the pulse valid state and the duration of the pulse invalid state in real time. If the duration of the pulse valid state exceeds the preset maximum valid duration Tw_max, or the duration of the pulse invalid state exceeds the preset no pulse duration Tno_pulse, the external conversion board reports the verification abnormality to the host computer through DSR status feedback, serial port status word or alarm signal. S12. After receiving the abnormal status reported by the external conversion board, the host computer controls the DTR pin to output the pulse path to leave the control level; during the RS485 bus idle state or pulse non-valid window period, it issues a communication recovery command to drive the energy meter to switch back to the default communication mode. S13. The host computer records the number of times the recovery communication command is sent. If the recovery communication command is sent Nretry times and no valid response is obtained, the current pulse calibration is determined to be faulty, the current calibration process is stopped, and an abnormal prompt is output.

[0105] The following are examples illustrating embodiments of the present invention: The internal signal switching of the electricity meter involves adding an electronic selection switch (3) between the MCU (1) and the 485 chip (2) of the electricity meter.

[0106] When the energy meter receives a pulse calibration command from the host computer, it inputs active pulse, reactive pulse, or clock pulse signals into the DI pin of the RS485 transceiver chip. At this time, the RS485 transceiver chip's DE / RE control does not use a always-enabled transmit mode, but rather an automatic switching mode or equivalent control mode that changes according to the DI input state: when the pulse corresponding to DI is valid, DE transmit is enabled, causing the RS485 A / B terminals to output differential pulses; when the pulse corresponding to DI is invalid, DE transmit is released, and RE receive is enabled or allowed to receive, allowing the host computer to send a communication recovery command or status query command via the RS485 bus within the pulse invalid window. Through this method, the energy meter can output differential pulses in pulse calibration mode without occupying the RS485 bus for extended periods, thus ensuring timing compatibility between pulse calibration and short-frame communication.

[0107] When the energy meter receives a communication switching command (switching to 485 communication mode) from the host computer, it needs to switch the MCU's TX pin to the DI pin and simultaneously enable the 485 chip's RE (receive enable) function. By default, the energy meter switches the TX pin to the DI pin each time it powers on. The 485 chip's receive / transmit enable control uses an automatic switching circuit design. Its overall function is to allow the RS-485 chip's receive / transmit enable to be controlled by the input signal following DI, reducing the overhead of the MCU I / O ports. The operating state is: when DI is low, it automatically switches to transmit enable control; when DI is high, it automatically switches to receive enable control. The energy meter's communication protocol is extended by adding command frames such as pulse switching.

[0108] The internal working principle of the converter board is as follows: When in pulse verification mode, the DTR output of the RS232 interface (4) is low; the internal electronic selection switch of the energy meter connects the pulse signal to the DI pin, and at the same time controls the DE pin to be in the transmit enable state. When the pulse is valid, DI is low; the 485 bus signal A is low and B is high, the LED (5) of the converter board is lit, and the optocouplers U3 and U4 are turned on. The pulse terminal or clock terminal (6) of the platform can be used for verification.

[0109] In communication mode: The host computer mainly communicates with the energy meter through the RS485 communication box (7) link. According to the above-mentioned automatic switching working principle of the energy meter's 485 chip's receive / transmit enable, if the host computer wants to communicate, it needs to monitor the DSR pin status of RS232. If DSR changes from low to high, a communication command can be sent (that is, during the high level period of each DSR waveform, it is necessary to ensure that the 485 communication command frame is sent); at the same time, it is necessary to control the DTR output of the RS232 interface to be high, so that the pulse path of the conversion board is disconnected, and to prevent the pulse light of the conversion board from flashing during communication.

[0110] The internal signal logic timing of the conversion board of this invention is shown below. Figure 2 .

[0111] In a preferred embodiment, the operating states of the present invention include the following three:

[0112] The specific control steps of the pulse calibration method for electricity meters in this invention are as follows: S1. After the energy meter is powered on, the electronic selector switch connects the TX pin of the MCU to the DI pin of the RS485 transceiver chip by default, and the energy meter is in the default communication state.

[0113] S2, the host computer sends a pulse verification switching command to the energy meter through the RS485 communication link. The command contains pulse type information, which includes active pulse, reactive pulse or clock pulse.

[0114] S3, after the energy meter receives the pulse verification switching command and passes the verification, it controls the electronic selection switch to disconnect the connection between TX and DI, and connects the corresponding pulse signal to the DI pin, while simultaneously putting the RS485 transceiver chip into a state where it can output differential signals.

[0115] S4, the DTR pin of the RS232 interface of the host computer control conversion board outputs a pulse path to the control level, so that the conversion board converts the RS485 A and B differential signals into pulse signals that can be recognized by the calibration platform.

[0116] S5, the calibration platform acquires the pulse signal output by the conversion board and calculates the error by combining it with the standard meter pulse.

[0117] S6. During the verification process, the conversion board monitors the differential status of RS485 A and B terminals in real time and feeds back the pulse validity or invalidity status to the host computer via the DSR pin. When the DSR indication pulse is valid, the host computer does not send a communication frame; when the DSR indication pulse is invalid and the duration meets the requirements for sending a communication frame, the host computer can send an authorized short frame communication command.

[0118] S7. After the verification is completed, the host computer first judges the status of the DSR pin and confirms that it is currently in a pulse inactive state; then it controls the output pulse path of the DTR pin to leave the control level, so that the pulse output path of the conversion board is disconnected.

[0119] S8, the host computer sends a communication recovery command to the energy meter via RS485. After receiving the communication recovery command, the energy meter controls the electronic selection switch to reconnect the MCU's TX pin to the RS485 transceiver chip's DI pin, and the energy meter resumes normal RS485 communication.

[0120] S9. If the energy meter is abnormally reset or powered on again, the electronic selector switch will automatically return to the default communication state where TX and DI are connected, preventing the energy meter from staying in the pulse verification mode for a long time and affecting on-site communication.

[0121] S10: After the energy meter enters the pulse verification mode, the verification mode hold timer is started. If no recovery communication command, renewal command, or status query command is received within the preset hold time Tmode, the energy meter automatically exits the pulse verification mode and restores the electronic selector switch to the communication path between the MCU TX and the RS485 transceiver chip DI pin.

[0122] S11, the converter board continuously monitors the RS485 A and B differential signals during the calibration process. If the duration of the active pulse exceeds Tw_max, or the duration of the inactive pulse exceeds Tno_pulse, the converter board reports the abnormality to the host computer through the DSR status, serial port status word, or alarm signal.

[0123] S12, after receiving an abnormal status, the host computer first controls the DTR output pulse path to leave the control level to prevent the calibration platform from continuing to count incorrectly; then, it sends a recovery communication command within the RS485 bus idle or pulse ineffective window to make the energy meter return to the default communication state.

[0124] S13. If the host computer fails to send the recovery communication command N times in a row, the host computer will determine that the current verification is abnormal, stop the current verification process, and prompt manual handling or execute the power-on reset process of the energy meter.

[0125] The present invention has been described with reference to a few embodiments. However, it will be apparent to those skilled in the art that other embodiments besides those disclosed above fall equivalently within the scope of the present invention.

[0126] Generally, all terms used in this invention are interpreted according to their ordinary meaning in the art, unless otherwise expressly defined herein. All references to "a / / the [device, component, etc.]" are openly interpreted as at least one instance of a device, component, etc., unless otherwise expressly stated. The steps of any method disclosed herein need not be performed in the exact order disclosed, unless explicitly stated otherwise.

[0127] Those skilled in the art will understand that embodiments of the present invention can be provided as methods, systems, or computer program products. Therefore, the present invention can take the form of a completely hardware embodiment, a completely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention can take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0128] This invention is described with reference to flowchart illustrations and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each block of the flowchart illustrations and / or block diagrams, and combinations of blocks in the flowchart illustrations and / or block diagrams, can be implemented by computer program instructions. These computer program instructions can be provided to a processor of a general-purpose computer, special-purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, generate instructions for implementing the flowchart illustrations and / or block diagrams. Figure 1 One or more processes and / or boxes Figure 1 A device that provides the functions specified in one or more boxes.

[0129] These computer program instructions may also be stored in a computer-readable storage medium that can direct a computer or other programmable data processing device to function in a particular manner, such that the instructions stored in the computer-readable storage medium produce an article of manufacture including instruction means, which are implemented in a process Figure 1 One or more processes and / or boxes Figure 1 The function specified in one or more boxes.

[0130] These computer program instructions may also be loaded onto a computer or other programmable data processing equipment to cause a series of operational steps to be performed on the computer or other programmable equipment to produce a computer-implemented process, thereby providing instructions that execute on the computer or other programmable equipment for implementing the process. Figure 1 One or more processes and / or boxes Figure 1 The steps of the function specified in one or more boxes.

[0131] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and not to limit it. Although the present invention has been described in detail with reference to the above embodiments, those skilled in the art should understand that modifications or equivalent substitutions can still be made to the specific implementation of the present invention. Any modifications or equivalent substitutions that do not depart from the spirit and scope of the present invention should be covered within the protection scope of the present invention.

Claims

1. A pulse verification system for energy meters based on RS485 interface multiplexing, characterized in that, The system includes an electricity meter, an external conversion board, and a host computer. The energy meter internally includes an MCU, a metering module, an RS485 transceiver chip, an electronic selector switch, and a transceiver enable control circuit. The input terminal of the electronic selector switch is connected to the communication transmit pin TX of the MCU and the pulse signal output terminal of the metering module, respectively. The output terminal of the electronic selector switch is connected to the DI pin of the RS485 transceiver chip. The RS485 transceiver chip is equipped with external RS485 A and B differential interface terminals. The external conversion board is connected between the RS485 A and B differential interface terminals of the energy meter and the pulse input terminal of the calibration platform. The host computer is communicatively connected to the RS485 A and B differential interfaces of the energy meter and the control interface of the external conversion board.

2. The system according to claim 1, characterized in that, The energy meter operates in communication mode by default. After power-on, the electronic selection switch automatically connects the TX pin of the MCU and the DI pin of the RS485 transceiver chip to achieve conventional RS485 communication. The host computer controls the electronic selection switch to switch the path by issuing a pulse verification switching command, so that the pulse signal output by the metering module is connected to the DI pin of the RS485 transceiver chip, and the RS485 A and B differential interface terminals are multiplexed to output differential pulse signals. The transmit / receive enable control circuit automatically switches the transmit / receive state of the RS485 transceiver chip according to the input state of the DI pin: when the pulse is active, the transmit enable is turned on and the receive enable is turned off, and differential pulses are output through the RS485 A and B terminals; When the pulse is inactive, the transmit enable is turned off, the receive enable is turned on, and the bus is released for short-term communication with the host computer. The external conversion board acquires RS485 A and B differential signals and restores them to standard pulse signals, which are then output to the calibration platform. Simultaneously, it provides real-time feedback on the pulse operating status to the host computer. The host computer implements interlock control between communication and pulse calibration based on the pulse operating status feedback from the conversion board, thereby completing the pulse calibration operation of the energy meter.

3. The system according to claim 1, characterized in that, The energy meter is equipped with a pulse source selection unit. The input terminal of the pulse source selection unit is connected to any multiple pulse signals from active energy pulses, reactive energy pulses, and clock pulses, and the output terminal is connected to the pulse input terminal of the electronic selection switch. The energy meter selects the corresponding pulse source by matching the pulse source selection unit according to the pulse type field in the pulse verification switching command issued by the host computer, thereby completing the pulse signal path switching.

4. The system according to claim 1, characterized in that, The electronic selector switch performs a safe switching procedure when switching paths, including: Determine if the RS485 bus is in an idle state; When the RS485 bus is idle, disable or release the RS485 transmit enable; Switch the electronic selection switch to the target signal path; Wait for the preset stabilization time Ts; Restore the RS485 transceiver chip to normal working condition; Where Ts satisfies: Ts ≥ Tsw + Tsettle Where Tsw is the maximum operating time of the electronic selector switch, and Tsettle is the settling time of the RS485 transceiver chip and the input terminal of the external conversion board.

5. The system according to claim 1, characterized in that, The control interface of the external conversion board includes DTR control pins and DSR status feedback pins; The DTR control pin is used to receive control signals from the host computer and switch the access and disconnection status of the pulse output path of the external conversion board; the DSR status feedback pin is used to provide real-time feedback to the host computer on the pulse validity, invalidity, or bus idle status corresponding to the current RS485 differential signal. The host computer uses the DTR control pin and DSR status feedback pin to achieve hardware interlock between communication and pulse verification, so as to prevent communication frames from being misidentified as verification pulses.

6. The system according to claim 1, characterized in that, The external conversion board has a built-in polarity configuration unit and a hysteresis filter unit. The polarity configuration unit is used to configure the correspondence between the RS485 differential voltage VAB and the pulse active state, adapt to the A and B pin definitions of different chips, and support adaptive matching of high and low level pulses. The hysteresis filter unit is configured with a pulse validity determination threshold Vth_on, a pulse release determination threshold Vth_off, a valid confirmation filtering time Tf_on, and a release confirmation filtering time Tf_off; the pulse state switch is determined only when the differential signal continuously meets the corresponding state duration, thus filtering bus noise and glitches.

7. The system according to claim 6, characterized in that, The external conversion board has a built-in pulse widening circuit. When the effective width of the input pulse is less than the minimum recognition width of the calibration table, the output pulse will be automatically widened to a preset standard width.

8. The system according to claim 1, characterized in that, The host computer is configured with a pulse non-valid window communication mechanism, including: The host computer sends an RS485 short frame communication command only when the external conversion board feedbacks an invalid pulse through the DSR pin and is in a communication-enabled state, and the remaining idle time meets the condition Tframe + Tguard ≤ Tidle. Where Tframe is the communication frame transmission duration, Tguard is the total system delay margin, and Tidle is the remaining idle time of the pulse.

9. The system according to claim 1, characterized in that, The energy meter is set to a mode hold timer. After entering the pulse verification mode, the mode hold timer is started to count down. If the preset hold time Tmode does not receive a recovery communication command, renewal command, or status query command, the energy meter exits the pulse verification mode, automatically resets the electronic selection switch path, and restores the default RS485 communication mode.

10. The system according to claim 1, characterized in that, The system is equipped with a pulse integrity verification and anomaly recovery mechanism, including: The host computer and external conversion board monitor anomalies in real time, including pulse period deviation, pulse effective width, pulse number deviation, and bus occupancy status. Based on the anomaly monitoring results, pulse jamming, pulse loss, and bus abnormal faults are identified. When an anomaly is detected, the host computer executes a graded recovery process that includes disconnecting from the pulse path, releasing the RS485 bus, retrying to send the recovery command, and triggering an over-limit alarm, ensuring the stability of batch verification.

11. The system according to claim 1, characterized in that, The electricity meter extended dedicated communication command frame includes a meter address field, a command type field, a pulse type field, a pulse polarity field, a verification hold time field, and an authorization verification field. The electricity meter will only respond to the pulse verification switching command when the command frame address matches the electricity meter address, the command frame verification is correct, the authorization authentication is successful, the meter is currently in the verification allowed state, and there is no critical parameter writing operation being performed. This will prevent accidental triggering of the verification mode.

12. A method for pulse verification of an electricity meter based on the system according to any one of claims 1-11, the method comprising: S1. When the energy meter is powered on and initialized, the electronic selector switch is turned on by default to connect the MCU's communication transmitting pin TX and the RS485 transceiver chip's DI pin, and the energy meter is working in communication mode. S2. The host computer sends a pulse verification switching command carrying the pulse type to the energy meter via the RS485 bus. The pulse verification switching command includes the pulse type. The energy meter verifies the received pulse verification switching command; After the S3 pulse verification switching command passes the test, the energy meter will connect the pulse signal of the corresponding pulse type to the DI pin of the RS485 transceiver chip, so that the RS485 A and B terminals follow the real-time level of the pulse signal and output the corresponding differential pulse signal. S4. The upper computer controls the DTR pin output pulse path of the external conversion board to connect to the control level, so that the external conversion board converts the acquired RS485A and B differential pulse signals into standard pulse signals to the calibration bench. S5. The calibration platform collects standard pulse signals and calculates the power error based on the standard pulse signals; S6. During the verification process, the external conversion board monitors the differential status of RS485 A and B terminals in real time and continuously feeds back the pulse valid or invalid status to the host computer through the DSR pin. The host computer strictly follows the communication interlock rules. When the DSR pin indicates that the pulse is valid, it is prohibited to send any communication frame. The host computer can only send a short frame communication command when the DSR pin indicates that the pulse is invalid and the remaining idle time of the pulse meets the conditions for sending a communication frame. S7. After the calibration platform completes the calibration, the host computer confirms that the DSR pin is in the pulse inactive off state, and then controls the DTR pin to output the pulse path away from the control level, so that the pulse output path of the external conversion board is disconnected. S8. The host computer sends a recovery communication command to the energy meter via the RS485 bus. After receiving the recovery communication command, the energy meter controls the electronic selection switch to reconnect the TX pin of the MCU and the DI pin of the RS485 transceiver chip, so that the energy meter returns to the normal RS485 communication mode. S9. During the verification process, if the energy meter experiences an abnormal reset or power-on, the electronic selector switch will automatically return to the default communication state where the TX pin of the MCU and the DI pin of the RS485 transceiver chip are connected; S10. After the energy meter enters the pulse verification mode, the verification mode holding timer is started. If no recovery communication command, renewal command or status query command is received within the preset holding time Tmode, the energy meter will automatically exit the pulse verification mode and control the electronic selection switch to restore the communication path between the TX pin of the MCU and the DI pin of the RS485 transceiver chip. S11. During the verification process, the external conversion board continuously monitors the status of RS485 A and B differential signals and monitors the duration of pulse valid state and pulse invalid state in real time. If the duration of the pulse valid state exceeds the preset maximum valid duration Tw_max, or the duration of the pulse invalid state exceeds the preset no pulse duration Tno_pulse, the external conversion board will report the verification abnormality to the host computer through DSR status feedback, serial port status word or alarm signal. S12. After receiving the abnormal status reported by the external conversion board, the host computer controls the DTR pin to output the pulse path to leave the control level; during the RS485 bus idle state or pulse non-valid window period, it issues a communication recovery command to drive the energy meter to switch back to the default communication mode. S13. The host computer records the number of times the recovery communication command is sent. If the recovery communication command is sent Nretry times and no valid response is obtained, the current pulse calibration is determined to be faulty, the current calibration process is stopped, and an abnormal prompt is output.