Dual-core electric energy meter clock synchronization circuit, method, electronic equipment and medium
By setting up a second pulse signal interface in the clock synchronization circuit of the dual-core electric energy meter, the legal unit can promptly send interrupt signals to the management unit, solving the problem of inaccurate clock synchronization in the existing technology, ensuring the normal operation of the electric energy meter and the consistency of data clocks.
Patent Information
- Application Number
- CN202111439707.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-11-30
- Publication Date
- 2025-04-25
- Estimated Expiration
- 2041-11-30
AI Technical Summary
The existing clock synchronization method of dual-core electric energy meters has low communication success rate, communication delay and abnormality. The management part cannot obtain the clock data as soon as possible, resulting in the clock being unable to be synchronized, affecting the normal recording and management of the electric energy meters.
A dual-core electrical energy meter clock synchronization circuit is designed, including a legal unit and a management unit. By setting a second pulse signal interface at the output end of the clock circuit of the legal unit and connecting it to the processor, the legal unit promptly sends an interrupt trigger signal to the management unit after obtaining the hardware clock, and completes clock synchronization.
Ensure the clock synchronization between the legal unit and the management unit, reduce clock deviation, and ensure the normal operation of the power meter and the consistency of data clocks.
Smart Images

Figure CN114355032B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of electric energy meters, and in particular to a dual-core electric energy meter clock synchronization circuit, method, electronic equipment and medium. Background Art
[0002] In the field of electric energy meters, dual-core electric energy meters are a common multi-core modular electric energy meter that meets the requirements of IR46. Existing dual-core electric energy meters usually include independent legal and management parts when performing clock timing work. The clock management of the dual-core electric energy meter is based on the legal part, and the management part uses the clock (or time) read from the legal part as the clock basis for its own management. Since the clock is an important basis for the legal part and the management part of the dual-core electric energy meter to record events and freeze records, it is crucial for the legal part and the management part of the dual-core electric energy meter to achieve accurate clock synchronization, which is crucial for the normal operation of the dual-core electric energy meter.
[0003] The existing traditional clock synchronization method for dual-core electric energy meters mainly uses the legal part as the clock. The legal part uploads clock data to the management part every second for synchronization of the management part clock. The management part does not have a clock chip and clock crystal oscillator.
[0004] However, there are some problems with the existing traditional clock synchronization method for dual-core electricity meters: when the management part and the clock part of the dual-core electricity meter obtain clock data through interactive communication, once the communication success rate between the two is low or the communication is delayed or there are abnormal situations such as the legal part running cleanup, the management part will not be able to obtain the clock data of the clock part in the first time, which will eventually lead to various problems caused by the inability to synchronize the clock, affecting the normal recording and management of the dual-core electricity meter. Summary of the invention
[0005] The first technical problem to be solved by the present invention is to provide a dual-core electric energy meter clock synchronization circuit for the above-mentioned prior art.
[0006] The second technical problem to be solved by the present invention is to provide a dual-core electric energy meter clock synchronization method applied to the above-mentioned dual-core electric energy meter clock synchronization circuit in view of the above-mentioned prior art.
[0007] The third technical problem to be solved by the present invention is to provide an electronic device for realizing the clock synchronization method of the dual-core electric energy meter.
[0008] The fourth technical problem to be solved by the present invention is to provide a readable storage medium for implementing the above-mentioned dual-core electric energy meter clock synchronization method.
[0009] The technical solution adopted by the present invention to solve the first technical problem is: a dual-core electric energy meter clock synchronization circuit, comprising:
[0010] A legal unit having a first processor and a clock circuit;
[0011] The management unit has a second processor, and the second processor is connected to the first processor of the legal unit through a clock synchronization pin;
[0012] The invention is characterized in that the output end of the clock circuit of the legal unit is connected to a pulse per second signal interface, and the pulse per second signal interface is connected to the first processor.
[0013] The technical solution adopted by the present invention to solve the second technical problem is: a dual-core electric energy meter clock synchronization method applied to the dual-core electric energy meter clock synchronization circuit, characterized in that it includes the following steps:
[0014] Step S1, the output end of the clock circuit outputs a second-changing square wave signal to a second pulse signal interface;
[0015] Step S2, detecting the signal at the pulse per second signal interface;
[0016] Step S3, making a judgment based on the detected signal:
[0017] When the signal is a falling edge, go to step S4; otherwise, go to step S2;
[0018] Step S4, the first processor of the legal unit reads the hardware clock of the clock circuit, and uses the obtained hardware clock as the latest clock of the legal unit;
[0019] Step S5, the legal unit sends an interrupt trigger signal to the second processor of the management unit;
[0020] Step S6, the second processor of the management unit reads the latest clock of the legal unit through the clock synchronization pin to complete clock synchronization.
[0021] As an improvement, in the dual-core electric energy meter clock synchronization method, in step S5, the legal unit immediately sends an interrupt trigger signal to the management unit after using the acquired hardware clock as the latest clock of the legal unit.
[0022] As a further improvement, in the dual-core electric energy meter clock synchronization method, the legal unit sends the latest clock of the legal unit to the second processor of the management unit within a preset time after the clock is carried.
[0023] As a further improvement, in the dual-core electric energy meter clock synchronization method, the legal unit sends the latest clock of the legal unit to the second processor of the management unit at a preset interval within a preset time after the clock is carried.
[0024] Preferably, in the dual-core electric energy meter clock synchronization method, the preset interval is less than or equal to 1 minute.
[0025] Furthermore, in the dual-core electric energy meter clock synchronization method, the preset time is 100ms.
[0026] As a further improvement, in the dual-core electric energy meter clock synchronization method, the data communication between the legal unit and the management unit adopts communication container technology.
[0027] The technical solution adopted by the present invention to solve the third technical problem is: an electronic device, characterized in that it includes a memory, a processor, and a computer program stored in the memory and executable on the processor, and when the processor executes the computer program, it implements any one of the dual-core electric energy meter clock synchronization methods.
[0028] The technical solution adopted by the present invention to solve the fourth technical problem is: a readable storage medium, on which a computer program is stored, characterized in that when the computer program is executed by a processor, any one of the dual-core electric energy meter clock synchronization methods is implemented.
[0029] Compared with the prior art, the advantages of the present invention are as follows: the present invention adds a second pulse signal interface on the basis of the existing legal unit and management unit, and connects the second pulse signal interface to the output end of the clock circuit of the legal unit, and the second pulse signal interface is connected to the processor of the legal unit. In this way, after the legal unit uses the hardware clock as the latest clock of the legal unit, the legal unit promptly sends an interrupt trigger signal to the management unit to trigger the management unit to read the latest clock of the legal unit through the clock synchronization pin, thereby achieving the consistency of the hardware clock signal, the clock signal of the legal unit and the clock signal of the management unit, ensuring the clock synchronization of the legal unit and the management unit, and ensuring the clock consistency of the electricity data at the same freezing point of the electric energy meter. BRIEF DESCRIPTION OF THE DRAWINGS
[0030] Figure 1 It is a schematic diagram of a clock synchronization circuit of a dual-core electric energy meter in an embodiment of the present invention;
[0031] Figure 2 The figure is a flow chart of a clock synchronization method for a dual-core electric energy meter in an embodiment of the present invention. DETAILED DESCRIPTION
[0032] The present invention is further described in detail below with reference to the accompanying drawings.
[0033] This embodiment provides a dual-core electric energy meter clock synchronization circuit. Specifically, Figure 1As shown, the clock synchronization circuit of the dual-core electric energy meter of this embodiment includes a legal unit 1 and a management unit 2, wherein the legal unit 1 has a first processor 11 and a clock circuit 12; the management unit 2 has a second processor 21, and the second processor 21 is connected to the first processor 11 of the legal unit 1 through a clock synchronization pin 22; and the output end of the clock circuit 12 of the legal unit 1 is connected to a second pulse signal interface 3, and the second pulse signal interface 3 is connected to the first processor 11. Among them, the signal at the second pulse signal interface 3 is a square wave signal.
[0034] This embodiment also provides a dual-core electric energy meter clock synchronization method applied to the dual-core electric energy meter clock synchronization circuit. Figure 2 As shown, the dual-core electric energy meter clock synchronization method of this embodiment includes the following steps:
[0035] Step S1, the output end of the clock circuit 12 outputs a second-changing square wave signal to the second pulse signal interface 3;
[0036] Step S2, detecting the signal at the pulse per second signal interface 3;
[0037] Step S3, making a judgment based on the detected signal:
[0038] When the signal is a falling edge, go to step S4; otherwise, go to step S2;
[0039] Step S4, the first processor 11 of the legal unit 1 reads the hardware clock of the clock circuit 12, and uses the obtained hardware clock as the latest clock of the legal unit 1;
[0040] Step S5, the legal unit 1 sends an interrupt trigger signal to the second processor 21 of the management unit 2; wherein, in this embodiment, the legal unit 1 sends the latest clock of the legal unit to the second processor of the management unit within a preset time after the clock is carried according to a preset interval, for example, the preset interval here is less than or equal to 1 minute, preferably 1 minute, and the preset time is 100ms; the data communication between the legal unit 1 and the management unit 2 adopts the communication container technology to provide the data transmission rate between the two;
[0041] Step S6, the second processor 21 of the management unit 2 reads the latest clock of the legal unit 1 through the clock synchronization pin 22 to complete the clock synchronization.
[0042] It should be noted that, in the clock synchronization method of the dual-core electric energy meter in this embodiment, after the legal unit uses the hardware clock as the latest clock of the legal unit, the legal unit promptly sends an interrupt trigger signal to the management unit 2 to trigger the management unit to read the latest clock of the legal unit through the clock synchronization pin, thereby achieving the consistency of the hardware clock signal, the clock signal of the legal unit and the clock signal of the management unit, ensuring the clock synchronization of the legal unit and the management unit, and ensuring the clock consistency of the electric energy meter's electric energy data at the same freezing point. In addition, because the legal unit in this embodiment reads the hardware clock at the hardware clock switching point, there will be no very large time difference between the legal unit time and the hardware clock, reducing the clock deviation, and because the lower edge of the second pulse signal output by the hardware clock is the clock reference of the management unit, so, in this way, there will be no large time difference between the clocks of the legal unit and the management unit, ensuring the clock synchronization of the legal unit and the management unit.
[0043] In order to synchronize the latest clock of the legal unit to the legal unit in time, as an improvement, in step S5 of this embodiment, the legal unit 1 immediately sends an interrupt trigger signal to the management unit 2 after using the acquired hardware clock as the latest clock of the legal unit.
[0044] This embodiment also provides an electronic device. Specifically, the electronic device includes a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the above-mentioned dual-core electric energy meter clock synchronization method is implemented.
[0045] This embodiment also provides a readable storage medium. The readable storage medium stores a computer program, and when the computer program is executed by a processor, the above-mentioned dual-core electric energy meter clock synchronization method is implemented.
[0046] Although the preferred embodiments of the present invention are described in detail above, it should be clearly understood that various modifications and variations are possible for those skilled in the art. Any modification, equivalent substitution, improvement, etc. made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.
Claims
1. A dual-core electric energy meter clock synchronization method applied to a dual-core electric energy meter clock synchronization circuit, the dual-core electric energy meter clock synchronization circuit comprising a legal unit (1) and a management unit (2), the legal unit (1) having a first processor (11) and a clock circuit (12); the management unit (2) having a second processor (21), the second processor (21) being connected to the first processor (11) of the legal unit (1) via a clock synchronization pin (22); the output end of the clock circuit (12) of the legal unit (1) being connected to a second pulse signal interface (3), the second pulse signal interface (3) being connected to the first processor (11); It is characterized in that The steps include: Step S1, the output end of the clock circuit outputs a second-changing square wave signal to a second pulse signal interface; Step S2, detecting the signal at the pulse per second signal interface; Step S3, making a judgment based on the detected signal: When the signal is a falling edge, go to step S4; Otherwise, go to step S2; Step S4, the first processor of the legal unit reads the hardware clock of the clock circuit, and uses the obtained hardware clock as the latest clock of the legal unit; Step S5, the legal unit sends an interrupt trigger signal to the second processor of the management unit; wherein the legal unit immediately sends the interrupt trigger signal to the management unit after taking the acquired hardware clock as the latest clock of the legal unit; Step S6, the second processor of the management unit reads the latest clock of the legal unit through the clock synchronization pin to complete clock synchronization.
2. The dual-core electric energy meter clock synchronization method according to claim 1, characterized in that: The legal unit sends the latest clock of the legal unit to the second processor of the management unit within a preset time after the clock is carried.
3. The dual-core electric energy meter clock synchronization method according to claim 2, characterized in that: The legal unit sends the latest clock of the legal unit to the second processor of the management unit at a preset interval within a preset time after the clock is carried.
4. The dual-core electric energy meter clock synchronization method according to claim 3, characterized in that: The preset interval is less than or equal to 1 minute.
5. The dual-core electric energy meter clock synchronization method according to claim 4, characterized in that: The preset time is 100ms.
6. The dual-core electric energy meter clock synchronization method according to any one of claims 1 to 5, characterized in that: The data communication between the legal unit and the management unit adopts the communication container technology.
7. An electronic device, characterized in that The method comprises a memory, a processor and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the clock synchronization method of the dual-core electric energy meter as described in any one of claims 1 to 6 is implemented.
8. A readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the dual-core electric energy meter clock synchronization method according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Dual-core electric energy meter clock synchronization method
CN106125035A
Management core and metering core clock synchronization processing method and device for dual-core intelligent electric energy meter
CN106571887A