Chain type TSN bus transmission system and transmission method
By adopting a chain TSN bus transmission system in the TSN network, using a combined structure of chain links and ring links, combining spanning tree corruption protocols, time synchronization protocols, interrupt triggering or time synchronization time triggering methods, the existing TSN star networking methods have solved the shortcomings in transmission rate, load capacity, etc., and achieved more efficient data transmission.
Patent Information
- Application Number
- CN202411812111.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-10
- Publication Date
- 2025-03-25
AI Technical Summary
The existing star networking method based on time-sensitive networks (TSN) has difficult challenges in the problems of multi-node concurrent transmission conflicts, low transmission rates, and limited load capacity, especially under the needs of high bandwidth data transmission.
A chain TSN bus transmission system is adopted to form a chain link through multiple TSN nodes through wired or wireless connections, and a ring link is formed between the head and tail nodes of the chain link. The first TSN node is connected to the time reference device. The system transmits data through spanning tree corruption protocol, time synchronization protocol, interrupt trigger or time synchronization time trigger.
The transmission rate, fault tolerance, delay certainty, time synchronization and centralized control functions of the bus are improved, and the problem of limited load capacity caused by insufficient drive is solved.
Smart Images

Figure CN119696955A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of network communications, and in particular to a chained TSN bus transmission system and a transmission method. Background Art
[0002] Existing transmission systems based on the time-sensitive network (TSN) bus usually adopt a star networking method, which requires switches. Each node exchanges data through the switch, and applies TSN traffic shaping and scheduling algorithms in the nodes and switches to achieve end-to-end delay deterministic transmission. Star networking is difficult to deploy in scenarios with strict volume requirements and a large number of nodes, and there are the following problems: the quality of low-priority data transmission cannot be guaranteed due to conflicts in concurrent transmission of multiple nodes; the transmission rate is low, which is difficult to meet the needs of high-bandwidth data such as audio and video, infrared, and radar; the bus driving force restricts the number of nodes that can be mounted on the bus, and usually the number of nodes does not exceed 32 at full rate. Summary of the invention
[0003] The present disclosure provides a chained TSN bus transmission system and transmission method, device and storage medium.
[0004] According to a first aspect of the present disclosure, a chained TSN bus transmission system is provided. The system comprises:
[0005] A plurality of TSN nodes, wherein each TSN node is connected in series to form a chain link through a wired or wireless connection mode, the first and last TSN nodes in the chain link are connected through a wired or wireless connection mode to form a ring network link, and the first TSN node is connected to a time reference device.
[0006] According to a second aspect of the present disclosure, a chained TSN bus transmission method is provided. The method comprises:
[0007] Each TSN node is powered on and initialized;
[0008] Read the currently configured network parameters and calculate the data sending time of each TSN node according to the network parameters;
[0009] Execute a spanning tree destruction protocol to block data transmission in one direction of the ring network link when the ring network link is normal, and release the blockage when the ring network link is abnormal;
[0010] Based on the master clock in the time reference device, the time is synchronized according to the time synchronization protocol;
[0011] After completing the time synchronization, the data transmission and reception task cycle is entered, and data transmission is carried out using interrupt triggering or time synchronization moment triggering according to the respective data sending time.
[0012] In some implementations of the second aspect, the network parameters include the number of TSN nodes currently configured, a message cycle, and a sequence number of each TSN node;
[0013] The calculating the data sending time of each TSN node according to the network parameters includes:
[0014] Calculate the time slot of each TSN node according to the number of TSN nodes and message cycle currently configured;
[0015] According to the time slot of each TSN node and the sequence number of each TSN node, the data sending time of each TSN node is calculated.
[0016] In some implementations of the second aspect, the step of synchronizing time based on a time synchronization protocol and taking a master clock in a time reference device as a reference includes:
[0017] According to the time synchronization protocol, the first TSN node receives the time synchronization message sent by the master clock in the time reference device, records the receiving timestamp, and adjusts its own time according to the sending timestamp contained in the time synchronization message to complete the time synchronization with the time reference device;
[0018] After the first TSN node completes the time synchronization, the same time synchronization method is used to synchronize the time of other TSN nodes in turn.
[0019] In some implementations of the second aspect, the data transmission is performed by using an interrupt trigger or a time synchronization moment trigger according to respective data sending moments, including:
[0020] For a TSN node that is ready to send data, when the data sending time of the TSN node is reached, the TSN node triggers an interrupt, generates an interrupt signal and calls the corresponding interrupt handler, and uses the interrupt trigger method to send the data to the next TSN node;
[0021] For TSN nodes that cannot use the interrupt trigger method, the time synchronization moment trigger method is used. According to the synchronization timestamp of the application running on the TSN node, the callback function is called to send the data to the next TSN node;
[0022] The next TSN node chooses to continue sending the data to the next TSN node or confirm receiving the data according to the destination IP of the received data.
[0023] In some implementations of the second aspect, sending data to the next TSN node by using an interrupt triggering method includes:
[0024] The interrupt processing program determines the value of the interrupt register corresponding to the interrupt signal. If the value of the interrupt register matches the sequence number of its own TSN node, the application running on its own TSN node sends the data to the next TSN node.
[0025] In some implementations of the second aspect, calling a callback function to send data to a next TSN node according to a synchronization timestamp of an application running on the TSN node includes:
[0026] The master control program in the TSN node loads the offset time of each TSN node, determines the arrival of its own TSN node offset time according to the synchronization timestamp of the application running on the TSN node, and its own TSN node starts the global timer timing and calls the callback function to send the data to the next TSN node.
[0027] In some implementations of the second aspect, the next TSN node selects, according to the destination IP of the received data, to continue sending the data to the next TSN node or to determine to receive the data, including:
[0028] If the destination IP of the data received by the next TSN node does not belong to its own TSN node, the data will continue to be sent to the next TSN node;
[0029] If the destination IP of the data received by the next TSN node belongs to its own TSN node, it is determined to receive the data.
[0030] In some implementations of the second aspect, if the destination IP of the data received by the next TSN node belongs to its own TSN node, determining to receive the data includes:
[0031] For the interrupt triggering method, if the destination IP of the data received by the next TSN node belongs to its own TSN node, the own TSN node calls the corresponding interrupt handler to perform data reception by receiving the interrupt signal generated by the previous TSN node.
[0032] In some implementations of the second aspect, the method further includes:
[0033] When the ring link fails, data transmission is performed on the chain link;
[0034] When the chain link fails, data transmission is performed on the ring link.
[0035] According to a third aspect of the present disclosure, an electronic device is provided. The electronic device includes: at least one processor; and a memory connected to the at least one processor in communication; the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can perform the method described above.
[0036] According to a fourth aspect of the present disclosure, a non-transitory computer-readable storage medium storing computer instructions is provided, where the computer instructions are used to cause a computer to execute the method as described above.
[0037] In the present disclosure, the transmission system includes a plurality of TSN nodes, wherein each TSN node is connected in series to form a chain link by wired or wireless connection, the head and tail TSN nodes in the chain link are connected by wired or wireless connection to form a ring network link, and the first TSN node is connected to a time reference device; the method for transmitting data in the transmission system includes powering on and initializing each TSN node; reading the currently configured network parameters, and calculating the data transmission time of each TSN node according to the network parameters; executing the spanning tree destruction protocol, blocking the data transmission in one direction of the ring network link when the ring network link is normal, and releasing the blockage when the ring network link is abnormal; taking the master clock in the time reference device as the reference, and performing time synchronization according to the time synchronization protocol; after completing the time synchronization, entering the data receiving and sending task cycle, and performing data transmission according to the respective data transmission time by using the interrupt trigger or the time synchronization time trigger method. In this way, the transmission rate, fault tolerance, delay certainty, time synchronization and centralized control function of the bus can be improved, and the problem of limited load capacity caused by insufficient drive can be eliminated.
[0038] It should be understood that the contents described in the summary of the invention are not intended to limit the key or important features of the embodiments of the present disclosure, nor are they intended to limit the scope of the present disclosure. Other features of the present disclosure will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. The accompanying drawings are used to better understand the present solution and do not constitute a limitation of the present disclosure. In the accompanying drawings, the same or similar reference numerals represent the same or similar elements, among which:
[0040] Figure 1 A structural diagram of a chained TSN bus transmission system provided by an embodiment of the present disclosure is shown;
[0041] Figure 2 A schematic diagram of a wired-wireless network based on a chained TSN bus transmission system provided by an embodiment of the present disclosure is shown;
[0042] Figure 3 A flow chart of a chained TSN bus transmission method provided by an embodiment of the present disclosure is shown;
[0043] Figure 4 A schematic diagram of time slot division provided by an embodiment of the present disclosure is shown;
[0044] Figure 5 A schematic diagram of an interrupt triggering method provided by an embodiment of the present disclosure is shown;
[0045] Figure 6 A schematic diagram of a time synchronization moment triggering method provided by an embodiment of the present disclosure is shown;
[0046] Figure 7 A schematic diagram of a data transmission path provided by an embodiment of the present disclosure is shown;
[0047] Figure 8 A block diagram of an exemplary electronic device capable of implementing an embodiment of the present disclosure is shown. DETAILED DESCRIPTION
[0048] In order to make the purpose, technical solution and advantages of the embodiments of the present disclosure clearer, the technical solution in the embodiments of the present disclosure will be clearly and completely described below in conjunction with the drawings in the embodiments of the present disclosure. Obviously, the described embodiments are part of the embodiments of the present disclosure, not all of the embodiments. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present disclosure.
[0049] In addition, the term "and / or" in this article is only a description of the association relationship between the associated objects, indicating that there can be three relationships. For example, A and / or B can represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the character " / " in this article generally indicates that the associated objects before and after are in an "or" relationship.
[0050] In view of the problems in the background technology, the embodiment of the present disclosure provides a chain TSN bus transmission system and a transmission method. Specifically, the transmission system includes a plurality of TSN nodes, wherein each TSN node is connected in series to form a chain link by wired or wireless connection, the head and tail TSN nodes in the chain link are connected by wired or wireless connection to form a ring network link, and the first TSN node is connected to a time reference device; the method for transmitting data in the transmission system includes powering on and initializing each TSN node; reading the currently configured network parameters, and calculating the data transmission time of each TSN node according to the network parameters; executing the spanning tree destruction protocol, blocking the data transmission in one direction of the ring network link when the ring network link is normal, and releasing the blockage when the ring network link is abnormal; taking the master clock in the time reference device as the reference, and performing time synchronization according to the time synchronization protocol; after completing the time synchronization, entering the data receiving and sending task cycle, and performing data transmission according to the respective data sending time by using the interrupt trigger or the time synchronization moment trigger method. In this way, the transmission rate, fault tolerance, delay certainty, time synchronization and centralized control function of the bus can be improved, and the problem of limited load capacity caused by insufficient drive can be eliminated.
[0051] The chained TSN bus transmission system and transmission method provided by the embodiments of the present disclosure are described in detail below with reference to the accompanying drawings through specific embodiments.
[0052] Figure 1 The structure diagram of a chain TSN bus transmission system provided by an embodiment of the present disclosure is shown, wherein the system includes multiple TSN nodes, wherein each TSN node is connected in series to form a chain link through a wired or wireless connection mode, and the head and tail TSN nodes in the chain link are connected through a wired or wireless connection mode to form a ring network link ( Figure 1 The first TSN node is connected to the time reference device (dashed line part); wherein the time reference device is used to synchronize the time with TSN node 1 through (1PPS+TOD) or PTP synchronization message;
[0053] Figure 1 It includes N TSN nodes. Two adjacent TSN nodes are connected through the TSN bus. Each TSN node supports dual-port 100Mbps / 1000Mbps adaptive rate. The transmission medium supports twisted pair, coaxial and optical fiber. Each TSN node supports bypass power-off pass-through. That is, when a TSN node fails, the two network ports in the failed TSN node will automatically short-circuit to achieve pass-through, thereby avoiding link disconnection caused by node failure.
[0054] In some embodiments, the time reference device may be a device that can actively provide time, such as Beidou, GPS, or inertial navigation, with a set clock signal.
[0055] In some embodiments, TSN nodes may be connected together in a wired-wireless manner, for example Figure 2 In the wired-wireless network shown, the time reference device is connected to TSN node 1, TSN node 1 is connected to TSN node 2 via a wired connection, and TSN node 2 is connected to TSN node 3 as well as TSN node 3 and TSN node 4 are connected via a wireless connection.
[0056] The above is an introduction to the device embodiment. The following is a method embodiment to further illustrate the solution disclosed in the present disclosure.
[0057] Figure 3 A flow chart of a chained TSN bus transmission method provided by an embodiment of the present disclosure is shown. The method 300 includes the following steps:
[0058] S310, each TSN node is powered on and initialized.
[0059] In some embodiments, each TSN node includes a programmable logic module PL and a data processing module PS.
[0060] In some embodiments, each TSN node is powered on and initialized, including:
[0061] Each TSN node is powered on, the program running on each TSN node is loaded, and the program running on the PS of each TSN node is initialized.
[0062] S320, reading the currently configured network parameters, and calculating the data sending time of each TSN node according to the network parameters.
[0063] In some embodiments, the network parameters include the number of TSN nodes currently configured, the message cycle, and the sequence number of each TSN node;
[0064] The calculating the data sending time of each TSN node according to the network parameters includes:
[0065] Calculate the time slot of each TSN node according to the number of TSN nodes and message cycle currently configured;
[0066] According to the time slot of each TSN node and the sequence number of each TSN node, the data sending time of each TSN node is calculated;
[0067] Further, Figure 4 The time slot division method is shown. The time slot of each TSN node is the same. Assuming that the message cycle is T and the number of TSN nodes is N, the time slot P of each TSN node is the ratio of T to N. As long as each TSN node completes the data transmission within its own time slice (i.e., time slot) and the data reaches the next TSN node within a time slice, the orderly and conflict-free communication between the TSN nodes can be guaranteed.
[0068] Furthermore, the data transmission time of the TSN node is the product of the time slot of the TSN node and the sequence number of the TSN node, and the unit is μs.
[0069] In some embodiments, HD services require end-to-end transmission delay within 100 μs. To meet this communication requirement, the IEEE 802.1Qbv time slot division method is used. To achieve more complex mixed traffic transmission, other TSN sub-protocols can be superimposed.
[0070] Furthermore, the comparison table of the TSN sub-protocol and its corresponding transmission delay characteristics is shown in Table 1. In order to solve the transmission delay uncertainty problem of Ethernet, each TSN node realizes end-to-end transmission delay determination through the synchronous or asynchronous traffic scheduling mechanism corresponding to the TSN sub-protocol at the data link layer. In the absence of link queuing, the transmission delay is equal to the ratio of the length of the data message being transmitted to the Ethernet link rate, plus the processing delay of the network device data;
[0071] The three TSN sub-protocols shown in Table 1 can provide transmission delays of three orders of magnitude: a few μs, tens of μs, and hundreds of μs.
[0072] Table 1
[0073]
[0074] In some embodiments, end-to-end ultra-low transmission delay can be achieved by utilizing the traffic scheduling mechanism corresponding to the TSN sub-protocol.
[0075] In some embodiments, according to HD service requirements, a maximum transmission delay of a transmission system with different numbers of TSN nodes when transmitting data is analyzed;
[0076] Assume that there are 5 TSN nodes in the transmission system, the message cycle is 2.5ms, and TSN node 1 sends data to TSN node 5. Then the time slot of each TSN node is 500μs, and the effective bandwidth that each TSN node can allocate = 1000Mbps / 5 = 200Mbps. According to the data transmission path, the transmission delay is the sum of the storage and forwarding delay of TSN node 1 and the direct forwarding delay of other TSN nodes in the transmission path. Under Gigabit Ethernet, the direct forwarding delay of other TSN nodes in the transmission path has nothing to do with the frame length, and its maximum delay is 1.76μs. The storage and forwarding delay of TSN node 1 is related to the frame length. When the shortest frame is 64 bytes, the maximum storage and forwarding delay is 2.38μs, when the longest frame is 1518 bytes, the maximum storage and forwarding delay is 13.94μs, so when the longest frame is 1518 bytes, the maximum transmission delay = 13.94μs + 1.76μs × 3 = 19.22μs; to ensure that the data is transmitted in an orderly manner without conflict, it is only necessary to ensure that the data reception time from TSN node 4 to TSN node 5 is after the data reception from TSN node 1 to TSN node 5 is completed. Table 2 gives the time when TSN node 1, TSN node 4 and TSN node 5 send or receive data. It can be seen from Table 2 that the maximum transmission delay is the transmission delay from TSN node 1 to TSN node 5, and the data can be transmitted in an orderly manner without conflict;
[0077] Table 2
[0078]
[0079] When there are 50 TSN nodes in the transmission system and data is sent from TSN node 1 to TSN node 50, the time slot of each TSN node is 50μs, and the effective bandwidth that can be allocated to each TSN node = 1000Mbps / 50 = 20Mbps. The maximum transmission delay calculated according to the above method = 13.94μs + 1.76μs × 48 = 98.42μs. To ensure that data is transmitted in an orderly manner without conflict, it is only necessary to ensure that the data reception time from TSN node 49 to TSN node 50 is after the data reception from TSN node 1 to TSN node 50 is completed. Table 3 gives the time when TSN node 1, TSN node 49 and TSN node 50 send or receive data. It can be seen from Table 3 that the maximum transmission delay is the transmission delay from TSN node 1 to TSN node 50, and the data can be transmitted in an orderly manner without conflict.
[0080] Table 3
[0081]
[0082] S330, executing a spanning tree destruction protocol to block data transmission in one direction of the ring network link when the ring network link is normal, and to release the blockage when the ring network link is abnormal.
[0083] S340, using the master clock in the time reference device as a reference, and performing time synchronization according to a time synchronization protocol.
[0084] In some embodiments, the step of synchronizing the time based on the time synchronization protocol using the master clock in the time reference device as a reference includes:
[0085] According to the time synchronization protocol, the first TSN node receives the time synchronization message sent by the master clock in the time reference device, records the receiving timestamp, and adjusts its own time according to the sending timestamp contained in the time synchronization message to complete the time synchronization with the time reference device;
[0086] After the first TSN node completes the time synchronization, the same synchronization method is used to synchronize the time of other TSN nodes in turn. For example, the second TSN node connected to the first TSN node receives the time synchronization message sent by the first TSN node and records the receiving timestamp, compares the receiving timestamp with the sending timestamp in the received synchronization time message, adjusts its own time, and completes the time synchronization with the first TSN node.
[0087] In some embodiments, the time synchronization protocol is IEEE 802.1AS / IEEE 1588v2. Link measurement, link compensation and frequency calibration can be implemented based on the time synchronization protocol, thereby achieving high-precision time synchronization of the system.
[0088] In some embodiments, when the transmission system is not connected to a time reference device, a TSN node is selected and a clock signal in the TSN node is used as the time reference of the system for time synchronization.
[0089] In some embodiments, since the transmission system has its own link frequency or delay compensation capability, high-precision time synchronization can still be maintained in a wired-wireless network based on the transmission system, for example Figure 2 In the wired-wireless network shown, the time reference device synchronizes time with TSN node 1 through (1PPS+TOD) or PTP synchronization message. TSN node 1 and TSN node 2 are wired connected. They synchronize time with an accuracy better than 50ns through TSN gPTP synchronization message. In addition, TSN node 1 can also synchronize time with the operating system kernel in the transmission system CPU through linuxPTP synchronization message with an accuracy better than 50ns. Due to the natural compatibility of PTP synchronization message and gPTP synchronization message, TSN node 1 can simultaneously support the exchange of these two time synchronization messages, thereby realizing time synchronization between TSN node and the operating system kernel in the transmission system CPU. TSN node 2 and TSN node 3 are wirelessly connected. Since the time synchronization mechanism based on TSN gPTP synchronization message has a link delay compensation function, the wireless link is transparent to the time synchronization process, which enables TSN node 2 to also synchronize time with TSN node 3 through TSN gPTP synchronization message. Similarly, TSN node 3 and TSN node 4 are wirelessly connected and synchronize time through TSN gPTP synchronization message.
[0090] Will Figure 2 The PPS port of any TSN node in the wired-wireless network shown is connected to two channels of the oscilloscope respectively. After observing that PPS signals are output on channel 1 and channel 2 of the oscilloscope, the oscilloscope persistence mode is turned on to make the oscilloscope display the PPS signals and time synchronization accuracy of the master and slave TSN nodes corresponding to the TSN node. According to the content displayed by the oscilloscope, the network can achieve a time synchronization accuracy within 50ns, with high-precision time synchronization characteristics.
[0091] S350, after completing the time synchronization, enter the data receiving and sending task cycle, and perform data transmission according to the respective data sending time by using the interrupt trigger or the time synchronization time trigger method.
[0092] In some embodiments, in order to ensure that each data transmission start time of the TSN node is aligned with the time slot edge of the TSN node, an interrupt trigger or a time synchronization moment trigger is used for data transmission.
[0093] In some embodiments, the data transmission is performed by using an interrupt trigger or a time synchronization moment trigger according to respective data transmission moments, including:
[0094] For a TSN node that is ready to send data, when the data sending time of the TSN node is reached, the TSN node triggers an interrupt, generates an interrupt signal and calls the corresponding interrupt handler, and uses the interrupt trigger method to send the data to the next TSN node;
[0095] For TSN nodes that cannot use the interrupt trigger method, the time synchronization moment trigger method is used. According to the synchronization timestamp of the application running on the TSN node, the callback function is called to send the data to the next TSN node;
[0096] The next TSN node chooses to continue sending the data to the next TSN node or confirm receiving the data according to the destination IP of the received data.
[0097] In some embodiments, for a TSN node that is ready to send data, when the data sending time of the TSN node is reached, the TSN node triggers an interrupt, generates an interrupt signal and calls a corresponding interrupt handler, including:
[0098] For a TSN node that is ready to send data, when the logic timer of the programmable logic module PL in the TSN node counts to the data sending time of its own TSN node, the data processing module PS in its own TSN node triggers an interrupt, the PL in its own TSN node generates an interrupt signal and sends it to the PS in its own TSN node, and the PS in its own TSN node calls the corresponding interrupt handler according to the interrupt signal.
[0099] In some embodiments, sending data to the next TSN node by using an interrupt triggering method includes:
[0100] The interrupt handler determines the value of the interrupt register corresponding to the interrupt signal. If the value of the interrupt register matches the sequence number of its own TSN node, the application running on its own TSN node sends the data to the next TSN node; wherein the value of the interrupt register indicates the time slot window number of the TSN node that generates the interrupt signal;
[0101] Furthermore, if the value of the interrupt register does not match the sequence number of its own TSN node, its own TSN node is in a ready state, waiting for the arrival of the next interrupt signal;
[0102] Furthermore, if Figure 5As shown in the interrupt triggering method diagram, the value of the interrupt register is 16 bits, there are 256 TSN nodes in one message cycle, the time slot of each TSN node is P, the unit is μs, if the value of the interrupt register corresponding to the interrupt signal generated by TSN node 1 is 1, the application on TSN node 1 sends the data to TSN node 2, if the value of the interrupt register corresponding to the interrupt signal generated by TSN node 2 is 2, the application on TSN node 2 continues to send the data to the next TSN node, if the value of the interrupt register corresponding to the interrupt signal generated by TSN node 256 is 256, TSN node 256 as the last TSN node will receive the data.
[0103] In some embodiments, the TSN node that cannot adopt the interrupt triggering method may be a TSN node whose data processing module PS resources are limited or whose hardware does not support interrupt triggering.
[0104] In some embodiments, calling a callback function to send data to a next TSN node according to a synchronization timestamp of an application running on the TSN node includes:
[0105] The master control program in the TSN node loads the offset time of each TSN node, determines the arrival of its own TSN node offset time according to the synchronization timestamp of the application running on the TSN node, and its own TSN node starts the global timer timing and calls the callback function to send the data to the next TSN node;
[0106] Furthermore, if Figure 6 As shown in the schematic diagram of the time synchronization moment triggering method, there are 256 TSN nodes in one message cycle, and the time slot of each TSN node is P, with the unit of μs. The offset time of each TSN node is determined according to the start time of the message cycle. For example, the offset time of TSN node 1 is offset time 1, and the offset time of TSN node 2 is offset time 2. When the offset time corresponding to the TSN node arrives, the data is sent to the next TSN node.
[0107] In some embodiments, the next TSN node selects to continue to send the data to the next TSN node or to determine to receive the data according to the destination IP of the received data, including:
[0108] If the destination IP of the data received by the next TSN node does not belong to its own TSN node, the data will continue to be sent to the next TSN node;
[0109] If the destination IP of the data received by the next TSN node belongs to its own TSN node, it is determined to receive the data;
[0110] For example, Figure 7As shown in the data transmission path diagram, during the process of data being transmitted from the CPU in TSN node 1 to the CPU in TSN node 5, when the data is transmitted from TSN node 1 to TSN node 2 through the TSN bus, the PL in TSN node 2 determines that the received data does not belong to its own TSN node, and then continues to send the data to TSN node 3 through the TSN bus, instead of sending the data to the CPU in its own TSN node to receive the data, and TSN node 3 continues to transmit the data using the same method until it is sent to TSN node 5, and the PL in TSN node 5 determines that the received data belongs to its own TSN node, and then receives the data through the CPU in its own TSN node, wherein TSN nodes 1-TSN nodes 5 all include CPU, PL and PS.
[0111] In some embodiments, if the destination IP of the data received by the next TSN node belongs to its own TSN node, determining to receive the data includes:
[0112] For the interrupt trigger mode, if the destination IP of the data received by the next TSN node belongs to its own TSN node, the own TSN node calls the corresponding interrupt handler to perform data reception by receiving the interrupt signal generated by the previous TSN node;
[0113] Specifically, for the interrupt triggering method, if the destination IP of the data received by the next TSN node belongs to its own TSN node, the PS in its own TSN node obtains the data and receives the interrupt signal generated by the previous TSN node, and calls the corresponding interrupt handler to perform data reception according to the interrupt signal.
[0114] In some embodiments, method 300 further includes:
[0115] When the ring network link fails, data transmission is carried out on the chain link; when the chain link fails, data transmission is carried out on the ring network link to realize the CB seamless redundancy function, achieving zero switching time and zero packet loss.
[0116] According to an embodiment of the present disclosure, a transmission system includes a plurality of TSN nodes, wherein each TSN node is connected in series to form a chain link by wired or wireless connection, the head and tail TSN nodes in the chain link are connected by wired or wireless connection to form a ring network link, and the first TSN node is connected to a time reference device; the method for transmitting data in the transmission system includes powering on and initializing each TSN node; reading the currently configured network parameters, and calculating the data transmission time of each TSN node according to the network parameters; executing a spanning tree destruction protocol, blocking the data transmission in one direction of the ring network link when the ring network link is normal, and releasing the blockage when the ring network link is abnormal; taking the master clock in the time reference device as the reference, and performing time synchronization according to the time synchronization protocol; after completing the time synchronization, entering the data transceiver task cycle, and performing data transmission according to the respective data transmission time by using an interrupt trigger or a time synchronization moment trigger. In this way, the transmission rate, fault tolerance, delay certainty, time synchronization and centralized control function of the bus can be improved, and the problem of limited load capacity caused by insufficient drive can be eliminated.
[0117] It should be noted that, for the aforementioned method embodiments, for the sake of simplicity, they are all described as a series of action combinations, but those skilled in the art should be aware that the present disclosure is not limited by the order of the actions described, because according to the present disclosure, certain steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all optional embodiments, and the actions and modules involved are not necessarily required by the present disclosure.
[0118] Understandably, Figure 1 Each module / unit in the transmission system shown has the function of implementing each step in the transmission method 300 provided in the embodiment of the present disclosure, and can achieve its corresponding technical effect.
[0119] Figure 8 A block diagram of an exemplary electronic device capable of implementing an embodiment of the present disclosure is shown. The electronic device 800 is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device 800 may also represent various forms of mobile devices, such as personal digital processing, cellular phones, smart phones, wearable devices, and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present disclosure described and / or required herein.
[0120] like Figure 8As shown, the electronic device 800 includes a computing unit 801, which can perform various appropriate actions and processes according to a computer program stored in a read-only memory (ROM) 802 or a computer program loaded from a storage unit 808 into a random access memory (RAM) 803. In the RAM 803, various programs and data required for the operation of the electronic device 800 can also be stored. The computing unit 801, the ROM 802, and the RAM 803 are connected to each other via a bus 804. An I / O interface 805 is also connected to the bus 804.
[0121] Multiple components in the electronic device 800 are connected to the I / O interface 805, including: an input unit 806, such as a keyboard, a mouse, etc.; an output unit 807, such as various types of displays, speakers, etc.; a storage unit 808, such as a disk, an optical disk, etc.; and a communication unit 809, such as a network card, a modem, a wireless communication transceiver, etc. The communication unit 809 allows the electronic device 800 to exchange information / data with other devices through a computer network such as the Internet and / or various telecommunication networks.
[0122] The computing unit 801 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the computing unit 801 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various computing units running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The computing unit 801 performs the various methods and processes described above, such as method 300. For example, in some embodiments, the method 300 may be implemented as a computer software program, which is tangibly contained in a machine-readable medium, such as a storage unit 808. In some embodiments, part or all of the computer program may be loaded and / or installed on the electronic device 800 via ROM 802 and / or communication unit 809. When the computer program is loaded into RAM 803 and executed by the computing unit 801, one or more steps of the method 300 described above may be performed. Alternatively, in other embodiments, the computing unit 801 may be configured to perform the method 300 in any other appropriate manner (e.g., by means of firmware).
[0123] Various implementations of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field programmable gate arrays (FPGAs), application specific integrated circuits (ASICs), application specific standard products (ASSPs), systems on chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.
[0124] The program code for implementing the method of the present disclosure may be written in any combination of one or more programming languages. These program codes may be provided to a processor or controller of a general-purpose computer, a special-purpose computer, or other programmable data processing device, so that the program code, when executed by the processor or controller, enables the functions / operations specified in the flow chart and / or block diagram to be implemented. The program code may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.
[0125] In the context of the present disclosure, a machine-readable medium may be a tangible medium that may contain or store a program for use by or in conjunction with an instruction execution system, device, or equipment. A machine-readable medium may be a machine-readable signal medium or a machine-readable storage medium. A machine-readable medium may include, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, device, or equipment, or any suitable combination of the foregoing. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, a portable computer disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
[0126] It should be noted that the present disclosure also provides a non-transitory computer-readable storage medium storing computer instructions, wherein the computer instructions are used to enable a computer to execute method 100 and achieve the corresponding technical effect achieved by executing the method in the embodiment of the present disclosure. For the sake of concise description, they are not repeated here.
[0127] To provide interaction with a user, the systems and techniques described herein can be implemented on a computer having: a display device for displaying information to the user; and a keyboard and a pointing device (e.g., a mouse or trackball) through which the user can provide input to the computer. Other types of devices can also be used to provide interaction with the user; for example, the feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including acoustic input, voice input, or tactile input).
[0128] The systems and techniques described herein may be implemented in a computing system that includes back-end components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes front-end components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such back-end components, middleware components, or front-end components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), and the Internet.
[0129] A computer system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The relationship of client and server is generated by computer programs running on respective computers and having a client-server relationship with each other. The server may be a cloud server, a server of a distributed system, or a server combined with a blockchain.
[0130] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps recorded in this disclosure can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solutions disclosed in this disclosure can be achieved, and this document does not limit this.
[0131] The above specific implementations do not constitute a limitation on the protection scope of the present disclosure. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present disclosure shall be included in the protection scope of the present disclosure.
Claims
1. A chained TSN bus transmission system, characterized in that: include: A plurality of TSN nodes, wherein each TSN node is connected in series to form a chain link through a wired or wireless connection mode, the first and last TSN nodes in the chain link are connected through a wired or wireless connection mode to form a ring network link, and the first TSN node is connected to a time reference device.
2. A chained TSN bus transmission method based on the system of claim 1, characterized in that: include: Each TSN node is powered on and initialized; Read the currently configured network parameters and calculate the data sending time of each TSN node according to the network parameters; Execute a spanning tree destruction protocol to block data transmission in one direction of the ring network link when the ring network link is normal, and release the blockage when the ring network link is abnormal; Based on the master clock in the time reference device, the time is synchronized according to the time synchronization protocol; After completing the time synchronization, the data transmission and reception task cycle is entered, and data transmission is carried out using interrupt triggering or time synchronization moment triggering according to the respective data sending time.
3. The method according to claim 2, characterized in that The network parameters include the number of TSN nodes currently configured, the message cycle and the sequence number of each TSN node; The calculating the data sending time of each TSN node according to the network parameters includes: Calculate the time slot of each TSN node according to the number of TSN nodes and message cycle currently configured; According to the time slot of each TSN node and the sequence number of each TSN node, the data sending time of each TSN node is calculated.
4. The method according to claim 2, characterized in that: The time synchronization is performed based on the master clock in the time reference device and the time synchronization protocol, including: According to the time synchronization protocol, the first TSN node receives the time synchronization message sent by the master clock in the time reference device, records the receiving timestamp, and adjusts its own time according to the sending timestamp contained in the time synchronization message to complete the time synchronization with the time reference device; After the first TSN node completes the time synchronization, the same time synchronization method is used to synchronize the time of other TSN nodes in turn.
5. The method according to claim 2, characterized in that: The method of transmitting data by interrupt triggering or time synchronization triggering according to respective data transmission times includes: For a TSN node that is ready to send data, when the data sending time of the TSN node is reached, the TSN node triggers an interrupt, generates an interrupt signal and calls the corresponding interrupt handler, and uses the interrupt trigger method to send the data to the next TSN node; For TSN nodes that cannot use the interrupt trigger method, the time synchronization moment trigger method is used. According to the synchronization timestamp of the application running on the TSN node, the callback function is called to send the data to the next TSN node; The next TSN node chooses to continue sending the data to the next TSN node or confirm receiving the data according to the destination IP of the received data.
6. The method according to claim 5, characterized in that The method of sending data to the next TSN node by using an interrupt triggering method includes: The interrupt processing program determines the value of the interrupt register corresponding to the interrupt signal. If the value of the interrupt register matches the sequence number of its own TSN node, the application running on its own TSN node sends the data to the next TSN node.
7. The method according to claim 5, characterized in that The method of calling a callback function to send data to the next TSN node according to the synchronization timestamp of the application running on the TSN node includes: The master control program in the TSN node loads the offset time of each TSN node, determines the arrival of its own TSN node offset time according to the synchronization timestamp of the application running on the TSN node, and its own TSN node starts the global timer timing and calls the callback function to send the data to the next TSN node.
8. The method according to claim 5, characterized in that The next TSN node selects to continue to send the data to the next TSN node or to determine to receive the data according to the destination IP of the received data, including: If the destination IP of the data received by the next TSN node does not belong to its own TSN node, the data will continue to be sent to the next TSN node; If the destination IP of the data received by the next TSN node belongs to its own TSN node, it is determined to receive the data.
9. The method according to claim 8, characterized in that If the destination IP of the data received by the next TSN node belongs to its own TSN node, determining to receive the data includes: For the interrupt triggering method, if the destination IP of the data received by the next TSN node belongs to its own TSN node, the own TSN node calls the corresponding interrupt handler to perform data reception by receiving the interrupt signal generated by the previous TSN node.
10. The method according to claim 2, characterized in that The method further comprises: When the ring link fails, data transmission is performed on the chain link; When the chain link fails, data transmission is performed on the ring link.
Citation Information
Patent Citations
Time synchronization method and device based on ring network and readable storage medium
CN115473601A