Data transmission method, networking system, chip and computer storage medium
By delaying the transmission of the target message by a fixed amount of time after receiving it at the intermediate node of the network system, the problem of transmission asymmetry caused by the variable processing delay of the nodes is solved, and simplified accurate time synchronization is achieved.
Patent Information
- Application Number
- PCT/CN2025/070212
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2024-07-12
- Filing Date
- 2025-01-02
- Publication Date
- 2026-01-15
AI Technical Summary
In data communication networks, the variable processing latency of nodes leads to asymmetry in uplink and downlink transmission between the master clock node and the slave clock node, affecting the accuracy of time synchronization. Existing technologies require a cumbersome time synchronization process to record the message dwell time of intermediate nodes in order to achieve accurate synchronization.
By receiving the target message at the intermediate node of the network system and then sending it to the downstream node after a fixed delay, the processing delay of each intermediate node is ensured to be symmetrical, simplifying the time synchronization process.
It achieves symmetrical uplink and downlink transmission between the master clock node and the slave clock node, simplifies the time synchronization process, and improves the accuracy and precision of time synchronization.
Smart Images

Figure CN2025070212_15012026_PF_FP_ABST
Abstract
Description
Data transmission methods, networking systems, chips, and computer storage media
[0001] This application claims priority to PCT patent application filed on July 12, 2024, with application number "PCT / CN2024 / 105328" and patent title "Data Transmission Method, Chip and Storage Medium", the entire contents of which are incorporated herein by reference. Technical Field
[0002] This application relates to the field of data communication technology, and in particular to a data transmission method, a networking system, a chip, and a computer storage medium. Background Technology
[0003] In data communication networks, the normal operation of many services requires network clock synchronization. Currently, time synchronization of all nodes in an electronic communication network is typically achieved using a time synchronization scheme based on the Precision Time Protocol (PTP). PTP-based time synchronization between a slave clock node and a master clock node requires at least three messages (including a synchronization message, a delay request message, and a delay response message) to be exchanged between the slave and master clock nodes during each synchronization process. The slave clock node then retrieves different timestamps from these messages to calculate the clock offset between its local clock and the master clock, and adjusts its local clock accordingly to achieve synchronization with the master clock node.
[0004] The prerequisite for a slave clock node to achieve accurate time synchronization with the master clock node based on clock offset values is that the uplink and downlink transmission delays between the master and slave clock nodes must be as consistent as possible; otherwise, the time synchronization accuracy will deviate due to differences in delay. However, in existing data communication networks, the processing delay of nodes for messages is not fixed, leading to asymmetry in node transmission and reception delays, and consequently, asymmetry in uplink and downlink transmission between the master and slave clock nodes. To achieve accurate time synchronization in this situation, PTP requires each intermediate node between the master and slave clock nodes to record the message's dwell time at that intermediate node during time synchronization. This makes the time synchronization process cumbersome and limits the accuracy of time synchronization. Summary of the Invention
[0005] In view of this, embodiments of this application provide a data transmission method, a networking system, a chip, and a computer storage medium to at least partially solve the above-mentioned technical problems.
[0006] According to a first aspect of the embodiments of this application, a data processing method is provided, applied to any intermediate node in a network system, the method comprising:
[0007] Receive a target message, wherein the destination node of the target message is different from the intermediate node, and the target message is a message used for time synchronization;
[0008] After a first duration following the start of receiving the target message, the target message is sent to the downstream node of the intermediate node.
[0009] According to a second aspect of the embodiments of this application, a networking system is provided, including: a master clock node, a slave clock node belonging to the same clock domain as the master clock node, and at least one intermediate node that is communicatively connected to the master clock node and the slave clock node respectively.
[0010] The master clock node is used to send downlink time messages to the slave clock node via the intermediate node;
[0011] The slave clock node is used to send an uplink time message to the master clock node via the intermediate node;
[0012] The intermediate node is configured to receive any target message from the downlink time message and the uplink time message, and after a first duration from the start of receiving the target message, send the target message to the corresponding downstream node of the intermediate node.
[0013] According to a third aspect of the embodiments of this application, a data transmission method is provided, applied to the first node of two nodes used for time synchronization in a network system, comprising:
[0014] Obtain the target message to be sent to the second node, wherein the second node is the other of the two nodes, and the target message is a message used for time synchronization;
[0015] The target message is sent to the second node after a second delay and a first timestamp is generated. The first timestamp is used to indicate the time of transmission of the target message. The second delay is set so that the message transmission delay of the first node is the same as that of the second node.
[0016] According to a fourth aspect of the embodiments of this application, a data transmission method is provided, applied to a third node of two nodes used for time synchronization in a networking system, the method comprising:
[0017] Receive a target message sent by a fourth node, wherein the fourth node is the other of the two nodes, and the target message is a message used for time synchronization;
[0018] A second timestamp is generated three time intervals after the start of receiving the target message. The second timestamp is used to indicate the time of receiving the target message. The third time interval is set such that the message transmission and reception delay of the third node is the same as that of the fourth node.
[0019] According to a fifth aspect of the embodiments of this application, a chip is provided, including: a processing unit and a storage unit, wherein the processing unit and the storage unit communicate with each other;
[0020] The storage unit is used to store at least one executable instruction, which causes the processing unit to perform the operation corresponding to the method described in the first aspect.
[0021] According to a sixth aspect of the embodiments of this application, a computer storage medium is provided that stores a computer program thereon, which, when executed by a processor, implements the method described in the first aspect.
[0022] According to the data transmission scheme provided in the embodiments of this application, any intermediate node in the network system receives the target message and, after a first duration from the start of receiving the target message, sends the target message to the downstream node of that intermediate node. Therefore, the processing delay of each intermediate node for the target message in the network system is fixed, which makes the sending and receiving processing delays of each intermediate node symmetrical. Based on this data transmission scheme, when the master clock node and the slave clock node exchange target messages for time synchronization via intermediate nodes, the uplink and downlink transmissions between the master clock node and the slave clock node can be ensured to be symmetrical, thereby achieving accurate time synchronization while simplifying the time synchronization process. Attached Figure Description
[0023] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments recorded in the embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings.
[0024] Figure 1 is a schematic diagram of a networking system according to an embodiment of this application;
[0025] Figure 2 is a schematic diagram of a networking system according to another embodiment of this application;
[0026] Figure 3 is a flowchart illustrating a data transmission method according to an embodiment of this application;
[0027] Figure 4 is a flowchart illustrating a data transmission method according to another embodiment of this application;
[0028] Figure 5 is a flowchart illustrating an exemplary implementation of step 302 in the data transmission method shown in Figure 3;
[0029] Figure 6 is a flowchart illustrating an exemplary implementation of step 302 in the data transmission method shown in Figure 3;
[0030] Figure 7 is an exemplary flowchart of the data transmission method shown in Figure 6;
[0031] Figure 8 is a schematic diagram of the format of the target message provided in the embodiments of this application;
[0032] Figure 9 is a flowchart illustrating a data transmission method according to another embodiment of this application;
[0033] Figure 10 is a flowchart illustrating a data transmission method according to another embodiment of this application;
[0034] Figure 11 is a schematic diagram of the chip structure provided in an embodiment of this application. Detailed Implementation
[0035] To enable those skilled in the art to better understand the technical solutions in the embodiments of this application, the technical solutions in the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art should fall within the protection scope of the embodiments of this application.
[0036] The specific implementation of the embodiments of this application will be further described below with reference to the accompanying drawings.
[0037] The application scenario of this application
[0038] This application proposes a data transmission scheme. The entire data transmission scheme is relatively universal and can be used for data transmission in various types of networking systems, such as ring topologies, daisy-chain topologies, and linear topologies. For example, it can be used for data transmission between different nodes in a vehicle-mounted networking system. Furthermore, the data transmission scheme of this application is not limited to vehicle-mounted networking systems and can also be applied to other scenarios.
[0039] Before detailing the data transmission scheme provided in this application, the network system to which the data transmission scheme provided in this application is applicable and the related terminology shall be explained.
[0040] The networking system in this embodiment is a network system composed of multiple nodes connected through communication. These nodes can be connected via a physical transmission medium. The physical transmission medium can be shielded twisted-pair cable, unshielded twisted-pair cable, coaxial cable, or other similar cable harnesses. Each node can be any device, apparatus, module, or chip that implements the solution of this application. The multiple nodes in the networking system can be divided into master nodes and child nodes.
[0041] The master node is typically connected to a host, which may include or may be one or more of various processors such as a Digital Signal Processor (DSP), a Microcontroller Unit (MCU), or a Central Processing Unit (CPU).
[0042] Child nodes can be functional nodes connected to peripheral devices, also known as functional nodes or slave nodes. By connecting child nodes to peripheral devices, different functional applications can be implemented. For example, peripheral devices can include the following types: Local Interconnect Network (LIN) bus peripherals, Pulse Width Modulation (PWM) driver devices, Inter-Integrated Circuit (I2C) bus peripherals, Serial Peripheral Interface (SPI) bus peripherals, Quad Serial Peripheral Interface (QSPI) bus peripherals, General-purpose Input / Output (GPIO) peripherals, Ethernet peripherals, Controller Area Network (CAN) bus peripherals, Media Independent Interface (MII) and various extensions and derivatives of MII peripherals, Universal Asynchronous Receiver / Transmitter (UART) peripherals, Single Edge Nibble Transmission (SENT) bus peripherals, and Peripheral Sensor Interface (SMI). Peripherals using the PSI5 protocol, Inter-IC Sound (I2S) peripherals, Time-Division Multiplexing (TDM) peripherals, Analog Microphone (AMIC) peripherals, Digital Microphone (DMIC) peripherals, Analog-to-digital converters (ADCs), etc.
[0043] It should be understood that the features such as main nodes and child nodes mentioned in the embodiments of this application can be logical concepts or entity concepts. Furthermore, multiple features can be multiple entity devices, or multiple features can be combined into one entity device. This application does not make specific limitations in this regard.
[0044] In a network system, network clock synchronization is typically required to ensure the normal operation of services. From the perspective of clock synchronization (also known as time synchronization), multiple nodes in a network system (including master nodes and slave nodes) can be divided into master clock nodes and slave clock nodes. The master clock node is the clock node that publishes the synchronization time, and the slave clock node is the clock node that receives the synchronization time. The slave clock node adjusts its local clock according to the clock deviation to achieve time synchronization with the master clock node.
[0045] A network system can be divided into only one clock domain, meaning that only one master clock node is allowed in the network system, and all other nodes are slave clock nodes. All nodes in the network system need to synchronize their time.
[0046] For application flexibility, the network system can be divided into multiple clock domains. Each clock domain includes a corresponding master clock node and slave clock nodes. The master clock node in each clock domain is responsible for managing the slave clock nodes within that domain. That is, the master clock node in each clock domain only performs time synchronization with the slave clock nodes in that domain.
[0047] In this embodiment of the application, the master node in the network system can be designated as either a master clock node or a slave clock node. Similarly, a child node in the network system can be designated as either a master clock node or a slave clock node.
[0048] In this embodiment of the application, for ease of explanation, intermediate nodes are further defined for daisy-chain and ring-topology networking systems. An intermediate node is a node used to forward the target message between the node initiating the transmission of the target message and the node ending the transmission of the target message during the transmission of the target message in the data transmission link. Specifically, an intermediate node is a node that forwards the target message between the master clock node and the slave clock nodes that need to synchronize their time with the master clock node. The upstream node of the intermediate node is the node that transmitted the target message before the intermediate node, and the downstream node of the intermediate node is the node that transmitted the target message after the intermediate node.
[0049] For ease of explanation, the master clock node, slave clock node, and intermediate node will be described below with reference to Figures 1 and 2.
[0050] Figure 1 is a schematic diagram of a networking system according to an embodiment of this application. As shown in Figure 1, the networking system is a ring topology. The networking system includes a master node, child node 1, child node 2, child node 3, child node 4, child node 5, child node 6, child node 7, and child node 8. The master node, child node 1, child node 2, child node 3, child node 4, child node 5, child node 6, child node 7, and child node 8 are connected sequentially, and child node 8 is connected to the master node to form a ring topology.
[0051] From a time synchronization perspective, this network system is divided into two clock domains. The first clock domain includes a master node, child node 1, child node 6, and child node 8. The master node is designated as master clock node A in the first clock domain. Child nodes 1, 6, and 8 are slave clock nodes managed by master clock node A, and for ease of description, they are referred to as slave clock nodes A1, A2, and A3, respectively. Master clock node A only synchronizes time with slave clock nodes A1, A2, and A3. The second clock domain includes child nodes 2, 3, 4, 5, and 7. Child node 4 is designated as master clock node B in the second clock domain. Child nodes 2, 3, 5, and 7 are slave clock nodes managed by master clock node B, and for ease of description, they are referred to as slave clock nodes B1, B2, B3, and B4, respectively. Master clock node B only synchronizes time with slave clock nodes B1, B2, B3, and B4.
[0052] Taking time synchronization between master clock node A and slave clock node A2 as an example, when master clock node A (i.e., the master node) sends a target message to slave clock node A2 (i.e., child node 6), the target message is sent by master clock node A and transmitted sequentially through child node 1, child node 2, child node 3, child node 4, and child node 5 to slave clock node A2 (i.e., child node 6). Child node 1 to child node 5 are all intermediate nodes. For example, for child node 1, which is an intermediate node, its upstream node is the master node, and its downstream node is child node 2. When slave clock node A2 (i.e., child node 6) sends a target message to master clock node A (i.e., the master node), the target message is transmitted sequentially from slave clock node A2 (i.e., child node 6) through child node 5, child node 4, child node 3, child node 2, and child node 1 to master clock node A (i.e., the master node). Similarly, child node 1 to child node 5 are all intermediate nodes. For child node 1, which is an intermediate node, its upstream node is child node 2, and its downstream node is the master node.
[0053] Furthermore, the data transmission scheme provided in this application embodiment is also applicable to the daisy-chain topology networking system shown in Figure 2. In the networking system shown in Figure 2, the master node, child node 1, child node 2, child node 3, child node 4, child node 5, child node 6, child node 7, and child node 8 are connected sequentially to form a daisy-chain topology. Similar to the ring topology shown in Figure 1, the daisy-chain topology networking system shown in Figure 2 is also exemplaryly divided into two clock domains. The functions of the master clock node, slave clock nodes, and intermediate nodes in the daisy-chain topology shown in Figure 2 are similar to those in the daisy-chain topology networking system shown in Figure 1, and will not be described again here.
[0054] The data transmission scheme provided in this application embodiment is also applicable to a point-to-point topology networking system consisting of two nodes. In a point-to-point topology networking system, there is no intermediate node; one node acts as the master clock node, and the other acts as the slave clock node, and the two synchronize their time.
[0055] It should be understood that Figures 1 and 2 only show examples of one ring topology and one bus topology networking system, respectively. In practical applications, the number of child nodes in the networking system, the number of clock domains that can be divided, and the number of master and slave clock nodes in each clock domain can all be configured as needed.
[0056] Data transmission methods
[0057] Figure 3 is an exemplary flowchart of a data transmission method provided according to an embodiment of this application. This data transmission method is executed by any intermediate node in the network system. It should be understood that an intermediate node does not represent a physically connected intermediate node, but rather a node used to forward the target message between the node that initiates the transmission of the target message and the node that terminates the transmission of the target message during the transmission of the target message in the data transmission link.
[0058] As shown in Figure 3, the data transmission method includes the following steps:
[0059] Step 301: Receive the target message, wherein the destination node of the target message is different from the intermediate node, and the target message is a message used for time synchronization.
[0060] The target message is the message exchanged between the master clock node and the slave clock node in the same clock domain of the network system during time synchronization. In one embodiment, the target message may include a synchronization (sync) message, a delay request (Delay_Req) message, and a delay response (Delay_Resp) message. The sync message is sent from the master clock node to the slave clock node, and the master clock node records the sending time of the sync message. The slave clock node records the receiving time of the sync message. The Delay_Req message is sent from the slave clock node to the master clock node. The slave clock node records the sending time of the Delay_Req message. The master clock node records the receiving time of the Delay_Req message. The Delay_Resp message is sent from the master clock node to the slave clock node. The Delay_Resp message carries the receiving time of the master clock node's reception of the Delay_Req message. In this embodiment, the sync message carries the transmission time of the sync message sent by the master clock node. In another embodiment, the target message may further include a follow-up message. In this embodiment, the sync message does not carry the transmission time of the sync message sent by the master clock node. The follow-up message is used to carry the transmission time of the sync message sent by the master clock node.
[0061] During data transmission, a target message can be transmitted in a network system by being loaded into a data field of a target data packet. A target data packet may include at least one data field. A data field is an area within a data packet used to carry data, typically having a specific length or format. Each data field can be used to load a message. A target message can be loaded into any data field of a target data packet, thereby enabling transmission within the network system. It should be understood that a target message can also be considered as a data subframe within a target data frame transmitted within the network system; this application does not limit the specific form in which the target message is carried.
[0062] In one specific implementation, the target message includes a downlink time message sent from the master clock node to the slave clock node and an uplink time message sent from the slave clock node to the master clock node. The downlink and uplink time messages are used for time synchronization between the master and slave clock nodes. Accordingly, in one implementation of this application, step 301 includes:
[0063] Step 301a: Receive the downlink time message sent by the master clock node to the slave clock node for time synchronization with the master clock node;
[0064] Step 301b: Receive the uplink time message sent from the clock node to the master clock node.
[0065] It should be understood that, in this embodiment, when the target message is a downlink time message sent by the master clock node to the slave clock node, the target node of the target message is the slave clock node. When the target message is an uplink time message sent by the slave clock node to the master clock node, the destination node of the target message is the master clock node. In this embodiment, the downlink time message may include a sync message and a Delay_Resp message. The uplink time message may include a Delay_Req message.
[0066] Step 302: After the first duration since the start of receiving the target message, send the target message to the downstream node of the intermediate node.
[0067] In this context, the downstream nodes of an intermediate node are those that transmit the target message after the intermediate node. A downstream node of an intermediate node may be the target node itself, or it may be another intermediate node used to forward the target message to the target node.
[0068] Since the intermediate node sends the target packet to its downstream node after a first duration from the start of receiving the target packet, the target packet's dwell time in the intermediate node is the first duration. The dwell time is the time difference between the target packet entering and leaving the intermediate node.
[0069] Since the target message resides for the first duration at any intermediate node in the network system, the processing delay of the intermediate node is fixed at the first duration for both uplink and downlink time messages that serve as the target message. Therefore, based on this data transmission scheme, when the master clock node and slave clock node exchange target messages for time synchronization via intermediate nodes, symmetrical uplink and downlink transmissions between the master clock node and slave clock node can be ensured. This allows for accurate time synchronization through a simplified time synchronization process.
[0070] For ease of understanding, the data transmission method provided in this application embodiment will be described below from the perspective of interaction between the master clock node, intermediate nodes, and slave clock nodes, with reference to FIG4. FIG4 shows a master clock node, a slave clock node for time synchronization with the master clock node, and intermediate nodes that are communicatively connected to both the master clock node and the slave clock node. It should be understood that only one intermediate node is shown in FIG4 for ease of explanation; in practical applications, there may be two or more intermediate nodes. As shown in FIG4, the data transmission method includes:
[0071] Step 401: The master clock node sends the first message to the intermediate node.
[0072] The destination node of the first message is the slave clock node, and the first message carries a first timestamp, which is used to indicate the time when the master clock node sent the first message.
[0073] Step 402: The intermediate node receives the first message and sends the first message to the slave clock node after a first duration since the first message was received.
[0074] In this embodiment, only one intermediate node is shown. During downlink time message transmission, the downstream node of the intermediate node is the slave clock node. In other embodiments, multiple intermediate nodes may exist. Each intermediate node sends the first message downlink to its downstream node after a first duration from the start of receiving the first message, until the first message is transmitted to the slave clock node.
[0075] Step 403: Receive the first message from the clock node and determine the second timestamp based on the time of receipt of the first message.
[0076] Step 404: Send the second message from the clock node to the intermediate node.
[0077] The destination node of the second message is the master clock node.
[0078] Step 405: Determine the third timestamp from the clock node based on the sending time of the second message.
[0079] Step 406: The intermediate node receives the second message and sends the first message to the master clock node after a first duration since the second message was first received.
[0080] In this embodiment, only one intermediate node is shown. During the uplink time message transmission, the downstream node of the intermediate node is the master clock node. In other embodiments, multiple intermediate nodes may exist. Each intermediate node sends the second message uplink to its downstream node after a first duration from the start of receiving the second message, until the second message is transmitted to the master clock node.
[0081] Step 407: The master clock node receives the second message and sends the third message to the intermediate node.
[0082] The target node of the third message is the slave clock node, and the third message includes a fourth timestamp, which is used to indicate the time when the master clock node receives the second message.
[0083] Step 408: The intermediate node receives the third message and sends the third message to the slave clock node after the first time interval since it started receiving the third message.
[0084] In this embodiment, only one intermediate node is shown. During downlink time message transmission, the downstream node of the intermediate node is the slave clock node. In other embodiments, multiple intermediate nodes may exist. Each intermediate node sends the third message downlink to its downstream node after a first duration from the start of receiving the third message, until the third message is transmitted to the slave clock node.
[0085] Step 409: Adjust the local clock from the clock node based on the first, second, third, and fourth timestamps to synchronize the time with the master clock node.
[0086] In this embodiment, the master clock node sends a first message to a slave clock node via unicast. To improve bandwidth utilization, in another embodiment of this application, the master clock node sends the first message to multiple or all slave clock nodes in the same clock domain via multicast, wherein the intermediate nodes process the first message in the same way as in this embodiment.
[0087] In this embodiment, the first, second, and third messages are all target messages, with the first and third messages being downlink time messages. For example, the first and third messages can be a sync message and a Delay_Resp message, respectively. The second message is an uplink time message. For example, the second message is a Delay_Req message. The dwell time of the first, second, and third messages at the intermediate nodes is a first duration. That is, the processing delay of the uplink and downlink time messages between the master clock node and the slave clock node is the same at the intermediate nodes, and the uplink and downlink transmission delays between the master clock node and the slave clock node are symmetrical. Therefore, the slave clock node can achieve accurate time synchronization based on the first, second, third, and fourth timestamps obtained through interaction with the master clock node. Compared with traditional schemes where the processing delay of intermediate nodes is not fixed and the dwell time of time messages at each intermediate node needs to be recorded, this greatly simplifies the time synchronization process.
[0088] In the foregoing embodiments, embedding a first timestamp indicating the time of transmission of the first message in the first message requires certain hardware processing to achieve the highest accuracy and precision. To reduce hardware requirements, this application provides another data transmission method. The difference between this embodiment and the foregoing embodiments is that after the master clock node sends the first message to the slave clock node, the master clock node sends a follow-up message to the first message to the slave clock node. Both the first message and the follow-up message target the slave clock node. The follow-up message carries a first timestamp, which indicates the time the master clock node sent the first message, while the first message does not need to carry a first timestamp. Similar to the foregoing embodiments, the master clock node can send the first message and the follow-up message to a slave clock node via unicast. To improve bandwidth utilization, in another embodiment of this application, the master clock node sends the first message and the follow-up message to multiple or all slave clock nodes in the same clock domain via multicast.
[0089] This application embodiment mainly ensures that the intermediate node's processing delay for the target message is fixed by sending the target message to the downstream node of the intermediate node after a first duration from the start of receiving the target message. This achieves symmetrical uplink and downlink transmission between the master clock node and the slave clock node, thereby enabling accurate time synchronization with a simplified time synchronization process. The following two embodiments illustrate how the intermediate node sends the target message to the downstream node of the intermediate node after a first duration from the start of receiving the target message (i.e., step 302).
[0090] In a first embodiment of this application, as shown in FIG5, step 302 includes:
[0091] Step 3021a: During the process of receiving the target message, the indication data included in the target message is received using a preset number of clock cycles, and it is determined whether the indication data meets the matching conditions, wherein the first duration is the preset number of clock cycles.
[0092] Step 3021b: If the indication data does not meet the matching conditions, the target message is sent to the downstream node of the intermediate node.
[0093] In this embodiment, the target message may include indication data and body data. The indication data is located relatively early in the target message, for example, in the header. The indication data is used to indicate key information about the target message. For example, in one implementation, the indication data indicates the target node of the target message. In other implementations, the indication data may also include key information such as whether the data fields of the target message are free and / or the priority of the target message. The body data follows the indication data. The body data typically includes data required for performing time synchronization.
[0094] In this embodiment, when an intermediate node receives the target packet and receives the indication data included in the target packet, it can determine whether to forward the target packet based on whether the indication data meets the matching conditions. That is, during the reception of the target packet, it only needs to cache and parse the indication data in the target packet. When it is determined that the indication data does not meet the matching conditions, the target packet is forwarded to the downstream node of the intermediate node, realizing pipelined data transmission. During pipelined data transmission, the intermediate node only needs a preset number of clock cycles (also called unit buffer time) to complete the caching and parsing of the indication data, thereby determining whether to continue forwarding the target packet.
[0095] For example, in one implementation of this embodiment, the indication data includes a node indication identifier for indicating the destination node. Accordingly, determining whether the indication data meets the matching condition includes: if the node indicated by the node indication identifier is not an intermediate node, then the indication data does not meet the matching condition. That is, during the reception of the target message, when the intermediate node caches the node indication identifier using a preset number of clock cycles and parses and determines that the node indication identifier is not an intermediate node, the target message is forwarded to the downstream node of the intermediate node, achieving efficient transmission of the target message.
[0096] Furthermore, since intermediate nodes use a preset number of clock cycles to cache and parse the indication data to determine whether to continue forwarding the target packet, the processing latency of the intermediate nodes for the target packet is fixed, i.e., the processing latency is the preset number of clock cycles, such as 3 clock cycles, and each clock cycle is typically 60-80 nanoseconds. Because the processing latency of the intermediate nodes for the target packet is fixed and at the nanometer level, when the master clock node and slave clock node exchange target packets via intermediate nodes for time synchronization, symmetrical uplink and downlink transmission between the master clock node and slave clock node can be ensured, thereby achieving precise time synchronization with nanometer-level accuracy.
[0097] In a second embodiment of this application, step 302, as shown in FIG6, includes:
[0098] Step 3022a: Obtain the first moment when receiving the target message begins;
[0099] Step 3022b: After receiving the target message, process the target message to determine whether the target message meets the forwarding conditions;
[0100] Step 3022c: If it is determined that the target message meets the forwarding conditions, the target message is sent to the downstream node of the intermediate node after a preset maximum message processing time has elapsed since the first time, wherein the first time is equal to the preset maximum message processing time.
[0101] In this embodiment, according to the network system requirements, the intermediate nodes are pre-set with a maximum packet processing time. This maximum processing time can be set to be greater than the processing time for any packet handled by the intermediate node. When forwarding a target packet, the intermediate node ensures that the target packet's dwell time at the intermediate node is equal to the maximum processing time.
[0102] When receiving a target packet, the intermediate node obtains the start time of receiving the target packet from the interface as the first moment. After receiving the complete target packet, the control unit connected to the intermediate node, or the control unit built into the intermediate node (such as an MCU or switch), performs parsing and other processing on the target packet to determine whether the target packet meets the forwarding conditions. Forwarding conditions, for example, indicate that the target node of the target packet is not an intermediate node. If it is determined that the target node of the target packet is not an intermediate node, the target packet is sent to the downstream node of the intermediate node after a preset maximum packet processing time after the first moment. This ensures that the processing delay of the intermediate node for the target packet is fixed. This ensures that when the master clock node and the slave clock node exchange target packets through the intermediate node for time synchronization, the uplink and downlink transmissions between the master clock node and the slave clock node are symmetrical, thereby ensuring accurate time synchronization.
[0103] In one implementation of this application embodiment, step 3022b further includes: obtaining the processing time of the target packet as a second duration. The processing time of the target packet includes the entire duration from the start of receiving the target packet to the intermediate node determining that the target packet meets the forwarding conditions. Correspondingly, step 3022c includes: buffering the target packet for a third duration before sending it to the downstream node of the intermediate node, where the third duration is equal to the difference between the preset maximum packet processing time and the second duration.
[0104] Specifically, a buffer unit is set up in the intermediate node. After the intermediate node receives the complete target packet, and the control unit of the intermediate node (such as an MCU or switch) performs parsing and other processing on the target packet to determine whether the target packet meets the forwarding conditions, the processing time of the target packet is obtained as the second duration. If the second duration is less than the preset maximum packet processing time when the target packet meets the forwarding conditions, the target packet can be buffered in the buffer unit for a third duration before being sent to the downstream node of the intermediate node, so as to ensure that the processing delay of the target packet by the intermediate node is the maximum packet processing time.
[0105] The difference between the second embodiment corresponding to steps 3022a, 3022b, and 3022c and the first embodiment corresponding to steps 3021a and 3021b is that, in the process of receiving the target message, the intermediate node in the first embodiment only needs to cache and parse the indication data in the target message. Therefore, the first duration is a preset number of clock cycles. By using this preset number of clock cycles to complete the caching and parsing of the indication data, the target message can be forwarded. However, in the second embodiment, after the intermediate node receives the complete target message, the control unit connected to the intermediate node or the control unit (such as an MCU or switch) built into the intermediate node performs parsing and other processing on the target message to determine whether the target message meets the forwarding conditions. Therefore, the first duration is equal to the preset maximum message processing duration to ensure that all target messages can be determined for forwarding within the maximum message processing duration.
[0106] For ease of understanding, Figure 7 provides an exemplary flowchart of the data transmission method shown in Figure 6. The intermediate node includes a first interface and a second interface, which are, for example, physical interfaces. The intermediate node connects to two adjacent nodes via the first and second interfaces, respectively. When the intermediate node receives a first target message through the first interface, after receiving the complete first target message, it processes the first target message using an MCU or switch to determine whether the first target message meets the forwarding conditions. Assuming the processing time of the first target message is T1, the first target message is sent to the adjacent node via the second interface after being buffered in the delay-aligned buffer for a duration T3, where T3 = T_delay - T1. When the intermediate node receives a second target message through the second interface, after receiving the complete second target message, it processes the second target message using an MCU or switch to determine whether the second target message meets the forwarding conditions. Assuming the processing time of the second target message is T3, the second target message is sent via the first interface after being buffered in the corresponding delay-aligned buffer for a duration T4. Therefore, even when the data processing methods in the two directions are different, it can be ensured that the message processing latency in both directions is consistent.
[0107] In this application embodiment, in order to ensure that the target message is sent on time, in one implementation of this application, before sending the target message to the downstream node of the intermediate node, it is detected whether there are other messages being sent, and the message types of the other messages are different from those of the target message; if there are other messages, the sending of the other messages is stopped.
[0108] In this embodiment, since the processing delay of the intermediate node for the target message is fixed at the maximum message processing time, it ensures symmetrical uplink and downlink transmission between the master clock node and the slave clock node when they exchange target messages via the intermediate node for time synchronization, thereby ensuring accurate time synchronization. Furthermore, compared to pipelined data transmission, this embodiment does not require the intermediate node to have completely identical uplink and downlink time message processing functions between the master and slave clock nodes, and it can achieve relatively accurate time synchronization even in scenarios where the processing delay of the intermediate node for uplink and downlink time messages fluctuates.
[0109] In this embodiment, the data transmission method is implemented based on the physical layer of intermediate nodes, where the physical layer is the lowest layer in network communication. It should be understood that while this data transmission method is implemented based on the physical layer, it does not mean that it only performs the functions that the physical layer can perform as defined in standard protocols. For example, in standard protocols, the physical layer's function is to convert frame signals from higher layers (e.g., the data link layer) into electrical or optical signals that can be transmitted over the physical transmission medium, and to convert electrical or optical signals received from the physical transmission medium into bit streams for processing by higher layers (e.g., the data link layer). The fact that this application's data transmission method is implemented based on the physical layer of intermediate nodes means that the data transmission method in this embodiment does not pass through higher layers (e.g., the data link layer, network layer, etc.) defined in standard physical communication. Instead, it defines a set of transmission methods based on the physical layer, enabling it to perform data processing beyond certain functions that the physical layer can perform as defined in standard protocols. Optionally, the physical transmission medium is, for example, a twisted-pair cable, coaxial cable, or other bus.
[0110] In this embodiment, the data transmission method is implemented based on the physical layer of the intermediate node. Therefore, the processing and transmission of the target message are both performed based on the physical layer of the target node. Since the target message is transmitted by each node based on the physical layer, it does not need to be encapsulated, processed and parsed by higher-level protocols. Therefore, the latency of the intermediate node in forwarding and the latency of the target node in transmission can be reduced.
[0111] In one possible implementation, the target message is sent from the physical layer of the upstream node of the intermediate node to the physical layer of the intermediate node via a first transmission medium, wherein the intermediate node and the upstream node are connected via the first transmission medium. The first transmission medium is a physical transmission medium, such as a coaxial cable or twisted pair, and the twisted pair can be shielded twisted pair or unshielded twisted pair.
[0112] In one specific implementation, the intermediate node is an intermediate chip for data transmission based on the physical layer, and the upstream node is an upstream chip for data transmission based on the physical layer. Based on this, during the process of receiving the target message sent by the upstream chip, the intermediate chip can receive the target message sent by the upstream chip through a first interface, a first transmission medium for connecting the first interface and the second interface, and a second interface, so as to realize that the physical layer of the upstream node of the intermediate node is sent to the physical layer of the intermediate node through the first transmission medium; wherein, the first interface is an interface on the upstream chip for transmitting physical layer data, and the second interface is an interface on the intermediate chip for transmitting physical layer data, and the first interface and the second interface are, for example, physical layer interfaces.
[0113] In this embodiment, when an intermediate node receives a target message, it receives data sent from the physical layer of the upstream node through its own physical layer. Therefore, the transmission of the target message is directly based on the physical layers of both the upstream and intermediate nodes. Compared to data group encapsulation of higher-level or multi-level protocols via an MCU outside the physical layer, the target message does not include multiple protocol headers, resulting in a larger proportion of main data and improved bandwidth utilization for data transmission. Furthermore, since the networking system in this embodiment is a local area network (LAN) communication system, it does not require MAC addresses, and the target message in this embodiment does not require most fields found in PTP protocol messages.
[0114] As shown in Figure 8, in one embodiment of this application, the target message includes a target node number field, a source node number field, a packet type field, and a timestamp field. The target node number field carries the recipient information of the target message; the source node number field carries the sender information of the target message; the packet type field carries the type information of the target message; and the timestamp field carries timestamp information used for time synchronization. As shown in Figure 5, the target node number field, source node number field, and packet type field of the target message each occupy 1B, and the timestamp field occupies 10B. The total size of the target message is only about 13B, which can reduce the bandwidth required by PTP by more than 50%, significantly improving bandwidth utilization. Optionally, the data in the target node number field serves as the indication data in step 3021a, and the data in the other fields serves as the main data of the target message. This significantly improves bandwidth utilization. It should be understood that the data in the target node number field and the source node number field can also be used as indication data; this embodiment of the application does not limit this.
[0115] It should be understood that in other embodiments, the target message also includes a check field. The check field may, for example, employ Cyclic Redundancy Check (CRC). It should be understood that other suitable check methods may be used as needed in practical applications, and this embodiment does not limit this.
[0116] Figure 9 shows a flowchart of another data transmission method provided in an embodiment of this application. This data transmission method uses a first node among two nodes in a network system used for time synchronization. The first node can be either of the two nodes. As shown in Figure 9, the method includes:
[0117] Step 901: Obtain the target message to be sent to the second node, where the second node is the other of the two nodes used for time synchronization in the network system, and the target message is the message used for time synchronization.
[0118] In this embodiment, the target message to be sent to the second node can be generated and sent to the first node by the control unit (e.g., MCU or switch) of the first node. The control unit of the first node can be a control unit connected to the first node, or it can be a control unit internal to the first node.
[0119] In this embodiment, the first node can be either a master clock node or a slave clock node, and correspondingly, the second node can be either a slave clock node or a master clock node.
[0120] For example, in one embodiment of this application, the first node is the master clock node and the second node is the slave clock node. Accordingly, step 901 includes: the master clock node acquiring a downlink time message to be sent to the slave clock node. The downlink time message is used for time synchronization between the master clock node and the slave clock node. For example, the downlink time message includes a sync message and a Delay_Resp message.
[0121] For example, in another embodiment of this application, the first node is a slave clock node and the second node is a master clock node. Accordingly, step 901 includes: obtaining an uplink time message to be sent to the master clock node from the slave clock node. The uplink time message is used for time synchronization between the master clock node and the slave clock node. For example, the uplink time message includes a Delay_Req message.
[0122] Step 901: Delay the target message for a second duration and send it to the second node, and generate the first timestamp information. The first timestamp information is used to indicate the time when the target message was sent.
[0123] The second duration is set so that the message transmission delay of the first node is the same as that of the second node. The message transmission delay of a node refers to the time elapsed between the first moment when the node obtains the message and the second moment when the node sends the message via the physical interface.
[0124] In this embodiment, the first node is equipped with a caching unit. When the first node obtains a target packet, it can cache the target packet in the caching unit for a second duration. Afterward, the first node sends the target packet to the second node and generates a first timestamp based on the sending time of the target packet. Since the second duration is set so that the packet sending delay of the first node is the same as that of the second node, their packet sending delays are symmetrical. This allows the first timestamp generated based on the sending time of the target packet to achieve more accurate time synchronization between the first and second nodes.
[0125] For example, if it takes 1000ns for the first node to send a message to the second node, and 1240ns for the second node to send a message to the first node, then the second duration can be set to 240ns. When the first node obtains the target message to be sent to the second node, it can buffer the target message for 240ns before sending it to the second node. This ensures that the message transmission delay between the first and second nodes is 1240ns, guaranteeing symmetry in message transmission delay between the first and second nodes, thereby ensuring accurate time synchronization between them.
[0126] In a point-to-point topology network system, when the master clock node and the slave clock node are synchronizing time, the data transmission method provided in this application embodiment can ensure that the message transmission delays of the master clock node and the slave clock node are symmetrical. This ensures that the timestamp information recorded when sending and receiving sync messages, Delay_Resp messages and Delay_Req messages can accurately achieve time synchronization between the first node and the second node.
[0127] Figure 10 shows a flowchart of another data transmission method provided in an embodiment of this application. This data transmission method uses a third node from two nodes in a network system used for time synchronization. The third node can be either of the two nodes. As shown in Figure 10, the method includes:
[0128] Step 1001: Receive the target message sent by the fourth node, where the fourth node is the other of the two nodes, and the target message is a message used for time synchronization.
[0129] In this embodiment, the third node can be either the master clock node or the slave clock node, and correspondingly, the fourth node can be either the slave clock node or the master clock node.
[0130] In one implementation of this application, the fourth node is the master clock node and the third node is the slave clock node. Step 1001 includes: the slave clock node receiving a downlink time message sent by the master clock node. The downlink time message is used for time synchronization between the master clock node and the slave clock node. For example, the downlink time message includes a sync message and a Delay_Resp message.
[0131] In another implementation of this application, the fourth node is a slave clock node and the third node is the master clock node. Receiving the target message sent by the third node includes: the master clock node receiving an uplink time message sent by the slave clock node. The uplink time message is used for time synchronization between the master clock node and the slave clock node. For example, the uplink time message includes a Delay_Req message.
[0132] Step 1002: Generate a second timestamp after the third time interval since the start of receiving the target message. The second timestamp is used to indicate the time of receiving the target message.
[0133] The third duration is configured such that the message reception delay of the third node is the same as that of the fourth node. The message reception delay of a node refers to the time from the third moment when the node begins receiving messages via the physical interface to the fourth moment when the node parses and determines the destination node of the message.
[0134] In this embodiment, since the third duration is configured such that the message reception delay of the third node is the same as that of the fourth node, the message reception delay of the third node is symmetrical with that of the fourth node. This allows the second timestamp information generated based on the reception time of the target message to achieve more accurate time synchronization between the third node and the fourth node.
[0135] For example, if the delay for the third node to receive a message is 1000ns and the delay for the fourth node is 1240ns, then the third duration can be set to 240ns. When the third node receives the target message, it generates a second timestamp 240ns after receiving the target message to indicate the time of receipt. This is equivalent to delaying the time of receipt of the target message by 240ns, ensuring symmetry in message reception delays between the third and fourth nodes, thereby ensuring accurate time synchronization between them.
[0136] In one implementation of this application, step 1002 includes:
[0137] During the process of receiving the target message, the indication data included in the target message is received using a preset number of clock cycles, and it is determined whether the indication data meets the matching conditions. The third duration is the preset number of clock cycles.
[0138] If the indicated data meets the matching conditions, a second timestamp is generated.
[0139] Similar to the previous embodiments, in this embodiment, the target message may include indication data and body data. The indication data is located relatively early in the target message, for example, in the header. The indication data is used to indicate key information about the target message. For example, in one implementation, the indication data indicates the target node of the target message. In other implementations, the indication data may also include key information such as whether the data fields of the target message are free and / or the priority of the target message. The body data follows the indication data. The body data typically includes data required for performing time synchronization.
[0140] In this embodiment, during the process of receiving the target message, the third node uses a preset number of clock cycles to receive and parse the indication data of the target message. When the parsing determines that the indication data meets the matching conditions, a second timestamp is generated to indicate the reception time of the target message.
[0141] For example, in one implementation of this embodiment, the indication data includes a node indication identifier for indicating the destination node. Accordingly, determining whether the indication data meets the matching condition includes: if the node indicated by the node indication identifier is a third node, then the indication data is determined to meet the matching condition. That is, during the process of receiving the target message, when the third node caches the node indication identifier using a preset number of clock cycles and parses and determines that the node indication identifier is a third node, a second timestamp is generated.
[0142] In this embodiment, a preset number of clock cycles can determine the duration required for the third and fourth nodes to have the same message reception delay. Since the clock cycle is measured in nanometers, this allows the third and fourth nodes to achieve precise time synchronization with an accuracy at the nanometer level.
[0143] It should be understood that in the embodiments of this application, the two nodes used for time synchronization can combine the two data transmission methods shown in Figures 9 and 10 to ensure symmetrical transmission and reception delays between the two nodes. For example, the first node in the embodiment shown in Figure 9 can implement the operation of the third node in the embodiment shown in Figure 10 when receiving the target message, and the third node in the embodiment shown in Figure 10 can implement the operation of the first node in the embodiment shown in Figure 9 when sending the target message.
[0144] Networking System
[0145] This application also provides a networking system. The networking system includes: a master clock node, slave clock nodes belonging to the same clock domain as the master clock node, and at least one intermediate node communicatively connected to both the master clock node and the slave clock nodes.
[0146] The master clock node is used to send downlink time messages to the slave clock nodes via intermediate nodes.
[0147] The slave clock node is used to send uplink time messages to the master clock node via intermediate nodes;
[0148] Intermediate nodes are used to receive any target message from downlink time messages and uplink time messages, and after a first duration from the start of receiving the target message, send the target message to the corresponding downstream node of the intermediate node.
[0149] In one implementation, the intermediate node is specifically used to: receive indication data included in the target message and determine whether the indication data meets the matching conditions using a preset number of clock cycles during the process of receiving any target message from the downlink time message and the uplink time message, wherein the first duration is the preset number of clock cycles; if the indication data does not meet the matching conditions, the target message is sent to the corresponding downstream node of the intermediate node.
[0150] In one implementation, the indication data includes a node indication identifier for indicating the destination node and intermediate nodes, specifically used to: if the node indicated by the node indication identifier is not an intermediate node, then determine that the indication data does not meet the matching conditions.
[0151] In one implementation, the intermediate node is specifically used to: obtain the first moment when receiving any target message from the downlink time message and the uplink time message; after completing the reception of the time message, process the target message to determine whether the target message meets the forwarding conditions; if the target message meets the forwarding conditions, send the target message to the corresponding downstream node of the intermediate node after a preset maximum message processing time has elapsed since the first moment, wherein the first time is equal to the preset maximum message processing time.
[0152] In one implementation, the intermediate node is specifically used to: obtain the processing time of the target message as the second duration; and send the target message to the downstream node of the intermediate node after caching it for a third duration, whereby the third duration is equal to the difference between the preset maximum message processing time and the second duration.
[0153] In one implementation, the intermediate node is specifically used to: detect whether there are other messages being sent before sending the target message to the downstream node of the intermediate node, and whether the other messages have a different message type than the target message; if there are other messages, then stop sending the other messages.
[0154] In one implementation, the network system is divided into multiple clock domains, each of which includes a corresponding master clock node and slave clock nodes. The master clock node in each clock domain synchronizes its time with the slave clock node in that clock domain.
[0155] In one implementation, the master clock node is specifically used for:
[0156] The first message sent from the intermediate node to the slave clock node carries a first timestamp, which indicates the time when the master clock node sent the first message; and
[0157] In response to receiving the second message, a third message is sent from the intermediate node to the slave clock node. The third message includes a fourth timestamp, which is used to indicate the time when the master clock node receives the second message. The second message is a message sent from the slave clock node to the master clock node in response to receiving the first message.
[0158] From the clock node, specifically used for:
[0159] The second timestamp is determined based on the time the first message was received;
[0160] In response to receiving the first message, a second message is sent to the master clock node via the intermediate node, and a third timestamp is determined based on the sending time of the second message;
[0161] Time synchronization between the master clock node and the slave clock node is performed based on the first, second, third, and fourth timestamps.
[0162] Among them, the dwell time of the first message, the second message, and the third message at the intermediate node is the first duration.
[0163] In one implementation, to save bandwidth, the master clock node is used to send the first message to multiple slave clock nodes in the same clock domain via intermediate nodes in a multicast manner.
[0164] In one implementation, to reduce the hardware requirements of the master clock node, the master clock node is specifically used for:
[0165] The first message sent from the intermediate node to the clock node;
[0166] A follow-up message to the first message is sent from the intermediate node to the clock node. This follow-up message carries a first timestamp, which indicates the time the master clock node sent the first message; and
[0167] In response to receiving the second message, a third message is sent from the intermediate node to the slave clock node. The third message includes a fourth timestamp, which is used to indicate the time when the master clock node receives the second message. The second message is a message sent from the slave clock node to the master clock node in response to receiving the first message.
[0168] From the clock node, specifically used for:
[0169] The second timestamp is determined based on the time the first message was received;
[0170] In response to receiving the first message, a second message is sent to the master clock node via the intermediate node, and a third timestamp is determined based on the sending time of the second message;
[0171] Time synchronization between the master clock node and the slave clock node is performed based on the first, second, third, and fourth timestamps.
[0172] Among them, the dwell time of the first message, the following message, the second message, and the third message at the intermediate node is the first duration.
[0173] In one implementation, to save bandwidth, the master clock node is used to send the first message and follow-up messages to multiple slave clock nodes in the same clock domain via intermediate nodes in a multicast manner.
[0174] In one implementation, the target message includes a target node number field, a source node number field, a packet type field, and a timestamp field. The target node number field carries the recipient information of the target message; the source node number field carries the sender information of the target message; the packet type field carries the type information of the target message; and the timestamp field carries timestamp information used for time synchronization. The target message provided in this embodiment can reduce the bandwidth required by more than 50% compared to PTP messages, significantly improving bandwidth utilization.
[0175] In one implementation, the networking system can take various forms such as ring topology, daisy chain topology, or linear topology.
[0176] This application also provides another networking system, which includes: a first node and a second node for time synchronization.
[0177] The first node is used for:
[0178] Obtain the target message to be sent to the second node; the target message is used for time synchronization.
[0179] The target message is sent to the second node after a second delay and a first timestamp is generated. The second delay is set so that the message sending delay of the first node is the same as that of the second node.
[0180] The second node is used for:
[0181] Receive the target message;
[0182] A second timestamp is generated from the start of receiving the target message. The second timestamp is used to indicate the time when the target message was received.
[0183] In one implementation of this application, the first node is the master clock node and the second node is the slave clock node, wherein the master clock node and the slave clock node belong to the same clock domain.
[0184] The first node is the slave clock node and the second node is the master clock node, wherein the master clock node and the slave clock node belong to the same clock domain.
[0185] The networking system provided in this application embodiment is applicable to the data transmission method shown in Figure 9. The operations performed by the first node and the second node in this application embodiment and the beneficial effects achieved can be referred to the data transmission method shown in Figure 9, and will not be described in detail here.
[0186] Furthermore, the first node and the second node in the networking system provided in this application embodiment can also combine to execute the data transmission methods shown in Figures 9 and 10 to achieve symmetrical message transmission and reception delays between the first node and the second node, thereby achieving accurate time synchronization.
[0187] In one implementation, the networking system can take various forms, such as point-to-point topology, ring topology, daisy chain topology, or linear topology.
[0188] This application also provides another networking system, which includes a third node and a fourth node for time synchronization.
[0189] The fourth node is used for:
[0190] Obtain the target message to be sent to the third node; the target message is used for time synchronization.
[0191] Send the target message to the third node and generate the first timestamp information, which is used to indicate the time when the target message was sent;
[0192] The third node is used for:
[0193] Receive the target message;
[0194] A second timestamp is generated three time intervals after the start of receiving the target message. The second timestamp is used to indicate the time when the target message was received.
[0195] In one implementation, the third node is specifically used for:
[0196] During the process of receiving the target message, the indication data included in the target message is received using a preset number of clock cycles, and it is determined whether the indication data meets the matching conditions. The third duration is the preset number of clock cycles.
[0197] If the indicated data meets the matching conditions, a second timestamp is generated.
[0198] In one implementation, the third node is specifically used to: determine that the indicated data meets the matching conditions if the node indicated by the node indicator is the target node.
[0199] In one implementation of this application, the third node is the master clock node and the fourth node is the slave clock node, wherein the master clock node and the slave clock node belong to the same clock domain.
[0200] The third node is the slave clock node and the fourth node is the master clock node. The master clock node and the slave clock node belong to the same clock domain.
[0201] The networking system provided in this application embodiment is applicable to the data transmission method shown in Figure 10. The operations performed by the third node and the fourth node in this application embodiment and the beneficial effects achieved can be referred to the data transmission method shown in Figure 10, which will not be described in detail here.
[0202] Furthermore, the third and fourth nodes in the networking system provided in this application embodiment can also combine to execute the data transmission methods shown in Figures 9 and 10 to achieve symmetrical message transmission and reception delays between the third and fourth nodes, thereby achieving accurate time synchronization.
[0203] In one implementation, the networking system can take various forms, such as point-to-point topology, ring topology, daisy chain topology, or linear topology.
[0204] chip
[0205] Figure 11 is a schematic block diagram of a chip provided in an embodiment of this application. Specific embodiments of this application do not limit the specific implementation of the chip. As shown in Figure 11, the chip may include: a processor 902 and a memory unit 906. Wherein:
[0206] The processing unit 1102 and the storage unit 1106 communicate with each other.
[0207] The processing unit 1102 is used to execute program 1110, which can specifically execute the relevant steps in any of the aforementioned data transmission method embodiments.
[0208] Specifically, program 1110 may include program code that includes computer operation instructions.
[0209] The processing unit 1102 may be an application-specific integrated circuit (ASIC) or one or more integrated circuits configured to implement the embodiments of this application.
[0210] Storage unit 1106 is used to store program 1110. Optionally, storage unit 1106 may include a high-speed RAM storage unit, and may also include a non-volatile storage unit, such as at least one disk storage unit.
[0211] Specifically, program 1110 can be used to cause processing unit 1102 to execute the data transmission method in any of the foregoing embodiments.
[0212] The specific implementation of each step in program 1110 can be found in the corresponding steps and units described in any of the foregoing data transmission method embodiments, and will not be repeated here. Those skilled in the art will clearly understand that, for the sake of convenience and brevity, the specific working process of the devices and modules described above can be referred to the corresponding process descriptions in the foregoing method embodiments, and will not be repeated here.
[0213] With the chip in this application embodiment, when the target node receives the target data packet, it only needs to receive the indication data included in the target data group in the target data packet to start caching the indication data and determine whether the indication data meets the matching conditions. If the matching conditions are met, the target data group is updated; if the matching conditions are not met, the target data group is received normally. Therefore, the target data group in the target data packet includes indicator data. The target node only needs to determine whether the indicator data meets the matching conditions after receiving it to determine whether the target node needs to update the current target data group. In other words, in the actual process of receiving the entire target data group, we only need to cache and parse the indicator data in the target data group, instead of completely caching and parsing all the data in the entire target data group before determining whether to update the target data group. After determining that the target data group needs to be updated, the target node can update the target data group during the process of receiving the target data packet. Compared with related technologies, where the target node can only determine whether to update the target data group after receiving and caching the complete target data packet, and then update the target data group after determining that the target data group needs to be updated, the target node in this embodiment only needs to cache and parse the indicator data to determine whether to update the target data group, and then update the target data group during the process of receiving the target data packet after determining that the target data group needs to be updated. It also does not need to cache data other than the indicator data, so that data transmission based on the target node can be carried out quickly and efficiently, reducing the latency of data transmission based on the target node.
[0214] Computer storage media
[0215] This application also provides a computer-readable storage medium storing instructions for causing a machine to perform the data transmission method as described herein. Specifically, a system or apparatus equipped with a storage medium storing software program code that implements the functions of any of the embodiments described above, and enabling the computer (or CPU or MPU) of the system or apparatus to read and execute the program code stored in the storage medium.
[0216] In this case, the program code read from the storage medium can itself implement the function of any of the above embodiments, and therefore the program code and the storage medium storing the program code constitute part of this application.
[0217] Examples of storage media used to provide program code include floppy disks, hard disks, magneto-optical disks, optical disks (such as CD-ROM, CD-R, CD-RW, DVD-ROM, DVD-RAM, DVD-RW, DVD+RW), magnetic tapes, non-volatile memory cards, and ROMs. Alternatively, program code can be downloaded from a server computer via a communication network.
[0218] It should be noted that the user-related information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to sample data used for training the model, data used for analysis, stored data, displayed data, etc.) involved in the embodiments of this application are all information and data authorized by the user or fully authorized by all parties. Furthermore, the collection, use and processing of related data must comply with the relevant laws, regulations and standards of the relevant countries and regions, and corresponding operation entry points are provided for users to choose to authorize or refuse.
[0219] Those skilled in the art will recognize that the units and method steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for specific applications, but such implementations should not be considered beyond the scope of the embodiments of this application.
[0220] The above embodiments are only used to illustrate the embodiments of this application, and are not intended to limit the embodiments of this application. Those skilled in the art can make various changes and modifications without departing from the spirit and scope of the embodiments of this application. Therefore, all equivalent technical solutions also fall within the scope of the embodiments of this application, and the patent protection scope of the embodiments of this application should be defined by the claims.
Claims
1. A data transmission method, characterized in that, The method, applied to any intermediate node in a network system, includes: Receive a target message, wherein the destination node of the target message is different from the intermediate node, and the target message is a message used for time synchronization; After a first duration following the start of receiving the target message, the target message is sent to the downstream node of the intermediate node.
2. The method according to claim 1, characterized in that, The step of sending the target message to the downstream node of the intermediate node after a first duration from the start of receiving the target message includes: During the process of receiving the target message, the indication data included in the target message is received using a preset number of clock cycles, and it is determined whether the indication data meets the matching conditions, wherein the first duration is the preset number of clock cycles. If the indicated data does not meet the matching conditions, the target message is sent to the downstream node of the intermediate node.
3. [Correction 17.01.2025 according to Rule 91] The method according to claim 2, characterized in that, The indication data includes node indication identifiers used to indicate the purpose. Determining whether the indication data meets the matching conditions includes: If the node indicated by the node indicator is not the intermediate node, then the indicator data is determined not to meet the matching condition.
4. [Revised according to Rule 91, 17.01.2025] The method according to claim 1, characterized in that, The step of sending the target message to the downstream node of the intermediate node after a first duration from the start of receiving the target message includes: Obtain the first moment when receiving the target message begins; After receiving the target message, the target message is processed to determine whether the target message meets the forwarding conditions. If it is determined that the target message meets the forwarding conditions, then the target message is sent to the downstream node of the intermediate node after a preset maximum message processing time has elapsed since the first time, wherein the first time is equal to the preset maximum message processing time.
5. The method according to claim 4, characterized in that, The step of processing the target packet to determine whether the target packet meets the forwarding conditions further includes: The processing time of the target message is obtained as the second duration; The step of sending the target message to the downstream node of the intermediate node after a preset maximum message processing time has elapsed since the first moment includes: The target message is buffered for a third duration and then sent to the downstream node of the intermediate node. The third duration is equal to the difference between the preset maximum message processing duration and the second duration.
6. The method according to any one of claims 1-5, characterized in that, The received target message includes: Receive downlink time messages sent by the master clock node to slave clock nodes for time synchronization with the master clock node; and Receive the uplink time message sent from the clock node to the master clock node. The downlink time message and the uplink time message are used for time synchronization between the master clock node and the slave clock node.
7. The method according to claim 6, characterized in that, The network system is divided into multiple clock domains. Each clock domain includes a corresponding master clock node and slave clock nodes. The master clock node in each clock domain synchronizes its time with the slave clock node in that clock domain.
8. The method according to claim 6, characterized in that, The receiving of downlink time messages from the master clock node to the slave clock node used for time synchronization with the master clock node includes: Receive a first message sent by the master clock node to the slave clock node, the first message carrying a first timestamp, the first timestamp indicating the time when the master clock node sent the first message; and The master clock node receives a third message sent to the slave clock node in response to receiving the second message. The third message includes a fourth timestamp, which indicates the time when the master clock node receives the second message. The second message is a message sent by the slave clock node to the master clock node in response to receiving the first message. Receiving the uplink time message sent from the slave clock node to the master clock node includes: The slave clock node receives a second message sent to the master clock node in response to receiving the first message, wherein the first message is used to determine a second timestamp at the time of reception by the slave clock node, and the second message is used to determine a third timestamp at the time of transmission by the slave clock node. The first timestamp, the second timestamp, the third timestamp, and the fourth timestamp are used for time synchronization between the master clock node and the slave clock node.
9. The method according to claim 6, characterized in that, The receiving of downlink time messages from the master clock node to the slave clock node includes: Receive the first message sent by the master clock node to the slave clock node; Receive a follow-up message to the first message sent by the master clock node to the slave clock node, the follow-up message carrying a first timestamp, the first timestamp indicating the time when the master clock node sent the first message; and The master clock node receives a third message sent to the slave clock node in response to receiving the second message. The third message includes a fourth timestamp, which indicates the time when the master clock node receives the second message. The second message is a message sent by the slave clock node to the master clock node in response to receiving the first message. Receiving the uplink time message sent from the slave clock node to the master clock node includes: The slave clock node receives a second message sent to the master clock node in response to receiving the first message, wherein the first message is used to determine a second timestamp at the time of reception by the slave clock node, and the second message is used to determine a third timestamp at the time of transmission by the slave clock node. The first timestamp, the second timestamp, the third timestamp, and the fourth timestamp are used for time synchronization between the master clock node and the slave clock node.
10. The method according to claim 8 or 9, characterized in that, The first message is a message sent by the master clock node to multiple slave clock nodes in the same clock domain in a multicast manner.
11. The method according to claims 1-5, characterized in that, The target message includes a target node number field, a source node number field, a packet type field, and a timestamp field. The target node number field is used to carry the recipient information of the target message; The source node number field is used to carry the sender information of the target message; The packet type field is used to carry the type information of the target message; The timestamp field is used to carry timestamp information for time synchronization.
12. A data transmission method, characterized in that, The first node in a network system used for time synchronization includes: Obtain the target message to be sent to the second node, wherein the second node is the other of the two nodes, and the target message is a message used for time synchronization; The target message is sent to the second node after a second delay and a first timestamp is generated. The first timestamp is used to indicate the time of transmission of the target message. The second delay is set so that the message transmission delay of the first node is the same as that of the second node.
13. The method according to claim 12, characterized in that, The first node is the master clock node and the second node is the slave clock node. The step of obtaining the target message to be sent to the target node includes: the master clock node obtaining the downlink time message to be sent to the slave clock node; or... The first node is a slave clock node and the second node is a master clock node. The step of obtaining the target message to be sent to the target node includes: obtaining the uplink time message to be sent to the master clock node from the slave clock node. The downlink time message and the uplink time message are used for time synchronization between the master clock node and the slave clock node.
14. A data transmission method, characterized in that, The method, applied to a third node in a network system for time synchronization, includes: Receive a target message sent by a fourth node, wherein the fourth node is the other of the two nodes, and the target message is a message used for time synchronization; A second timestamp is generated three time intervals after the start of receiving the target message. The second timestamp is used to indicate the time of receiving the target message. The third time interval is set such that the message receiving delay of the fourth node is the same as the message receiving delay of the third node.
15. The method according to claim 14, characterized in that, The generation of the second timestamp information after a third time interval from the start of receiving the target message includes: During the process of receiving the target message, the indication data included in the target message is received using a preset number of clock cycles, and it is determined whether the indication data meets the matching conditions, wherein the third duration is the preset number of clock cycles; If the indicated data meets the matching condition, then the second timestamp information is generated.
16. The method according to claim 15, characterized in that, The indication data includes a node indication identifier used to indicate the destination node of the target message. Determining whether the indication data meets the matching conditions includes: If the node indicated by the node indicator is the third node, then the indicator data is determined to meet the matching condition.
17. The method according to claim 15, characterized in that, The fourth node is the master clock node and the third node is the slave clock node. Receiving the target message sent by the fourth node includes: the slave clock node receiving a downlink time message sent by the master clock node; or... The fourth node is a slave clock node and the third node is a master clock node. Receiving the target message sent by the fourth node includes: the master clock node receiving the uplink time message sent by the slave clock node.
18. A networking system, characterized in that, include: A master clock node, a slave clock node belonging to the same clock domain as the master clock node, and at least one intermediate node that is communicatively connected to the master clock node and the slave clock node respectively; The master clock node is used to send downlink time messages to the slave clock node via the intermediate node; The slave clock node is used to send an uplink time message to the master clock node via the intermediate node; The intermediate node is configured to receive any target message from the downlink time message and the uplink time message, and after a first duration from the start of receiving the target message, send the target message to the corresponding downstream node of the intermediate node.
19. The networking system according to claim 18, characterized in that, The intermediate node is specifically used for: During the process of receiving any target message from the downlink time message and the uplink time message, the indication data included in the target message is received using a preset number of clock cycles, and it is determined whether the indication data meets the matching conditions, wherein the first duration is the preset number of clock cycles. If the indicated data does not meet the matching conditions, the target message is sent to the corresponding downstream node of the intermediate node.
20. The networking system according to claim 19, characterized in that, The indication data includes a node indication identifier for indicating the destination node, and the intermediate node is specifically used for: If the node indicated by the node indicator is not the intermediate node, then the indicator data is determined not to meet the matching condition.
21. The networking system according to claim 18, characterized in that, The intermediate node is specifically used for: The first moment when receiving any target message from the downlink time message and the uplink time message is obtained; After receiving the time message, the target message is processed to determine whether the target message meets the forwarding conditions. If it is determined that the target message meets the forwarding conditions, then the target message is sent to the corresponding downstream node of the intermediate node after a preset maximum message processing time has elapsed since the first time, wherein the first time is equal to the preset maximum message processing time.
22. The networking system according to claim 21, characterized in that, The intermediate node is specifically used for: The processing time of the target message is obtained as the second duration; The target message is buffered for a third duration and then sent to the downstream node of the intermediate node. The third duration is equal to the difference between the preset maximum message processing duration and the second duration.
23. The networking system according to any one of claims 18-22, characterized in that, The network system is divided into multiple clock domains. Each clock domain includes a corresponding master clock node and slave clock nodes. The master clock node in each clock domain synchronizes its time with the slave clock node in that clock domain.
24. The networking system according to any one of claims 18-22, characterized in that, The master clock node is specifically used for: A first message sent from the intermediate node to the slave clock node, the first message carrying a first timestamp, the first timestamp being used to indicate the time when the master clock node sent the first message; and In response to receiving the second message, a third message is sent from the intermediate node to the slave clock node, the third message including a fourth timestamp, the fourth timestamp being used to indicate the time when the master clock node receives the second message, the second message being a message sent by the slave clock node to the master clock node in response to receiving the first message; The slave clock node is specifically used for: The second timestamp is determined based on the time the first message was received; In response to receiving the first message, the second message is sent to the master clock node via the intermediate node, and a third timestamp is determined based on the sending time of the second message; Time synchronization between the master clock node and the slave clock node is performed based on the first timestamp, the second timestamp, the third timestamp, and the fourth timestamp. The dwell time of the first message, the second message, and the third message at the intermediate node is the same as the first duration.
25. The networking system according to any one of claims 18-22, characterized in that, The master clock node is specifically used for: The first message sent from the intermediate node to the clock node; A follow-up message to the first message is sent to the clock node via the intermediate node. The follow-up message carries a first timestamp, which is used to indicate the time when the master clock node sent the first message. and In response to receiving the second message, a third message is sent from the intermediate node to the slave clock node, the third message including a fourth timestamp, the fourth timestamp being used to indicate the time when the master clock node receives the second message, the second message being a message sent by the slave clock node to the master clock node in response to receiving the first message; The slave clock node is specifically used for: The second timestamp is determined based on the time the first message was received; In response to receiving the first message, the second message is sent to the master clock node via the intermediate node, and a third timestamp is determined based on the sending time of the second message; Time synchronization between the master clock node and the slave clock node is performed based on the first timestamp, the second timestamp, the third timestamp, and the fourth timestamp. The dwell time of the first message, the following message, the second message, and the third message at the intermediate node is the same as the first duration.
26. The networking system according to any one of claims 18-22, characterized in that, The master clock node is used for: The first message is sent via multicast to multiple slave clock nodes in the same clock domain through the intermediate node.
27. The networking system according to any one of claims 18-22, characterized in that, The target message includes a target node number field, a source node number field, a packet type field, and a timestamp field. The target node number field is used to carry the recipient information of the target message; The source node number field is used to carry the sender information of the target message; The packet type field is used to carry the type information of the target message; The timestamp field is used to carry timestamp information for time synchronization.
28. A chip, comprising: The processing unit and the storage unit communicate with each other. The storage unit is used to store at least one executable instruction, which causes the processing unit to perform an operation corresponding to the method as described in any one of claims 1-11, or an operation corresponding to the method as described in any one of claims 12-13, or an operation corresponding to the method as described in any one of claims 14-17.
29. A computer storage medium having a computer program stored thereon, which, when executed by a processor, implements the method as claimed in any one of claims 1-11, or the method as claimed in any one of claims 12-13, or the method as claimed in any one of claims 14-17.
Citation Information
Patent Citations
Method, system and device for time synchronous transfer
CN101515831A
Clock synchronization method, equipment and system
CN102111258A
Processing method and device for time synchronization message
CN106549724A
Time synchronization processing method and device, storage medium and electronic device
CN117062209A
Synchronized data network system, and method for initializing and synchronizing same
WO2024017947A2