Centralized power distribution terminal high-precision time synchronization system
By designing independent management and real-time cores in centralized power distribution terminals, and connecting the Beidou/GPS module with RS232 universal serial port, high-precision timing function is realized, solving the problems of timing accuracy and CPU resource use in the existing technology.
Patent Information
- Application Number
- CN202510007549.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-03
- Publication Date
- 2025-04-04
- Estimated Expiration
- 2045-01-03
AI Technical Summary
It is difficult for the prior art to realize the high standard design requirements of Beidou/GPS module timing accuracy not greater than 5ms in centralized power distribution terminals. The method of reducing time delay in conventional solutions will occupy a large amount of CPU resources or lead to low time synchronization stability.
A centralized power distribution terminal high-precision timing system is designed, and the independent hardware architecture and software process of Beidou/GPS module, management core and real-time core are connected to Beidou/GPS module and management core through the RS232 universal serial port, so as to independently capture PPS second pulse signals and communicate information.
It realizes the high-precision timing function with a simple hardware architecture and stable and reliable software process. The control time error is within 90μs, dynamically adjusts the usage of CPU resources, and improves CPU utilization.
Smart Images

Figure CN119758697A_ABST
Abstract
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 a centralized power distribution terminal. Background Art
[0002] In the vigorous development of power system construction, higher standards are put forward for the construction of distribution network, which is an important component. The "Standardized Design Scheme for Distribution Automation Terminals" (hereinafter referred to as the "Standardized Design Scheme") is introduced, requiring the real-time core to be responsible for real-time data collection and real-time calculation, local fault action and line loss measurement, etc. The management core is responsible for communication, status monitoring data reception and data analysis. The "Standardized Design Scheme" proposes a hardware architecture for the coordinated processing of real-time core and management core for centralized distribution terminals, and at the same time, the Beidou / GPS time synchronization accuracy should be no more than 5ms. High standard design requirements; The conventional solution to achieve this design requirement is that the management core receives the synchronization message from the Beidou / GPS module (stage 1), and then notifies the real-time core of the time information through the serial port / network port (stage 2), thereby achieving time synchronization between the management core and the real-time core. Stages 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 that the management core increases the frequency of receiving the synchronization message from the Beidou / GPS module. The disadvantage is that it will occupy a lot of CPU resources and even affect As for other functions of the management core, a method for reducing △T2 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 (approximately 2~3ms) in the channel delay calculated by the management core, resulting in low time synchronization stability. In order to meet the design standard of the "standardized design scheme" and achieve the high-standard design requirement 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
[0003] 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 flow.
[0004] To achieve the purpose of the present invention, the present invention is implemented by 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 for PPS second pulse 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 the real-time core is used to monitor and capture the PPS pulse-per-second signal input; The hardware architecture and software flow of the management core and the real-time core are relatively independent. The Beidou / GPS module and the management core are connected via a RS232 universal serial port, and the management core and the real-time core are connected via a RS232 universal serial port.
[0005] 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, and the UTC format value is a 32-bit integer value, expressed as Tutc, in seconds, and at the same time maintain 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; when each millisecond interrupt is entered, the millisecond Tms value is increased by 1, and 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.
[0006] 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 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 millisecond count after capturing the PPS second pulse signal.
[0007] Further improvements are as follows: 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 out 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, it continues to operate normally in the process of the first system millisecond interrupt module, and the first PPS second pulse signal capture module notifies the synchronous message receiving module of the captured second pulse rising edge event.
[0008] 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 cycle settings, 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. When the first PPS second pulse signal capture module receives the event notification of capturing the second pulse rising edge, 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.
[0009] Further improvements are: 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 and is an integrated service in the chip system. After being enabled, the service is entered 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, and maintains the system millisecond information TTms, in milliseconds. When the system is powered on 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. When each 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.
[0010] 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 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, the TTpps value is assigned to 0, and the cycle is repeated. TTpps is used to count the millisecond count after capturing the PPS second pulse signal.
[0011] Further improvement lies in: 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, and the time mark at this moment is TTo', (TTo'-TTo) time error is stable within 90μs, after TTpps is assigned a value of 0, it continues to operate normally in the process of the second system millisecond interrupt module, and then, the second PPS second pulse signal capture module will capture the second pulse rising edge event to notify the time receiving module.
[0012] A further improvement is 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 type is to detect once every 60ms, and the second type is to detect once every 6ms. In normal operation, the time receiving module runs under the first period. When the event notification of the rising edge of the second pulse is captured from the second PPS second pulse signal capture module, 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.
[0013] The beneficial effects of the present invention are: 1. The present invention consists 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.
[0014] 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 emitted by the Beidou / GPS module is captured by the first PPS second pulse signal capture module, and 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 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 emitted by the Beidou / GPS module is captured by the second PPS second pulse signal capture module, and the time error is controlled to be stable within 90μs. The synchronization message emitted by the management core is detected and analyzed by the time receiving module according to the switching of 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
[0015] Figure 1 It is a schematic diagram of the hardware architecture connection of the present invention; Figure 2 This is a flow chart of the management core software control of the present invention; Figure 3 This is a control flow chart of the synchronization message receiving module of the present invention; Figure 4 is a real-time core software control flow chart of the present invention; Figure 5 This is a control flow chart of the time receiving module of the present invention. DETAILED DESCRIPTION
[0016] In order to deepen the understanding of the present invention, the present invention will be further described in detail below in conjunction with examples. The examples are only used to explain the present invention and do not constitute a limitation on the protection scope of the present invention.
[0017] Embodiment 1 according to Figure 1 , 2 As shown in , 3, 4, and 5, this embodiment proposes 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 for PPS second pulse 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 the real-time core is used to monitor and capture the PPS pulse-per-second signal input; The hardware architecture and software flow of the management core and the real-time core are relatively independent. The Beidou / GPS module and the management core are connected via a RS232 universal serial port, and the management core and the real-time core are connected via a RS232 universal serial port. The Beidou / GPS module is a universal module, which has integrated supporting software and can be used directly.
[0018] It consists of Beidou / GPS module, management core and 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 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.
[0019] Embodiment 2 according to Figure 1 , 2 As shown in , 3, 4, and 5, this embodiment proposes a centralized power distribution terminal high-precision time synchronization system, including a Beidou / GPS module, a management core, and a real-time core; Management and software process implementation method 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.
[0020] First system millisecond interrupt module: The millisecond interrupt function is an integrated service in the chip system. It is entered once every millisecond after being enabled. This module converts the current system time (year, month, day, hour, minute, and second) into UTC format. The UTC format value is a 32-bit integer value, expressed as Tutc, in seconds; it also maintains the system millisecond information Tms, in milliseconds. The advantage of this method is that it can avoid the leap year calculation problem caused by the second carry.
[0021] When the centralized power distribution terminal is powered on, 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; then, each time a millisecond interruption occurs, 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. This method is used to maintain the system time.
[0022] In the first system millisecond interrupt module, another millisecond value is maintained at the same time, expressed as Tpps, in milliseconds. This millisecond value is initialized to 0 when the centralized power distribution terminal is powered on; then, 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 repeats. Tpps is used to count the millisecond count after capturing the PPS second pulse signal.
[0023] The first PPS pulse per second signal capture module: Activate the capture function of the capture pin of the management core, and the capture pin will periodically detect 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, (the rising edge moment is also the 0ms moment of the second). When the capture pin detects the rising edge of the second pulse signal, the Tpps value is initialized to 0, and the time mark at this moment is To'. The (To'-To) time error is stable within 90μs. After Tpps is assigned a value of 0, it will continue to operate normally in module 1 (system millisecond interrupt module process).
[0024] Then, the first PPS second pulse signal capturing module will notify the synchronous message receiving module of the event of capturing the second pulse rising edge.
[0025] Synchronization message receiving module: 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. Generally, the synchronization message receiving module will run under the first period, and detect whether there is a message every 60ms. This situation will only occupy a small part of the management core CPU resources. 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 period is immediately adjusted to the second type, and it is detected every 6ms. The synchronization message receiving module receives the time message at about 200ms of the second, and converts the time in the year-month-day hour-minute-second format in the message into the UTC format time Tutc', in seconds; the Tutc' value is assigned to Tutc, and the Tpps value at this moment is assigned to Tms. This method completely ignores the influence of △T1 and can stably control the timing error within (To'-To), and (To'-To) <90μs, realizing high-precision timing function. The management and verification process is now completed.
[0026] Then, the synchronization message receiving module slows down the detection cycle to the first cycle of 60ms, dynamically adjusts the core CPU resource usage, and makes the CPU utilization more efficient. The synchronization message receiving module sends the UTC time information to the real-time core through the RS232 serial port.
[0027] Real-time kernel software flow implementation method The real-time core software is divided into three modules: the second system millisecond interrupt module, the second PPS second pulse signal capture module, and the time receiving module.
[0028] Second system millisecond interrupt module: The millisecond interrupt function is an integrated service in the chip system. It is entered once every millisecond after being enabled. This module converts the current system time (year, month, day, hour, minute, and second) into UTC format. The UTC format value is a 32-bit integer value, expressed as TTutc, in seconds; it also maintains the system millisecond information TTms, in milliseconds. The advantage of this method is that it can avoid the leap year calculation problem caused by the second carry.
[0029] When the centralized power distribution terminal is powered on, the current system time is first converted into a UTC format value and assigned to TTutc, and the system millisecond TTms is initialized to 0; then, each time a millisecond interruption occurs, 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. This method is used to maintain the system time.
[0030] In the second system millisecond interrupt module, another millisecond value is maintained at the same time, expressed as TTpps, in milliseconds. This millisecond value is initialized to 0 when the centralized power distribution terminal is powered on; then, 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 repeats. TTpps is used to count the millisecond count after capturing the PPS second pulse signal.
[0031] The second PPS pulse signal capture module: Activate the capture function of the real-time core capture pin, and the capture pin will periodically detect 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, (the rising edge moment is also the 0ms moment of the second). 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, it will continue to operate normally in module 1 (system millisecond interrupt module process).
[0032] Then, the second PPS second pulse signal capturing module will notify the time receiving module of the event of capturing the second pulse rising edge.
[0033] Time receiving module: 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. Generally, 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 event of capturing the rising edge of the second pulse from the second PPS second pulse signal capture module, the detection period is immediately adjusted to the second type, and detects 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) <90μs, realizing high-precision timing function. The real-time timing verification process is now completed.
[0034] Then, the time receiving module slows down the detection cycle to the first cycle of 60ms, dynamically adjusts the kernel CPU resource usage, and makes the CPU utilization more efficient.
[0035] The centralized power distribution terminal high-precision time synchronization system consists of Beidou / GPS module, management core and 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 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. In the management core, 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.
[0036] The above shows and describes the basic principles, main features and advantages of the present invention. It should be understood by those skilled in the art that the present invention is not limited to the above embodiments. The above embodiments and descriptions are only for explaining the principles of the present invention. Without departing from the spirit and scope of the present invention, the present invention may have various changes and improvements, which fall within the scope of the present invention. The scope of protection of the present invention is defined by the attached 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 in that: 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 second pulse 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 the real-time core is used to monitor and capture the PPS pulse-per-second signal input; The hardware architecture and software flow of the management core and the real-time core are relatively independent. The Beidou / GPS module and the management core are connected via a RS232 universal serial port, and the management core and the real-time core are connected via a RS232 universal serial port.
2. According to claim 1, a centralized power distribution terminal high-precision time synchronization system is characterized in that: 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 maintains the system millisecond information Tms in milliseconds; when the system is powered on 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; when each 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.
3. A centralized power distribution terminal high-precision time synchronization system according to claim 2, characterized in that: In the first system millisecond interrupt module, another millisecond value is maintained, expressed as Tpps, in milliseconds. The millisecond value is initialized to 0 when the 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 millisecond count after capturing the PPS second pulse signal.
4. A centralized power distribution terminal high-precision time synchronization system according to claim 3, 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 out 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, it continues to operate normally 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.
5. A centralized power distribution terminal high-precision time synchronization system according to claim 4, characterized in that: The synchronization message receiving module is used for periodically detecting 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. When the event notification of the rising edge of the second pulse is captured from 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.
6. A centralized power distribution terminal high-precision time synchronization system 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 and is an integrated service in the chip system. After being enabled, the second system millisecond interrupt module 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 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. When each 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.
7. A centralized power distribution terminal high-precision time synchronization system according to claim 6, characterized in that: In the second system millisecond interrupt module, another millisecond value is maintained, expressed as TTpps, in milliseconds. The millisecond value is initialized to 0 when the 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, the TTpps value is assigned to 0, and the cycle is repeated. TTpps is used to count the millisecond count after capturing the PPS second pulse signal.
8. A centralized power distribution terminal high-precision time synchronization system according to claim 7, 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, it continues to operate normally 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.
9. A centralized power distribution terminal high-precision time synchronization system according to claim 8, characterized in that: The time receiving module is used for periodically detecting 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 type is to detect once every 60ms, and the second type is to detect once every 6ms. In normal operation, the time receiving module runs under the first period. When receiving the event notification of capturing the rising edge of the second pulse from the second PPS second pulse signal capture module, 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
System and method for checking GPS time setting precision
CN103777517A
Synchronous flashing lamp low-power-consumption realization method
CN106163030A
SoC dual-core system clock synchronization method and device
CN112947678A
Topology identification method and system based on GNSS and synchronous phasor
CN117955241A
Clock synchronization method, device, equipment, medium and product
CN118944795A