Time synchronization method based on DCS
Through the DCS-based time synchronization method, the encoded PPS information, TOD information and start instructions are used to transmit the encoded PPS information, TOD information and start instructions, the problems of high hardware costs and complex system architecture caused by multiple synchronization lines are solved, and the accuracy and reliability of time synchronization are achieved.
Patent Information
- Application Number
- CN202510051888.X
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-14
- Publication Date
- 2025-04-25
AI Technical Summary
In the prior art, multiple synchronization lines used for time synchronization have problems such as high hardware cost, complex system architecture, inflexible equipment transfer, and insufficient accuracy and reliability of time synchronization.
By adopting a DCS-based time synchronization method, the PPS information and TOD information are acquired, the second time information is formed by encoding processing, and the transmission is achieved through a synchronization line to achieve the simultaneous transmission of PPS information, TOD information and start instructions.
Reduces additional wiring, enhances flexibility in equipment transfer, and improves accuracy and reliability of time synchronization.
Smart Images

Figure CN119892285A_ABST
Abstract
Description
Technical Field
[0001] The present invention mainly relates to the technical field of time synchronization for cross-device collaboration, and in particular to a time synchronization method based on DCS. Background Art
[0002] In a test system, when multiple devices work together, if you want these devices to perform actions at the same time, you usually use synchronization lines to connect multiple devices. The master device (or host or host device) sends a start command to the slave device (or slave or slave device) via the synchronization line at the same time, so as to achieve the purpose of simultaneous execution of actions. When it is necessary to accurately measure the response time of the device under test, since the crystal oscillator of each device will produce errors, in order to achieve synchronization and measure time more accurately, multiple devices often have to run under the same clock, and generally an external clock source is connected to the system to ensure clock synchronization.
[0003] However, there are some disadvantages in using multiple synchronization lines for time synchronization. For example, each additional synchronization line requires additional hardware resources to support it, which directly leads to an increase in hardware costs. Multiple synchronization lines mean that there are more connection points and interfaces in the system, which makes the overall architecture of the system more complicated. When the system needs to expand and add more devices or nodes, each additional node requires rewiring and adjusting the connection of the synchronization line, which not only increases the workload, but may also affect the normal operation of the original system. In addition, the layout and connection method of multiple synchronization lines are relatively fixed. Once the system architecture is determined, it is difficult to make flexible adjustments and optimizations. Summary of the invention
[0004] The technical problem to be solved by the present invention is to provide a time synchronization method based on DCS (Distributed Control System), which reduces additional wiring, enhances the flexibility of equipment transfer, and has higher time synchronization accuracy and better reliability.
[0005] To solve the above technical problems, the present invention provides a DCS-based time synchronization method, which is applied to a master device, including: acquiring first time information, wherein the first time information includes PPS information and TOD information; encoding the first time information to form second time information transmitted on a synchronization line; wherein the encoding method includes: taking the rising edge of the PPS information and shortening the continuous pulse time of the PPS information; incorporating the TOD information after the PPS information pulse is at a low level; and sending the second time information to the slave device.
[0006] Furthermore, a start instruction is included, and the start instruction is incorporated after the TOD information.
[0007] Furthermore, it also includes: judging whether the master device is connected to an external clock source; if the master device is connected to the external clock source, the first time information is derived from the external clock source; if the master device is not connected to the external clock source, the first time information is derived from the local clock of the master device.
[0008] Furthermore, it also includes: when the master device is connected to the external clock source, determining whether the external clock source is disconnected; if the external clock source is disconnected, performing a self-timekeeping process, wherein the self-timekeeping process relies on the master device crystal oscillator to continue to simulate clock information according to the received time information.
[0009] The present invention also provides a DCS-based time synchronization method, which is applied to a slave device, including: receiving second time information, where the second time information is the second time information sent by the master device as described in any of the above items; parsing the second time information, obtaining PPS information and TOD information in the second time information, or PPS information, TOD information and a start instruction; and synchronizing the time information on the slave device according to the parsed PPS information and the TOD information.
[0010] Furthermore, it also includes: in the process of receiving the second time information, refreshing and recording the time intervals of several consecutive PPS information, estimating the interval range of the next PPS information, and adding windows according to the estimated interval range to shield the interference signal on the synchronization line.
[0011] Furthermore, it also includes: after parsing the second time information, using a CRC check method to check the TOD information, and when the check is successful, indicating that the PPS information before the TOD information is valid.
[0012] Furthermore, it also includes: performing a self-timekeeping process, wherein the self-timekeeping process relies on the crystal oscillator of the slave device to continue simulating clock information according to the time information received in the early stage.
[0013] Furthermore, it also includes: adjusting the range of the window according to the time interval of the PPS information.
[0014] Furthermore, the method further includes: after synchronizing the time information on the slave device, feeding back the time synchronization result to the master device or the host computer.
[0015] Compared with the prior art, the present invention has the following beneficial effects: only one synchronization line is required to realize the simultaneous transmission of PSS information, TOD information and start instructions on the synchronization line without interfering with each other, reducing additional wiring, enhancing the flexibility of equipment transfer, and having higher time synchronization accuracy and better reliability. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] The accompanying drawings are included to provide a further understanding of the present invention, and they are included and constitute a part of the present invention. The accompanying drawings illustrate embodiments of the present invention and together with the specification serve to explain the principles of the present invention. In the accompanying drawings:
[0017] Figure 1 It is a schematic diagram of the connection between the master device and each slave device in the present invention;
[0018] Figure 2 It is a schematic diagram of the time synchronization process between the master device and the slave device in the present invention;
[0019] Figure 3 It is a schematic diagram of time signal coding in the present invention;
[0020] Figure 4 It is a schematic diagram of the task execution flow of the master device after time synchronization in the present invention;
[0021] Figure 5 It is a schematic diagram of the task execution flow of the slave device after time synchronization in the present invention. DETAILED DESCRIPTION
[0022] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the following is a brief introduction to the drawings required for the description of the embodiments. Obviously, the drawings described below are only some examples or embodiments of the present invention. For ordinary technicians in this field, the present invention can also be applied to other similar scenarios based on these drawings without creative work. Unless it is obvious from the language environment or otherwise explained, the same reference numerals in the figures represent the same structure or operation.
[0023] refer to Figure 1 and Figure 2 As shown, the DCS-based time synchronization method of this embodiment is applied to a master device (master chassis), including: obtaining first time information, wherein the first time information includes PPS information (Pulse Per Second) and TOD information (Time Of Day), encoding the first time information to form second time information transmitted on a synchronization line, wherein the encoding method includes: taking the rising edge of the PPS information, and shortening the continuous pulse time of the PPS information, incorporating the TOD information after the PPS information pulse is at a low level, and sending the second time information to the slave device (slave chassis).
[0024] In this embodiment, PPS information + TOD information is introduced in the information re-encoding implementation process, and the designated master device re-encodes the received PPS information + TOD information. Figure 3As shown, since PPS information + TOD information needs to be transmitted on the synchronization line, the PPS information needs to be accurate, and the TOD information allows a certain degree of lag in the system. Therefore, in the encoding process of the time synchronization information, the rising edge of the PPS information is taken to shorten the pulse of the PPS information that would originally last for hundreds of milliseconds, and after the low level is fixed at 2 milliseconds, the TOD information is forwarded, thereby realizing the forwarding of PPS information with accurate time and TOD information with reliable content through one synchronization line.
[0025] When the master device is connected to the host computer, since the host computer sends the start command at a random time and the slave devices need to reuse the synchronization line, the master device cannot forward the start command immediately after receiving it, but needs to wait until the time synchronization information is transmitted before forwarding the start command.
[0026] refer to Figure 3 As shown, in an ideal situation, the time information is transmitted once every 1 second, so for the slave device as the receiving end, after correctly receiving the time information and completing the CRC check (CyclicRedundancy Check) of the TOD information, there will be no valid PPS information in a short period of time. Any information fluctuations during this period should not be mistaken as a valid PPS information. Therefore, after the last CRC check is completed, the time synchronization information receiving module of the slave device will block the reception of information. Therefore, this period is called the synchronization information shielding period. Due to the existence of various factors such as the crystal oscillator error on the board, the synchronization information receiving module sets an elastic window, and the pulses that appear during this window period are considered to be valid PPS information second pulses.
[0027] In one embodiment, the time synchronization method also includes a start instruction, which is incorporated after the TOD information. The encoded time synchronization information includes PPS information, TOD information and a start instruction, and it can be known that the current start instruction is preceded and followed by the previous TOD information and the next PPS information respectively.
[0028] In one embodiment, it is determined whether the master device is connected to an external clock source. If the master device is connected to the external clock source, the first time information is derived from the external clock source. If the master device is not connected to the external clock source, the first time information is derived from the local clock of the master device.
[0029] In one embodiment, when the master device is connected to an external clock source, it is determined whether the external clock source is disconnected. If the external clock source is disconnected, a self-timekeeping process is performed. The self-timekeeping process relies on the master device crystal oscillator to continue to simulate clock information according to the received time information.
[0030] When the external clock source is disconnected and the master device needs to be self-contained, it relies on its own crystal oscillator to continue simulating clock information for synchronization according to the sending frequency of the previous time information, so that the entire system can still run under the time system based on the master device.
[0031] Another embodiment of the present invention is a time synchronization method based on DCS, which is applied to a slave device, including: receiving second time information, the second time information is the second time information sent by the master device in the aforementioned embodiment, parsing the second time information, obtaining PPS information and TOD information in the second time information, or PPS information, TOD information and a start instruction, and synchronizing the time information on the slave device according to the parsed PPS information and TOD information.
[0032] In one embodiment, during the process of receiving the second time information, the time intervals of several consecutive PPS information are refreshed and recorded, the interval range of the next PPS information is estimated, and a window is added according to the estimated interval range to shield the interference signal on the synchronization line.
[0033] In one embodiment, after parsing the second time information, the TOD information is verified by using a CRC verification method. If the verification is successful, it indicates that the PPS information before the TOD information is valid.
[0034] After the CRC check of the TOD information is completed, it indicates that the PPS information before the TOD information is valid. In the process of receiving the PPS information + TOD information, the slave device continuously refreshes the record of the time interval of the latest PPS information, estimates the interval range of the next PPS information, and adds a window according to the estimated interval range to shield the interference caused by other signals on the line.
[0035] In one embodiment, it also includes performing a self-timekeeping process, where the self-timekeeping process relies on the crystal oscillator of the slave device to continue simulating clock information according to the time information received in the previous period.
[0036] When the external clock source is disconnected and the slave device needs to be self-contained, it relies on its own crystal oscillator to continue simulating clock information for synchronization according to the sending frequency of the previous time information, so that the slave device can still operate under the time system based on the slave device itself.
[0037] In one embodiment, the range of the window is adjusted according to the time interval of the PPS information. The range of the window is continuously and flexibly adjusted according to the recording of the time interval of the PPS to ensure that the PPS information within a reasonable range is correctly captured and that valid second pulses are received within the window period, so the window can be called an "elastic window".
[0038] In one embodiment, after synchronizing the time information on the slave device, the time synchronization result is fed back to the master device or the host computer.
[0039] After the CRC check of the TOD signal is correct for at least three consecutive times, the slave device indicates that time synchronization is successfully established and feedbacks the successful establishment to the master device or host computer through data communication. After all slave devices in the system report the successful establishment status, it is considered that the response time test conditions are met.
[0040] After the time synchronization state is established, the host computer specifies the devices participating in the action through the data communication channel and issues a series of action instructions. When everything is ready, the host computer controls the master device to send a start instruction to all slave devices through the synchronization line. The start instruction is transmitted by the master device on the synchronization line without time synchronization information transmission and during the shielding period of the inelastic window as the start instruction, so as to realize the multiplexing of the synchronization line. After receiving the start instruction, all devices participating in the action will execute the action at the same time when the PPS information is received next time.
[0041] refer to Figure 3 to Figure 5 As shown in the figure, the period from the end of the last TOD information transmission to the arrival of the next window period is the synchronization information shielding period. The master device will not transmit time synchronization information and is only allowed to forward the start command during this period. If the start command from the host computer is received during this period, it will be forwarded immediately; if not during this period, the start command will be cached until the synchronization information shielding period is entered, and then forwarded. Accordingly, the slave device only receives valid start commands during this period. After the start command transmitted on the synchronization line is completed, all devices enter the ready state and start executing tasks at the same time when valid PPS information appears on the next synchronization line.
[0042] When each device is in synchronization, the relative time is started with the execution start time (i.e. the next PPS information synchronization time after receiving the start command) as the zero time. Each device records the relative time as a timestamp when outputting control actions or receiving the state change of the measured object, and uploads it to the host computer at the same time as the data. The host computer can calculate the response time by comparison.
[0043] The present invention is based on the time synchronization method of DCS, which improves the accuracy and reliability of time synchronization, and can further realize the synchronous execution of the actions of multiple devices with precise control. By introducing an external clock source, the cumulative error caused by the crystal oscillator deviation is eliminated, making the response time measurement more accurate and reliable. It reduces additional wiring, enhances the flexibility of equipment transfer, and is conducive to system status monitoring and fault detection. After the clock information is introduced, when the test equipment performs data transmission and fault reporting, it can simultaneously transmit the current time stamp, which is convenient for monitoring the current state of the system and knowing the time when the fault or error occurs, so as to better locate the problem location.
[0044] For those skilled in the art, the above invention disclosure is only for example and does not constitute a limitation of the present invention. Although not explicitly stated herein, those skilled in the art may make various modifications, improvements and corrections to the present invention. Such modifications, improvements and corrections are suggested in the present invention, so such modifications, improvements and corrections still belong to the spirit and scope of the exemplary embodiments of the present invention.
[0045] Although the present invention has been described with reference to the current specific embodiments, those skilled in the art should recognize that the above embodiments are only used to illustrate the present invention, and various equivalent changes or substitutions may be made without departing from the spirit of the present invention. Therefore, any changes or modifications to the above embodiments within the spirit of the present invention will fall within the scope of the claims of the present invention.
Claims
1. A DCS-based time synchronization method, applied to a master device, characterized in that: include: Acquire first time information, wherein the first time information includes PPS information and TOD information; encoding the first time information to form second time information transmitted on a synchronization line; The encoding method includes: taking the rising edge of the PPS information and shortening the continuous pulse time of the PPS information; incorporating the TOD information after the PPS information pulse is at a low level; The second time information is sent to the slave device.
2. The DCS-based time synchronization method according to claim 1, characterized in that: A start instruction is also included, and the start instruction is incorporated after the TOD information.
3. The DCS-based time synchronization method according to claim 1, characterized in that: Also includes: Determine whether the master device is connected to an external clock source. If the master device is connected to the external clock source, the first time information is derived from the external clock source. If the master device is not connected to the external clock source, the first time information is derived from the local clock of the master device.
4. The DCS-based time synchronization method according to claim 3, characterized in that: Also includes: In a case where the master device is connected to the external clock source, determining whether the external clock source is disconnected; If the external clock source is disconnected, a self-timekeeping process is performed, wherein the self-timekeeping process relies on the crystal oscillator of the master device to continue simulating clock information according to the received time information.
5. A DCS-based time synchronization method, applied to a slave device, characterized in that: include: receiving second time information, where the second time information is the second time information sent by the master device according to any one of claims 1 to 4; Parsing the second time information, obtaining PPS information and TOD information, or PPS information, TOD information and a start instruction in the second time information; The time information on the slave device is synchronized according to the parsed PPS information and the TOD information.
6. The DCS-based time synchronization method according to claim 5, characterized in that: Also includes: In the process of receiving the second time information, the time intervals of several consecutive PPS information are refreshed and recorded, the interval range of the next PPS information is estimated, and a window is added according to the estimated interval range to shield the interference signal on the synchronization line.
7. The DCS-based time synchronization method according to claim 5, characterized in that: include: After parsing the second time information, the TOD information is verified using a CRC verification method. If the verification is successful, it indicates that the PPS information before the TOD information is valid.
8. The DCS-based time synchronization method according to claim 5, characterized in that: include: A self-timekeeping process is performed, wherein the self-timekeeping process relies on the slave device crystal oscillator to continue simulating clock information according to the time information received in the early stage.
9. The DCS-based time synchronization method according to claim 5, characterized in that: Also includes: The range of the window is adjusted according to the time interval of the PPS information.
10. The DCS-based time synchronization method according to claim 5, characterized in that: Also includes: After synchronizing the time information on the slave device, the time synchronization result is fed back to the master device or the host computer.