Time jump compensation method and system in transmission network data channel switching scenario
By receiving and analyzing time protocol packets, and utilizing redundancy processing and iterative optimization algorithms, the system automatically identifies and compensates for time jumps caused by transmission network channel switching, thus solving the problem of decreased synchronization accuracy due to transmission network data channel switching and achieving high-precision time synchronization.
Patent Information
- Application Number
- CN202610458939.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2026-04-09
- Publication Date
- 2026-06-09
- Estimated Expiration
- 2046-04-09
AI Technical Summary
During the data channel switching process in the transmission network, existing technologies cannot accurately detect time jumps and perform high-precision compensation, resulting in a decrease in synchronization accuracy. Furthermore, methods that rely on external time sources or special protocols have poor applicability in certain scenarios.
By receiving and analyzing time protocol packets, and utilizing redundancy processing and iterative optimization algorithms, the system automatically identifies and compensates for time jumps caused by transmission network channel switching. This includes time jump trigger judgment, integration correction, and iterative optimization, achieving accurate compensation without the need for external time sources or special protocols.
It ensures the accuracy of time synchronization in transmission network switching scenarios. Through automatic identification and compensation, it significantly improves the accuracy and stability of time synchronization and reduces the occupation of network bandwidth.
Smart Images

Figure CN122001514B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of wireless communication network technology, and in particular to a time jump compensation method and system for data channel switching scenarios in transmission networks. Background Technology
[0002] Currently, the mainstream technologies in the field of network synchronization are Network Time Protocol (NTP) and Precision Time Protocol (PTP). Building time-synchronized networks based on the data channels of transmission networks such as Synchronous Digital Hierarchy (SDH), Packet Transport Network (PTN), and Optical Transport Network (OTN) is a widely used implementation method. The technical foundation of network time synchronization relies on two sets of core calculation formulas (based on the assumption of identical transmission and reception paths): the formula for calculating the round-trip time of a message and the formula for calculating the time difference between the client and the clock source.
[0003] However, time synchronization networks based on transmission network data channels generally suffer from network path asymmetry. Therefore, in the initial stage of network construction, it is necessary to obtain a fixed delay compensation amount through time instrument testing and satellite source comparison to offset the impact of path asymmetry and ensure synchronization accuracy. However, once the time synchronization network enters the operational phase, link failures can cause channel switching in the transmission network data channels, altering the network operating state and generating new network delays. Compared to the delay before the switching, the deviation can reach microseconds or more, severely impacting high-precision time synchronization networks that rely on the transmission network and leading to a significant decrease in synchronization accuracy.
[0004] To address the time jump issue caused by channel switching, existing technologies primarily employ two approaches: one is to introduce a satellite synchronization source or other external time signal at the slave clock end, achieving automatic or manual compensation through signal comparison; the other is to utilize the master clock for compensation, adding a special protocol between the slave and master clocks to complete automatic compensation. However, both methods have significant limitations, requiring reliance on other time sources or additional equipment / protocols, making them less suitable for scenarios with only network data channels. Summary of the Invention
[0005] The technical problems this invention aims to solve are: first, how to accurately detect time jumps caused by transmission network channel switching from network time deviation data; and second, how to intelligently compensate for network delays caused by transmission network switching without relying on external time sources or special protocols, so as to ensure the continuous high-precision operation of the time synchronization network. To solve these technical problems, this invention provides a time jump compensation method and system for transmission network data channel switching scenarios.
[0006] In a first aspect, embodiments of the present invention provide a time jump compensation method for data channel switching scenarios in a transmission network, including:
[0007] Receive several first time protocol packets transmitted through the data channel of the transmission network, and perform a time jump trigger judgment process based on all the first time protocol packets to determine whether a time jump has occurred;
[0008] After determining that a time jump has occurred, the system continues to receive several second time protocol packets transmitted through the data channel of the transmission network, and integrates and corrects all the second time protocol packets and the pre-measured first time jump compensation value to obtain the second time jump compensation value.
[0009] In response to the frequency adjustment instruction sent by the time request packet, the system continues to receive several third time protocol packets transmitted through the data channel of the transmission network, and iteratively optimizes the second time jump compensation value according to all the third time protocol packets to obtain the third time jump compensation value.
[0010] The third time jump compensation value is saved and applied to time synchronization compensation.
[0011] Preferably, the step of receiving a plurality of first time protocol packets transmitted through the transmission network data channel, and performing a time jump trigger judgment process based on all the first time protocol packets to determine whether a time jump has occurred includes:
[0012] Receive several first time protocol packets continuously transmitted through the data channel of the transmission network, and store the first master-slave clock time difference and the first message round-trip delay obtained by parameter parsing of each first time protocol packet into the first data pool in sequence;
[0013] At each first preset time interval, redundancy processing is performed on all the latest first master-slave clock time differences and all the latest first message round-trip delays in the first data pool to obtain the second master-slave clock time difference and the second message round-trip delay obtained from the last redundancy processing before the time jump.
[0014] By comparing the difference between the first master-slave clock time difference and the second master-slave clock time difference with the difference between the round-trip delay of the first message and the round-trip delay of the second message, it is determined whether a time jump has occurred.
[0015] Preferably, the process of redundancy processing for all the latest first master-slave clock time differences in the first data pool includes:
[0016] Sort all the latest first master-slave clock time differences in the first data pool to obtain the first time difference sequence;
[0017] Outlier processing is performed on the first time difference sequence to obtain the second time difference sequence;
[0018] Calculate the average value of the second time difference sequence to obtain the average value of the first time difference;
[0019] Sort all the first master-slave clock time differences in the second time difference sequence to obtain the third time difference sequence;
[0020] Based on the average value of the first time difference, outlier processing is performed on the third time difference sequence to obtain the fourth time difference sequence;
[0021] The average value of the fourth time difference sequence is calculated to obtain the average value of the second time difference.
[0022] Preferably, the step of determining whether a time jump has occurred by comparing the difference between the first master-slave clock time difference and the second master-slave clock time difference with the difference between the first message round-trip time delay and the second message round-trip time delay includes:
[0023] If the difference between the first master-slave clock time difference and the second master-slave clock time difference obtained by parameter parsing of a first preset number of consecutive first time protocol packets exceeds a first threshold, and the difference between the first message round-trip delay and the second message round-trip delay obtained by parameter parsing of a first preset number of consecutive first time protocol packets exceeds the first threshold, then a time jump is determined to have occurred.
[0024] Preferably, after determining that a time jump has occurred, the step of continuing to receive a plurality of second time protocol packets transmitted through the data channel of the transmission network, and integrating and correcting all the second time protocol packets and the pre-measured first time jump compensation value to obtain a second time jump compensation value, includes:
[0025] After determining that a time jump has occurred, continue to receive several second time protocol packets that are continuously transmitted through the data channel of the transmission network, and store the third master-slave clock time difference and the third message round-trip delay obtained by parameter parsing of each second time protocol packet into the second data pool in sequence.
[0026] Every first preset time interval, redundancy processing is performed on all the latest third master-slave clock time differences and all the latest third message round-trip delays in the second data pool to obtain the fourth master-slave clock time difference and the fourth message round-trip delay obtained by a second preset number of redundancy processing operations.
[0027] A first operation is performed on all the fourth master-slave clock time differences to obtain several first time deviation values, and redundancy processing is performed on all the first time deviation values to obtain a first clock hold deviation.
[0028] Preferably, after performing a first operation on all the fourth master-slave clock time differences to obtain a plurality of first time deviation values, and performing redundancy processing on all the first time deviation values to obtain a first clock hold-off deviation, the method further includes:
[0029] Each of the fourth master-slave clock time differences is subjected to a second operation with the first clock to obtain the corresponding fifth master-slave clock time difference, and all the fifth master-slave clock time differences are subjected to redundancy processing to obtain the sixth master-slave clock time difference;
[0030] The second time jump compensation value is obtained by superimposing the sixth master-slave clock time difference and the pre-measured first time jump compensation value.
[0031] Preferably, in response to the frequency adjustment instruction sent by the time request packet, the system continues to receive a plurality of third time protocol packets transmitted through the data channel of the transmission network, and iteratively optimizes the second time jump compensation value based on all the third time protocol packets to obtain a third time jump compensation value, including:
[0032] After executing the instruction to accelerate the transmission frequency of time request packets, it continues to receive several third time protocol packets continuously transmitted through the data channel of the transmission network, and stores the seventh master-slave clock time difference and the fifth message round-trip delay obtained by parameter parsing of each third time protocol packet into the second data pool in sequence.
[0033] Every second preset time interval, redundancy processing is performed on all the latest seventh master-slave clock time differences and all the latest fifth message round-trip delays in the second data pool to obtain the eighth master-slave clock time difference and the sixth message round-trip delay obtained by a third preset number of redundancy processing operations.
[0034] A first operation is performed on all the eighth master-slave clock time differences to obtain several second time deviation values, and redundancy processing is performed on all the second time deviation values to obtain a second clock hold deviation.
[0035] Preferably, after performing a first calculation on all the eighth master-slave clock time differences to obtain a plurality of second time deviation values, and performing redundancy processing on all the second time deviation values to obtain a second clock hold-off deviation, the method further includes:
[0036] Each of the eighth master-slave clock time differences is processed with the second clock hold deviation to obtain the corresponding ninth master-slave clock time difference, and all the ninth master-slave clock time differences are processed for redundancy to obtain the tenth master-slave clock time difference.
[0037] The third operation is performed on the tenth master-slave clock time difference, the sixth master-slave clock time difference, and the second time jump compensation value to obtain the third time jump compensation value.
[0038] Preferably, the third operation on the tenth master-slave clock time difference, the sixth master-slave clock time difference, and the second time jump compensation value to obtain the third time jump compensation value includes:
[0039] The difference between the tenth master-slave clock time difference and the sixth master-slave clock time difference is weighted, and the weighted result is superimposed with the second time jump compensation value to obtain the third time jump compensation value.
[0040] Secondly, embodiments of the present invention provide a time jump compensation system for data channel switching scenarios in a transmission network, comprising:
[0041] The time jump detection module is used to receive several first time protocol packets transmitted through the data channel of the transmission network, and to execute a time jump trigger judgment process based on all the first time protocol packets to determine whether a time jump has occurred.
[0042] The time jump observation module is used to continue receiving several second time protocol packets transmitted through the data channel of the transmission network after determining that a time jump has occurred, and to integrate and correct the second time jump compensation value based on all the second time protocol packets and the pre-measured first time jump compensation value.
[0043] The time jump confirmation module is used to respond to the frequency adjustment instruction sent by the time request packet, continue to receive a number of third time protocol packets transmitted through the data channel of the transmission network, and iteratively optimize the second time jump compensation value according to all the third time protocol packets to obtain the third time jump compensation value.
[0044] The time jump compensation module is used to save the third time jump compensation value and apply it to time synchronization compensation.
[0045] Compared with existing technologies, the time jump compensation method and system for data channel switching scenarios in transmission networks, as described in this embodiment of the invention, have the following advantages:
[0046] (1) This invention does not rely on additional time sources or new special network protocols. It can achieve automatic identification and accurate compensation of time jumps by analyzing and processing the round-trip delay of messages generated by existing time synchronization protocols and the time difference between the client and the clock source. It has reference value for time synchronization jump processing in transmission network switching and other Ethernet environments.
[0047] (2) The three-stage progressive processing of jump trigger judgment, compensation value integration and correction, and iterative optimization verification ensures the rigor of the compensation logic and the reliability of the derivation. Especially in the verification and optimization stage, by dynamically adjusting the sending frequency of time request packets, the packet sending rate is increased only briefly during the compensation value iteration period, which not only greatly shortens the verification cycle of jump values, but also avoids the occupation of network bandwidth by long-term high-frequency packet sending.
[0048] (3) By expanding the calculation elements of the time hold deviation value and combining redundant data processing, the accuracy of clock hold deviation measurement is significantly improved; at the same time, the hold deviation value is introduced into the time deviation value calculation for difference correction, which effectively offsets the inherent error interference such as local crystal oscillator drift, and further ensures the accuracy of jump compensation value. Attached Figure Description
[0049] Figure 1 This is a schematic diagram of the hardware architecture of a time synchronization network built based on a transmission network according to an embodiment of the present invention;
[0050] Figure 2 This is a flowchart illustrating a time jump compensation method for a data channel switching scenario in a transmission network according to an embodiment of the present invention.
[0051] Figure 3 This is a schematic diagram of the process for determining whether a time jump has occurred according to an embodiment of the present invention;
[0052] Figure 4 This is a schematic diagram of the process for obtaining the second time jump compensation value according to an embodiment of the present invention;
[0053] Figure 5 This is a schematic diagram of the process for obtaining the third time jump compensation value according to an embodiment of the present invention;
[0054] Figure 6 This is a schematic diagram of a time jump compensation method in a data channel switching scenario of a transmission network according to an embodiment of the present invention;
[0055] Figure label:
[0056] 1. Time jump detection module; 2. Time jump observation module; 3. Time jump confirmation module; 4. Time jump compensation module. Detailed Implementation
[0057] The specific embodiments of the present invention will be described in further detail below with reference to the accompanying drawings and examples. The following examples are for illustrative purposes only and are not intended to limit the scope of the invention.
[0058] In the description of this invention, it should be understood that the terms "first" and "second," etc., are used to distinguish different objects, rather than to describe a specific order.
[0059] In the description of this invention, it should be noted that, unless otherwise defined, all technical and scientific terms used in this invention have the same meaning as commonly understood by those skilled in the art. The terminology used in this specification is for the purpose of describing specific embodiments only and is not intended to limit the invention. Those skilled in the art can understand the specific meaning of the above terms in this invention based on the specific circumstances.
[0060] like Figure 1 The diagram shown illustrates the hardware architecture of a time synchronization network built upon a transmission network according to an embodiment of the present invention. (Refer to...) Figure 1 This architecture is centered around a slave clock, which includes a master FPGA, an MCU, and a network PHY interface. The master FPGA implements underlying functions such as hardware time stamping of the network port, hardware network IP core and network protocol processing, network port PHY data and address bus management, and MCU address and data bus interface management. The MCU completes upper-layer logic such as network latency calculation, time packet management, and routing table management. Then, with the help of the network PHY interface and transmission network data channel, it conducts Ethernet data transmission with the master clock. Finally, a time synchronization network is built based on transmission networks such as SDH, PTN, and OTN to achieve microsecond-level time synchronization between the master and slave clocks.
[0061] Specifically, the main control FPGA undertakes hardware-level processing of time and data, and implements the following functions: 1) Hardware time stamping of the network port to accurately mark the timestamps of Ethernet packets; 2) Hardware network IP core and network protocol processing to complete the hardware parsing and encapsulation of network protocols; 3) Management of the network port PHY data address bus to realize bus interaction with the network PHY interface; 4) Management of the MCU address data bus interface to communicate with the MCU through the address data bus, while receiving a 20M clock signal input and triggering a TimeTOD interrupt to the MCU to synchronize time events.
[0062] Furthermore, the MCU is responsible for upper-layer time and network management, and has the following functions: 1) calculating network latency and deriving master-slave clock transmission delay; 2) managing network time packets and scheduling the sending and receiving of time synchronization messages; 3) managing network routing tables and maintaining transmission network routing information. In addition, the MCU provides two types of user interfaces: a management serial port and a management network port, supporting device debugging and identification management.
[0063] Furthermore, the network PHY interface, acting as a physical layer bridge between the clock and the external transmission network, establishes an Ethernet data transmission link with the master clock through the transmission network data channel, thereby realizing signal conversion between the data link layer and the physical layer.
[0064] It should be noted that the time synchronization network in this embodiment of the invention uses slave clocks and master clocks both with hardware time stamp time protocol packet processing capabilities, thus achieving high time accuracy after synchronization between the slave and master clocks. Furthermore, the transmission of time synchronization data through the data channel of the transmission network inevitably involves situations where the transmit and receive paths are unequal. In order to quickly detect time jumps caused by transmission network data channel switching and confirm the jump compensation parameters when the slave clock is not connected to other time signals (satellite sources and ground input time signals), this embodiment of the invention provides a time jump compensation method for transmission network data channel switching scenarios.
[0065] like Figure 2 The diagram shown is a flowchart illustrating a time jump compensation method for a data channel switching scenario in a transmission network according to an embodiment of the present invention. (Refer to...) Figure 2 An embodiment of the present invention provides a time jump compensation method in a data channel switching scenario of a transmission network, comprising the following steps:
[0066] S1. Receive several first time protocol packets transmitted through the data channel of the transmission network, and execute the time jump trigger judgment process according to all first time protocol packets to determine whether a time jump has occurred;
[0067] like Figure 3 As shown, this is a flowchart illustrating step S1. (Refer to...) Figure 3 Step S1 includes:
[0068] S101. Receive a number of first time protocol packets continuously transmitted through the data channel of the transmission network, and store the first master-slave clock time difference and the first message round-trip delay obtained by parameter parsing of each first time protocol packet into the first data pool in sequence.
[0069] The system receives several first time protocol packets (eNTP or PTP packets) continuously transmitted by the master clock through the transmission network data channel. It parses each packet, extracts the key timestamp, and calculates the first master-slave clock time difference and the first message round-trip delay based on known formulas. These real-time calculated first master-slave clock time differences and first message round-trip delays are then stored in the first data pool in the order of reception.
[0070] Specifically, the key timestamps include T1, T2, T3, and T4. Among them, T1 represents the timestamp when the client (slave clock) sends the request, T2 represents the timestamp when the server (master clock) receives the request, T3 represents the timestamp when the server (master clock) sends the response, and T4 represents the timestamp when the client (slave clock) receives the response.
[0071] Furthermore, before the time synchronization network is established, the network time deviation is measured using a time testing instrument, and this deviation is used as the first time jump compensation value. Therefore, the first master-slave clock time difference and the first message round-trip delay calculated based on the known formula are as follows:
[0072] offset1=(((T2-T1)+(T3-T4)) / 2)+Compensation1
[0073] Here, offset1 represents the first master-slave clock time difference, and Compensation1 represents the first time jump compensation value.
[0074] delay1=(T4-T1)-(T3-T2)
[0075] Here, delay1 represents the round-trip delay of the first message.
[0076] S102. At each first preset time interval, perform redundancy processing on all the latest first master-slave clock time differences and all the latest first message round-trip delays in the first data pool, and obtain the second master-slave clock time difference and the second message round-trip delay obtained from the last redundancy processing before the time jump.
[0077] In this embodiment, the first preset time is set to 50 seconds. Every 50 seconds, redundancy processing is performed on all the latest first master-slave clock time differences and all the latest first message round-trip delays in the first data pool. The second master-slave clock time difference and the second message round-trip delay obtained from the last redundancy processing before the time jump are then obtained. It can be understood that the first data pool is updated every 50 seconds. That is, the object of each redundancy processing is the current latest first master-slave clock time difference or first message round-trip delay.
[0078] Redundancy handling mainly employs a combination of outlier handling and average value calculation. The following explanation uses the first master-slave clock time difference as an example to illustrate the redundancy handling process.
[0079] The process of redundancy processing for all the latest master-slave clock time differences in the first data pool includes the following steps:
[0080] 1) Sort all the latest first master-slave clock time differences in the first data pool to obtain the first time difference sequence;
[0081] 2) Outlier point processing is performed on the first time difference sequence to obtain the second time difference sequence;
[0082] In this embodiment, the largest and smallest 10% of the data in the first time difference sequence are removed to obtain the second time difference sequence.
[0083] 3) Calculate the average value of the second time difference sequence to obtain the average value of the first time difference;
[0084] 4) Sort all the first master-slave clock time differences in the second time difference sequence to obtain the third time difference sequence;
[0085] 5) Based on the average value of the first time difference, outlier points in the third time difference sequence are processed to obtain the fourth time difference sequence;
[0086] For the third time difference sequence, remove the largest data points, which are at most 10% of the total data (if less than 10% of the data are greater than the average of the first time difference, remove all data points greater than the average of the first time difference); remove the smallest data points, which are at most 10% of the total data (if less than 10% of the data are less than the average of the first time difference, remove all data points smaller than the average of the first time difference). Through this outlier removal process, the fourth time difference sequence is obtained.
[0087] 6) Calculate the average value of the fourth time difference sequence to obtain the average value of the second time difference.
[0088] Steps 1) to 3) constitute the first redundancy processing, and steps 4) to 5) constitute the second redundancy processing. The average value of the second time difference is the result obtained from the corresponding redundancy processing. It should be noted that all redundancy processing operations used in this invention can refer to steps 1) to 5) above, the only difference being the processing object.
[0089] S103. By comparing the difference between the first master-slave clock time difference and the second master-slave clock time difference with the difference between the first message round-trip delay and the second message round-trip delay, it is determined whether a time jump has occurred.
[0090] If the difference between the first master-slave clock time difference and the second master-slave clock time difference obtained by parameter parsing of a first preset number of consecutive first time protocol packets exceeds a first threshold, and the difference between the first message round-trip delay and the second message round-trip delay obtained by parameter parsing of a first preset number of consecutive first time protocol packets exceeds the first threshold, then a time jump is determined to have occurred.
[0091] After the data channel of the transmission network is switched, the round-trip time of the first message is most likely to change. Under normal transmission conditions, the round-trip time of the first message calculated from the Ethernet time packet and the jitter of the first master-slave clock time difference are very small, generally not exceeding microseconds. In this embodiment, 2 microseconds is used as the time jump trigger condition.
[0092] Specifically, data channel switching can occur in two ways:
[0093] First, comparing the round-trip delay of the first message and the round-trip delay of the second message, the difference is greater than 2 microseconds, but the difference between the first master-slave clock time difference and the second master-slave clock time difference is very small, so this situation does not need to be considered.
[0094] Second, comparing the round-trip delay of the first message with the round-trip delay of the second message, and comparing the time difference between the first master-slave clock and the time difference between the second master-slave clock, if the difference exceeds 2 microseconds, this situation must be considered.
[0095] In this embodiment, the first preset quantity is set to 10, and the first threshold is set to 2 microseconds. If the difference between the first master-slave clock time difference and the second master-slave clock time difference calculated by 10 consecutive first time protocol packets exceeds 2 microseconds, and the difference between the first message round-trip delay and the second message round-trip delay also exceeds 2 microseconds, then the time jump warning is activated, the device enters the time hold mode, the data in the first data pool is cleared, the new data enters the second data pool, the time jump flag in the program is set, and the process proceeds to the next step S2.
[0096] S2. After determining that a time jump has occurred, continue to receive several second time protocol packets transmitted through the data channel of the transmission network, and integrate and correct them according to all the second time protocol packets and the pre-measured first time jump compensation value to obtain the second time jump compensation value.
[0097] like Figure 4 As shown, this is a flowchart illustrating step S2. (Refer to...) Figure 4 Step S2 includes:
[0098] S201. After determining that a time jump has occurred, continue to receive several second time protocol packets that are continuously transmitted through the data channel of the transmission network, and store the third master-slave clock time difference and the third message round-trip delay obtained by parameter parsing of each second time protocol packet into the second data pool in sequence.
[0099] After determining that a time jump has occurred, the slave clock continues to receive several second time protocol packets continuously transmitted by the master clock through the transmission network data channel. Each protocol packet is parsed, its key timestamp is extracted, and the third master-slave clock time difference and the third message round-trip delay are calculated based on known formulas. These real-time calculated third master-slave clock time differences and third message round-trip delays are then stored sequentially into the second data pool according to the receiving order. It should be noted that the parameter parsing process in step S201 can be referred to in step S101, and will not be repeated here.
[0100] S202. Every first preset time interval, perform redundancy processing on all the latest third master-slave clock time differences and all the latest third message round-trip delays in the second data pool, and obtain the fourth master-slave clock time difference and fourth message round-trip delay obtained by a second preset number of redundancy processing.
[0101] In this embodiment, the first preset time is set to 50 seconds, and the second preset quantity is 20. Every 50 seconds, redundancy processing is performed on all the latest third master-slave clock time differences and all the latest third message round-trip delays in the second data pool, resulting in the fourth master-slave clock time difference and the fourth message round-trip delay obtained after 20 redundancy processing steps. It can be understood that the second data pool is updated every 50 seconds. That is, the object of each redundancy processing step is the current latest third master-slave clock time difference or third message round-trip delay. The redundancy processing process can be referred to in step S102, and will not be repeated here.
[0102] S203. Perform a first operation on all fourth master-slave clock time differences to obtain several first time deviation values, and perform redundancy processing on all first time deviation values to obtain the first clock hold deviation.
[0103] Under conditions where the ambient temperature remains relatively stable and the discipline voltage of the internal cryogenic crystal oscillator is constant, the clock aging deviation of the cryogenic crystal oscillator is negligible over a short period. The short-term clock hold deviation of the cryogenic crystal oscillator is primarily due to the discipline voltage. Theoretically, the clock hold deviation for a fixed time slice is essentially constant over a short period. Therefore, by calculating the deviation of the master-slave clock time difference between any two time slices, a set of clock hold deviation values can be obtained. Further redundancy processing can then yield the final clock hold deviation value.
[0104] Specifically, the process of performing a first operation on all fourth master-slave clock time differences to obtain several first time deviation values in this embodiment includes:
[0105] The difference between the fourth master-slave clock time difference of the first clock and the second master-slave clock time difference, the difference between the fourth master-slave clock time difference of the second clock and the first clock, the difference between the fourth master-slave clock time difference of the third clock and the first clock, is divided by 2, ..., the difference between the fourth master-slave clock time difference of the 20th clock and the first clock, divided by 19, yields 20 first time deviation values.
[0106] The difference between the fourth master-slave clock time difference of the second and third master-slave clocks is divided by 2. The difference between the fourth master-slave clock time difference of the third and fourth master-slave clocks is divided by 2. ... The difference between the fourth master-slave clock time difference of the second and third master-slave clocks is divided by 2. ... The difference between the fourth master-slave clock time difference of the 20th and fourth master-slave clocks is divided by 18, resulting in 19 first time deviation values.
[0107] The difference between the fourth master-slave clock time difference of the 3rd clock and the second master-slave clock time difference is divided by 3. The difference between the fourth master-slave clock time difference of the 4th clock and the fourth master-slave clock time difference of the 3rd clock is divided by 2. ... The difference between the fourth master-slave clock time difference of the 5th clock and the fourth master-slave clock time difference of the 3rd clock is divided by 17, resulting in 18 first time deviation values.
[0108] ……,
[0109] The value of the fourth master-slave clock time difference of the 19th clock minus the second master-slave clock time difference, divided by 19, and the fourth master-slave clock time difference of the 20th clock minus the fourth master-slave clock time difference of the 19th clock, yields two first time deviation values.
[0110] The value of the fourth master-slave clock time difference minus the second master-slave clock time difference, divided by 20, yields a first time deviation value.
[0111] Through the above process, a total of 210 first time deviation values can be obtained. These deviation values are then subjected to redundancy processing to obtain the first clock hold deviation. The redundancy processing process can be referred to step S102, and will not be repeated here.
[0112] Furthermore, such as Figure 4 As shown, after step S203, the following steps are also included:
[0113] S204. Perform a second operation on each fourth master-slave clock time difference and the first clock to obtain the corresponding fifth master-slave clock time difference, and perform redundancy processing on all fifth master-slave clock time differences to obtain the sixth master-slave clock time difference.
[0114] Specifically, in this embodiment, the first master-slave clock time difference is subtracted from the first clock hold deviation, the second master-slave clock time difference is subtracted from twice the first clock hold deviation, the third master-slave clock time difference is subtracted from three times the first clock hold deviation, ..., the 20th master-slave clock time difference is subtracted from 20 times the first clock hold deviation, to obtain the corresponding fifth master-slave clock time difference.
[0115] Furthermore, redundancy processing is performed on all fifth master-slave clock time differences to obtain the sixth master-slave clock time difference. The redundancy processing process can be referred to step S102, and will not be repeated here.
[0116] S205. The second time jump compensation value is obtained by superimposing the time difference between the sixth master and slave clocks and the pre-measured first time jump compensation value.
[0117] It should be noted that, under normal circumstances, the master-slave clock time difference and message round-trip delay caused by the switching of the transmission network data channel are very large (more than 2 microseconds), and the difference is rarely less than 1 microsecond. Therefore, if the difference between the third master-slave clock time difference and the second master-slave clock time difference calculated by 10 consecutive second time protocol packets is within 1 microsecond, and the difference between the third message round-trip delay and the second message round-trip delay is also within 1 microsecond, then it is determined that the transmission network data channel has performed a rollback operation. In order not to affect the normal synchronization process, the program first exits the jump calculation and clears the time jump flag accordingly.
[0118] S3. In response to the frequency adjustment instruction sent by the time request packet, continue to receive several third time protocol packets transmitted through the data channel of the transmission network, and iteratively optimize the second time jump compensation value according to all the third time protocol packets to obtain the third time jump compensation value.
[0119] like Figure 5 As shown, this is a flowchart illustrating step S3. (Refer to...) Figure 5 Step S3 includes:
[0120] S301. After executing the instruction to accelerate the transmission frequency of the time request packet, continue to receive several third time protocol packets continuously transmitted through the transmission network data channel, and store the seventh master-slave clock time difference and the fifth message round-trip delay obtained by parameter parsing of each third time protocol packet into the second data pool in sequence.
[0121] This embodiment increases the sending frequency of time request packets to twice the original frequency, thereby shortening the data processing time. Originally, data was processed once every 50 seconds, but because the sending frequency has been doubled, the data processing time has been shortened to 25 seconds.
[0122] Specifically, after executing the instruction to accelerate the transmission frequency of time request packets (twice the rate), the slave clock continues to receive several third time protocol packets continuously transmitted by the master clock through the transmission network data channel. Each protocol packet is parsed, its key timestamp is extracted, and the seventh master-slave clock time difference and the round-trip delay of the fifth message are calculated based on known formulas. These real-time calculated seventh master-slave clock time differences and fifth message round-trip delays are then sequentially stored in the second data pool according to the receiving order. It should be noted that the parameter parsing process in step S301 can be referred to in step S101, and will not be repeated here.
[0123] S302. Every second preset time interval, perform redundancy processing on all the latest seventh master-slave clock time differences and all the latest fifth message round-trip delays in the second data pool, and obtain the eighth master-slave clock time difference and the sixth message round-trip delay obtained by a third preset number of redundancy processing.
[0124] In this embodiment, the second preset time is set to 25 seconds, and the third preset quantity is 10. Every 25 seconds, redundancy processing is performed on all the latest seventh master-slave clock time differences and all the latest fifth message round-trip delays in the second data pool, obtaining the eighth master-slave clock time difference and the sixth message round-trip delay after 10 redundancy processing steps. It can be understood that the second data pool is updated every 25 seconds. That is, the object of each redundancy processing step is the current latest seventh master-slave clock time difference or fifth message round-trip delay. The redundancy processing process can be referred to in step S102, and will not be repeated here.
[0125] S303. Perform a first operation on all the eighth master-slave clock time differences to obtain several second time deviation values, and perform redundancy processing on all the second time deviation values to obtain the second clock hold deviation.
[0126] For ease of explanation, the second master-slave clock time difference is corrected, and the corrected second master-slave clock time difference is used as the starting value for the first operation in this step. Specifically, this embodiment uses the following formula to correct the second master-slave clock time difference:
[0127] offsetR2 = offset2 + 20 × Hold1
[0128] Where offsetR2 represents the corrected second master-slave clock time difference, offset2 represents the second master-slave clock time difference, and Hold1 represents the first clock hold offset.
[0129] Specifically, the process of performing a first operation on all the time differences between the eighth master and slave clocks to obtain several second time deviation values in this embodiment includes:
[0130] The difference between the eighth master-slave clock time difference of the first clock and the corrected second master-slave clock time difference, the difference between the eighth master-slave clock time difference of the second clock and the first clock, the difference between the eighth master-slave clock time difference of the third clock and the first clock, is divided by 2, ..., the difference between the eighth master-slave clock time difference of the tenth clock and the first clock, divided by 9, yields 10 second time deviation values.
[0131] The value of the second master-slave clock time difference minus the corrected second master-slave clock time difference is divided by 2. The value of the third master-slave clock time difference minus the second master-slave clock time difference is divided by 2. The value of the fourth master-slave clock time difference minus the second master-slave clock time difference is divided by 2. ... The value of the tenth master-slave clock time difference minus the second master-slave clock time difference is divided by 8, resulting in 9 second time deviation values.
[0132] The value of the eighth master-slave clock time difference of the third clock minus the corrected second master-slave clock time difference is divided by 3. The difference between the eighth master-slave clock time difference of the fourth clock and the eighth master-slave clock time difference of the third clock is divided by 2. ... The difference between the eighth master-slave clock time difference of the fifth clock and the eighth master-slave clock time difference of the third clock is divided by 7. This yields eight second time deviation values.
[0133] ……,
[0134] The value of the eighth master-slave clock time difference of the 9th clock minus the corrected second master-slave clock time difference, divided by 9, and the eighth master-slave clock time difference of the 10th clock minus the eighth master-slave clock time difference of the 9th clock, yields two second time deviation values.
[0135] The value of the 10th master-slave clock time difference minus the corrected second master-slave clock time difference, divided by 10, yields a second time deviation value.
[0136] Through the above process, a total of 55 second time deviation values can be obtained. These deviation values are then subjected to redundancy processing to obtain the second clock hold deviation. The redundancy processing process can be referred to step S102, and will not be repeated here.
[0137] Furthermore, such as Figure 5 As shown, after step S303, the following steps are also included:
[0138] S304. Perform a second operation on each eighth master-slave clock time difference, keeping it offset from the second clock, to obtain the corresponding ninth master-slave clock time difference. Perform redundancy processing on all ninth master-slave clock time differences to obtain the tenth master-slave clock time difference.
[0139] Specifically, in this embodiment, the second clock hold bias is subtracted from the first eighth master-slave clock time difference, twice the second clock hold bias is subtracted from the second eighth master-slave clock time difference, three times the second clock hold bias is subtracted from the third eighth master-slave clock time difference, ..., ten times the second clock hold bias is subtracted from the tenth eighth master-slave clock time difference, to obtain the corresponding ninth master-slave clock time difference.
[0140] Furthermore, redundancy processing is performed on all ninth master-slave clock time differences to obtain the tenth master-slave clock time difference. The redundancy processing process can be referred to step S102, and will not be repeated here.
[0141] S305. Perform a third operation on the tenth master-slave clock time difference, the sixth master-slave clock time difference, and the second time jump compensation value to obtain the third time jump compensation value.
[0142] The difference between the tenth master-slave clock time difference and the sixth master-slave clock time difference is weighted, and the weighted result is superimposed on the second time jump compensation value to obtain the third time jump compensation value. The weighting values are low, and only minor adjustments are made. Specifically, this embodiment uses the following formula to calculate the third time jump compensation value:
[0143] Compensation3=Compensation2+(offset10-offset6)×0.1
[0144] Where Compensation3 represents the third time jump compensation value, Compensation2 represents the second time jump compensation value, offset10 represents the tenth master-slave clock time difference, and offset6 represents the sixth master-slave clock time difference.
[0145] It should be noted that, under normal circumstances, the master-slave clock time difference and message round-trip delay caused by the switching of the transmission network data channel are very large (more than 2 microseconds), and the difference is rarely less than 1 microsecond. Therefore, if the difference between the seventh master-slave clock time difference calculated by 10 consecutive third time protocol packets and the corrected second master-slave clock time difference is within 1 microsecond, and the difference between the fifth message round-trip delay and the second message round-trip delay is also within 1 microsecond, then it is determined that the transmission network data channel has performed a rollback operation. In order not to affect the normal synchronization process, the program first exits the jump calculation and clears the time jump flag accordingly.
[0146] S4. Save the third time jump compensation value and apply it to time synchronization compensation.
[0147] Specifically, the third time jump compensation value is written into the Flash storage module of the local MCU to ensure that it is not lost after the device loses power, and serves as the benchmark compensation amount for subsequent time synchronization calculations; at the same time, the third time jump compensation value is uploaded to the network management system to complete centralized backup and management, making it easier for maintenance personnel to monitor changes in compensation parameters.
[0148] Furthermore, the third time jump compensation value is substituted into the calculation model of the master-slave clock time difference from the clock, replacing the previous compensation value, and is used to correct the delay deviation after the data channel switching of the transmission network in real time. After the compensation value is saved and the application configuration is completed, the program officially exits the time jump calculation stage and switches to the normal time synchronization operation stage, and continues to ensure the high-precision synchronization of the master and slave clocks through this compensation value.
[0149] This invention provides a time jump compensation method for data channel switching scenarios in transmission networks. It eliminates the need for additional time sources or new network-specific protocols. By analyzing the round-trip delay of messages generated by existing time synchronization protocols and the time difference between the client and the clock source, it achieves automatic identification and accurate compensation for time jumps. This method is applicable to time synchronization jump handling in transmission network switching and other Ethernet environments. A three-stage progressive processing approach—judgment of jump triggers, integration and correction of compensation values, and iterative optimization verification—ensures the rigor of the compensation logic and the reliability of its derivation. Particularly in the verification and optimization stage, by dynamically adjusting the sending frequency of time request packets and only briefly increasing the packet sending rate during the compensation value iteration period, the verification cycle of jump values is significantly shortened, and the network bandwidth occupation caused by long-term high-frequency packet sending is avoided. By expanding the calculation elements of the time hold deviation value and combining it with redundant data processing, the accuracy of clock hold deviation measurement is significantly improved. Simultaneously, the introduction of this hold deviation value into the time deviation value calculation for difference correction effectively offsets inherent error interference such as local crystal oscillator drift, further ensuring the accuracy of the jump compensation value.
[0150] like Figure 6 The diagram shown is a structural schematic of a time jump compensation system for a data channel switching scenario in a transmission network according to an embodiment of the present invention. (Refer to...) Figure 6 An embodiment of the present invention provides a time jump compensation system for a data channel switching scenario in a transmission network, comprising:
[0151] The time jump detection module 1 is used to receive several first time protocol packets transmitted through the data channel of the transmission network, and to execute a time jump trigger judgment process based on all the first time protocol packets to determine whether a time jump has occurred.
[0152] The time jump observation module 2 is used to continue receiving several second time protocol packets transmitted through the transmission network data channel after determining that a time jump has occurred, and to integrate and correct the second time jump compensation value based on all the second time protocol packets and the pre-measured first time jump compensation value.
[0153] The time jump confirmation module 3 is used to respond to the frequency adjustment instruction sent by the time request packet, continue to receive several third time protocol packets transmitted through the data channel of the transmission network, and iteratively optimize the second time jump compensation value according to all the third time protocol packets to obtain the third time jump compensation value.
[0154] The time jump compensation module 4 is used to save the third time jump compensation value and apply it to time synchronization compensation.
[0155] It should be noted that the modules in the aforementioned time jump compensation system for a data channel switching scenario in a transmission network can be implemented entirely or partially through software, hardware, or a combination thereof. These modules can be embedded in the processor of a computer device in hardware form or independent of it, or stored in the memory of a computer device in software form, so that the processor can call and execute the corresponding operations of each module. For specific limitations regarding the time jump compensation system for a data channel switching scenario in a transmission network, please refer to the limitations of the time jump compensation method for a data channel switching scenario in a transmission network described above; both have the same function and role, and will not be repeated here.
[0156] In summary, the time jump compensation method and system for data channel switching scenarios in transmission networks, as described in this embodiment of the invention, do not rely on additional time sources or new network-specific protocols. They achieve automatic identification and accurate compensation of time jumps simply by analyzing and processing the round-trip delay of messages generated by existing time synchronization protocols and the time difference between the client and the clock source. This provides a valuable reference for time synchronization jump processing in transmission network switching and other Ethernet environments. The three-stage progressive processing—judgment of jump triggers, integration and correction of compensation values, and iterative optimization verification—ensures the rigor of the compensation logic and the reliability of its derivation. Especially in the verification and optimization stage, by dynamically adjusting the sending frequency of time request packets and only briefly increasing the packet sending rate during the compensation value iteration period, the verification cycle of jump values is significantly shortened, and the network bandwidth occupation caused by long-term high-frequency packet sending is avoided. By expanding the calculation elements of the time hold deviation value and combining it with redundant data processing, the accuracy of clock hold deviation measurement is significantly improved. Simultaneously, the introduction of this hold deviation value for difference correction in the time deviation value calculation effectively offsets inherent error interference such as local crystal oscillator drift, further ensuring the accuracy of the jump compensation value.
[0157] The various embodiments in this specification are described in a progressive manner. For directly identical or similar parts of the embodiments, refer to each other. Each embodiment focuses on its differences from other embodiments. In particular, the system embodiments are basically similar to the method embodiments, so the description is relatively simple; relevant parts can be referred to the descriptions in the method embodiments. It should be noted that the technical features of the above embodiments can be combined arbitrarily. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as the combination of these technical features does not contradict each other, it should be considered within the scope of this specification.
[0158] The above description is only a preferred embodiment of the present invention. It should be noted that for those skilled in the art, several improvements and substitutions can be made without departing from the technical principles of the present invention, and these improvements and substitutions should also be considered within the scope of protection of the present invention.
Claims
1. A time jump compensation method for data channel switching scenarios in a transmission network, characterized in that, include: Receive several first time protocol packets transmitted through the data channel of the transmission network, and perform a time jump trigger judgment process based on all the first time protocol packets to determine whether a time jump has occurred; After determining that a time jump has occurred, the system continues to receive several second time protocol packets transmitted through the data channel of the transmission network, and integrates and corrects all the second time protocol packets and the pre-measured first time jump compensation value to obtain the second time jump compensation value. In response to the frequency adjustment instruction sent by the time request packet, the system continues to receive several third time protocol packets transmitted through the data channel of the transmission network, and iteratively optimizes the second time jump compensation value according to all the third time protocol packets to obtain the third time jump compensation value. The third time jump compensation value is saved and applied to time synchronization compensation.
2. The time jump compensation method for data channel switching scenarios in a transmission network according to claim 1, characterized in that, The process of receiving a plurality of first time protocol packets transmitted through the data channel of the transmission network and performing a time jump trigger judgment process based on all the first time protocol packets to determine whether a time jump has occurred includes: Receive several first time protocol packets continuously transmitted through the data channel of the transmission network, and store the first master-slave clock time difference and the first message round-trip delay obtained by parameter parsing of each first time protocol packet into the first data pool in sequence; At each first preset time interval, redundancy processing is performed on all the latest first master-slave clock time differences and all the latest first message round-trip delays in the first data pool to obtain the second master-slave clock time difference and the second message round-trip delay obtained from the last redundancy processing before the time jump. By comparing the difference between the first master-slave clock time difference and the second master-slave clock time difference with the difference between the round-trip delay of the first message and the round-trip delay of the second message, it is determined whether a time jump has occurred.
3. The time jump compensation method in the data channel switching scenario of the transmission network according to claim 2, characterized in that, The process of redundancy processing for all the latest master-slave clock time differences in the first data pool includes: Sort all the latest first master-slave clock time differences in the first data pool to obtain the first time difference sequence; Outlier processing is performed on the first time difference sequence to obtain the second time difference sequence; Calculate the average value of the second time difference sequence to obtain the average value of the first time difference; Sort all the first master-slave clock time differences in the second time difference sequence to obtain the third time difference sequence; Based on the average value of the first time difference, outlier processing is performed on the third time difference sequence to obtain the fourth time difference sequence; The average value of the fourth time difference sequence is calculated to obtain the average value of the second time difference.
4. The time jump compensation method in the data channel switching scenario of the transmission network according to claim 2, characterized in that, The step of determining whether a time jump has occurred by comparing the difference between the first master-slave clock time difference and the second master-slave clock time difference with the difference between the first message round-trip time delay and the second message round-trip time delay, includes: If the difference between the first master-slave clock time difference and the second master-slave clock time difference obtained by parameter parsing of a first preset number of consecutive first time protocol packets exceeds a first threshold, and the difference between the first message round-trip delay and the second message round-trip delay obtained by parameter parsing of a first preset number of consecutive first time protocol packets exceeds the first threshold, then a time jump is determined to have occurred.
5. The time jump compensation method in the data channel switching scenario of the transmission network according to claim 1, characterized in that, After determining that a time jump has occurred, the system continues to receive several second time protocol packets transmitted through the data channel of the transmission network, and integrates and corrects all the second time protocol packets and the pre-measured first time jump compensation value to obtain a second time jump compensation value, including: After determining that a time jump has occurred, continue to receive several second time protocol packets that are continuously transmitted through the data channel of the transmission network, and store the third master-slave clock time difference and the third message round-trip delay obtained by parameter parsing of each second time protocol packet into the second data pool in sequence. Every first preset time interval, redundancy processing is performed on all the latest third master-slave clock time differences and all the latest third message round-trip delays in the second data pool to obtain the fourth master-slave clock time difference and the fourth message round-trip delay obtained by a second preset number of redundancy processing operations. A first operation is performed on all the fourth master-slave clock time differences to obtain several first time deviation values, and redundancy processing is performed on all the first time deviation values to obtain a first clock hold deviation.
6. The time jump compensation method for data channel switching scenarios in a transmission network according to claim 5, characterized in that, After performing a first operation on all the fourth master-slave clock time differences to obtain several first time deviation values, and performing redundancy processing on all the first time deviation values to obtain a first clock hold-off deviation, the method further includes: Each of the fourth master-slave clock time differences is subjected to a second operation with the first clock to obtain the corresponding fifth master-slave clock time difference, and all the fifth master-slave clock time differences are subjected to redundancy processing to obtain the sixth master-slave clock time difference; The second time jump compensation value is obtained by superimposing the sixth master-slave clock time difference and the pre-measured first time jump compensation value.
7. The time jump compensation method for data channel switching scenarios in a transmission network according to claim 6, characterized in that, In response to the frequency adjustment instruction sent by the time request packet, the system continues to receive a number of third time protocol packets transmitted through the data channel of the transmission network, and iteratively optimizes the second time jump compensation value based on all the third time protocol packets to obtain a third time jump compensation value, including: After executing the instruction to accelerate the transmission frequency of time request packets, it continues to receive several third time protocol packets continuously transmitted through the data channel of the transmission network, and stores the seventh master-slave clock time difference and the fifth message round-trip delay obtained by parameter parsing of each third time protocol packet into the second data pool in sequence. Every second preset time interval, redundancy processing is performed on all the latest seventh master-slave clock time differences and all the latest fifth message round-trip delays in the second data pool to obtain the eighth master-slave clock time difference and the sixth message round-trip delay obtained by a third preset number of redundancy processing operations. A first operation is performed on all the eighth master-slave clock time differences to obtain several second time deviation values, and redundancy processing is performed on all the second time deviation values to obtain a second clock hold deviation.
8. The time jump compensation method in the data channel switching scenario of the transmission network according to claim 7, characterized in that, After performing a first calculation on all the eighth master-slave clock time differences to obtain several second time deviation values, and performing redundancy processing on all the second time deviation values to obtain a second clock hold-off deviation, the method further includes: Each of the eighth master-slave clock time differences is processed with the second clock hold deviation to obtain the corresponding ninth master-slave clock time difference, and all the ninth master-slave clock time differences are processed for redundancy to obtain the tenth master-slave clock time difference. The third operation is performed on the tenth master-slave clock time difference, the sixth master-slave clock time difference, and the second time jump compensation value to obtain the third time jump compensation value.
9. The time jump compensation method in the data channel switching scenario of the transmission network according to claim 8, characterized in that, The third operation, which involves processing the tenth master-slave clock time difference, the sixth master-slave clock time difference, and the second time jump compensation value to obtain the third time jump compensation value, includes: The difference between the tenth master-slave clock time difference and the sixth master-slave clock time difference is weighted, and the weighted result is superimposed with the second time jump compensation value to obtain the third time jump compensation value.
10. A time jump compensation system for data channel switching scenarios in a transmission network, characterized in that, include: The time jump detection module is used to receive several first time protocol packets transmitted through the data channel of the transmission network, and to execute a time jump trigger judgment process based on all the first time protocol packets to determine whether a time jump has occurred. The time jump observation module is used to continue receiving several second time protocol packets transmitted through the data channel of the transmission network after determining that a time jump has occurred, and to integrate and correct the second time jump compensation value based on all the second time protocol packets and the pre-measured first time jump compensation value. The time jump confirmation module is used to respond to the frequency adjustment instruction sent by the time request packet, continue to receive a number of third time protocol packets transmitted through the data channel of the transmission network, and iteratively optimize the second time jump compensation value according to all the third time protocol packets to obtain the third time jump compensation value. The time jump compensation module is used to save the third time jump compensation value and apply it to time synchronization compensation.
Citation Information
Patent Citations
Method and device capable of achieving peer-to-peer (PTP) time synchronization and based on aggregation links
CN103067113A
Line asymmetrical compensation method, equipment and system
CN103166792A
