Network time synchronization method

By maintaining the main port vector table in each node and dynamically selectively sending synchronous messages, the problems of large overhead of time synchronization packets and conflicts with time-sensitive services in the prior art are solved, and more efficient bandwidth utilization and better compatibility are achieved.

CN119766382AActive Publication Date: 2025-04-04XIDIAN UNIV

Patent Information

Application Number
CN202411977835.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-31
Publication Date
2025-04-04
Estimated Expiration
2044-12-31

AI Technical Summary

Technical Problem

The overhead of time synchronization packets in the prior art is large, resulting in additional bandwidth consumption, and time-sensitive services and time-synchronization signaling packets are prone to conflict.

Method used

Maintain a main port vector table within each node, record the maximum clock drift rate and maximum clock drift amount of all nodes under each main port, and dynamic decisions selectively send or forward synchronous messages.

Benefits of technology

By dynamically adjusting the transmission interval of synchronous packets, the bandwidth consumption caused by time-synchronous packets is reduced, and conflicts with time-sensitive services are avoided, which improves protocol efficiency and compatibility.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119766382A_ABST
    Figure CN119766382A_ABST
Patent Text Reader

Abstract

The invention relates to a network time synchronization method, and belongs to the technical field of communication networks. Comprising the steps that a main port vector table is maintained in each node, and the maximum clock drift rate and the maximum clock drift amount of all nodes under each main port are recorded in the table; according to the synchronized state message, each node completes initialization of a main port vector table; when the synchronization moment arrives, the root node updates the main port vector table and selectively sends a synchronization message; the slave node receives the synchronization message, synchronizes the time of the slave node and updates the clock drift rate of the slave node; meanwhile, a state message is replied to the father node along the slave port, and the self clock drift rate is notified; and after each node receives the state message, updating a main port vector table of the node, and selectively notifying the father node. The method solves the problems that in the prior art, extra bandwidth consumption is generated due to the fact that the time synchronization message overhead is large, and the time sensitive service conflicts with the time synchronization signaling message.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention belongs to the technical field of communication networks, and in particular relates to a network time synchronization method. Background Art

[0002] With the rapid development of industrial automation and embedded system technology, as well as the increasing demand for real-time, reliability, efficiency and data diversity in the fields of avionics, automotive electronics, etc., traditional Ethernet technology has gradually shown its limitations and is difficult to fully adapt to these new challenges. In this context, real-time Ethernet technology, especially Time-Sensitive Networking (TSN), as a key component of modern industrial networks, is becoming increasingly important and has a wider range of applications, becoming a core technology supporting the development of the industrial field.

[0003] TSN time-sensitive network is a new generation of network architecture developed by optimizing the existing Ethernet protocol based on traditional Ethernet technology. TSN network aims to achieve precise delay control, bandwidth reservation and low-latency data transmission. Its standard setting work is mainly promoted by the IEEE 802.1 committee. Compared with traditional Ethernet, TSN network provides high reliability, low latency and low jitter communication solutions for industrial automation, smart grid, Internet of Vehicles and other fields through a series of open standard protocols, including IEEE802.1AS, IEEE802.1Qbv, IEEE802.1Qci, IEEE802.1CB and IEEE802.1Qch. In addition, TSN network uses the IEEE802.1AS time synchronization mechanism to ensure efficient collaboration between devices, so that data can be transmitted accurately and without error according to the scheduled time, meeting the real-time requirements.

[0004] In real-time Ethernet technology represented by TSN time-sensitive network, time synchronization technology is the basis for ensuring business determinism and real-time performance. In order for each device in the network to have the same time reference, thereby ensuring the accuracy of key business data transmission and the overall stability and security of the system, a high degree of time synchronization must be achieved between each device. In key application areas such as aviation and self-driving cars, it is particularly important to ensure extremely high time synchronization accuracy, which can effectively prevent business conflicts that may be caused by slight differences in local clocks. Therefore, how to design and improve time synchronization protocols, reduce the complexity of protocol implementation and bandwidth resource consumption, and improve fault tolerance and time synchronization accuracy has become one of the key research directions to promote the sustainable development of TSN technology.

[0005] Existing time synchronization solutions include SAE AS6802 protocol, IEEE 1588 protocol and IEEE 802.1AS protocol. In IEEE 802.1AS, the transmission interval of synchronization messages is initially set to a fixed value, and too frequent time synchronization may bring additional network load. Therefore, the disadvantages of the existing technology are:

[0006] First, different network devices have different clock performance. Traditional time synchronization solutions use a fixed synchronization cycle. Frequent participation of devices with excellent clock performance in time synchronization will bring additional load to the network. In addition, although the synchronization cycle of the existing solution can be dynamically adjusted, all network devices will participate in each synchronization, which will also cause bandwidth waste.

[0007] Second, time-sensitive services may conflict with time synchronization messages. The time-sensitive service scheduling algorithm reserves time slots for time synchronization, but in the existing variable synchronization cycle solution, the transmission of time synchronization messages may not be within the reserved time slots, which may conflict with time-sensitive services. Summary of the invention

[0008] The technical problems to be solved by the present invention are:

[0009] In order to avoid the deficiencies of the prior art, the present invention provides a network time synchronization method for solving the problems in the prior art that the time synchronization message overhead is large, resulting in extra bandwidth consumption, and time-sensitive services conflict with time synchronization signaling messages.

[0010] In order to solve the above technical problems, the technical solution adopted by the present invention is:

[0011] A network time synchronization method, characterized by comprising:

[0012] A master port vector table is maintained inside each node, which records the maximum clock drift rate and maximum clock drift amount of all nodes under each master port;

[0013] According to the synchronized status message, each node completes the initialization of the master port vector table;

[0014] When the synchronization time arrives, the root node updates the master port vector table and selectively sends synchronization messages;

[0015] The slave node receives the synchronization message, synchronizes its own time and updates its own clock drift rate; at the same time, it replies a status message to the parent node along the slave port to inform its own clock drift rate;

[0016] After receiving the status message, each node updates its own master port vector table. If the maximum clock drift rate and maximum clock drift value of all nodes in the subtree with this node as the root node change, it will notify the parent node along the slave port.

[0017] A further technical solution of the present invention: the selectively sending a synchronization message comprises:

[0018] The root node synchronizes itself according to its own synchronization interval t sync interval Update the maximum estimated clock offset value t of all ports in the master port vector table max drift ;

[0019] According to the current maximum estimated clock offset value t of each master port max drift , maximum clock deviation speed v max drift and the synchronization interval t sync interval Calculate the maximum estimated clock offset value t when the next synchronization time arrives max driftnext time ;

[0020] If the next synchronization time arrives, the maximum estimated clock offset value t max drift next time If the synchronization accuracy is exceeded, a synchronization message is sent to the port.

[0021] A further technical solution of the present invention is that when the maximum clock drift rate and the maximum clock drift value of all nodes in the subtree with the current node as the root node are changed, the updating of the own master port vector table will be notified to the parent node along the slave port, including:

[0022] Each node stores the maximum clock drift speed v of all nodes in the subtree with the current node as the root node. subtree max drift and the current maximum estimated drift t subtree max drift ;

[0023] When a node receives a status message, it updates the master port vector table entry corresponding to the port that received the status message. According to the port that received the message, it traverses and searches for the corresponding entry in the master port vector table, and sets the maximum clock drift speed v in the entry to max drift and the current maximum estimated drift t max drift Replaced with the values ​​of the two fields in the status message;

[0024] The node will calculate the drift speed v according to the main port vector table and its own clock drift , calculate the new v subtree max drift and t subtree max drift ;

[0025] If an update occurs, that is, v subtree max drift and t subtree max drift If a change occurs and the current node is not the root node, a status message is sent to the slave port.

[0026] A further technical solution of the present invention is that each node completes the initialization of the master port vector table, including:

[0027] Each node initiates link measurement and records link delay;

[0028] The root node initiates synchronization and sends synchronization messages along all master ports;

[0029] The slave node receives the synchronization message, corrects its own clock according to the link delay and updates its own clock drift rate. At the same time, it replies to the parent node through the slave port to inform its own clock drift rate.

[0030] After receiving the status message, each node updates its own information and selectively notifies the parent node based on the updated main port vector table.

[0031] A further technical solution of the present invention also includes receiving a synchronization message from a node, and when the slave node is a non-leaf node, the synchronization message needs to be forwarded along all master ports.

[0032] A further technical solution of the present invention: the link measurement comprises:

[0033] Each node sends a PdelayReq message to the slave node;

[0034] After receiving the PdelayReq message, each node replies with a PdelayResp message to the port;

[0035] Each node calculates the link delay based on the received PdelayResp message.

[0036] A further technical solution of the present invention: the selective notification to the parent node based on the updated own master port vector table comprises:

[0037] If the maximum clock drift rate and the maximum clock drift value of all nodes in the subtree with this node as the root node change, it will be notified to the parent node along the slave port.

[0038] A computer system, characterized in that it comprises: one or more processors, and a computer-readable storage medium for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors implement the above-mentioned method.

[0039] A computer-readable storage medium, characterized in that it stores computer-executable instructions, which are used to implement the above method when executed.

[0040] A computer program product, characterized by comprising computer executable instructions, wherein the instructions are used to implement the above method when executed.

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

[0042] The present invention provides a network time synchronization method, which records the clock performance of the nodes under each port by maintaining a main port vector table in each node. When the node receives a synchronization message, it dynamically decides which ports to forward to, thereby solving the problem of large time synchronization message overhead and conflict between time-sensitive services and time synchronization signaling messages in the prior art.

[0043] First, the method can dynamically adjust the transmission interval of the synchronization message according to the clock performance of each node in the network, thereby improving the protocol efficiency and reducing the bandwidth consumption caused by the time synchronization message.

[0044] Second, the method selectively sends or forwards synchronization messages based on the minimum synchronization interval, ensuring that time synchronization can be performed within a reserved time slot, avoiding conflicts with time-sensitive services, and improving compatibility with existing protocols. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] The drawings are only for the purpose of illustrating particular embodiments and are not to be considered limiting of the present invention. Like reference symbols denote like components throughout the drawings.

[0046] Figure 1 It is an interactive schematic diagram of the present invention.

[0047] Figure 2 It is a flow chart for implementing the present invention.

[0048] Figure 3 This is a sub-flow chart for implementing step (6) of the present invention.

[0049] Figure 4 This is a sub-flow chart for implementing step (8) of the present invention. DETAILED DESCRIPTION

[0050] In order to make the purpose, technical solutions and advantages of the present invention more clearly understood, the present invention is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present invention and are not intended to limit the present invention. In addition, the technical features involved in the various embodiments of the present invention described below can be combined with each other as long as they do not conflict with each other.

[0051] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the terms used in this way can be interchangeable where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0052] The implementation idea of ​​the present invention is: 1) a master port vector table is maintained inside each node, and the table records the maximum clock drift rate and the maximum clock drift amount of all nodes under each master port; 2) in the startup phase, each node will perform a link measurement, record the link delay with the parent node, and then initiate a synchronization by the root node; 3) after receiving the synchronization message sent by the root node, the node will synchronize its own clock and forward it to all master ports; 4) after receiving the synchronization message, each node will simultaneously reply a status message to the parent node along the slave port to notify Its own clock drift rate; 5) After receiving the status message, each node will update its own master port vector table. If the maximum clock drift rate and maximum clock drift value of all nodes in the subtree with this node as the root node change, it will be notified to the parent node along the slave port; 6) According to the status message, each node can complete the initialization of the master port vector table; 7) Thereafter, every time a synchronization cycle arrives, the root node will update the master port vector table and decide which ports to send synchronization messages to. Non-leaf nodes will perform the same operation after receiving the synchronization message.

[0053] In order to enable those skilled in the art to better understand the present invention, the present invention is described in detail below in conjunction with specific embodiments.

[0054] The flowchart for implementing the present invention is shown in the attached Figure 2 As shown, including:

[0055] (1) Maintain the main port vector table inside the node, record the port number, the maximum clock drift speed v of all nodes under the port max drift And the maximum estimated clock drift of all nodes under this port t max drift .

[0056] Specifically, a master port vector table is maintained for each node. The table has three columns. The first column is the master port number, and the second column is the maximum clock drift speed v of all nodes under the port. max driftThe third column is the maximum estimated clock drift of all nodes under this port, t max drift .

[0057] (2) Set up the time synchronization spanning tree through the Best Master Clock Algorithm (BMCA) or external configuration, and configure the minimum synchronization interval.

[0058] Specifically, the time synchronization spanning tree can be configured externally or generated by calculation by all nodes, and is compatible with the master port vector table set in (1).

[0059] (3) After each device is powered on, link measurement is initiated.

[0060] (3a) Each node sends a PdelayReq message to the slave node.

[0061] (3b) After receiving the PdelayReq message, each node replies with a PdelayResp message to the port.

[0062] (3c) Each node calculates the link delay based on the received PdelayResp message.

[0063] Specifically, the link measurement method is consistent with the IEEE 802.1AS protocol and is compatible with this method.

[0064] (4) After the minimum synchronization interval, the root node synchronization time arrives, and the root node initiates synchronization and sends synchronization messages along all master ports.

[0065] (5) After receiving the synchronization message, the node will first correct its own clock, which can be divided into the following two types:

[0066] (5a) After receiving the synchronization message, the non-leaf node updates the synchronization domain field of the message according to the link measurement result, forwards the synchronization message to all master ports, and corrects its own clock at the same time.

[0067] (5b) After receiving the synchronization message, the leaf node corrects its own clock based on the link measurement results.

[0068] Specifically, when the first synchronization time arrives, the root node sends a synchronization message to all master ports, and non-leaf nodes send synchronization messages to all master ports after completing their own synchronization. That is, all nodes participate in the first synchronization.

[0069] Then calculate the clock drift per unit time v drift The calculation method is to divide the correction value by the difference between the current timestamp and the node startup timestamp. The formula is as follows:

[0070]

[0071] After that, the node sends a status message to the slave port. The message has two fields, namely, the maximum clock drift speed v of all nodes in the subtree with the current node as the root node and subtree max drift and the maximum estimated drift t subtree max drift At this time v subtree max drift is the clock drift per unit time v drift , t subtree max drift is 0.

[0072] Specifically, after a node receives a synchronization message and completes its own clock correction, it will first reply with a status message with a value of v drift and 0. After receiving the status message, it decides whether to forward it to the parent node based on whether the content of the status message has changed, thus saving bandwidth.

[0073] (6) After receiving the status message, the node will update its own information and selectively send a status message to the slave port.

[0074] (6a) Each node stores the maximum clock drift speed v of all nodes in the subtree with the current node as the root node. subtree max drift and the current maximum estimated drift t subtree max drift .

[0075] Specifically, after the master port vector table is updated, the node will subtree max drift and t subtree max drift Temporarily save as v′ subtree max drift and t′ subtree max drift , and recalculate the v of this node sbtree max drift and t subtree max drift If they have changed, a status message is sent to the slave port. The two fields in the message are the new v subtree max drift and t subtree max drift .

[0076] (6b) When the node receives the status message, it updates the master port vector table entry corresponding to the port that received the status message. According to the port that received the message, it traverses and searches for the corresponding entry in the master port vector table, and sets the maximum clock drift speed v in the entry to max drift and the current maximum estimated drift t max drift Replaced with the values ​​of the two fields in the status message.

[0077] (6c) The node will change the clock speed v according to the master port vector table and its own clock drift speed v drift , calculate the new v subtree max drift and t subtree max drift .

[0078] (6d) If an update occurs, that is, v subtree max driftand t subtree max drift If a change occurs and the current node is not the root node, a status message is sent to the slave port.

[0079] (7) After the first round of synchronization, each node completes the initialization of the master port vector table through the received status message and synchronizes the clock with the root node, and the startup phase is completed.

[0080] Specifically, after completing the first round of synchronization, each node synchronizes the clock with the root node, and completes the initialization of the master port vector table compared to IEEE802.1AS. After that, the root node initiates synchronization according to the configured minimum synchronization interval.

[0081] (8) Thereafter, every time the minimum synchronization interval passes, the root node will update its own master port vector table and selectively send a synchronization message.

[0082] (8a) The root node synchronizes itself according to its own synchronization interval t stnc interval Update the maximum estimated clock offset value t of all ports in the master port vector table max drift The calculation process is the current maximum estimated clock offset value plus the product of the synchronization interval and the maximum clock offset speed. The formula is as follows:

[0083] t′ max drift =t max drift +t sync interval *v max drift

[0084] (8b) Based on the current maximum estimated clock offset value t of each master port max drift , maximum clock deviation speed v max drift and the synchronization interval t sync interval Calculate the maximum estimated clock offset value t when the next synchronization time arrives max drift next time The calculation process is the current maximum estimated clock offset value plus the product of the maximum clock offset speed and the synchronization interval. The formula is as follows:

[0085] t max drift next time =t max drift +t sync interval *v max drift

[0086] (8c) If the next synchronization time arrives, the maximum estimated clock offset value t max drift next time If the synchronization accuracy is exceeded, a synchronization message is sent to the port.

[0087] (9) After receiving the synchronization message, the node will also perform the master port vector table update and synchronization message selective forwarding operations.

[0088] (9a) After receiving the synchronization message, the node corrects its own clock based on the link measurement and the synchronization field in the synchronization message. The calculation method is consistent with IEEE 802.1AS.

[0089] (9b) Node update synchronization interval t sync intrval , and updates the maximum estimated clock offset value t of each item in the master port vector table according to the synchronization interval max drift .

[0090] Specifically, the synchronization interval is calculated as the difference between the current synchronization timestamp and the previous synchronization timestamp:

[0091] t sync interval =t current timestamp -t last timestamp

[0092] The maximum estimated clock offset is calculated by adding the current maximum estimated clock offset to the product of the maximum clock offset speed of all nodes under the port and the synchronization interval of the node:

[0093] t′ max drift =t max drift +t sync interval *v max drift

[0094] (9c) As with the root node, the maximum estimated clock offset value of each port is calculated for the next synchronization.

[0095] t max drift next time =t max drift +t sync interval *v max drift

[0096] (9d) If the next synchronization time arrives, the maximum estimated clock offset value t max drift next time If the synchronization accuracy is exceeded, the synchronization field in the synchronization message is updated and the synchronization message is sent to the port.

[0097] (10) As in the startup phase, after receiving a synchronization message, the node will reply with a status message. After receiving a status message, the node will update its own information and selectively send a status message to the slave port.

[0098] Specifically, after receiving the synchronization message, the node will reply to the slave port with a status message with a field value of v drift and 0; after receiving the status message, the node will update the v of the corresponding port in the main port vector table max drift and t max drift , and recalculate the maximum clock drift speed v of all nodes in the subtree with the current node as the root node subtree max drift and drift t subtree max driftIf an update occurs, a status message is sent to the primary port.

[0099] The above description is only a specific implementation mode of the present invention, but the protection scope of the present invention is not limited thereto. Any technician familiar with the technical field can easily think of various equivalent modifications or substitutions within the technical scope disclosed in the present invention, and these modifications or substitutions should be included in the protection scope of the present invention.

Claims

1. A network time synchronization method, characterized in that: include: A master port vector table is maintained inside each node, which records the maximum clock drift rate and maximum clock drift amount of all nodes under each master port; According to the synchronized status message, each node completes the initialization of the master port vector table; When the synchronization time arrives, the root node updates the master port vector table and selectively sends synchronization messages; The slave node receives the synchronization message, synchronizes its own time and updates its own clock drift rate; at the same time, it replies a status message to the parent node along the slave port to inform its own clock drift rate; After receiving the status message, each node updates its own master port vector table. If the maximum clock drift rate and maximum clock drift value of all nodes in the subtree with this node as the root node change, it will notify the parent node along the slave port.

2. A network time synchronization method according to claim 1, characterized in that: The selectively sending a synchronization message comprises: The root node synchronizes itself according to its own synchronization interval t sync interval Update the maximum estimated clock offset value t of all ports in the master port vector table max drift ; According to the current maximum estimated clock offset value t of each master port max drift , maximum clock deviation speed v max drift and the synchronization interval t sync interval Calculate the maximum estimated clock offset value t when the next synchronization time arrives max drift next time ; If the next synchronization time arrives, the maximum estimated clock offset value t max drift next time If the synchronization accuracy is exceeded, a synchronization message is sent to the port.

3. A network time synchronization method according to claim 1, characterized in that: The updating of the own master port vector table, if the maximum clock drift rate and the maximum clock drift value of all nodes in the subtree with the current node as the root node change, will be notified to the parent node along the slave port, including: Each node stores the maximum clock drift speed v of all nodes in the subtree with the current node as the root node. subtree max drift and the current maximum estimated drift t subtree max drift ; When a node receives a status message, it updates the master port vector table entry corresponding to the port that received the status message. According to the port that received the message, it traverses and searches for the corresponding entry in the master port vector table, and sets the maximum clock drift speed v in the entry to max drift and the current maximum estimated drift t max drift Replaced with the values ​​of the two fields in the status message; The node will calculate the drift speed v according to the main port vector table and its own clock drift , calculate the new v subtree max drift and t subtree max drift ; If an update occurs, that is, v subtree max drift and t subtree maxdrift If a change occurs and the current node is not the root node, a status message is sent to the slave port.

4. A network time synchronization method according to claim 1, characterized in that: Each node completes the initialization of the master port vector table, including: Each node initiates link measurement and records link delay; The root node initiates synchronization and sends synchronization messages along all master ports; The slave node receives the synchronization message, corrects its own clock according to the link delay and updates its own clock drift rate. At the same time, it replies to the parent node through the slave port to inform its own clock drift rate. After receiving the status message, each node updates its own information and selectively notifies the parent node based on the updated main port vector table.

5. A network time synchronization method according to claim 5, characterized in that: It also includes receiving a synchronization message from the slave node. When the slave node is a non-leaf node, the synchronization message needs to be forwarded along all master ports.

6. A network time synchronization method according to claim 5, characterized in that: The link measurement includes: Each node sends a PdelayReq message to the slave node; After receiving the PdelayReq message, each node replies with a PdelayResp message to the port; Each node calculates the link delay based on the received PdelayResp message.

7. A network time synchronization method according to claim 5, characterized in that: The selective notification to the parent node according to the updated own master port vector table includes: If the maximum clock drift rate and the maximum clock drift value of all nodes in the subtree with this node as the root node change, it will be notified to the parent node along the slave port.

8. A computer system, characterized in that include: One or more processors, and a computer-readable storage medium for storing one or more programs, wherein when the one or more programs are executed by the one or more processors, the one or more processors are enabled to implement the method of claim 1.

9. A computer-readable storage medium, characterized in that Computer executable instructions are stored, and when the instructions are executed, they are used to implement the method of claim 1.

10. A computer program product, characterized in that The invention comprises computer executable instructions, which are used to implement the method of claim 1 when being executed.

Citation Information

Patent Citations

  • Clock synchronizing method for wireless sensing network

    CN104158647A

  • Wireless sensor network confidence weighted time synchronization method for steel structure flaw detection

    CN110572874A

  • IPv6 wireless sensor network time synchronization method based on RPL routing protocol

    CN111083775A

  • Clock synchronization

    CN111868662A

  • Synchronous efficient convergence method and system of 802.1 AS

    CN118487693A

Cited By

  • Dynamic time synchronization method and system based on aerospace scene

    CN121814283A