5G and TSN fusion network time synchronization method based on timestamp compensation algorithm

By introducing a timestamp compensation algorithm in the 5G and TSN converged network, the time stamp information is used to achieve time synchronization between the 5G network and the TSN network, the problem of time synchronization uncertainty in the 5G network is solved, the time synchronization accuracy is significantly improved, and the strict closed-loop motion control requirements are met.

CN120018264AActive Publication Date: 2025-05-16CHONGQING UNIV OF POSTS & TELECOMM
View PDF 6 Cites 0 Cited by

Patent Information

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

AI Technical Summary

Technical Problem

The network-side TSN converter introduced by 5G network as a TSN logic bridge and the device-side TSN converter have increased the uncertainty of time synchronization, especially when the frequency offset between DS-TT and NW-TT cannot be accurately calculated, which affects the accuracy of TSN synchronization, especially in closed-loop motion control, time accuracy requirements are strictly required.

Method used

A time synchronization method for 5G and TSN converged network based on timestamp compensation algorithm is proposed. By introducing the 5G network into the TSN network as a TSN virtual bridge, the timestamp information between the TSN switch, NW-TT and DS-TT is used to calculate the synchronization-related parameters through the peer-to-peer delay response measurement mechanism of gPTP, and cross-network time synchronization is achieved.

Benefits of technology

It effectively improves the cross-network time synchronization accuracy of 5G-TSN, can meet the strict time accuracy requirements in closed-loop motion control, and ensures that all nodes in the network share a unified time scale.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120018264A_ABST
    Figure CN120018264A_ABST
Patent Text Reader

Abstract

The invention relates to a 5G and TSN fusion network time synchronization method based on a timestamp compensation algorithm, and belongs to the field of cross-network time synchronization. The method comprises the steps that a 5G network serves as a TSN virtual network bridge and is introduced into a TSN network to form a cross-network network, the cross-network network comprises a TSN1 network, a 5G network and a TSN2 network, the cross-network network takes a TSN switch in the TSN1 network as a main clock and TSN equipment in the TSN2 network as a slave clock, and the main clock and the slave clock cross an NW-TT module, a 5G network clock domain and a DS-TT module to transmit time synchronization information step by step to achieve synchronization; wherein the time synchronization of the cross-network network comprises TSN2 network time synchronization, 5G network time synchronization and TSN2 network time synchronization. According to the invention, by calculating the frequency offset and the residence time of the NW-TT and the DS-TT in the 5G system, time compensation is carried out in the DS-TT, and the time synchronization precision can be improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of cross-network time synchronization and relates to a 5G and TSN fusion network time synchronization method based on a timestamp compensation algorithm. Background Art

[0002] The current trend in industry and academia is to work towards unifying communication technologies to develop a single technology that can serve a variety of real-time and non-real-time applications. The solution discussed by the industry and standardization organizations to address the new requirements is Time-Sensitive Networking (TSN). TSN is a set of IEEE 802.1 standards that uses Ethernet to implement real-time capabilities. Wireless technology is consistent with the goals of Industry 4.0 and will become an indispensable aspect of large-scale industrial communications in the future. The fifth generation of cellular network technology (5G) is a promising technology that can solve problems such as lack of mobility and scalability in wired networks. The 3rd Generation Partnership Project (3GPP) group is committed to making 5G real-time capabilities suitable for industrial applications. Among them, a key aspect is the seamless integration with TSN to establish a converged 5G-TSN network.

[0003] The 3GPP standard and IEEE standard have conducted in-depth analysis on the integration of 5G and TSN respectively, and it is feasible to integrate 5G with TSN as a TSN logic bridge. The TSN logic bridge achieves seamless integration of 5G and TSN by hiding the complexity of 5G using dedicated TSN converters (TTs). These converters provide TSN-compliant interfaces for TSN networks. A key feature is the support of IEEE802.1AS general precision time protocol (gPTP) synchronization. From an architectural perspective, the 5G-TSN integration as a TSN logic bridge is thoroughly defined.

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

[0005] However, the network-side TSN translator (NW-TT) and device-side TSN translator (DS-TT) introduced by the 5G network as a TSN logic bridge add more uncertainty to time synchronization. Unlike the wired connection of the TSN bridge, the DS-TT is wirelessly connected to the NW-TT, so for gPTP messages, the frequency offset between the DS-TT and NW-TT cannot be accurately calculated. Therefore, the industry is eager to understand the time synchronization accuracy within the 5G network to evaluate the overall time accuracy performance of the TSN end station. It is important to study whether the TSN synchronization requirements can be met, especially for the case of closed-loop motion control, whose time accuracy is strictly up to 1us. Summary of the invention

[0006] In view of this, the object of the present invention is to provide a 5G and TSN fusion network time synchronization method based on a timestamp compensation algorithm.

[0007] In order to achieve the above object, the present invention provides the following technical solutions:

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

[0009] Among them, 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 used as the master clock and NW-TT is used as the slave clock. The master and slave clocks use the gPTP peer delay response measurement mechanism to calculate synchronization-related parameters and achieve synchronization.

[0011] For 5G network time synchronization, synchronization is achieved by calculating the residence 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 slave clock sends an end-to-end delay request message, the master clock receives the end-to-end delay request message and responds to the delay request, and the master and slave clocks are synchronized 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 NW-TT and record the sending time.

[0015] A2) The TSN switch sends a Follow_Up_MC message and carries a sending timestamp.

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

[0017] A4) TSN switches After receiving the Delay_Req_NW message, it immediately sends a Delay_Resp_MC message to NW-TT, carrying a timestamp.

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

[0019] A6) NW-TT obtains four timestamps and And start calculating the master-slave clock link delay d nw,mc Offset nw,mc , and its calculation formula is:

[0020]

[0021] According to the link delay d between the TSN switch and NW-TT nw,mc Offset nw,mc Complete time synchronization of TSN1 network.

[0022] Furthermore, for 5G network time synchronization, the 5G network joins the TSN network as a TSN virtual bridge, which has its own master clock, and the entire 5G network is synchronized with the 5G master clock; focus on the inlet NW-TT and the outlet DS-TT of the 5G system, and use the one-way message propagation mechanism combined with statistical methods to design a synchronization method, which specifically includes the following steps:

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

[0024] B2) The TSN switch sends the Follow_Up_1 message again. At this time, 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 calculated in the TSN1 network nw,mc Offset nw,mc and TSi n The information is encapsulated into the Sync_5G message;

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

[0026] B4) DS-TT sends Sync_2 message to TSN equipment and records the egress timestamp TSe n , fill the parsed information in the Sync_5G message into the Follow_Up_2 message, where TSi n With the TSe just recorded n After the 5G network time synchronization value is processed, the dwell time is obtained. DS-TT fills the dwell time into the Follow_Up_2 message and deletes TSi n , and then sends the Follow_Up_2 message to the TSN device to complete time synchronization.

[0027] Furthermore, in the first synchronization cycle of 5G network time synchronization, NW-TT sends its current time to DS-TT through a one-way message transmission method. DS-TT receives the message at time, and the receiving time is as follows:

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

[0029] Where, TSi 1 Indicates the entry timestamp recorded after NW-TT receives the synchronization message in the first synchronization period; TSe 1 Indicates the egress timestamp created by the first synchronization period DS-TT before forwarding the message to the TSN device; DS,NW Indicates the initial clock frequency offset of DS-TT relative to NW-TT; TimeDelay 5G Indicates the residence time of the message in the 5G network;

[0030] Transform the equation into:

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

[0032] After n synchronizations, n groups (TSi n ,TSe n ) Import and export timestamp:

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

[0034] Here, the above formula is expressed as y=ax+b, a=r DS,NW , b=TimeDelay 5G ×(1+r DS,NW ), y = TSe n -TSi n , x = TSi n , where r DS,NW Indicates the initial clock frequency offset of DS-TT relative to NW-TT.

[0035] Furthermore, the initial clock frequency offset r is calculated by DS-TT DS,NW TimeDelay 5G , specifically including the following steps:

[0036] C1), DS-TT forms a set T of n sets of timestamps received for the first time, regards each timestamp as a sample point and obtains a discrete graph of the sample points, and sets the number of iterations k;

[0037] C2), DS-TT performs denoising on the sample points in the current set T: set the tolerance value ε, if two adjacent groups of sample points (TSi n ,TSe i ) and (TSi n+1 ,TSe n+1 ) is greater than ε, then the two 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 a and b, where the constraints are: the sum of the distances from all sample points to the target line satisfies:

[0039]

[0040] C4) After DS-TT obtains the target line y=ax+b, it calculates the distance from each sample point to the target line to obtain a distance sequence D. Then, it calculates the "absolute median deviation" of the distance sequence D for noise reduction. The specific method is:

[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 absolute differences, which is the desired MAD(x);

[0044] d. Identify outliers: If the deviation of a data point from the median exceeds m times MAD(x), the data point is an outlier, discard it and update the set T;

[0045] C5), DS-TT receives several new groups of timestamps and puts them into set T, the number of iterations k=k+1, and DS-TT executes the above steps C1 to C4;

[0046] If the change of a in two consecutive iterations is less than or equal to the preset threshold σ, it is considered that a has converged and the required r DS,NW is a,TimeDelay 5G for

[0047] If the change of a in two consecutive iterations is greater than the preset threshold σ, the next round of solution operation will be continued;

[0048] When k exceeds the preset k max When a does not converge, r DS,NW Set to a obtained in the current round, TimeDelay 5G The current round

[0049] C6) DS-TT calculation completed DS,NW with TimeDelay 5G After that, the residence time is filled into the Follow_Up message, and then the Follow_Up message is sent to the TSN device to synchronize the TSN2 network time.

[0050] Furthermore, for TSN2 network time synchronization, DS-TT is used as the master clock and TSN equipment is used as the slave clock. 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:

[0051] D1) DS-TT acts as the master clock to send Pdelay_Req_DS message to the slave clock TSN device and record the sending time

[0052] D2) After the TSN device receives the Pdelay_Req_DS message sent by DS-TT, it records the message receiving time

[0053] D3) TSN equipment sends Pdelay_Resp_D message to DS-TT and records the sending time And carry a timestamp in the Pdelay_Resp_D message

[0054] D4) TSN equipment sends Pdelay_Resp_Follow_Up_D message to DS-TT, and carries a timestamp in the message

[0055] D5) When DS-TT receives the Pdelay_Resp_D message, it records the message receiving 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 time, DS-TT obtains Four timestamps, the link delay between the TSN device and DS-TT is calculated according to the following formula ds,d Offset ds,d :

[0057]

[0058] According to the link delay between TSN equipment and DS-TT ds,d Offset ds,d Complete time synchronization of TSN2 network.

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

[0060] S1, using the TSN switch as the main clock, the TSN switch sends a synchronization message to NW-TT;

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

[0062] S3. NW-TT performs time synchronization with the TSN switch based on the calculated result and fills the ingress timestamp TSi into the gPTP message and sends it to DS-TT;

[0063] S4, DS-TT creates an egress timestamp TSe before forwarding the message to the TSN device. n ;

[0064] S5,DS-TT uses the timestamp compensation algorithm to calculate the residence time of gPTP messages in the 5G system;

[0065] S6, DS-TT converts the residence time in the 5G system into the time of the TSN network and sends the gPTP message to the TSN device;

[0066] S7. After receiving the gPTP message, the TSN device calculates the link delay and clock phase offset between it and DS-TT;

[0067] S8, TSN equipment and DS-TT perform time synchronization to complete cross-network time synchronization.

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

[0069] The present invention proposes a timestamp compensation algorithm for the 5G and TSN converged network, which transmits the time synchronization information between the 5G network and TSN through DS-TT / NW-TT to achieve cross-network time synchronization. Based on the timestamp compensation algorithm, the present invention records the timestamp of each entry and exit of the 5G system, analyzes the distribution and statistical characteristics of the timestamp, performs data processing on the timestamp, calculates the frequency offset and residence time of NW-TT and DS-TT in the 5G system, and performs time compensation in DS-TT, which can effectively improve the accuracy of 5G-TSN cross-network time synchronization.

[0070] Other advantages, objectives and features of the present invention will be described in the following description to some extent, and to some extent, will be obvious to those skilled in the art based on the following examination and study, or can be taught from the practice of the present invention. The objectives and other advantages of the present invention can be realized and obtained through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0071] In order to make the purpose, technical solutions and advantages of the present invention more clear, the present invention will be described in detail below in conjunction with the accompanying drawings, wherein:

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

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

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

[0075] Figure 4 Schematic diagram of time synchronization message transmission in a converged network;

[0076] Figure 5 Schematic diagram of the unidirectional message propagation mechanism of 5G network in the converged network;

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

[0078] Figure 7 A scatter plot of timestamps with noise;

[0079] Figure 8 This is the scatter plot of timestamps after denoising;

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

[0081] Fig.10 A timestamp scatter plot with noise in one embodiment;

[0082] Fig.11 is a timestamp (TSi) in an embodiment n ,TSe i ) and (TSi n+1 ,TSe n+1 )

[0083] Fig.12 A scatter plot of timestamps after denoising in an embodiment. DETAILED DESCRIPTION

[0084] The following describes the embodiments of the present invention by specific examples, and those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways 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 only illustrate the basic concept of the present invention in a schematic manner, and the following embodiments and features in the embodiments can be combined with each other without conflict.

[0085] Among them, the drawings are only used for illustrative explanations, and they only represent schematic diagrams rather than actual pictures, and should not be understood as limitations on the present invention. In order to better illustrate the embodiments of the present invention, some parts of the drawings may be omitted, enlarged or reduced, and do not represent the size of actual products. For those skilled in the art, it is understandable that some well-known structures and their descriptions in the drawings may be omitted.

[0086] The same or similar numbers in the drawings of the embodiments of the present invention correspond to the same or similar parts; in the description of the present invention, it should be understood that if the terms "upper", "lower", "left", "right", "front", "back" and the like indicate directions or positional relationships, they are based on the directions or positional relationships shown in the drawings, which are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific direction, be constructed and operated in a specific direction. Therefore, the terms describing the positional relationship in the drawings are only used for illustrative purposes and cannot be understood as limiting the present invention. For ordinary technicians in this field, the specific meanings of the above terms can be understood according to specific circumstances.

[0087] See also Figures 1 to 12 , which is a 5G and TSN fusion network time synchronization method based on timestamp compensation algorithm.

[0088] Example 1

[0089] This embodiment provides a specific implementation method of the 5G and TSN fusion 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 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, and the master and slave clocks pass 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 the TSN 1 network time synchronization, 5G network time synchronization and TSN2 network time synchronization; for TSN1 network time synchronization, the TSN switch is used as the master clock and NW-TT is used as the slave clock. The master and slave clocks use the gPTP peer delay response measurement mechanism to calculate the synchronization-related parameters and achieve synchronization; for 5G network time synchronization, the residence time of the time synchronization message in the 5G network is calculated to achieve synchronization; for TSN2 network time synchronization, DS-TT is used as the master clock and TSN equipment is used as the slave clock. The master and slave clocks use the gPTP peer delay response measurement mechanism to calculate the synchronization-related parameters and achieve synchronization.

[0090] In order to achieve the integration of 5G and TSN, 3GPP introduced the time-sensitive communication function in the R16 standard 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 centralized controller, a centralized network configurator, TSN1, DS-TT, 5GS, NW-TT and TSN2. Among them, the 5G network consists of UE, RAN and 5G core network to realize data transmission in the 5G network; the TSN switch is responsible for tasks such as time synchronization and data transmission; and the DS-TT module and NW-TT module are introduced into the UE and UPF to connect the 5G network and the TSN network. The two TSN converters act as a bridge connecting the two networks. The 5G-TSN converged network adopts the 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 configuration to enable CNC to configure and manage the 5G TSN logical bridge.

[0091] This embodiment only considers the 5G data plane, because synchronization messages are only transmitted on the data plane. The 5G network is introduced into the TSN network as a virtual TSN bridge (VTB). It only includes one UPF associated with the NW-TT, but may include multiple UEs. The wireless connection is provided to the terminal by the gNB. The VTB is a standard-compliant TSN bridge that follows the black box paradigm. Therefore, the DS-TT and NW-TT on the boundary of the 5G network must provide virtual TSN bridges and TSN network access operations.

[0092] This embodiment also provides a message format of a 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 length of the transportSpecific field is 4 bits, which is related to the transport; 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 length of the messageType field is 4 bits, which indicates the message type. 1588v2 messages are divided into two categories: event messages (EVENT Message) and general messages (General Message). Event messages are time-concept messages, which require accurate timestamps when entering and exiting the device port, while general messages are non-time-concept messages, and no timestamps are generated when entering and exiting the device. Type values ​​0 to 3 are event messages, and 8 to D are 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 length of the Reserved field is 4 bits, which is a reserved field. The length of the versionPTP field is 4 bits, indicating the version of the 1588 protocol. The length of the messageLength field is 2 bytes, which is the length of the PTP message, that is, the total number of bytes of the PTP message. The included bytes start with the first byte of the header and include and end with the last byte of any tail, or end with the last byte of the message when there is no tail member. The length of the domianNumber field is 1 byte, which is the domain number, indicating the domain to which the clock sending the message belongs. The length of the Reserved2 field is 1 byte, which is a reserved field. The length of the FlagField field is 2 bytes, which indicates the flag field. The length of the CorrectionField field is 8 bytes, which is a correction field, which exists in each message and is mainly used in the Sync message to compensate for the transmission delay in the network and the frequency synchronization of E2E. The length of the Reserved3 field is 4 bytes, which is a reserved field. The length of the sourcePortIdentity field is 10 bytes, which is the source port identifier, the ID and port number of the clock sending the message. The length of the sequenceID field is 2 bytes, which is the sequence number ID, indicating the sequence number of the message and the corresponding relationship between the associated messages.

[0100] The controlField field is 1 byte long and is the control field, which 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 length of the logMessageInterval field is 1 byte, indicating the message logging period, the time interval for sending PTP messages, which is determined by the message type.

[0109] In order to ensure the needs of real-time communication and real-time control, the nodes in the 5G-TSN network need to be synchronized with the corresponding master clock. For example, nodes such as UE / DS-TT, gNB and UPF / NW-TT need to be synchronized with the 5G master clock, while nodes such as TSN equipment, TSN switches, TSN terminals, DS-TT and NW-TT need to be synchronized with the TSN master clock. Therefore, DS-TT and NW-TT nodes need to sense the time of these two different time domains at the same time to ensure the normal operation of their real-time communication and real-time control functions in the 5G-TSN network. In contrast, gNB does not need to be synchronized with TSN time.

[0110] In this embodiment, the entire cross-network TSN switch is used as the master clock, and the TSN device is used as the slave clock. The master and slave clocks transmit time synchronization information step by step across the NW-TT module, 5G network clock domain and DS-TT module to achieve synchronization.

[0111] This embodiment proposes a timestamp compensation algorithm for the 5G and TSN converged network, which transmits the time synchronization information between the 5G network and TSN through DS-TT / NW-TT to achieve cross-network time synchronization.

[0112] Based on the above-mentioned timestamp compensation algorithm, the present invention records the timestamp of each entry and exit of the 5G network, analyzes the distribution and statistical characteristics of the timestamp, performs data processing on the timestamp, calculates the frequency offset and residence time of NW-TT and DS-TT in the 5G network, and performs time compensation in DS-TT.

[0113] like Figure 2 As shown in the figure, this solution divides the entire inter-network into three parts: TSN1 network, 5G network and TSN2 network, among which the 5G network is regarded as a TSN virtual bridge. The entire inter-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. The master and slave clocks pass time synchronization information step by step across the NW-TT module, 5G network clock domain and DS-TT module to achieve synchronization.

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

[0115] The first time synchronization cycle starts in the 5G-TSN converged network. Figure 3The TSN switch sends a Sync message, and NW-TT starts TSN1 network time synchronization after receiving the Follow_Up message. The TSN device starts TSN2 network time synchronization after receiving the Follow_Up message. After TSN1 network synchronization is completed, continue to follow Figure 1 The process sends the time synchronization message and finally completes the cross-network time synchronization of the first time synchronization cycle.

[0116] After a fixed time, the TSN switch actively starts TSN1 network time synchronization, and the TSN device actively starts TSN2 network time synchronization. After TSN1 network synchronization is completed, continue as Figure 1 The process sends the time synchronization message and finally completes the cross-network time synchronization of 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 in the figure, 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 delay response measurement mechanism. The slave clock sends an end-to-end delay request message, the master clock receives the end-to-end delay request message and responds to the delay request, and the master and slave clocks are synchronized by measuring the clock offset. The specific synchronization process is as follows:

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

[0120] A2) Then the TSN switch sends a Follow_Up_MC message, which carries the sending timestamp.

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

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

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

[0124] A6) At this time, NW-TT can get four timestamps and And start calculating the master-slave clock link delay d nw,mc Offset nw,mc , and its calculation formula is:

[0125]

[0126] For 5G network time synchronization, such as Figure 4 As shown in the figure, 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 in the entire cross-network synchronization process, only the residence time of the time synchronization message in the 5G network needs to be calculated, so this part only focuses on the inlet NW-TT and the outlet DS-TT of the 5G system, and uses the unidirectional message propagation mechanism combined with statistical methods to design the synchronization method. Specifically, the following steps are included:

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

[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 and The link delay d between the TSN switch and NW-TT calculated in the TSN1 network nw,mc Offset 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 the Sync_5G message;

[0130] B4) Finally, DS-TT sends a Sync_2 message to the TSN device, records the egress timestamp TSe, and then fills the parsed information in the Sync_5G message into the Follow_Up_2 message, where TSi and the just-recorded TSe are processed by the method proposed by the 5G network time synchronization value to obtain the residence time. DS-TT fills the residence time into the Follow_Up_2 message and deletes TSi, and then sends the Follow_Up_2 message to the TSN device to complete time synchronization.

[0131] like Figure 5 As shown in the diagram of the 5G network one-way message propagation mechanism, in the first synchronization cycle, NW-TT sends its current time to DS-TT through one-way message propagation. DS-TT receives the message at time, and the receiving time is as shown in the formula:

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

[0133] Where, TSi 1 Indicates the entry timestamp recorded after NW-TT receives the synchronization message in the first synchronization period; TSe 1 Indicates the egress timestamp created by the first synchronization period DS-TT before forwarding the message to the TSN device; DS,NW Indicates the initial clock frequency offset of DS-TT relative to NW-TT; TimeDelay 5G Indicates the residence time of the message in the 5G network.

[0134] Transform the equation into:

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

[0136] After n synchronizations, n groups (TSi n ,TSe n ) Import and export timestamp:

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

[0138] Among them, r DS,NW Considered as a, TimeDelay 5G ×(1+r DS,NW ) is regarded as b, (TSe n -TSi n ) is regarded as y, TSi n As x, the equation can be regarded as y = ax + b, r DS,NWIndicates the initial clock frequency offset of DS-TT relative to NW-TT.

[0139] Next, DS-TT calculates r DS,NW with TimeDelay 5G The specific process is as follows Figure 6 As shown, the following steps are included:

[0140] C1) DS-TT combines the n sets of timestamps received for the first time into a set T, and regards each timestamp as a sample point, which can be drawn as follows: Figure 7 The scatter plot shown. And set the number of iterations k, in this embodiment, set the number of iterations k = 0;

[0141] C2), DS-TT performs denoising on the sample points in the current set T, that is, a tolerance value ε is set. If two adjacent groups of sample points (TSi n ,TSe i ) and (TSi n+1 ,TSe n+1 ) is greater than ε, the two sets of data are discarded. At this time, DS-TT updates the set T to 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 a and b. The constraints are: the sum of the distances from all sample points to the target line is as small as possible, that is, it satisfies:

[0143]

[0144] C4) After DS-TT obtains the target line y=ax+b obtained above, it calculates the distance from each sample point to the target line to obtain a distance sequence D. Then it calculates the "absolute median deviation" of the distance sequence D for noise reduction. The specific method is:

[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 absolute differences, which is the desired MAD(x);

[0148] d. Identify outliers: If the deviation of a data point from the median exceeds m times MAD(x), the data point can be considered an outlier and the set T is updated after it is removed.

[0149] C5) DS-TT receives 100 new timestamps and puts them into set T. The number of iterations is k=k+1. DS-TT executes the above steps C2 to C4. If the change of a in two consecutive iterations is less than or equal to the preset threshold σ, it is considered that a has converged. DS,NW is a,TimeDelay 5G for If the change in a between two consecutive iterations is greater than the preset threshold σ, the next round of solution operation will be continued. max At the iteration number, if a has not converged, r DS,NW Set to a obtained in the current round, TimeDelay 5G The current round

[0150] C6) DS-TT calculation completed DS,NW with TimeDelay 5G After that, the dwell time is filled into the Follow_Up message, and then the Follow_Up message is sent to the TSN device to synchronize the TSN network 2 time.

[0151] For TSN2 network time synchronization, such as Fig. 9 As shown, DS-TT is the master clock and TSN equipment is the slave clock. The master and slave clocks calculate synchronization-related parameters and achieve synchronization through the gPTP peer delay response measurement mechanism. The specific steps include:

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

[0153] D2) After the TSN device receives the Pdelay_Req_DS message sent by DS-TT, it records the message receiving time

[0154] D3) Then, the TSN device sends a Pdelay_Resp_D message to DS-TT and records the sending time. And carry a timestamp in the Pdelay_Resp_D message

[0155] D4) Then the TSN device sends a Pdelay_Resp_Follow_Up_D message to DS-TT, and carries a timestamp in the message.

[0156] D5) When DS-TT receives the Pdelay_Resp_D message, it records the message receiving time.

[0157] D6) After DS-TT receives the Pdelay_Resp_Follow_Up_D message, it can parse the Pdelay_Resp_D message and the Pdelay_Resp_Follow_Up_D message to get the timestamp and At this point, DS-TT has Four timestamps. At this point, the link delay between the TSN device and DS-TT can be obtained. ds,d Offset ds,d , as shown below:

[0158]

[0159] The definitions of terms involved in the method of the present invention are given in this embodiment as shown in Table 3 below:

[0160] Table 3

[0161]

[0162]

[0163] Example 2

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

[0165] In the first step, the TSN switch (master clock) sends the Sync_MC synchronization message for the first time, and NW-TT receives the Sync_1 synchronization message at 40 o'clock, that is, Then NW-TT receives the follow_up_MC message sent by the TSN switch and stores the time 37 when the TSN switch (master clock) first sends the Sync_MC synchronization message, that is, NW-TT at 42 The Delay_Req_NW message is sent to the TSN switch at any time. The TSN switch receives the Delay_Req_NW message at 43. It will then carry The timestamped Delay_Resp_MC is sent to NW-TT. According to the link delay formula, It turns out that:

[0166]

[0167] In the second step, DS-TT sends the Pdelay_Req_DS synchronization message for the first time at 44 hours, and the time is recorded as The TSN device receives 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 sends the Pdelay_Resp_D synchronization message, that is, TSN equipment is available in 48 The Pdelay_Resp_Follow_up_D message is sent to DS-TT at time 47. DS-TT receives the Pdelay_Resp_Follow_up_D message at time 47. According to the link delay formula, we can substitute It turns out that:

[0168]

[0169] In the third step, when both TSN network 1 and TSN network 2 complete a synchronization process, cross-network time synchronization begins immediately. The 5G-TSN converged network performs the first time synchronization cycle: the TSN switch sends a sync_1 message to NW-TT, the TSN switch sends it at 60, the NW-TT receives it at 63, and this time is also TSi, NW-TT sends sync_5G to DS-TT, DS-TT receives it at 89.4, and parses the received Sync_5G message, calculates the corresponding residence time and then adjusts its own time, DS-TT sends the time synchronization information to the TSN device through the Follow_Up_2 message at 76, and the TSN device receives Sync_2 at 81.

[0170] After 500 synchronizations, 500 groups (TSi n ,TSe n ) Import and export timestamps and 500 sets of frequency offsets i DS,NW , draw a scatter plot, such as Fig.10 shown.

[0171] De-noising the original data scatter plot:

[0172] 1) These 500 sets of timestamps (TSi n ,TSe i ) and (TSi n+1 ,TSe n+1 ) Fig.11 As shown in the figure, the tolerance value ε is set to 3, and the timestamps received by two adjacent groups (TSi n ,TSe i ) and (TSi n+1 ,TSe n+1) is greater than ε, the two sets of data are discarded.

[0173] 2) Using rolling average to compare (TSi n ,TSe n -TSi n ) for further denoising, setting the window to 5, and obtaining Fig.11 The denoising result is shown.

[0174] The scatter plot is 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 time of the TSN switch is 1060. Due to the link delay d between the TSN switch and NW-TT, mc,nw 2 and time offset mc,nw =1, the link delay between DS-TT and TSN equipment is d ds,d 1 and time offset ds,d 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 solution of the present invention rather than to limit it. Although the present invention has been described in detail with reference to the preferred embodiments, those skilled in the art should understand that the technical solution of the present invention can be modified or replaced by equivalents without departing from the purpose and scope of the technical solution, which should be included in the scope of the claims of the present invention.

Claims

1. A 5G and TSN fusion network time synchronization method based on a timestamp compensation algorithm, characterized by: It includes: Introduce 5G network as TSN virtual bridge into TSN network to form cross-network. Cross-network includes TSN1 network, 5G network and TSN2 network. The cross-network uses TSN switch in TSN1 network as master clock and TSN equipment in TSN2 network as slave clock. The master and slave clocks pass time synchronization information step by step across NW-TT module, 5G network clock domain and DS-TT module to achieve synchronization. Among them, 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 used as the master clock and NW-TT is used as the slave clock. The master and slave clocks use the gPTP peer delay response measurement mechanism to calculate synchronization-related parameters and achieve synchronization. For 5G network time synchronization, synchronization is achieved by calculating the residence time of the time synchronization message in the 5G network; 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.

2. The 5G and TSN fusion network time synchronization method based on the timestamp compensation algorithm according to claim 1 is characterized in that: For TSN1 network time synchronization, the slave clock sends an end-to-end delay request message, the master clock receives the end-to-end delay request message and responds to the delay request, and the master and slave clocks are synchronized by measuring the clock offset; the specific synchronization process is as follows: A1) The TSN switch will send a Sync_MC synchronization message to NW-TT and record the sending time. A2) The TSN switch sends a Follow_Up_MC message and carries a sending timestamp. A3) After receiving the Sync_MC synchronization message, NW-TT records the arrival time And send Delay_Req_NW message to TSN switch and record the sending time A4) TSN switches After receiving the Delay_Req_NW message, it immediately sends a Delay_Resp_MC message to NW-TT, carrying a timestamp. A5) When the Follow_Up_MC follow message and Delay_Resp_MC message arrive at NW-TT, NW-TT will parse the timestamps from them respectively. and timestamp A6) NW-TT obtains four timestamps and And start calculating the master-slave clock link delay d nw,mc Offset nw,mc , and its calculation formula is: According to the link delay d between the TSN switch and NW-TT nw,mc Offset nw,mc Complete time synchronization of TSN1 network.

3. The 5G and TSN fusion network time synchronization method based on the timestamp compensation algorithm according to claim 2 is characterized in that: For 5G network time synchronization, the 5G network joins the TSN network as a TSN virtual bridge, which has its own master clock. The entire 5G network is synchronized with the 5G master clock. Focusing on the ingress NW-TT and egress DS-TT of the 5G system, a synchronization method is designed using a one-way message propagation mechanism combined with statistical methods, which specifically includes the following steps: B1), the TSN switch first sends the Sync_1 message to NW-TT, and the time of sending the Sync_1 message is recorded as B2) The TSN switch sends the Follow_Up_1 message again. At this time, 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 calculated in the TSN1 network nw,mc Offset nw,mc and TSi n Information is encapsulated into the Sync_5G message B3) NW-TT sends a Sync_5G message to DS-TT, and DS-TT parses the message after receiving the Sync_5G message; B4) DS-TT sends Sync_2 message to TSN equipment and records the egress timestamp TSe n , fill the parsed information in the Sync_5G message into the Follow_Up_2 message, where TSi n With the TSe just recorded n After the 5G network time synchronization value is processed, the dwell time is obtained. DS-TT fills the dwell time into the Follow_Up_2 message and deletes TSi n , and then sends the Follow_Up_2 message to the TSN device to complete time synchronization.

4. The 5G and TSN fusion network time synchronization method based on the timestamp compensation algorithm according to claim 3 is characterized in that: In the first synchronization cycle of 5G network time synchronization, NW-TT sends its current time to DS-TT through one-way message propagation. DS-TT receives the message at time, and the receiving time is as follows: TSe1=(1+r DS,NW )×TSi1+TimeDelay 5G ×(1+r DS,NW ) Where, TSi1 represents the entry timestamp recorded by NW-TT after receiving the synchronization message in the first synchronization period; TSe1 represents the exit timestamp created by DS-TT before forwarding the message to the TSN device in the first synchronization period; DS,NW Indicates the initial clock frequency offset of DS-TT relative to NW-TT; TimeDelay 5G Indicates the residence time of the message in the 5G network; Transform the equation into: TSe1-TSi1=TSi1×r DS,NW +TimeDelay 5G ×(1+r DS,NW ) After n synchronizations, n groups (TSi n ,TSe n ) Import and export timestamp: TSe n -TSi n =TSi n ×r DS,NW +TimeDelay 5G ×(1+r DS,NW ) Here, the above formula is expressed as y=ax+b, a=r DS,NW , b=TimeDelay 5G ×(1+r DS,NW ), y = TSe n -TSi n , x = TSi n , where r DS,NW Indicates the initial clock frequency offset of DS-TT relative to NW-TT.

5. The 5G and TSN fusion network time synchronization method based on the timestamp compensation algorithm according to claim 4 is characterized in that: The initial clock frequency offset r is calculated by DS-TT Ds,NW TimeDelay 5G , specifically including the following steps: C1), DS-TT forms a set T of n sets of timestamps received for the first time, regards each timestamp as a sample point and obtains a discrete graph of the sample points, and sets the number of iterations k; C2), DS-TT performs denoising on the sample points in the current set T: set the tolerance value ε, if two adjacent groups of sample points (TSi n ,TSe i ) and (TSi n+1 ,TSe n+1 ) is greater than ε, then the two 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 a and b, where the constraints are: the sum of the distances from all sample points to the target line satisfies: C4) After DS-TT obtains the target line y=ax+b, it calculates the distance from each sample point to the target line to obtain a distance sequence D. Then it calculates the "absolute median deviation" of the distance sequence D for noise reduction. The specific method is: 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 absolute differences, which is the desired MAD(x); d. Identify outliers: If the deviation of a data point from the median exceeds m times MAD(x), then the data point is an outlier, discard it and update the set T; C5), DS-TT receives several new groups of timestamps and puts them into set T, the number of iterations k=k+1, and DS-TT executes the above steps C1 to C4; If the change of a in two consecutive iterations is less than or equal to the preset threshold σ, it is considered that a has converged and the required r DS,NW is a,TimeDelay 5G for If the change of a in two consecutive iterations is greater than the preset threshold σ, the next round of solution operation will be continued; When k exceeds the preset k max When a does not converge, r DS,NW Set to a obtained in the current round, TimeDelay 5G The current round C6) DS-TT calculation completed DS,NW with TimeDelay 5G After that, the residence time is filled into the Follow_Up message, and then the Follow_Up message is sent to the TSN device to synchronize the TSN2 network time.

6. The 5G and TSN fusion network time synchronization method based on the timestamp compensation algorithm according to claim 5 is characterized in that: 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 use the gPTP peer delay response measurement mechanism to calculate synchronization-related parameters and achieve synchronization. The specific steps include: D1) DS-TT acts as the master clock to send Pdelay_Req_DS message to the slave clock TSN device and record the sending time D2) After the TSN device receives the Pdelay_Req_DS message sent by DS-TT, it records the message receiving time D3) TSN equipment sends Pdelay_Resp_D message to DS-TT and records the sending time And carry a timestamp in the Pdelay_Resp_D message D4) TSN equipment sends Pdelay_Resp_Follow_Up_D message to DS-TT, and carries a timestamp in the message D5) When DS-TT receives the Pdelay_Resp_D message, it records the message receiving 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 time, DS-TT obtains Four timestamps, the link delay between the TSN device and DS-TT is calculated according to the following formula ds,d Offset ds,d : According to the link delay between TSN equipment and DS-TT ds,d Offset ds,d Complete time synchronization of TSN2 network.

7. The 5G and TSN fusion network time synchronization method based on the timestamp compensation algorithm according to any one of claims 1 to 6 is characterized in that: The execution steps of the method are: S1, using the TSN switch as the main clock, the TSN switch sends a synchronization message to NW-TT; S2. After receiving the synchronization message, NW-TT records the entry timestamp TSi n , and calculate the link delay and clock phase offset between the TSN switch; S3. NW-TT performs time synchronization with the TSN switch based on the calculated result and fills the ingress timestamp TSi into the gPTP message and sends it to DS-TT; S4, DS-TT creates an egress timestamp TSe before forwarding the message to the TSN device. n ; S5,DS-TT uses the timestamp compensation algorithm to calculate the residence time of gPTP messages in the 5G system; S6, DS-TT converts the residence time in the 5G system into the time of the TSN network and sends the gPTP message to the TSN device; S7. After receiving the gPTP message, the TSN device calculates the link delay and clock phase offset between it and DS-TT; S8, TSN equipment and DS-TT perform time synchronization 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

  • Cross-5G system TSN network time synchronization device and method

    CN118748832A

  • Cross-domain clock synchronization method in time sensitive network

    CN119402125A

  • Cross-network time synchronization method for industrial wireless network and TSN fusion

    US20240243829A1