A high-precision time synchronization system for centralized power distribution terminals

Through independent hardware architecture and software process optimization, the management core and real-time core capture the PPS second pulse signal of the Beidou/GPS module respectively, realizing high-precision time synchronization of the distribution terminal, solving the CPU resource occupation and synchronization stability problems in the existing technology, and achieving the 5ms accuracy requirement.

CN119758697BActive Publication Date: 2025-09-02BEIJING QINGCHANG POWER TECH CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202510007549.1
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-01-03
Publication Date
2025-09-02
Estimated Expiration
2045-01-03

AI Technical Summary

Technical Problem

The prior art is difficult to achieve high-precision time synchronization between the Beidou/GPS module and the real-time core in the power distribution terminal. Conventional solutions occupy CPU resources or affect synchronization stability, and cannot meet the 5ms accuracy requirements.

Method used

The independent hardware architecture adopts Beidou/GPS module, management core and real-time core. Through the RS232 universal serial port connection, the management core and real-time core independently capture the PPS second pulse signal, and optimize the use of CPU resources through the periodic switching of the software process to achieve high-precision timing.

Benefits of technology

It realizes high-precision time synchronization between the Beidou/GPS module and the real-time core, the time error is stable within 90μs, and the CPU resource utilization is efficient, meeting the high-standard design requirements of power distribution automation terminals.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119758697B_ABST
    Figure CN119758697B_ABST
Patent Text Reader

Abstract

The present invention provides a high-precision time synchronization system for a centralized power distribution terminal, which relates to the field of power distribution terminal communication technology, and includes a Beidou / GPS module, a management core and a real-time core. The Beidou / GPS module is equipped with one RS232 universal serial port and one chip pin, and the Beidou / GPS module is used for outputting a PPS second pulse signal; the management core is equipped with two RS232 universal serial ports and one chip pin, and the pin of the management core is used for monitoring and capturing the input of the PPS second pulse signal; the present invention is composed of a Beidou / GPS module, a management core and a real-time core. The hardware architectures of the management core and the real-time core are relatively independent, and their respective software processes are also independent. The management core and the real-time core independently capture the PPS second pulse signal emitted by the Beidou / GPS module, and exchange information through the RS232 universal serial port, thereby meeting the requirements of simple hardware architecture and stable and reliable software processes.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of power distribution terminal communication technology, and in particular to a high-precision time synchronization system for centralized power distribution terminals. Background Art

[0002] In the vigorous development of power system construction, higher standards are being set for the construction of distribution networks, a key component. A "Standardized Design Plan for Distribution Automation Terminals" (hereinafter referred to as the "Standardized Design Plan") is being introduced. This plan requires the real-time core to be responsible for real-time data collection and calculation, local fault action, and line loss measurement. The management core is responsible for communication, status monitoring data reception, and data analysis. The "Standardized Design Plan" proposes a hardware architecture for centralized distribution terminals that uses a real-time core and a management core for coordinated processing. Furthermore, the plan also requires a high standard design requirement for Beidou / GPS timing accuracy of no more than 5ms.

[0003] The conventional solution to achieve this design requirement is that the management core receives the synchronization message from the Beidou / GPS module (step 1), and then notifies the real-time core of the time information through the serial port / network port (step 2), thereby achieving time synchronization between the management core and the real-time core. Steps 1 and 2 consume time when transmitting and parsing time data, which are △T1 and △T2 respectively. The requirement is that "the synchronization accuracy should be no more than 5ms", that is, (△T1+△T2)≤5ms. The conventional solution to reduce △T1 is for the management core to increase the frequency of receiving Beidou / GPS module synchronization messages. The disadvantage is that it will occupy a lot of CPU resources and even affect The method of reducing △T2 for other functions of the management core is that the management core adds a ping-pong algorithm in the communication with the real-time core, calculates the channel delay between the management core and the real-time core, and adds a communication delay compensation error before sending the time to the real-time core. The disadvantage is that the ping-pong algorithm will be affected by the task management of the management core and the real-time core respectively. There are slight fluctuations in the channel delay calculated by the management core (approximately 2~3ms), resulting in low time synchronization stability. In order to meet the design standards of the "standardized design scheme" and achieve the high-standard design requirements of synchronization accuracy not exceeding 5ms, the present invention proposes a high-precision timing system for centralized distribution terminals to solve the problems existing in the prior art. Summary of the Invention

[0004] In view of the above problems, the present invention proposes a high-precision time synchronization system for centralized power distribution terminals, which meets the requirements of simple hardware architecture and stable and reliable software process.

[0005] To achieve the purpose of the present invention, the present invention is implemented through the following technical solutions: a centralized power distribution terminal high-precision time synchronization system, including a Beidou / GPS module, a management core and a real-time core, the Beidou / GPS module has a built-in RS232 universal serial port and a chip pin, and the Beidou / GPS module is used to output PPS second pulse signals;

[0006] The management core has two RS232 universal serial ports and one chip pin built in, and the management core is used to monitor and capture PPS pulse-per-second signal input;

[0007] The real-time core has a built-in RS232 universal serial port and a chip pin, and is used to monitor and capture PPS pulse-per-second signal input;

[0008] The hardware architecture and software process of the management core and the real-time core are relatively independent. The Beidou / GPS module and the management core are connected via an RS232 universal serial port, and the management core and the real-time core are connected via an RS232 universal serial port.

[0009] Further improvements are: the management core includes a first system millisecond interrupt module, a first PPS second pulse signal capture module and a synchronization message receiving module; the first system millisecond interrupt module has a millisecond interrupt function, which is an integrated service in the chip system. After being enabled, it enters the service once every millisecond. The first system millisecond interrupt module is used to convert the current system time into UTC format. The UTC format value is a 32-bit integer value, expressed as Tutc, in seconds, and at the same time maintains the system millisecond information Tms, in milliseconds; when the system as a whole is powered on and started, the current system time is first converted into a UTC format value and assigned to Tutc, and the system millisecond Tms is initialized to 0; each time a millisecond interrupt is entered, the millisecond Tms value is increased by 1. When the Tms value is equal to 1000 after being increased by 1, the UTC format time Tutc is increased by 1, and Tms is assigned to 0.

[0010] A further improvement is that in the first system millisecond interrupt module, another millisecond value is maintained, expressed as Tpps, in milliseconds. This millisecond value is initialized to 0 when the entire system is powered on. Each time a millisecond interrupt occurs, the millisecond Tpps value is increased by 1. When the Tpps value is equal to 1000 after adding 1, Tpps is assigned to 0, and the cycle is repeated. Tpps is used to count the milliseconds after capturing the PPS second pulse signal.

[0011] Further improvements are: the first PPS second pulse signal capture module is used to activate the capture function of the management core capture pin, the capture pin periodically detects the rising edge of the second pulse signal, when the Beidou / GPS module sends the rising edge of the PPS second pulse signal, the time mark at this moment is To, when the capture pin detects the rising edge of the second pulse signal, the Tpps value is initialized to 0, the time mark at this moment is To', the (To'-To) time error is stable within 90μs, when Tpps is assigned a value of 0, normal operation continues in the process of the first system millisecond interrupt module, and the first PPS second pulse signal capture module will capture the second pulse rising edge event and notify the synchronization message receiving module.

[0012] Further improvements are: the synchronization message receiving module is used to periodically detect the synchronization message sent by the Beidou / GPS module. The synchronization message has multiple frames of data. The synchronization message receiving module has two detection cycles, the first is to detect once every 60ms, and the second is to detect once every 6ms. During normal operation, the first cycle is used. When the first PPS second pulse signal capture module receives the notification of the second pulse rising edge event, the detection cycle is adjusted to the second. After receiving the time message, the year-month-day hour-minute-second format time in the message is parsed and converted into UTC format time Tutc', in seconds, and the Tutc' value is assigned to Tutc, and the Tpps value at this moment is assigned to Tms. Then the detection cycle is slowed down to the first one, and the UTC time information is sent to the real-time core through the RS232 universal serial port.

[0013] A further improvement is that the real-time core includes a second system millisecond interrupt module, a second PPS second pulse signal capture module, and a time reception module; the second system millisecond interrupt module has a millisecond interrupt function and serves as an integrated service within the chip system. After activation, the second system millisecond interrupt module enters service once every millisecond. The second system millisecond interrupt module converts the current system time into UTC format. The UTC format value is a 32-bit integer value represented as TTutc, which is measured in seconds. It also maintains system millisecond information TTms, which is measured in milliseconds. When the entire system is powered on, the current system time is converted into a UTC format value and assigned to TTutc. The system millisecond TTms is initialized to 0. Each time a millisecond interrupt occurs, the millisecond TTms value is incremented by 1. When the TTms value after incrementing by 1 equals 1000, the UTC format time TTutc is incremented by 1, and TTms is assigned to 0.

[0014] A further improvement is that in the second system millisecond interrupt module, another millisecond value is maintained, expressed as TTpps, in milliseconds. This millisecond value is initialized to 0 when the entire system is powered on. Each time a millisecond interrupt occurs, the millisecond TTpps value is increased by 1. When the TTpps value is equal to 1000 after adding 1, TTpps is assigned to 0, and the cycle is repeated. TTpps is used to count the milliseconds after capturing the PPS second pulse signal.

[0015] Further improvements are: the second PPS second pulse signal capture module is used to activate the capture function of the real-time core capture pin, and the capture pin periodically detects the rising edge of the second pulse signal. When the Beidou / GPS module sends the rising edge of the PPS second pulse signal, the time mark at this moment is TTo. When the capture pin detects the rising edge of the second pulse signal, the TTpps value is initialized to 0, and the time mark at this moment is TTo'. The (TTo'-TTo) time error is stable within 90μs. After TTpps is assigned a value of 0, normal operation continues in the process of the second system millisecond interrupt module. Then, the second PPS second pulse signal capture module will capture the second pulse rising edge event and notify the time receiving module.

[0016] Further improvements are: the time receiving module is used to periodically detect the synchronization message sent by the management core. The synchronization message has 1 frame of data. The time receiving module sets the detection period to two types, the first is to detect once every 60ms, and the second is to detect once every 6ms. During normal operation, the time receiving module operates under the first period. When the second PPS second pulse signal capture module receives the event notification of capturing the rising edge of the second pulse, the detection period is adjusted to the second period. The time receiving module receives the time message, parses it to obtain the UTC format time TTutc' in the message, in seconds, assigns the TTutc' value to TTutc, and assigns the current TTpps value to TTms. Then, the time receiving module slows down the detection period to the first period.

[0017] The beneficial effects of the present invention are:

[0018] 1. The present invention consists of a Beidou / GPS module, a management core and a real-time core. The hardware architecture of the management core and the real-time core are relatively independent, and their respective software processes are also independent. The management core and the real-time core independently capture the PPS pulse-per-second signal emitted by the Beidou / GPS module and exchange information through the RS232 universal serial port, thereby achieving the requirements of simple hardware architecture and stable and reliable software processes.

[0019] 2. In the management core of the present invention, a millisecond interrupt function is provided by the first system millisecond interrupt module, and the PPS second pulse signal captured by the first PPS second pulse signal capture module is used to capture the PPS second pulse signal emitted by the Beidou / GPS module, so that the time error is controlled to be stable within 90μs. The synchronization message receiving module is used to detect and analyze the synchronization message emitted by the Beidou / GPS module according to the switching of the two cycles; in the real-time core, a millisecond interrupt function is provided by the second system millisecond interrupt module, and the PPS second pulse signal captured by the second PPS second pulse signal capture module is used to capture the PPS second pulse signal emitted by the Beidou / GPS module, so that the time error is controlled to be stable within 90μs. The synchronization message receiving module is used to detect and analyze the synchronization message emitted by the management core according to the switching of the two cycles. In summary, a high-precision time synchronization function is realized, and the two cycles are switched to dynamically adjust the kernel CPU resource usage to make the CPU utilization more efficient. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] Figure 1 This is a schematic diagram of the hardware architecture connection of the present invention;

[0021] Figure 2 This is a flow chart of the management core software control of the present invention;

[0022] Figure 3 This is a control flow chart of the synchronization message receiving module of the present invention;

[0023] Figure 4 This is a real-time core software control flow chart of the present invention;

[0024] Figure 5 This is a control flow chart of the time receiving module of the present invention. DETAILED DESCRIPTION

[0025] In order to deepen the understanding of the present invention, the present invention will be further described in detail below with reference to the examples. The examples are only used to explain the present invention and do not constitute a limitation on the scope of protection of the present invention.

[0026] Example 1

[0027] according to Figure 1 、 2 As shown in Figures 3, 4, and 5, this embodiment proposes a high-precision time synchronization system for centralized power distribution terminals, including a Beidou / GPS module, a management core, and a real-time core. The Beidou / GPS module has a built-in RS232 universal serial port and a chip pin, and the Beidou / GPS module is used to output PPS pulse-per-second signals;

[0028] The management core has two RS232 universal serial ports and one chip pin built in, and the management core is used to monitor and capture PPS pulse-per-second signal input;

[0029] The real-time core has a built-in RS232 universal serial port and a chip pin, and is used to monitor and capture PPS pulse-per-second signal input;

[0030] The management core and real-time core have relatively independent hardware architectures and software processes. The Beidou / GPS module is connected to the management core via an RS232 universal serial port, and the management core and real-time core are also connected via an RS232 universal serial port. The Beidou / GPS module is a universal module with integrated supporting software and can be used directly.

[0031] It consists of a Beidou / GPS module, a management core and a real-time core. The hardware architecture of the management core and the real-time core are relatively independent, and their software processes are also independent. The management core and the real-time core independently capture the PPS pulse-per-second signal emitted by the Beidou / GPS module and exchange information through the RS232 universal serial port, thereby achieving the requirements of simple hardware architecture and stable and reliable software processes.

[0032] Example 2

[0033] according to Figure 1 、 2 As shown in , 3, 4, and 5, this embodiment proposes a high-precision time synchronization system for centralized power distribution terminals, including a Beidou / GPS module, a management core, and a real-time core;

[0034] Management Core Software Process Implementation Method

[0035] The management core software is divided into three modules: the first system millisecond interrupt module, the first PPS second pulse signal capture module, and the synchronization message receiving module.

[0036] First system millisecond interrupt module:

[0037] The millisecond interrupt function is an integrated service within the chip system and, when enabled, is triggered every millisecond. This module converts the current system time (year, month, day, hour, minute, and second) to UTC format, a 32-bit integer value expressed as Tutc, in seconds. It also maintains the system millisecond information, Tms, in milliseconds. This method avoids leap year calculation issues caused by rounding off the second.

[0038] When a centralized power distribution terminal is powered on and started, the current system time is converted to UTC format and assigned to Tutc. The system millisecond value Tms is initialized to 0. Then, with each millisecond interrupt, the millisecond value Tms is incremented by 1. When the Tms value equals 1000, the UTC format time Tutc is incremented by 1, and Tms is assigned to 0. This method maintains the system time.

[0039] The first system millisecond interrupt module also maintains a millisecond value, expressed as Tpps, in milliseconds. This millisecond value is initialized to 0 when the centralized power distribution terminal is powered on. Each time a millisecond interrupt occurs, the millisecond Tpps value increments by 1. When the incremented Tpps value reaches 1000, Tpps is reset to 0, and this cycle repeats. Tpps is used to count the milliseconds since the PPS signal was captured.

[0040] The first PPS pulse second signal capture module:

[0041] Activate the capture function on the management core capture pin. This pin periodically detects the rising edge of the PPS signal. When the Beidou / GPS module transmits a rising edge of the PPS signal, the time at that moment is marked as To' (the rising edge also marks the 0ms of that second). When the capture pin detects the rising edge of the PPS signal, it initializes the Tpps value to 0, marking the time at that moment as To'. The (To'-To) time error is stable within 90μs. After Tpps is reset to 0, normal operation continues in module 1 (the system millisecond interrupt module process).

[0042] Then, the first PPS second pulse signal capturing module notifies the synchronization message receiving module of the captured second pulse rising edge event.

[0043] Synchronization message receiving module:

[0044] The synchronization message receiving module periodically detects the synchronization message sent by the Beidou / GPS module. The synchronization message has multiple frames of data, and its content includes time information, longitude and latitude, altitude, number of satellites and other information. The detection period is set to two types. The first type adopted in the example of the present invention is to detect once every 60ms, and the second type is to detect once every 6ms. Under normal circumstances, the synchronization message receiving module will run under the first period, and detect whether there is a message every 60ms. This situation will only take up a small part of the management core CPU resources. Upon receiving the notification of the rising edge event of the second pulse captured by the first PPS second pulse signal capture module, the detection period is immediately adjusted to the second type, and detect once every 6ms. The synchronization message receiving module receives the time message at about 200ms of the second, and parses the time in the year-month-day hour-minute-second format in the message into the UTC format time Tutc', in seconds; assigns the Tutc' value to Tutc, and assigns the Tpps value at this moment to Tms. This method completely ignores the influence of △T1 and can stably control the timing error within (To'-To), and (To'-To) is <90μs, achieving a high-precision timing function. The management and verification process is now complete.

[0045] The synchronization message receiving module then slows down the detection cycle to the first cycle of 60ms, dynamically adjusting the core CPU resource usage to make CPU utilization more efficient. The synchronization message receiving module sends the UTC time information to the real-time core through the RS232 serial port.

[0046] Real-time kernel software process implementation method

[0047] The real-time core software is divided into three modules: the second system millisecond interrupt module, the second PPS pulse per second signal capture module, and the time reception module.

[0048] Second system millisecond interrupt module:

[0049] The millisecond interrupt function is an integrated service within the chip system and is activated every millisecond. This module converts the current system time (year, month, day, hour, minute, and second) to UTC format. The UTC format value is a 32-bit integer value (TTutc), expressed in seconds. It also maintains the system millisecond information (TTms), in milliseconds. This method has the advantage of avoiding leap year calculation issues caused by rounding off the second.

[0050] When a centralized power distribution terminal is powered on and started, the current system time is converted to UTC format and assigned to TTutc. The system millisecond value TTms is initialized to 0. Then, with each millisecond interrupt, the millisecond value TTms is incremented by 1. When the TTms value equals 1000, the UTC format time TTutc is incremented by 1, and TTms is set to 0. This method maintains the system time.

[0051] The second system millisecond interrupt module also maintains a millisecond value, expressed as TTpps, in milliseconds. This millisecond value is initialized to 0 when the centralized power distribution terminal is powered on. Each time a millisecond interrupt occurs, the millisecond TTpps value increments by 1. When the incremented TTpps value equals 1000, TTpps is reset to 0, and this cycle repeats. TTpps is used to count the milliseconds since the PPS signal was captured.

[0052] Second PPS pulse signal capture module:

[0053] Activate the capture function on the real-time core capture pin. This pin periodically detects the rising edge of the PPS signal. When the Beidou / GPS module transmits a rising edge of the PPS signal, the time at that moment is marked as TTo (the rising edge also marks the 0ms of that second). When the capture pin detects the rising edge of the PPS signal, it initializes the TTpps value to 0, marking the time at that moment as TTo'. The (TTo' - TTo) time error is stable within 90μs. After TTpps is reset to 0, normal operation continues in module 1 (the system millisecond interrupt module process).

[0054] Then, the second PPS second pulse signal capture module notifies the time receiving module of the event of capturing the second pulse rising edge.

[0055] Time receiving module:

[0056] The time receiving module periodically detects the synchronization message sent by the management core. The synchronization message only has one frame of data, and its content contains time information in UTC format. The time receiving module sets the detection period to two types. The first type adopted in the example of the present invention is to detect once every 60ms, and the second type is to detect once every 6ms. Under normal circumstances, the time receiving module will run under the first period, and detect whether there is a message every 60ms. This situation will only occupy a very small part of the real-time core CPU resources. Upon receiving the notification of the rising edge event of the second pulse captured by the second PPS second pulse signal capture module, the detection period is immediately adjusted to the second type, and detect once every 6ms. The time receiving module receives the time message at about 300ms of the second, and parses it to obtain the UTC format time TTutc' in the message, in seconds; assigns the TTutc' value to TTutc, and assigns the current TTpps value to TTms. This method completely ignores the influence of △T2 and can stably control the timing error within (TTo'-TTo), and (TTo'-TTo) is <90μs, achieving a high-precision timing function. The real-time timing verification process is now completed.

[0057] Then, the time receiving module slows down the detection period to the first period of 60ms, dynamically adjusting the kernel CPU resource usage to make CPU utilization more efficient.

[0058] The high-precision timing system of the centralized power distribution terminal consists of a Beidou / GPS module, a management core and a real-time core. The hardware architecture of the management core and the real-time core are relatively independent, and their respective software processes are also independent. The management core and the real-time core independently capture the PPS pulse-per-second signal emitted by the Beidou / GPS module and exchange information through the RS232 universal serial port, thereby achieving the requirements of simple hardware architecture and stable and reliable software processes. In the management core, a millisecond interrupt function is provided by the first system millisecond interrupt module, and the PPS second pulse signal capture module is used to capture the PPS second pulse signal sent by the Beidou / GPS module, so that the time error is controlled to be stable within 90μs. The synchronization message receiving module is used to detect and analyze the synchronization message sent by the Beidou / GPS module according to the switching of the two cycles; in the real-time core, a millisecond interrupt function is provided by the second system millisecond interrupt module, and the PPS second pulse signal capture module is used to capture the PPS second pulse signal sent by the Beidou / GPS module, so that the time error is controlled to be stable within 90μs. The synchronization message receiving module is used to detect and analyze the synchronization message sent by the management core according to the switching of the two cycles. In summary, a high-precision time synchronization function is realized, and the two cycles are switched to dynamically adjust the kernel CPU resource usage to make the CPU utilization more efficient.

[0059] The basic principles, main features, and advantages of the present invention are shown and described above. Those skilled in the art should understand that the present invention is not limited to the foregoing embodiments. The foregoing embodiments and descriptions are merely illustrative of the principles of the present invention. Various changes and modifications may be made to the present invention without departing from the spirit and scope of the present invention. Such changes and modifications are intended to fall within the scope of the present invention. The scope of protection claimed in the present invention is defined by the appended claims and their equivalents.

Claims

1. A high-precision time synchronization system for centralized power distribution terminals, including a Beidou / GPS module, a management core, and a real-time core, characterized by: The BeiDou / GPS module has a built-in RS232 universal serial port and a chip pin, and the BeiDou / GPS module is used for PPS pulse per second signal output; The management core has two RS232 universal serial ports and one chip pin built in, and the management core is used to monitor and capture PPS pulse-per-second signal input; The real-time core has a built-in RS232 universal serial port and a chip pin, and is used to monitor and capture PPS pulse-per-second signal input; The hardware architecture and software process of the management core and the real-time core are relatively independent. The Beidou / GPS module and the management core are connected via the RS232 universal serial port, and the management core and the real-time core are connected via the RS232 universal serial port; The management core includes a first system millisecond interrupt module, a first PPS second pulse signal capture module and a synchronization message receiving module; the first system millisecond interrupt module has a millisecond interrupt function, which is an integrated service in the chip system. After being enabled, it enters the service once every millisecond. The first system millisecond interrupt module is used to convert the current system time into UTC format. The UTC format value is a 32-bit integer value, expressed as Tutc, in seconds, and at the same time maintains the system millisecond information Tms, in milliseconds; when the system is powered on and started as a whole, the current system time is first converted into a UTC format value and assigned to Tutc, and the system millisecond Tms is initialized to 0; each time a millisecond interrupt is entered, the millisecond Tms value is increased by 1. When the Tms value is equal to 1000 after being increased by 1, the UTC format time Tutc is increased by 1, and Tms is assigned to 0.

2. A centralized power distribution terminal high-precision time synchronization system according to claim 1, characterized in that: In the first system millisecond interrupt module, another millisecond value is also maintained, expressed as Tpps, in milliseconds. This millisecond value is initialized to 0 when the entire system is powered on. Each time a millisecond interrupt occurs, the millisecond Tpps value is increased by 1. When the Tpps value is equal to 1000 after adding 1, Tpps is assigned to 0, and the cycle is repeated. Tpps is used to count the milliseconds after capturing the PPS second pulse signal.

3. The high-precision time synchronization system for centralized power distribution terminals according to claim 2, characterized in that: The first PPS second pulse signal capture module is used to activate the capture function of the management core capture pin. The capture pin periodically detects the rising edge of the second pulse signal. When the Beidou / GPS module sends the rising edge of the PPS second pulse signal, the time mark at this moment is To. When the capture pin detects the rising edge of the second pulse signal, the Tpps value is initialized to 0. The time mark at this moment is To'. The (To'-To) time error is stable within 90μs. When Tpps is assigned a value of 0, normal operation continues in the process of the first system millisecond interrupt module. The first PPS second pulse signal capture module will capture the second pulse rising edge event and notify the synchronization message receiving module.

4. A centralized power distribution terminal high-precision time synchronization system according to claim 3, characterized in that: The synchronization message receiving module is used to periodically detect the synchronization message sent by the Beidou / GPS module. The synchronization message has multiple frames of data. There are two detection cycle settings for the synchronization message receiving module. The first is to detect once every 60ms, and the second is to detect once every 6ms. In normal operation, the first cycle is used. After receiving the notification of the rising edge event of the second pulse captured by the first PPS second pulse signal capture module, the detection cycle is adjusted to the second. After receiving the time message, the time in the year-month-day hour-minute-second format in the message is parsed and converted into UTC format time Tutc', in seconds, and the Tutc' value is assigned to Tutc, and the Tpps value at this moment is assigned to Tms. Then the detection cycle is slowed down to the first one, and the UTC time information is sent to the real-time core through the RS232 universal serial port.

5. The high-precision time synchronization system for centralized power distribution terminals according to claim 1, characterized in that: The real-time core includes a second system millisecond interrupt module, a second PPS second pulse signal capture module and a time receiving module; the second system millisecond interrupt module has a millisecond interrupt function, which is an integrated service in the chip system. After being enabled, it enters the service once every millisecond. The second system millisecond interrupt module converts the current system time into UTC format. The UTC format value is a 32-bit integer value, expressed as TTutc, in seconds. At the same time, it maintains the system millisecond information TTms, in milliseconds. When the system is powered on and started as a whole, the current system time is converted into a UTC format value and assigned to TTutc. The system millisecond TTms is initialized to 0. Each time a millisecond interrupt is entered, the millisecond TTms value is increased by 1. When the TTms value is equal to 1000 after being increased by 1, the UTC format time TTutc is increased by 1, and TTms is assigned to 0 at the same time.

6. A centralized power distribution terminal high-precision time synchronization system according to claim 5, characterized in that: The second system millisecond interrupt module also maintains another millisecond value, expressed as TTpps, in milliseconds. This millisecond value is initialized to 0 when the entire system is powered on. Each time a millisecond interrupt occurs, the millisecond TTpps value is increased by 1. When the TTpps value is equal to 1000 after adding 1, TTpps is assigned to 0, and the cycle is repeated. TTpps is used to count the milliseconds after capturing the PPS second pulse signal.

7. The high-precision time synchronization system for centralized power distribution terminals according to claim 6, characterized in that: The second PPS second pulse signal capture module is used to activate the capture function of the real-time core capture pin. The capture pin periodically detects the rising edge of the second pulse signal. When the Beidou / GPS module sends out the rising edge of the PPS second pulse signal, the time mark at this moment is TTo. When the capture pin detects the rising edge of the second pulse signal, the TTpps value is initialized to 0. The time mark at this moment is TTo'. The (TTo'-TTo) time error is stable within 90μs. After TTpps is assigned a value of 0, normal operation continues in the process of the second system millisecond interrupt module. Then, the second PPS second pulse signal capture module will capture the second pulse rising edge event and notify the time receiving module.

8. The high-precision time synchronization system for centralized power distribution terminals according to claim 7, characterized in that: The time receiving module is used to periodically detect the synchronization message sent by the management core. The synchronization message has 1 frame of data. The time receiving module sets the detection period to two types, the first one is to detect once every 60ms, and the second one is to detect once every 6ms. During normal operation, the time receiving module operates under the first period. When the second PPS second pulse signal capture module receives the event notification of capturing the second pulse rising edge, the detection period is adjusted to the second period. The time receiving module receives the time message, parses it to obtain the UTC format time TTutc' in the message, in seconds, assigns the TTutc' value to TTutc, and assigns the current TTpps value to TTms. Then, the time receiving module slows down the detection period to the first period.

Citation Information

Patent Citations

  • Clock synchronization method, device, equipment, medium and product

    CN118944795A