A Time Synchronization Method for 5G and TSN Converged Networks Based on Timestamp Compensation Algorithm

By employing a timestamp compensation algorithm in the 5G-TSN network to transmit time synchronization information level by level, the time synchronization uncertainty problem introduced by the 5G network is solved, the cross-network time synchronization accuracy is improved, and the TSN synchronization requirements are met.

CN120018264BActive Publication Date: 2025-10-31CHONGQING UNIV OF POSTS & TELECOMM
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202510141237.X
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-02-08
Publication Date
2025-10-31
Estimated Expiration
2045-02-08

AI Technical Summary

Technical Problem

The network-side TSN converter introduced by 5G network as a TSN logic bridge increases the uncertainty of time synchronization, especially in closed-loop motion control, where it is difficult to meet TSN synchronization requirements, particularly when the time accuracy is as strict as 1µs.

Method used

A timestamp-based compensation algorithm is adopted to introduce the 5G network as a TSN virtual bridge into the TSN network. Time synchronization information is transmitted step by step through the TSN switch, NW-TT and DS-TT. Synchronization-related parameters are calculated using the peer-to-peer delay response measurement mechanism and one-way message propagation mechanism of gPTP to achieve cross-network time synchronization.

Benefits of technology

The accuracy of 5G-TSN cross-network time synchronization has been improved. By analyzing the distribution and statistical characteristics of timestamps, data processing is performed to calculate the frequency offset and dwell time between NW-TT and DS-TT, thereby achieving effective time compensation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120018264B_ABST
    Figure CN120018264B_ABST
Patent Text Reader

Abstract

This invention relates to a time synchronization method for 5G and TSN converged networks based on a timestamp compensation algorithm, belonging to the field of cross-network time synchronization. It includes: introducing a 5G network as a TSN virtual bridge into the TSN network to form a cross-network, which includes a TSN1 network, a 5G network, and a TSN2 network. The cross-network uses the TSN switches in the TSN1 network as the master clock and the TSN devices in the TSN2 network as slave clocks. Synchronization is achieved by transmitting time synchronization information step-by-step across the NW-TT module, the 5G network clock domain, and the DS-TT module. The cross-network time synchronization includes TSN2 network time synchronization, 5G network time synchronization, and TSN2 network time synchronization. This invention improves the accuracy of time synchronization by calculating the frequency offset and dwell time between NW-TT and DS-TT within the 5G system and performing time compensation in the DS-TT.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention belongs to the field of cross-network time synchronization and relates to a time synchronization method for 5G and TSN converged networks based on a timestamp compensation algorithm. Background Technology

[0002] The current trend in industry and academia is to unify communication technologies to develop a single technology capable of serving a variety of real-time and non-real-time applications. A solution discussed by industry and standardization organizations to address these new requirements is Time-Sensitive Networking (TSN). TSN is an IEEE 802.1 standard that uses Ethernet to achieve real-time functionality. Wireless technology aligns with the goals of Industry 4.0 and will become an indispensable aspect of future large-scale industrial communications. Fifth-generation cellular network technology (5G) is a promising technology that can address the lack of mobility and scalability in wired networks. The 3rd Generation Partnership Project (3GPP) group is committed to making 5G real-time capabilities applicable to industrial applications. A key aspect of this is seamless integration with TSN to establish converged 5G-TSN networks.

[0003] Both 3GPP and IEEE standards have provided in-depth analyses of the integration of 5G and TSN, demonstrating the feasibility of integrating 5G as a TSN logical bridge. The TSN logical bridge achieves seamless integration of 5G and TSN by hiding the complexities of 5G through dedicated TSN converters (TTs). These converters provide a TSN-compliant interface for the TSN network. A key feature is support for IEEE 802.1AS Universal Precision Time Protocol (gPTP) synchronization. From an architectural perspective, 5G-TSN integration as a TSN logical bridge is thoroughly defined.

[0004] Clock synchronization refers to the process of limiting the deviation between the clocks of devices in a system and a specific time information source within a certain range. It is a particularly important technology in distributed systems, aiming to establish a global time concept with predefined accuracy by ensuring a finite maximum offset between any two nodes. Especially in industrial control networks, many basic network operations such as object tracking, deterministic scheduling, and resource management rely on clock synchronization, which means that all nodes in the network need to share a unified time scale.

[0005] However, the network-side TSN converter (NW-TT) and device-side TSN converter (DS-TT) introduced by 5G networks as TSN logical bridges add more uncertainty to time synchronization. Unlike the wired connection of the TSN bridge, the DS-TT is wirelessly connected to the NW-TT, making it impossible to accurately calculate the frequency offset between the DS-TT and NW-TT for gPTP messages. Therefore, the industry is eager to understand the time synchronization accuracy within the 5G network to evaluate the overall time accuracy performance of TSN terminals. Researching whether TSN synchronization requirements can be met is crucial, especially for closed-loop motion control scenarios where time accuracy is critically low, down to 1µs. Summary of the Invention

[0006] In view of this, the purpose of this invention is to provide a time synchronization method for 5G and TSN converged networks based on a timestamp compensation algorithm.

[0007] To achieve the above objectives, the present invention provides the following technical solution:

[0008] A time synchronization method for a 5G and TSN converged network based on a timestamp compensation algorithm includes: introducing the 5G network as a TSN virtual bridge into the TSN network to form a cross-network, the cross-network including TSN1 network, 5G network and TSN2 network, the cross-network using the TSN switch in the TSN1 network as the master clock and the TSN device in the TSN2 network as the slave clock, and the master and slave clocks transmitting time synchronization information step by step across the NW-TT module, the 5G network clock domain and the DS-TT module to achieve synchronization;

[0009] Cross-network time synchronization includes TSN1 network time synchronization, 5G network time synchronization and TSN2 network time synchronization.

[0010] For TSN1 network time synchronization, the TSN switch is the master clock and the NW-TT is the slave clock. The master and slave clocks calculate synchronization-related parameters and achieve synchronization through the gPTP peer delay response measurement mechanism.

[0011] For 5G network time synchronization, synchronization is achieved by calculating the dwell time of the time synchronization message in the 5G network.

[0012] For TSN2 network time synchronization, DS-TT is used as the master clock and TSN devices are used as slave clocks. The master and slave clocks calculate synchronization-related parameters and achieve synchronization through the gPTP peer delay response measurement mechanism.

[0013] Furthermore, for TSN1 network time synchronization, the master clock receives and responds to end-to-end delay request messages from the clock transmitter and clock receiver, and synchronization between the master and slave clocks is achieved by measuring the clock offset; the specific synchronization process is as follows:

[0014] A1) The TSN switch will send a Sync_MC synchronization message to the NW-TT and record the sending time.

[0015] A2) The TSN switch sends a Follow_Up_MC message, which includes a timestamp of the sending process.

[0016] A3) After receiving the Sync_MC synchronization message, NW-TT records the arrival time. And send a Delay_Req_NW message to the TSN switch and record the sending time.

[0017] A4) TSN switches in Upon receiving a Delay_Req_NW message, immediately send a Delay_Resp_MC message to NW-TT, carrying a timestamp within it.

[0018] A5) When the Follow_Up_MC and Delay_Resp_MC messages arrive at NW-TT, NW-TT will parse out the timestamps from them respectively. and timestamp

[0019] A6) NW-TT obtained four timestamps and And begin calculating the master-slave clock link delay d. nw,mc offset with time deviation nw,mc The calculation formula is as follows:

[0020]

[0021] Based on the link delay d between the TSN switch and NW-TT nw,mc offset with time deviation nw,mc Complete time synchronization on the TSN1 network.

[0022] Furthermore, regarding 5G network time synchronization, the 5G network, acting as a TSN virtual bridge, joins the TSN network and has its own master clock. The entire 5G network is synchronized with the 5G master clock. Focusing on the 5G system's ingress NW-TT and egress DS-TT, a synchronization method is designed using a one-way message propagation mechanism combined with statistical methods. Specifically, the following steps are included:

[0023] B1) The TSN switch sends a Sync_1 message to the NW-TT. The time of sending the Sync_1 message is recorded as...

[0024] B2) The TSN switch then sends a Follow_Up_1 message. At this time, the NW-TT receives the Sync_1 message and records the entry timestamp TSi. n And the time when NW-TT receives the Sync message for the i-th time. The link delay d between the TSN switch and NW-TT will be calculated in the TSN1 network. nw,mc offset with time deviation nw,mc and TSi n The information is encapsulated in the Sync_5G message;

[0025] B3) NW-TT sends a Sync_5G message to DS-TT, and DS-TT parses the message after receiving it;

[0026] B4) DS-TT sends a Sync_2 message to the TSN device, recording the egress timestamp TSe. n The information parsed from the Sync_5G message is filled into the Follow_Up_2 message, where TSi n With the TSe that was just recorded n After processing the 5G network time synchronization value, the dwell time is obtained. DS-TT fills the dwell time into the Follow_Up_2 message and deletes TSi. n Then, the Follow_Up_2 message is sent to the TSN device to complete time synchronization.

[0027] Furthermore, during the first synchronization cycle of the 5G network time synchronization, the NW-TT sends its current time to the DS-TT via one-way message propagation. The DS-TT receives this message at a specific time, and the reception time is as follows:

[0028] TSe1=(1+r DS,NW )×TSi1+TimeDelay 5G ×(1+r DS,NW )

[0029] In the formula, TSi1 represents the entry timestamp recorded by NW-TT after receiving the synchronization message in the first synchronization cycle; TSe1 represents the exit timestamp created by DS-TT in the first synchronization cycle before forwarding the message to the TSN device; r DS,NW Indicates the initial clock frequency offset of DS-TT relative to NW-TT; TimeDelay 5G Indicates the dwell time of a message in the 5G network;

[0030] Transform the equation to:

[0031] TSe1-TSi1=TSi1×r DS,NW +TimeDelay 5G ×(1+r DS,NW )

[0032] After n synchronizations, n sets of (TSi) will be obtained in DS-TT. n ,TSe n Import / export timestamps:

[0033] TSe n -TSi n =TSi n ×r DS,NW +TimeDelay 5G ×(1+r DS,NW )

[0034] The above equation can be expressed in the form y = ax + b, where a = r DS,NW b = TimeDelay 5G ×(1+r DS,NW ), y = TSe n -TSi n x = TSi n , where r DS,NW This indicates the initial clock frequency offset of DS-TT relative to NW-TT.

[0035] Furthermore, the initial clock frequency offset r is calculated using DS-TT. DS,NW With 5G network dwell time TimeDelay 5G Specifically, it includes the following steps:

[0036] C1) DS-TT will form a set T from the n timestamps received for the first time, treat each timestamp as a sample point and obtain a discrete graph of the sample points, and set the number of iterations k;

[0037] C2) DS-TT performs noise reduction processing on the sample points in the current set T: A tolerance value ε is set, and if two adjacent sets of sample points (TSi) are denoised... n ,TSe i ) and (TSi n+1 ,TSe n+1 If the difference between the two groups is greater than ε, then both groups of samples are discarded and the rest are retained.

[0038] C3) DS-TT uses the least squares method to fit the sample points in the set according to the constraints to solve for a and b. The constraints are: the sum of the distances from all sample points to the target line satisfies:

[0039]

[0040] C4) After obtaining the target line y = ax + b using DS-TT, the distance from each sample point to the target line is calculated, resulting in a distance sequence D. Then, the "absolute median deviation" is calculated on the distance sequence D for noise reduction. The specific method is as follows:

[0041] a. Calculate the median of the distance sequence D, denoted as med(x);

[0042] b. Calculate the absolute difference between each data point in the distance sequence D and the median med(x);

[0043] c. Calculate the median of the above absolute differences, which is the desired MAD(x);

[0044] d. Identify outliers: If a data point deviates from the median by more than m times MAD(x), then the data point is an outlier, is discarded, and the set T is updated;

[0045] C5) DS-TT receives several new sets of timestamps and puts them into set T. The iteration number is k = k + 1. DS-TT executes the above steps C1 to C4.

[0046] If the change in 'a' over two consecutive iterations is less than or equal to a preset threshold σ, then 'a' is considered to have converged, and the desired r is obtained. DS,NW For a, TimeDelay 5G for

[0047] If the change in 'a' in two consecutive iterations is greater than the preset threshold σ, then the next round of calculation will continue.

[0048] When k exceeds the preset k max If a has not converged by the number of iterations, r DS,NW Set 'a' to be obtained in the current round, and TimeDelay 5G Calculated for the current round

[0049] C6), DS-TT calculation completed. DS,NW With TimeDelay 5G Then, the dwell time is filled into the Follow_Up message, and the Follow_Up message is sent to the TSN device to perform TSN2 network time synchronization.

[0050] Furthermore, for TSN2 network time synchronization, DS-TT is used as the master clock and TSN devices as slave clocks. Synchronization between the master and slave clocks is achieved by calculating synchronization-related parameters through the gPTP peer delay response measurement mechanism; specifically, the following steps are included:

[0051] D1) The DS-TT acts as the master clock to send Pdelay_Req_DS messages to the slave clock TSN device and records the sending time.

[0052] D2) After receiving the Pdelay_Req_DS message from DS-TT, the TSN device records the message reception time.

[0053] D3) The TSN device sends a Pdelay_Resp_D message to the DS-TT, recording the transmission time. And carry the timestamp in the Pdelay_Resp_D message

[0054] D4) The TSN device sends a Pdelay_Resp_Follow_Up_D message to the DS-TT, carrying a timestamp in the message.

[0055] D5) After DS-TT receives the Pdelay_Resp_D message, record the message reception time.

[0056] D6) After DS-TT receives the Pdelay_Resp_Follow_Up_D message, it parses the Pdelay_Resp_D message and the Pdelay_Resp_Follow_Up_D message to obtain the timestamp. and At this point, DS-TT obtains Four timestamps are used to calculate the link delay d between the TSN device and DS-TT according to the following formula. ds,d offset with time deviation ds,d :

[0057]

[0058] Based on the link delay between the TSN device and DS-TT ds,d offset with time deviation ds,d Complete time synchronization on the TSN2 network.

[0059] Furthermore, the execution steps of the 5G and TSN converged network time synchronization method based on the timestamp compensation algorithm of the present invention are as follows:

[0060] S1. Using the TSN switch as the master clock, the TSN switch sends a synchronization message to the NW-TT.

[0061] After receiving the synchronization message, S2 and NW-TT record the entry timestamp TSi. nAnd calculate the link delay and clock phase offset with the TSN switch;

[0062] S3 and NW-TT synchronize time with the TSN switch based on the calculation results and fill the entry timestamp TSi into the gPTP message and send it to DS-TT;

[0063] Before forwarding messages to TSN devices, S4 and DS-TT create an exit timestamp TSe. n ;

[0064] S5 and DS-TT use a timestamp compensation algorithm to calculate the dwell time of gPTP messages in the 5G system;

[0065] S6 and DS-TT convert the dwell time in the 5G system into the time of the TSN network and send gPTP messages to the TSN device;

[0066] After receiving the gPTP message, the S7 and TSN devices calculate the link delay and clock phase offset with DS-TT.

[0067] S8 and TSN devices synchronize time with DS-TT to complete cross-network time synchronization.

[0068] The beneficial effects of this invention are as follows:

[0069] This invention proposes a timestamp compensation algorithm for 5G and TSN converged networks. It uses DS-TT / NW-TT to transmit time synchronization information between the 5G network and TSN, achieving cross-network time synchronization. Based on the timestamp compensation algorithm, this invention records the timestamp of each entry and exit from the 5G system. By analyzing the distribution and statistical characteristics of the timestamps, the data is processed to calculate the frequency offset and dwell time of NW-TT and DS-TT within the 5G system. Time compensation is then performed on DS-TT, effectively improving the accuracy of 5G-TSN cross-network time synchronization.

[0070] Other advantages, objectives, and features of the invention will be set forth in part in the description which follows, and in part will be apparent to those skilled in the art from the following examination, or may be learned from practice of the invention. The objectives and other advantages of the invention can be realized and obtained through the following description. Attached Figure Description

[0071] To make the objectives, technical solutions, and advantages of the present invention clearer, the preferred embodiments of the present invention will be described in detail below with reference to the accompanying drawings, wherein:

[0072] Figure 1 This is a schematic diagram of a 5G-TSN converged network architecture;

[0073] Figure 2 This is a schematic diagram of the converged network time synchronization method of the present invention;

[0074] Figure 3 This is a schematic diagram of the time synchronization process in the TSN1 network.

[0075] Figure 4 A schematic diagram of time synchronization message passing in a converged network;

[0076] Figure 5 A schematic diagram of the one-way message propagation mechanism in a converged network of 5G;

[0077] Figure 6 A schematic diagram illustrating the process of calculating the initial clock frequency offset and 5G dwell time for DS-TT;

[0078] Figure 7 A scatter plot with noisy timestamps;

[0079] Figure 8 This is a scatter plot of timestamps after noise reduction.

[0080] Figure 9 This is a schematic diagram of the time synchronization process in the TSN2 network.

[0081] Figure 10 This is a noisy timestamp scatter plot of one embodiment;

[0082] Figure 11 A timestamp (TSi) in one embodiment n ,TSe i ) and (TSi n+1 ,TSe n+1 A diagram illustrating the difference between ( ).

[0083] Figure 12 This is a denoised timestamp scatter plot of one embodiment. Detailed Implementation

[0084] The following specific examples illustrate the implementation of the present invention. Those skilled in the art can easily understand other advantages and effects of the present invention from the content disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and various details in this specification can be modified or changed based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the illustrations provided in the following embodiments are only schematic representations of the basic concept of the present invention. Unless otherwise specified, the following embodiments and features can be combined with each other.

[0085] The accompanying drawings are for illustrative purposes only and are schematic diagrams, not actual pictures. They should not be construed as limiting the invention. To better illustrate the embodiments of the invention, some parts in the drawings may be omitted, enlarged, or reduced, and do not represent the actual product dimensions. It is understandable to those skilled in the art that some well-known structures and their descriptions may be omitted in the drawings.

[0086] In the accompanying drawings of the embodiments of the present invention, the same or similar reference numerals correspond to the same or similar components. In the description of the present invention, it should be understood that if terms such as "upper," "lower," "left," "right," "front," and "rear" indicate the orientation or positional relationship based on the orientation or positional relationship shown in the drawings, they are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, the terms used to describe positional relationships in the drawings are only for illustrative purposes and should not be construed as limiting the present invention. For those skilled in the art, the specific meaning of the above terms can be understood according to the specific circumstances.

[0087] Please see Figures 1-12 This is a time synchronization method for 5G and TSN converged networks based on a timestamp compensation algorithm.

[0088] Example 1

[0089] This embodiment provides a specific implementation of the 5G and TSN converged network time synchronization method based on the timestamp compensation algorithm of the present invention, which includes: introducing the 5G network as a TSN virtual bridge into the TSN network to form a cross-network network, the cross-network network including the TSN1 network, the 5G network, and the TSN2 network, the cross-network network using the TSN switch in the TSN1 network as the master clock and the TSN device in the TSN2 network as the slave clock, and the master and slave clocks transmitting time synchronization information step by step across the NW-TT module, the 5G network clock domain, and the DS-TT module to achieve synchronization; wherein, the time synchronization of the cross-network network includes TSN 1. Network time synchronization, 5G network time synchronization, and TSN2 network time synchronization; For TSN1 network time synchronization, the TSN switch is the master clock and NW-TT is the slave clock. The master and slave clocks calculate synchronization-related parameters and achieve synchronization through the gPTP peer-to-peer delay response measurement mechanism; For 5G network time synchronization, synchronization is achieved by calculating the dwell time of the time synchronization message in the 5G network; For TSN2 network time synchronization, DS-TT is the master clock and TSN devices are the slave clocks. The master and slave clocks calculate synchronization-related parameters and achieve synchronization through the gPTP peer-to-peer delay response measurement mechanism.

[0090] To achieve the convergence of 5G and TSN, 3GPP introduced Time-Sensitive Communication (TSN) functionality in the R16 standard, which was frozen in July 2020. The 5G-TSN cross-network architecture proposed in this standard is as follows: Figure 1 As shown, this architecture consists of a software-defined network central controller (SDB), a centralized network configurator (CNC), TSN1, DS-TT, 5GS, NW-TT, and TSN2. The 5G network comprises the UE, RAN, and 5G core network, enabling data transmission. The TSN switch handles time synchronization and data transmission. The DS-TT and NW-TT modules are integrated into the UE and UPF to connect the 5G and TSN networks. These two TSN converters act as bridges between the two networks. The 5G-TSN converged network adopts a fully centralized model network architecture defined by the IEEE 802.1Qcc protocol. To this end, the 5G control plane introduces TSN application function network elements to interact with the centralized network configurator, enabling the CNC to configure and manage the 5G TSN logical bridge.

[0091] This embodiment only considers the 5G data plane, as synchronization messages are transmitted only on the data plane. The 5G network is introduced into the TSN network as a Virtual TSN Bridge (VTB). It includes only one UPF associated with the NW-TT, but may include multiple UEs. Radio connectivity is provided to the terminal by the gNB. The VTB is a standards-compliant TSN bridge following a black-box paradigm. Therefore, the DS-TT and NW-TT at the 5G network boundary must provide inbound and outbound operations for the Virtual TSN Bridge and the TSN network.

[0092] This embodiment also provides the message format of the Precision Time Protocol (PTP) for network measurement and control systems, as shown in Table 1 below:

[0093] Table 1

[0094]

[0095] In Table 1, the transportSpecific field is 4 bits long and is related to the transmission; when its value is 0, it indicates that the PTP message is used by the 1588 protocol; when its value is 1, it indicates that the PTP message is used by the 802.1AS protocol.

[0096] In Table 1, the messageType field is 4 bits long and represents the message type. 1588v2 messages are divided into two categories: event messages and general messages. Event messages are time-sensitive messages, requiring precise timestamps when entering or leaving the device port, while general messages are non-time-sensitive messages, not generating timestamps when entering or leaving the device. Values ​​0-3 represent event messages, and 8-D represent general messages. Specifically, the correspondence between their values ​​and meanings is shown in Table 2 below:

[0097] Table 2

[0098]

[0099] In Table 1, the Reserved field is 4 bits long and is a reserved field. The versionPTP field is 4 bits long and indicates the version of the 1588 protocol. The messageLength field is 2 bytes long and represents the length of the PTP message, i.e., the total number of bytes in the PTP message. The count begins with the first byte of the header and ends with the last byte of any tail index, or the last byte of the message if there is no tail index member. The domainNumber field is 1 byte long and is the domain number, indicating the domain to which the clock that sent the message belongs. The Reserved2 field is 1 byte long and is a reserved field. The FlagField field is 2 bytes long and represents the flag field. The CorrectionField field is 8 bytes long and is a correction field, present in all messages, mainly used in Sync messages to compensate for transmission delays in the network and for E2E frequency synchronization. The Reserved3 field is 4 bytes long and is a reserved field. The sourcePortIdentity field is 10 bytes long and is the source port identifier, the ID and port number of the clock that sent the message. The sequenceID field is 2 bytes long and is a sequence number ID, representing the sequence number of the message and the corresponding relationship with the associated messages.

[0100] The length of the controlField field is 1 byte. It is a control field, and its length is determined by the message type.

[0101] 0x00: Sync

[0102] 0x01: Delay_Req

[0103] 0x02: Follow_Up

[0104] 0x03: Delay_Resp

[0105] 0x04: Management

[0106] 0x05: All others

[0107] 0x06-0xFF: reserved

[0108] The logMessageInterval field has a length of 1 byte and represents the message entry period, the time interval for sending PTP messages, which is determined by the message type.

[0109] To ensure real-time communication and control, nodes in a 5G-TSN network need to be synchronized with their corresponding master clocks. For example, nodes such as UE / DS-TT, gNB, and UPF / NW-TT need to be synchronized with the 5G master clock, while TSN devices, TSN switches, TSN terminals, DS-TT, and NW-TT nodes need to be synchronized with the TSN master clock. Therefore, DS-TT and NW-TT nodes need to be aware of both time domains simultaneously to ensure the normal operation of their real-time communication and control functions in the 5G-TSN network. In contrast, gNBs do not need to synchronize with the TSN time.

[0110] In this embodiment, the entire cross-network TSN switch is the master clock, and the TSN device is the slave clock. Synchronization is achieved by transmitting time synchronization information between the master and slave clocks through the NW-TT module, the 5G network clock domain, and the DS-TT module.

[0111] This embodiment proposes a timestamp compensation algorithm for 5G and TSN converged networks. It uses DS-TT / NW-TT to transmit time synchronization information between the 5G network and TSN, thereby achieving cross-network time synchronization.

[0112] Based on the above timestamp compensation algorithm, this invention records the timestamp of each entry and exit from the 5G network. By analyzing the distribution and statistical characteristics of the timestamps, the timestamps are processed to calculate the frequency offset and dwell time of NW-TT and DS-TT in the 5G network, and time compensation is performed in DS-TT.

[0113] like Figure 2 As shown, this scheme divides the entire cross-network into three parts: TSN1 network, 5G network, and TSN2 network, with the 5G network being regarded as a TSN virtual bridge. The entire cross-network uses the left port of the TSN switch in the TSN1 network (hereinafter referred to as the TSN switch) as the master clock and the TSN device in the TSN2 network (hereinafter referred to as the TSN device) as the slave clock. Synchronization between the master and slave clocks is achieved by transmitting time synchronization information step by step across the NW-TT module, the 5G network clock domain, and the DS-TT module.

[0114] This embodiment divides cross-network time synchronization into three parts: TSN1 network time synchronization, 5G network time synchronization, and TSN2 network time synchronization.

[0115] At the start of the first time synchronization cycle of the 5G-TSN converged network, according to Figure 3 The process involves sending a time synchronization message, the TSN switch sending a Sync message, the NW-TT initiating TSN1 network time synchronization upon receiving the Follow_Up message, and the TSN device initiating TSN2 network time synchronization upon receiving the Follow_Up message. After TSN1 network synchronization is complete, the process continues according to... Figure 1 The process sends time synchronization messages, ultimately completing the first cross-network time synchronization cycle.

[0116] After a fixed period of time, the TSN switch initiates TSN1 network time synchronization, and the TSN devices initiate TSN2 network time synchronization. Once TSN1 network synchronization is complete, the process continues according to... Figure 1 The process sends time synchronization messages, ultimately completing the cross-network time synchronization for the next time synchronization cycle.

[0117] The specific synchronization methods for each part are as follows:

[0118] For TSN1 network time synchronization, such as Figure 3 As shown, the TSN switch is the master clock, and the NW-TT is the slave clock. Synchronization between the master and slave clocks is achieved by calculating synchronization-related parameters through the gPTP peer-to-peer delay response measurement mechanism. The slave clock sends an end-to-end delay request message, and the master clock receives and responds to the delay request. Synchronization between the master and slave clocks is achieved by measuring the clock offset. The specific synchronization process is as follows:

[0119] A1) First, the TSN switch will send a Sync_MC synchronization message to the NW-TT and record the sending time.

[0120] A2) Immediately afterwards, the TSN switch sends a Follow_Up_MC message, which includes a timestamp of the sending process.

[0121] A3) After receiving the Sync_MC synchronization message, NW-TT records the arrival time. And send a Delay_Req_NW message to the TSN switch and record the sending time.

[0122] A4) TSN switches in Upon receiving a Delay_Req_NW message, the system will immediately send a Delay_Resp_MC message to NW-TT, carrying a timestamp within it.

[0123] A5) When the Follow_Up_MC and Delay_Resp_MC messages arrive at NW-TT, NW-TT will parse out the timestamps from them respectively. and timestamp

[0124] A6) At this point, NW-TT can obtain four timestamps. and And begin calculating the master-slave clock link delay d. nw,mc offset with time deviation nw,mc The calculation formula is as follows:

[0125]

[0126] For 5G network time synchronization, such as Figure 4 As shown, the 5G network joins the TSN network as a TSN virtual bridge, has its own master clock, and the entire 5G network is synchronized with the 5G master clock. Since time synchronization information is propagated unidirectionally in the 5G network, and only the residence time of the time synchronization message in the 5G network needs to be calculated during the entire cross-network synchronization process, this part only focuses on the 5G system's ingress NW-TT and egress DS-TT, and designs a synchronization method using a unidirectional message propagation mechanism combined with statistical methods. Specifically, the following steps are included:

[0127] B1) First, the TSN switch sends a Sync_1 message to the NW-TT. The time of sending the Sync_1 message is recorded as follows:

[0128] B2) Then send the Follow_Up_1 message. At this time, NW-TT receives the Sync_1 message and records the entry timestamp TSi. The link delay d between the TSN switch and NW-TT will be calculated in the TSN1 network. nw,mc offset with time deviation nw,mc Related parameters and TSi information are encapsulated into the Sync_5G message;

[0129] B3), then, NW-TT sends a Sync_5G message to DS-TT, and DS-TT parses the message after receiving it;

[0130] (B4) Finally, DS-TT sends a Sync_2 message to the TSN device, records the egress timestamp TSe, and then fills the Follow_Up_2 message with the information parsed from the Sync_5G message. The TSe and the recorded TSe are processed by the method proposed by the 5G network time synchronization value to obtain the dwell time. DS-TT fills the dwell time into the Follow_Up_2 message and deletes TSe. Then, the Follow_Up_2 message is sent to the TSN device to complete the time synchronization.

[0131] like Figure 5 The diagram illustrates the one-way message propagation mechanism of a 5G network. During the first synchronization cycle, the NW-TT sends its current time to the DS-TT via one-way message propagation. The DS-TT receives this message at time 10:00, and the reception time is shown in the formula:

[0132] TSe1=(1+r DS,NW )×TSi1+TimeDelay 5G ×(1+r DS,NW )

[0133] In the formula, TSi1 represents the entry timestamp recorded by NW-TT after receiving the synchronization message in the first synchronization cycle; TSe1 represents the exit timestamp created by DS-TT in the first synchronization cycle before forwarding the message to the TSN device; r DS,NW Indicates the initial clock frequency offset of DS-TT relative to NW-TT; TimeDelay 5G This indicates the dwell time of a message in the 5G network.

[0134] Transform the equation to:

[0135] TSe1-TSi1=TSi1×r DS,NW +TimeDelay 5G ×(1+r DS,NW )

[0136] After n synchronizations, n sets of (TSi) will be obtained in DS-TT. n ,TSe n Import / export timestamps:

[0137] TSe n -TSi n =TSi n ×r DS,NW +TimeDelay 5G ×(1+r DS,NW )

[0138] Among them, r can be DS,NW Treated as a, TimeDelay5G ×(1+r DS,NW ) is considered as b, (TSe n -TSi n ) is considered as y, TSi n If we consider x as x, then the equation can be viewed as y = ax + b, r DS,NW This indicates the initial clock frequency offset of DS-TT relative to NW-TT.

[0139] Next, r is calculated by DS-TT. DS,NW With TimeDelay 5G The specific process is as follows Figure 6 As shown, it includes the following steps:

[0140] C1) DS-TT groups the first n timestamps received into a set T, and treats each timestamp as a sample point, which can be plotted as follows: Figure 7 The scatter plot is shown. The iteration count k is set; in this embodiment, k = 0.

[0141] C2) DS-TT performs noise reduction on the sample points in the current set T, that is, sets a tolerance value ε, if two adjacent sets of sample points (TSi) n ,TSe i ) and (TSi n+1 ,TSe n+1 If the difference between the two sets of data is greater than ε, discard both sets. At this point, DS-TT updates set T with the remaining sample points after denoising, such as... Figure 8 As shown;

[0142] C3) DS-TT uses the least squares method to fit the sample points in the set according to the constraints to solve for a and b. The constraints are: the sum of the distances from all sample points to the target line should be as small as possible, i.e., satisfying:

[0143]

[0144] C4) After obtaining the target line y = ax + b from the aforementioned calculation using DS-TT, the distance from each sample point to the target line is calculated, resulting in a distance sequence D. Then, the "absolute median deviation" is calculated on the distance sequence D for noise reduction. The specific method is as follows:

[0145] a. Calculate the median of the distance sequence D, denoted as med(x);

[0146] b. Calculate the absolute difference between each data point in the distance sequence D and the median med(x);

[0147] c. Calculate the median of the above absolute differences, which is the desired MAD(x);

[0148] d. Identify outliers: If a data point deviates from the median by more than m times MAD(x), it can be considered an outlier. Remove it and update the set T.

[0149] C5) DS-TT receives 100 new timestamps and places them into set T. The iteration count is k = k + 1. DS-TT executes steps C2 to C4 above. If the change in 'a' between two consecutive iterations is less than or equal to the preset threshold σ, then 'a' is considered to have converged, and the desired r is obtained. DS,NW For a, TimeDelay 5G for If the change in 'a' between two consecutive iterations exceeds a preset threshold σ, then the next round of calculation continues. When k exceeds a preset threshold... max If a has not yet converged by the number of iterations, r DS,NW Set 'a' to be obtained in the current round, and TimeDelay 5G Calculated for the current round

[0150] C6), DS-TT calculation completed. DS,NW With TimeDelay 5G Then, the dwell time is filled into the Follow_Up message, and the Follow_Up message is sent to the TSN device to perform TSN network 2 time synchronization.

[0151] For TSN2 network time synchronization, such as Figure 9 As shown, DS-TT is the master clock, and the TSN device is the slave clock. Synchronization between the master and slave clocks is achieved by calculating synchronization-related parameters through the gPTP peer delay response measurement mechanism. Specifically, the steps include:

[0152] D1) First, DS-TT, acting as the master clock, sends a Pdelay_Req_DS message to the slave clock TSN device and records the sending time.

[0153] D2) After receiving the Pdelay_Req_DS message from DS-TT, the TSN device records the message reception time.

[0154] D3) Subsequently, the TSN device sends a Pdelay_Resp_D message to DS-TT, recording the transmission time. And carry the timestamp in the Pdelay_Resp_D message

[0155] D4) Immediately afterwards, the TSN device sends a Pdelay_Resp_Follow_Up_D message to the DS-TT, carrying a timestamp in the message.

[0156] D5) After DS-TT receives the Pdelay_Resp_D message, record the message reception time.

[0157] D6) After DS-TT receives the Pdelay_Resp_Follow_Up_D message, the timestamp can be obtained by parsing the Pdelay_Resp_D message and the Pdelay_Resp_Follow_Up_D message. and At this point, DS-TT obtained Four timestamps. At this point, the link delay d between the TSN device and DS-TT can be obtained. ds,d offset with time deviation ds,d As shown in the following formula:

[0158]

[0159] The following table 3 defines the terms used in the method of this invention:

[0160] Table 3

[0161]

[0162]

[0163] Example 2

[0164] This embodiment provides a time synchronization example based on embodiment 1.

[0165] The first step is that the TSN switch (master clock) sends the Sync_MC synchronization message for the first time, and the NW-TT receives the Sync_1 synchronization message at 40 o'clock. Immediately afterwards, NW-TT received a follow_up_MC message from the TSN switch, storing the time 37 when the TSN switch (master clock) first sent the Sync_MC synchronization message, i.e. NW-TT at 42 The TSN switch continuously sends Delay_Req_NW messages to the TSN switch. The TSN switch receives the Delay_Req_NW message at 43, which means... Then will carry The Delay_Resp_MC timestamp is sent to NW-TT. According to the link delay formula, it can be substituted into... Conclusion:

[0166]

[0167] The second step is that DS-TT sends the Pdelay_Req_DS synchronization message for the first time at 44:00, the time of which is recorded as follows: The TSN device received the Pdelay_Req_DS synchronization message at 47:00, that is... At this time, DS-TT receives the Pdelay_Resp_D message sent by the TSN device, and stores the time 47 when the TSN device first sent the Pdelay_Resp_D synchronization message, i.e. TSN devices are at 48 The Pdelay_Resp_Follow_up_D message is sent to DS-TT at all times. DS-TT receives the Pdelay_Resp_Follow_up_D message at time 47. According to the link delay formula, we can substitute... Conclusion:

[0168]

[0169] The third step involves cross-network time synchronization immediately after both TSN network 1 and TSN network 2 complete a synchronization process. The 5G-TSN converged network performs its first time synchronization cycle: the TSN switch sends a sync_1 message to the NW-TT at time 60, and the NW-TT receives it at time 63 (which is also TSi). The NW-TT then sends a sync_5G message to the DS-TT, which receives it at time 89.4. The DS-TT parses the received sync_5G message, calculates the corresponding dwell time, and adjusts its own time. At time 76, the DS-TT sends the time synchronization information to the TSN device via a Follow_Up_2 message. The TSN device receives the sync_2 message at time 81.

[0170] After 500 synchronizations, 500 sets (TSi) will be obtained. n ,TSe n Import / export timestamps and 500 frequency offsets r i DS,NW Draw a scatter plot, such as Figure 10 As shown.

[0171] Denoising the original scatter plot:

[0172] 1) These 500 timestamps (TSi) n ,TSe i ) and (TSi n+1 ,TSe n+1 The difference is as follows: Figure 11As shown, the tolerance value ε is set to 3, and the timestamps (TSi) received by two adjacent groups are... n ,TSe i ) and (TSi n+1 ,TSe n+1 If the difference between the two sets of data is greater than ε, discard both sets of data.

[0173] 2) Using the rolling average value for (TSi) n ,TSe n -TSi n Further noise reduction processing was performed, setting the window size to 5, resulting in the following: Figure 11 The denoising results are shown.

[0174] The scatter plot was fitted using the least squares method to obtain the clock frequency offset of DS-TT relative to NW-TT. TimeDelay of gPTP messages in 5G networks 5G It is 8.04.

[0175] After 500 time synchronizations, the TSN switch's time is now 1060. This is due to the link delay d between the TSN switch and NW-TT. mc,nw 2 and time offset mc,nw The link delay d between the DS-TT and TSN devices is 1. ds,d 1 and time offset ds,d The value is 2, so the TSN device time is adjusted to 1080.47. At this time, the TSN switch time is 1080, which can be regarded as a successful time synchronization.

[0176] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention and are not intended to limit it. Although the present invention has been described in detail with reference to preferred embodiments, those skilled in the art should understand that modifications or equivalent substitutions can be made to the technical solutions of the present invention without departing from the spirit and scope of the present invention, and all such modifications or substitutions should be covered within the scope of the claims of the present invention.

Claims

1. A time synchronization method for a 5G and TSN converged network based on a timestamp compensation algorithm, characterized in that: It includes: The 5G network is introduced into the TSN network as a TSN virtual bridge to form a cross-network network. The cross-network network includes the TSN1 network, the 5G network, and the TSN2 network. The cross-network network uses the TSN switch in the TSN1 network as the master clock and the TSN device in the TSN2 network as the slave clock. The master and slave clocks transmit time synchronization information step by step across the NW-TT module, the 5G network clock domain, and the DS-TT module to achieve synchronization. Cross-network time synchronization includes TSN1 network time synchronization, 5G network time synchronization and TSN2 network time synchronization. For TSN1 network time synchronization, the TSN switch is the master clock and the NW-TT is the slave clock. The master and slave clocks calculate synchronization-related parameters and achieve synchronization through the gPTP peer delay response measurement mechanism. For 5G network time synchronization, synchronization is achieved by calculating the dwell time of the time synchronization message in the 5G network. For TSN2 network time synchronization, DS-TT is the master clock and TSN devices are the slave clocks. The master and slave clocks calculate synchronization-related parameters and achieve synchronization through the gPTP peer delay response measurement mechanism. During the first synchronization cycle of 5G network time synchronization, NW-TT sends its current time to DS-TT via one-way message propagation. DS-TT receives this message at time 10:00, and the reception time is as follows: In the formula, This represents the entry timestamp recorded after NW-TT receives the synchronization message during the first synchronization cycle; This indicates the exit timestamp created by the DS-TT during the first synchronization cycle before forwarding the message to the TSN device; This indicates the initial clock frequency offset of DS-TT relative to NW-TT; Indicates the dwell time of a message in the 5G network; Transform the equation to: Then passed n After the first synchronization, DS-TT will receive n Group( , Import / export timestamps: The above formula can be expressed as y=ax+b In form, , , , ,in This indicates the initial clock frequency offset of DS-TT relative to NW-TT; Calculate the initial clock frequency offset using DS-TT 5G network dwell time Specifically, it includes the following steps: C1), DS-TT will receive it for the first time n A set of timestamps T Each timestamp is treated as a sample point, resulting in a discrete graph of these sample points. The number of iterations is set. k ; C2) DS-TT performs noise reduction processing on the sample points in the current set T: A tolerance value ε is set, and if two adjacent sets of sample points ( , )and( , If the difference between the two groups is greater than ε, then both groups of samples are discarded and the rest are retained. C3) DS-TT uses the least squares method to fit the sample points in the set according to the constraints to solve the problem. and The constraint is that the sum of the distances from all sample points to the target line satisfies: C4), DS-TT obtains the target line y=ax+b Next, the distance from each sample point to the target line is calculated, resulting in a distance sequence D. Then, the "absolute median deviation" is calculated on the distance sequence D for noise reduction. The specific method is as follows: a. Calculate the median of the distance sequence D, denoted as med(x); b. Calculate the absolute difference between each data point in the distance sequence D and the median med(x); c. Calculate the median of the above absolute differences, which is the desired MAD(x); d. Identify outliers: If a data point deviates from the median by more than m times MAD(x), then the data point is an outlier, is discarded, and the set T is updated; C5) DS-TT receives several new sets of timestamps and puts them into set T. The number of iterations is k = k+1. DS-TT executes the above steps C1 to C4. If two consecutive iterations The change is less than or equal to the preset threshold. Then it is believed It has converged, and what is sought... for , for ; If two consecutive iterations The change is greater than the preset threshold. If so, proceed to the next round of solution calculation; When k exceeds the preset k max When considering the number of iterations, if It hasn't subsided yet. Set as the result obtained in the current round , Calculated for the current round ; C6), DS-TT calculation completed. and Then, the dwell time is filled into the Follow_Up message, and the Follow_Up message is sent to the TSN device to perform TSN2 network time synchronization.

2. The 5G and TSN converged network time synchronization method based on timestamp compensation algorithm according to claim 1, characterized in that: For TSN1 network time synchronization, the master clock receives and responds to end-to-end delay request messages from the clock transmitter and clock receiver, and synchronization between the master and slave clocks is achieved by measuring the clock offset. The specific synchronization process is as follows: A1) The TSN switch will send a Sync_MC synchronization message to the NW-TT and record the sending time. ; A2) The TSN switch sends a Follow_Up_MC message, which includes a timestamp of the sending process. ; A3) After receiving the Sync_MC synchronization message, NW-TT records the arrival time. It also sends a Delay_Req_NW message to the TSN switch and records the sending time. ; A4), TSN switches in Upon receiving a Delay_Req_NW message, immediately send a Delay_Resp_MC message to NW-TT, carrying a timestamp within it. ; A5) When the Follow_Up_MC and Delay_Resp_MC messages arrive at NW-TT, NW-TT will parse out the timestamps from them respectively. and timestamp ; A6) NW-TT obtained four timestamps , , and And begin calculating the master-slave clock link delay. With time deviation The calculation formula is as follows: Based on the link delay between the TSN switch and NW-TT With time deviation Complete time synchronization on the TSN1 network.

3. The 5G and TSN converged network time synchronization method based on timestamp compensation algorithm according to claim 2, characterized in that: For 5G network time synchronization, the 5G network joins the TSN network as a TSN virtual bridge. It has its own master clock, and the entire 5G network is synchronized with the 5G master clock. Focusing on the NW-TT (Near-Wide Telemetry) and DS-TT (Short-Distance Telemetry) of 5G systems, a synchronization method is designed using a one-way message propagation mechanism combined with statistical methods. The specific steps include: B1) The TSN switch first sends a Sync_1 message to the NW-TT. The time of sending the Sync_1 message is recorded as... ; B2) The TSN switch then sends a Follow_Up_1 message. At this time, the NW-TT receives the Sync_1 message and records the entry timestamp. And the time when NW-TT receives the Sync message for the i-th time. The link delay between the TSN switch and NW-TT will be calculated in the TSN1 network. With time deviation as well as The information is encapsulated in the Sync_5G message; B3) NW-TT sends a Sync_5G message to DS-TT, and DS-TT parses the message after receiving it; B4) DS-TT sends a Sync_2 message to the TSN device and records the exit timestamp. The information parsed from the Sync_5G message is filled into the Follow_Up_2 message, where With the one just recorded After processing the 5G network time synchronization value, the dwell time is obtained. DS-TT fills the dwell time into the Follow_Up_2 message and then deletes it. Then, the Follow_Up_2 message is sent to the TSN device to complete time synchronization.

4. The 5G and TSN converged network time synchronization method based on timestamp compensation algorithm according to claim 3, characterized in that: For TSN2 network time synchronization, DS-TT is the master clock and TSN devices are the slave clocks. The master and slave clocks calculate synchronization-related parameters and achieve synchronization through the gPTP peer delay response measurement mechanism. Specifically, the following steps are included: D1) The DS-TT acts as the master clock to send Pdelay_Req_DS messages to the slave clock TSN device and records the sending time. ; D2) After receiving the Pdelay_Req_DS message from DS-TT, the TSN device records the message reception time. ; D3) The TSN device sends a Pdelay_Resp_D message to the DS-TT, recording the transmission time. And carry the timestamp in the Pdelay_Resp_D message. ; D4) The TSN device sends a Pdelay_Resp_Follow_Up_D message to DS-TT, carrying a timestamp in the message. ; D5) After DS-TT receives the Pdelay_Resp_D message, record the message reception time. ; D6) After DS-TT receives the Pdelay_Resp_Follow_Up_D message, it parses the Pdelay_Resp_D message and the Pdelay_Resp_Follow_Up_D message to obtain the timestamp. and At this point, DS-TT obtains , , , Four timestamps are used to calculate the link delay between the TSN device and DS-TT using the following formula. With time deviation : Based on the link delay between the TSN device and DS-TT With time deviation Complete time synchronization on the TSN2 network.

5. The 5G and TSN converged network time synchronization method based on timestamp compensation algorithm according to any one of claims 1-4, characterized in that: The execution steps of the method are as follows: S1. Using the TSN switch as the master clock, the TSN switch sends a synchronization message to the NW-TT. S2 and NW-TT record the entry timestamp after receiving the synchronization message. And calculate the link delay and clock phase offset with the TSN switch; S3 and NW-TT synchronize time with the TSN switch based on the calculation results and fill the entry timestamp TSi into the gPTP message and send it to DS-TT; Before forwarding messages to TSN devices, S4 and DS-TT create an exit timestamp. ; S5 and DS-TT use a timestamp compensation algorithm to calculate the dwell time of gPTP messages in the 5G system; S6 and DS-TT convert the dwell time in the 5G system into the time of the TSN network and send gPTP messages to the TSN device; After receiving the gPTP message, the S7 and TSN devices calculate the link delay and clock phase offset with DS-TT. S8 and TSN devices synchronize time with DS-TT to complete cross-network time synchronization.

Citation Information

Patent Citations

  • Cross-network time synchronization method for fusion of 5G and TSN

    CN115567139A

  • Method for high-precision time synchronization between device-side time-sensitive network (TSN) converter (DS-TT) and TSN master clock (GM)

    CN117223234A