A method and system for controlling TSN time synchronization message output

By separating time synchronization packets from ordinary Ethernet packet port processing and adopting priority policies and state machine design, the problem of high complexity of system design in the existing technology is solved, and flexible fault tolerance protection and accuracy of timestamp recording are achieved.

CN120050243BActive Publication Date: 2025-08-08NAT UNIV OF DEFENSE TECH
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202510527333.8
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2025-04-25
Publication Date
2025-08-08
Estimated Expiration
2045-04-25

AI Technical Summary

Technical Problem

In the prior art, time synchronization packets share port processing modules with other Ethernet packets, resulting in high complexity in system design, lack of flexibility, and difficult to achieve effective fault-tolerant protection under the requirements of fault-tolerant design such as aerospace.

Method used

The output processing of time synchronization packet ports is separated from the processing of ordinary Ethernet packet ports, and a separate output buffering module and output selection module are used to ensure that the output of time synchronization packets does not affect the output of high-priority Ethernet packets, and the accuracy of timestamp recording is ensured at the hardware level.

Benefits of technology

It realizes flexible separation between time-synchronous message output and other Ethernet messages, ensures the flexibility of fault-tolerant design and the accuracy of timestamp recording, and supports fault-tolerant design under the COM/MON mechanism.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120050243B_ABST
    Figure CN120050243B_ABST
Patent Text Reader

Abstract

The present invention discloses a method and system for controlling the output of TSN time synchronization messages, which are applied to a message output control system. The message output control system includes a first output buffer module for transmitting and receiving time synchronization messages and a second output buffer module for transmitting and receiving other Ethernet messages. The first output buffer module and the second output buffer module are both connected to an output selection module. The method includes: when the output selection module is idle, detecting messages waiting to be output in the first output buffer module and the second output buffer module; if the first output buffer module has a time synchronization message waiting to be output and the second output buffer module has no other Ethernet messages with a higher priority than the time synchronization message waiting to be output, then the time synchronization message is obtained from the first output buffer module, outputted, and then returned to an idle state; otherwise, the output selection module obtains other Ethernet messages from the second output buffer module, outputs them, and then returns to an idle state. The present invention ensures flexibility when meeting fault-tolerant design requirements.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of network technology, and in particular to a method and system for controlling TSN time synchronization message output. Background Art

[0002] In traditional Ethernet, congestion easily occurs when packets of different traffic flows are output from the same port, causing packets to queue at the port. Because the duration of this waiting period is uncertain, traditional Ethernet cannot guarantee that packet transmission latency and jitter will be within specified limits. Unlike traditional Ethernet, Time-Sensitive Networking (TSN) can provide deterministic latency and jitter for the transmission of critical traffic within the network. This makes TSN widely applicable in a variety of fields, including automotive, industrial control, and aerospace.

[0003] TSN uses a network-wide synchronized clock to plan and schedule network traffic transmission times, thus avoiding message congestion and uncertain queuing times. To achieve clock synchronization across all devices in the network, TSN defines a distributed time synchronization protocol in its 802.1AS standard. Network devices use this protocol to process time synchronization messages and achieve synchronization. The implementation of the 802.1AS protocol, specifically the logic for processing time synchronization messages, is a key component of TSN devices (switches / network interface cards).

[0004] An important component of the time synchronization message processing logic is its input and output processing logic at the port. For different types of time synchronization messages, the port needs to record the time of message arrival or output and perform corresponding processing. For SYNC messages, the port input side needs to record the local time of message arrival when receiving this type of message; the port output side needs to compare the local time of message output with its arrival time, calculate the message's residence delay in the device, and update the message's time correction field. For messages related to link delay measurement such as Pdelay_req and Pdelay_resp, the port needs to record the local time of message arrival on the input side; at the same time, when outputting this type of message, the port needs to record the local time of message output, construct a follow-up message containing this time, and send it to the network.

[0005] In TSN device implementations, time synchronization messages share the same port processing module as other types of Ethernet messages. This means the port processing module classifies and processes messages based on message type. While this shared port processing module approach saves hardware resources, it lacks flexibility when addressing system fault-tolerance design requirements in aerospace scenarios. In aerospace environments, ion radiation exposure can easily cause bit-flip failures in circuits. To achieve fault-tolerant operation, a common system design approach is to redundantly replicate the hardware logic that needs protection. Since the probability of simultaneous failure of multiple copies of logic due to ion radiation is extremely low, the system can detect faults and take appropriate action by comparing the execution results of multiple copies of the logic. For example, the COM / MON mechanism, widely used in aerospace, replicates execution logic into two copies, COM and MON, and detects faults by comparing the execution results of the COM and MON copies. TSN can protect its critical time synchronization message processing logic by applying the COM / MON mechanism. However, since time synchronization messages and other Ethernet messages share the same port processing module, when replicating the time synchronization message processing logic, the system must consider the impact of the port processing portion on the output of other Ethernet messages. This greatly increases the complexity of system design and implementation. Summary of the Invention

[0006] The technical problem to be solved by the present invention is: In response to the technical problems existing in the prior art, the present invention provides a method and system for TSN time synchronization message output control, which separates the time synchronization message port output processing from the ordinary Ethernet message port processing, ensuring flexibility when facing fault-tolerant design requirements, that is, the time synchronization message port processing logic can be copied without considering the impact on the output of other Ethernet message ports.

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

[0008] A method for controlling TSN time synchronization message output is applied to a message output control system. The message output control system includes a first output buffer module for sending and receiving time synchronization messages, and a second output buffer module for sending and receiving other Ethernet messages. The first output buffer module and the second output buffer module are both connected to the data receiving side of an output selection module. The method includes:

[0009] When the output selection module is in an idle state, detecting the messages waiting to be output in the first output buffer module and the second output buffer module;

[0010] If the first output buffer module has a time synchronization message waiting to be output and the second output buffer module has no other Ethernet messages with a higher priority than the time synchronization message waiting to be output, the output selection module obtains the time synchronization message from the first output buffer module, then outputs the time synchronization message and returns to the idle state;

[0011] If the second output buffer module has other Ethernet messages waiting to be output and the first output buffer module has no time synchronization messages waiting to be output, or the first output buffer module has a time synchronization message waiting to be output and the second output buffer module has other Ethernet messages with a higher priority than the time synchronization message waiting to be output, the output selection module obtains the other Ethernet messages from the second output buffer module, then outputs the other Ethernet messages and returns to the idle state.

[0012] Furthermore, the first output buffer module is connected to the data receiving side of the output selection module through the protocol port processing module and the first cyclic redundancy check calculation module in sequence. When the output selection module obtains the time synchronization message from the first output buffer module, the steps specifically include:

[0013] The output selection module sends a request signal to the first output buffer module, and the first output buffer module outputs the corresponding time synchronization message after receiving the request signal;

[0014] After the protocol port processing module waits for and obtains the time synchronization message, it performs port processing on the time synchronization message according to the 802.1AS standard and sends the processed time synchronization message to the first cyclic redundancy check calculation module;

[0015] After the first cyclic redundancy check calculation waits and obtains the time synchronization message, a cyclic redundancy check code is generated according to the message content and added to the end of the message, and the time synchronization message with the added cyclic redundancy check code is sent to the output selection module.

[0016] Furthermore, the data sending side of the output selection module is connected to the sending-side MAC processing module, and outputting the time synchronization message specifically outputs the time synchronization message to the sending-side MAC processing module, and outputting other Ethernet messages specifically outputs other Ethernet messages to the sending-side MAC processing module. After outputting the time synchronization message to the sending-side MAC processing module and outputting other Ethernet messages to the sending-side MAC processing module, the method further includes:

[0017] The sending side MAC processing module waits for and obtains the time synchronization message or Ethernet message, adds a preamble and a message start symbol before the Ethernet header of the time synchronization message or Ethernet message, switches the message transmission clock domain, and then outputs the processed time synchronization message or Ethernet message.

[0018] Furthermore, after the protocol port processing module waits for and obtains the time synchronization message, it also includes a clock compensation step, specifically including:

[0019] Record the local time when the time synchronization message is obtained;

[0020] The local time and a specified processing delay are calculated to obtain a compensated local time, where the specified processing delay is a constant value, specifically the sum of processing delays of the message data in the protocol port processing module, the first cyclic redundancy check calculation module, the output selection module, and the transmitting side MAC processing module.

[0021] Furthermore, the second output buffer module is connected to the data receiving side of the output selection module through the second cyclic redundancy check calculation module. When the output selection module obtains other Ethernet messages from the second output buffer module, the steps specifically include:

[0022] The output selection module sends a request signal to the second output buffer module, and the second output buffer module outputs the corresponding other Ethernet messages after receiving the request signal;

[0023] After waiting for and obtaining other Ethernet messages, the second cyclic redundancy check calculation module generates a cyclic redundancy check code according to the message content and adds it to the end of the message, and sends the other Ethernet messages with the added cyclic redundancy check code to the output selection module.

[0024] Furthermore, the priority of the time synchronization message is the lowest priority, or the other Ethernet messages include low-priority Ethernet messages whose priority is lower than that of the time synchronization message, and high-priority Ethernet messages whose priority is higher than that of the time synchronization message; when the output selection module obtains other Ethernet messages from the second output buffer module, it specifically obtains the Ethernet message with the highest priority in the second output buffer module.

[0025] The present invention further provides a message output control system, comprising a first output buffer module, a second output buffer module, and an output selection module, wherein the first output buffer module and the second output buffer module are both connected to a data receiving side of the output selection module, wherein:

[0026] The first output buffer module is used to send and receive time synchronization messages;

[0027] The second output buffer module is used to send and receive other Ethernet messages;

[0028] The output selection module is used to detect messages waiting to be output in the first output buffer module and the second output buffer module in an idle state; if the first output buffer module has a time synchronization message waiting to be output and the second output buffer module has no other Ethernet messages waiting to be output with a higher priority than the time synchronization message, then the time synchronization message is obtained from the first output buffer module, and then the time synchronization message is output and the idle state is returned; if the second output buffer module has other Ethernet messages waiting to be output and the first output buffer module has no time synchronization message waiting to be output, or if the first output buffer module has a time synchronization message waiting to be output and the second output buffer module has other Ethernet messages waiting to be output with a higher priority than the time synchronization message, then the other Ethernet messages are obtained from the second output buffer module, and then the other Ethernet messages are output and the idle state is returned.

[0029] Furthermore, the first output buffer module is connected to the data receiving side of the output selection module through the protocol port processing module and the first cyclic redundancy check calculation module in sequence. When the output selection module obtains the time synchronization message from the first output buffer module:

[0030] The output selection module is used to send a request signal to the first output buffer module;

[0031] The first output buffer module is used to output a corresponding time synchronization message after obtaining a request signal;

[0032] The protocol port processing module is used to wait for and obtain the time synchronization message, perform port processing of the time synchronization message according to the 802.1AS standard, and send the processed time synchronization message to the first cyclic redundancy check calculation module;

[0033] The first cyclic redundancy check calculation is used to wait for and obtain the time synchronization message, generate a cyclic redundancy check code according to the message content and add it to the end of the message, and send the time synchronization message with the added cyclic redundancy check code to the output selection module.

[0034] Furthermore, the second output buffer module is connected to the data receiving side of the output selection module through the second cyclic redundancy check calculation module. When the output selection module obtains other Ethernet messages from the second output buffer module:

[0035] The output selection module is used to send a request signal to the second output buffer module;

[0036] The second output buffer module is used to output corresponding other Ethernet messages after obtaining the request signal;

[0037] The second cyclic redundancy check calculation module is used to wait for and obtain other Ethernet messages, generate a cyclic redundancy check code according to the message content and add it to the end of the message, and send the other Ethernet messages with the added cyclic redundancy check code to the output selection module.

[0038] Furthermore, the data sending side of the output selection module is connected to the sending side MAC processing module, the sending side MAC processing module waits for and obtains the time synchronization message or Ethernet message, adds a preamble and a message start symbol before the Ethernet header of the time synchronization message or Ethernet message, switches the message transmission clock domain, and then outputs the processed time synchronization message or Ethernet message.

[0039] Compared with the prior art, the advantages of the present invention are:

[0040] 1. This invention designs an architecture that separates the port output processing of time synchronization messages from the port processing of ordinary Ethernet messages. The current output message is determined by message priority, ensuring that the output of time synchronization messages does not affect the output scheduling of high-priority Ethernet messages such as time-sensitive flows.

[0041] 2. The present invention places the protocol port processing module for time calculation after the first output buffer module, and combines this with the design of a specific state machine for the output selection module. This ensures at the hardware level that even in scenarios where the output of the time synchronization message needs to wait, its timestamp recording and resident delay calculation include the uncertain delay experienced by the time synchronization message while waiting for output, thus ensuring accuracy. BRIEF DESCRIPTION OF THE DRAWINGS

[0042] Figure 1 The present invention is a flowchart of output processing of time synchronization messages and other Ethernet messages at a port according to an embodiment of the present invention.

[0043] Figure 2 2 is a schematic diagram of the state machine design of the output selection module according to an embodiment of the present invention.

[0044] Figure 3 Schematic diagram of the output buffer module state machine design according to an embodiment of the present invention.

[0045] Figure 4 This is a flow chart of a message output control method according to an embodiment of the present invention. DETAILED DESCRIPTION

[0046] The present invention will be further described below in conjunction with the accompanying drawings and specific preferred embodiments, but the scope of protection of the present invention is not limited thereby.

[0047] Example 1

[0048] This embodiment proposes a method for controlling TSN time synchronization message output. This method separates the port output processing of time synchronization messages from the port processing of other Ethernet messages. When time synchronization messages and other Ethernet messages are simultaneously output to a port, the output selection module determines which message is output to the port based on a priority policy.

[0049] The method of this embodiment is applied to a message output control system, which includes a first output buffer module for sending and receiving time synchronization messages, and a second output buffer module for sending and receiving other Ethernet messages. The first output buffer module is connected to the data receiving side of the output selection module through a protocol port processing module and a first cyclic redundancy check (CRC) calculation module in sequence. The second output buffer module is connected to the data receiving side of the output selection module through a second cyclic redundancy check calculation module. The data sending side of the output selection module is connected to the sending-side MAC processing module.

[0050] like Figure 1 As shown, with the above structure, when a time synchronization message is output to a port, it first enters the first output buffer module for waiting. The first output buffer module interacts with the output selection module to control whether the message content is transmitted to subsequent modules. When the first output buffer module begins to output the time synchronization message, the time synchronization message is sequentially processed by the protocol port processing module, the first cyclic redundancy check calculation module, the output selection module, and the transmitting-side MAC message processing module before being output.

[0051] When other Ethernet packets are output to a port, they first enter the second output buffer module for waiting. The second output buffer module exchanges output control signals with the output selection module to control whether the packet content is transmitted to subsequent modules. When the second output buffer module begins outputting packets, the packets are processed in sequence by the second cyclic redundancy check calculation module, the output selection module, and the transmitting-side MAC processing module before being output.

[0052] The protocol port processing module in this embodiment is responsible for port processing of time synchronization messages according to the 802.1AS standard. Both the first and second cyclic redundancy check calculation modules are responsible for performing cyclic redundancy check calculations based on the message content, generating the corresponding cyclic redundancy check (CRC) code and appending it to the end of the message. The transmitting MAC processing module is responsible for adding a preamble and message start delimiter before the message Ethernet header and switching the message transmission clock domain.

[0053] Considering that time synchronization messages and other Ethernet messages may be output at the same time after separation, it is necessary to determine the output order of time synchronization messages and Ethernet messages when the messages are output. The design of the output selection module is challenging in two aspects. On the one hand, when the time synchronization message and ordinary Ethernet message arrive at the output selection at the same time, if the time synchronization message is output after the ordinary Ethernet message, the time synchronization message needs to wait for an uncertain period of time. Time-related calculations such as the residence delay of the time synchronization message header need to include this uncertain time. On the other hand, if the time synchronization message is output first, it is necessary to ensure that its output does not affect the output of higher priority traffic such as time-sensitive traffic.

[0054] In order to solve the problem that the time synchronization message is output first, which may affect the output of higher priority traffic such as time-sensitive traffic, the state machine of the output selection module of this embodiment is as follows: Figure 2 As shown, it contains 7 states. The processing logic in each state is as follows:

[0055] idle_s: Idle state. In this state, when there are messages waiting in the buffer, the output selection is determined based on the message information in the buffer provided by the output buffer module, and the state is changed to the corresponding state. If there is a time synchronization message waiting to be output and no other Ethernet messages with higher priority are available, the state changes to t_send_req_s to start outputting the time synchronization message. Otherwise, the state changes to n_send_req_s to output other Ethernet messages.

[0056] t_send_req_s: request signal sending state. In this state, the output selection module sends an output request signal to the output buffer module on the time synchronization message side. After the sending is completed, it jumps to t_trans_wait_s.

[0057] t_trans_wait_s: Time synchronization message transmission waiting state. In this state, the module waits for the first beat message from the time synchronization processing module to arrive at the output selection module. After receiving the first beat message, the module enters the t_trans_s state.

[0058] t_trans_s: The state of the time synchronization message being transmitted. After the transmission of the current message is completed, it jumps to idle_s.

[0059] n_send_req_s: request signal sending state. In this state, the output selection module sends an output request signal to the output buffer module on the other Ethernet message side. After the sending is completed, it jumps to n_trans_wait_s.

[0060] n_trans_wait_s: Waiting state for other Ethernet message transmission. In this state, the module waits for the first beat of the other Ethernet message to arrive at the output selection module. After receiving the first beat of the message, the module enters the n_trans_s state.

[0061] n_trans_s: The general switching module message transmission state. After completing the transmission of the current message, it jumps to idle_s.

[0062] The design of the output selection module state machine ensures that the output of the time synchronization message will not affect the certainty of the transmission of high-priority traffic in the network. Figure 2 As shown in the figure, if there are other types of higher-priority packets waiting to be output, the output selection module prioritizes the output of the high-priority packets. If a high-priority traffic packet arrives while the port is already outputting a time synchronization packet, the high-priority packet will need to wait in the output buffer module. However, after each packet transmission is completed, the output selection module returns to the idle state and reselects the output buffer module for the next packet output. Therefore, the maximum waiting time for a high-priority packet does not exceed the maximum transmission time of a time synchronization packet.

[0063] The output selection module's priority policy can be customized based on the actual scenario. A simpler implementation is to give time synchronization messages the lowest priority, meaning that if other Ethernet messages are waiting to be output, they will be output first. Another implementation is to determine that the priority of time synchronization messages is higher than the priority of best-effort forwarding traffic in the network. In this case, in order to make a priority determination, the output buffer module needs to provide feedback to the output selection module whether the currently waiting message has high-priority traffic. This implementation is more complex than the previous one, but it can prevent the output of time synchronization messages from being affected by the output of best-effort forwarding traffic when there is a lot of best-effort forwarding traffic in the network.

[0064] Finally, the state machine design of the output selection module ensures that once the time synchronization message starts to be output, it will not be preempted by other Ethernet messages. Figure 2 As shown, the output selection module ensures that once the output buffer module starts to output the time synchronization message, other Ethernet messages will be transmitted only after at least one time synchronization message is completely output.

[0065] In order to solve the problem mentioned above that the time synchronization message needs to wait for an uncertain time after being output after the ordinary Ethernet message. First, the time calculation of the time synchronization message is analyzed: the 802.1AS standard of TSN specifies the processing method for different types of time synchronization messages. For SYNC messages, port processing needs to calculate the residence delay based on the local time at the time of output and add it to the time correction field of the SYNC message; on the other hand, for Pdelay_req and Pdelay_resp messages, the port needs to record the local time of its output and generate the corresponding follow_up message. It can be seen that in order to ensure the accuracy of the residence delay calculation and the timestamp in the follow_up message, the protocol port processing module needs to use accurate local time during processing, that is, the local time it records must correspond to the actual time when the message is output from the TSN device.

[0066] Therefore, this embodiment avoids the impact of separating the time synchronization message port processing from other Ethernet message port processing on the accuracy of the local time record through two designs:

[0067] On the one hand, the protocol port processing module is located after the first output buffer module. This design ensures that the local time when the protocol port processing module obtains the time synchronization message already includes the waiting time of the time synchronization message in the first output buffer module. Therefore, the protocol port processing module only needs the local time when performing time calculation, and does not need to calculate the waiting time of the time synchronization message in the first output buffer module again.

[0068] On the other hand, the protocol port processing module can appropriately compensate for the local time value when processing the time synchronization message. The design of the protocol port processing module being located after the first output buffer module ensures that the processing delay of the time synchronization message from leaving the output buffer module to being output to the network is constant. Figure 1 As shown in the figure, this processing delay is the sum of the processing delays of the time synchronization message data in the protocol port processing, CRC calculation, output selection, and transmit-side MAC processing modules, and is a constant value. Therefore, the protocol port processing module compensates the local time by adding a constant processing delay to the local time, which is the sum of the processing delays of the message data in the protocol port processing, CRC calculation, output selection, and transmit-side MAC processing modules. This compensation mechanism ensures that the local time used by the protocol port processing module accurately reflects the time when the message is output by the transmit-side MAC processing module.

[0069] It can be seen that by setting the protocol port processing module for time calculation after the first output buffer module and combining it with the design of the specific state machine of the output selection module, it is ensured at the hardware level that even in the scenario where the output of the time synchronization message needs to wait, its timestamp recording and resident delay calculation include the uncertain delay experienced by the time synchronization message while waiting for output, and are accurate.

[0070] For the first output buffer module and the second output buffer module, in this embodiment, the output buffer module receives the control signal from the output selection module to implement the message buffering function and output control function. Figure 3 As shown, it contains 3 states. The processing logic in each state is as follows:

[0071] idle_s: idle state. When there are messages waiting to be output in the buffer, the system enters wait_req_s.

[0072] wait_req_s: Waiting for output request state. In this state, it waits for the output request signal from the output selection module and jumps to trans_s after receiving it.

[0073] trans_s: Transmitting state. In this state, messages are output. After the current message output is completed, the state jumps to idle_s.

[0074] Based on the message output control system of this embodiment, as well as the state machines of the output buffer module and the output selection module, Figure 4 As shown, the method of this embodiment includes the following steps:

[0075] S101) After the time synchronization message and other Ethernet messages are separated, they are input into the first output buffer module and the second output buffer module respectively.

[0076] S102) When the output selection module is in an idle state, detecting messages waiting to be output in the first output buffer module and the second output buffer module;

[0077] S103) If the first output buffer module has a time synchronization message waiting to be output and the second output buffer module has no other Ethernet messages with a higher priority than the time synchronization message waiting to be output, the output selection module obtains the time synchronization message from the first output buffer module. The time synchronization message sent by the first output buffer module passes through the protocol port processing module and the first cyclic redundancy check calculation module in sequence and reaches the output selection module. The output selection module then outputs the time synchronization message to the transmitting-side MAC processing module and returns to an idle state.

[0078] If the second output buffer module has other Ethernet messages waiting to be output and the first output buffer module has no time synchronization messages waiting to be output, or the first output buffer module has a time synchronization message waiting to be output and the second output buffer module has other Ethernet messages with a higher priority than the time synchronization message waiting to be output, the output selection module obtains the other Ethernet messages from the second output buffer module, and the time synchronization message sent by the second output buffer module passes through the second cyclic redundancy check calculation module to reach the output selection module, and then the output selection module outputs the other Ethernet messages to the sending side MAC processing module and returns to the idle state.

[0079] Through the above steps, the output selection module determines whether to output the time synchronization message or other Ethernet messages based on the waiting status of the time synchronization message and other Ethernet messages in the corresponding output buffer module and the priority of the waiting messages.

[0080] The relevant contents are described in detail below.

[0081] In step S103 of this embodiment, when the output selection module obtains the time synchronization message from the first output buffer module, the following steps are specifically included:

[0082] S201) The output selection module sends a request signal to the first output buffer module, and the first output buffer module outputs the corresponding time synchronization message after receiving the request signal;

[0083] S202) After the protocol port processing module waits for and obtains the time synchronization message, it performs port processing on the time synchronization message according to the 802.1AS standard and sends the processed time synchronization message to the first cyclic redundancy check calculation module;

[0084] S203) After the first cyclic redundancy check calculation waits and obtains the time synchronization message, a cyclic redundancy check code is generated according to the message content and added to the end of the message, and the time synchronization message with the added cyclic redundancy check code is sent to the output selection module.

[0085] Furthermore, in step S103), when the output selection module obtains other Ethernet messages from the second output buffer module, the following steps are specifically included:

[0086] S301) The output selection module sends a request signal to the second output buffer module, and the second output buffer module outputs the corresponding other Ethernet packets after receiving the request signal;

[0087] S302) After waiting for and obtaining other Ethernet messages, the second cyclic redundancy check calculation module generates a cyclic redundancy check code according to the message content and adds it to the end of the message, and sends the other Ethernet messages with the added cyclic redundancy check code to the output selection module.

[0088] In step S103 of this embodiment, after outputting the time synchronization message to the transmitting-side MAC processing module and outputting other Ethernet messages to the transmitting-side MAC processing module, the method further includes:

[0089] The sending side MAC processing module waits for and obtains the time synchronization message or Ethernet message, adds a preamble and a message start symbol before the Ethernet header of the time synchronization message or Ethernet message, switches the message transmission clock domain, and then outputs the processed time synchronization message or Ethernet message.

[0090] In step S103 of this embodiment, with respect to the priority between the time synchronization message and other Ethernet messages, according to the aforementioned output selection module priority strategy, the priority of the time synchronization message is the lowest priority, or the other Ethernet messages include low-priority Ethernet messages whose priority is lower than that of the time synchronization message, and high-priority Ethernet messages whose priority is higher than that of the time synchronization message. At this time, when the output selection module obtains other Ethernet messages from the second output buffer module, it specifically obtains the Ethernet message with the highest priority in the second output buffer module.

[0091] According to the aforementioned content on avoiding affecting the accuracy of local time records, in step S202 of this embodiment, after the protocol port processing module waits for and obtains the time synchronization message, a clock compensation step is further included, specifically including:

[0092] S401) Recording the local time when the time synchronization message is obtained;

[0093] S402) Calculating the sum of the local time and a specified processing delay to obtain a compensated local time, wherein the specified processing delay is a constant value, specifically the sum of the processing delays of the message data in the protocol port processing module, the first cyclic redundancy check calculation module, the output selection module, and the transmitting side MAC processing module.

[0094] Example 2

[0095] This embodiment provides a message output control system, including a first output buffer module, a second output buffer module, and an output selection module. The first output buffer module and the second output buffer module are both connected to the data receiving side of the output selection module, wherein:

[0096] The first output buffer module is used to send and receive time synchronization messages;

[0097] The second output buffer module is used to send and receive other Ethernet messages;

[0098] The output selection module is used to detect messages waiting to be output in the first output buffer module and the second output buffer module in an idle state; if the first output buffer module has a time synchronization message waiting to be output and the second output buffer module has no other Ethernet messages waiting to be output with a higher priority than the time synchronization message, then the time synchronization message is obtained from the first output buffer module, and then the time synchronization message is output and the idle state is returned; if the second output buffer module has other Ethernet messages waiting to be output and the first output buffer module has no time synchronization message waiting to be output, or if the first output buffer module has a time synchronization message waiting to be output and the second output buffer module has other Ethernet messages waiting to be output with a higher priority than the time synchronization message, then the other Ethernet messages are obtained from the second output buffer module, and then the other Ethernet messages are output and the idle state is returned.

[0099] In this embodiment, the first output buffer module is connected to the data receiving side of the output selection module through the protocol port processing module and the first cyclic redundancy check calculation module in sequence. When the output selection module obtains the time synchronization message from the first output buffer module:

[0100] The output selection module is used to send a request signal to the first output buffer module;

[0101] The first output buffer module is used to output a corresponding time synchronization message after obtaining a request signal;

[0102] The protocol port processing module is configured to, after waiting for and obtaining the time synchronization message, perform port processing of the time synchronization message according to the 802.1AS standard, and send the processed time synchronization message to the first cyclic redundancy check calculation module; at the same time, it also records the local time when the time synchronization message is obtained, calculates the sum of the local time and the specified processing delay, and obtains the compensated local time, thereby achieving clock compensation. The specified processing delay is a constant value, specifically the sum of the processing delays of the message data in the protocol port processing module, the first cyclic redundancy check calculation module, the output selection module, and the sending-side MAC processing module;

[0103] The first cyclic redundancy check calculation is used to wait for and obtain the time synchronization message, generate a cyclic redundancy check code according to the message content and add it to the end of the message, and send the time synchronization message with the added cyclic redundancy check code to the output selection module.

[0104] In this embodiment, the second output buffer module is connected to the data receiving side of the output selection module through the second cyclic redundancy check calculation module. When the output selection module obtains other Ethernet packets from the second output buffer module:

[0105] The output selection module is used to send a request signal to the second output buffer module;

[0106] The second output buffer module is used to output corresponding other Ethernet messages after obtaining the request signal;

[0107] The second cyclic redundancy check calculation module is used to wait for and obtain other Ethernet messages, generate a cyclic redundancy check code according to the message content and add it to the end of the message, and send the other Ethernet messages with the added cyclic redundancy check code to the output selection module.

[0108] In this embodiment, the data sending side of the output selection module is connected to the sending side MAC processing module, the sending side MAC processing module waits for and obtains the time synchronization message or Ethernet message, adds a preamble and a message start symbol before the Ethernet header of the time synchronization message or Ethernet message, switches the message transmission clock domain, and then outputs the processed time synchronization message or Ethernet message.

[0109] In summary, the present invention proposes a method for controlling TSN time synchronization message output and a corresponding message output control system. This design separates time synchronization message port output processing from ordinary Ethernet message port processing. This architectural design ensures that the output of time synchronization messages does not affect the output scheduling of high-priority Ethernet messages, such as time-sensitive flows. Furthermore, by placing the protocol port processing module for time calculation after the output buffer module, combined with the design of a specific state machine in the output selection module, this ensures that even in scenarios where time synchronization message output requires waiting, its timestamp recording and resident delay calculation remain accurate (i.e., this calculation includes the uncertain delay experienced by the time synchronization message while waiting for output). This solves the problem that current designs, where time synchronization message port output processing shares the same port output module with other Ethernet messages, lack flexibility in fault-tolerant design requirements for aerospace scenarios and are difficult to implement with common fault-tolerant mechanisms such as COM / MON. This design can be used to support the implementation of fault-tolerant designs in TSN devices that protect time synchronization message processing logic based on the COM / MON mechanism.

[0110] The above description is merely a preferred embodiment of the present invention and does not constitute any form of limitation to the present invention. Although the present invention has been disclosed above with reference to the preferred embodiment, it is not intended to limit the present invention. Therefore, any simple modifications, equivalent variations, and modifications to the above embodiment that do not depart from the technical solution of the present invention and are based on the technical essence of the present invention shall fall within the scope of protection of the technical solution of the present invention.

Claims

1. A method for controlling TSN time synchronization message output, characterized in that: Applied to a message output control system, the message output control system includes a first output buffer module for sending and receiving time synchronization messages, and also includes a second output buffer module for sending and receiving other Ethernet messages, the first output buffer module and the second output buffer module are both connected to the data receiving side of an output selection module, and a protocol port processing module is provided between the first output buffer module and the output selection module. The method includes: When the output selection module is in an idle state, detecting the messages waiting to be output in the first output buffer module and the second output buffer module; If the first output buffer module has a time synchronization message waiting to be output and the second output buffer module has no other Ethernet messages with a higher priority than the time synchronization message waiting to be output, the output selection module obtains the time synchronization message from the first output buffer module, then outputs the time synchronization message and returns to an idle state. When the output selection module obtains the time synchronization message from the first output buffer module, it includes: after the protocol port processing module waits for and obtains the time synchronization message from the first output buffer module, recording the local time when the time synchronization message is obtained; calculating the sum of the local time and the specified processing delay to obtain the compensated local time; If the second output buffer module has other Ethernet messages waiting to be output and the first output buffer module has no time synchronization messages waiting to be output, or the first output buffer module has a time synchronization message waiting to be output and the second output buffer module has other Ethernet messages with a higher priority than the time synchronization message waiting to be output, the output selection module obtains the other Ethernet messages from the second output buffer module, then outputs the other Ethernet messages and returns to the idle state.

2. The method for controlling TSN time synchronization message output according to claim 1, wherein: The first output buffer module is connected to the data receiving side of the output selection module through the protocol port processing module and the first cyclic redundancy check calculation module in sequence. When the output selection module obtains the time synchronization message from the first output buffer module, the method specifically includes: The output selection module sends a request signal to the first output buffer module, and the first output buffer module outputs the corresponding time synchronization message after receiving the request signal; After the protocol port processing module waits for and obtains the time synchronization message, it performs port processing on the time synchronization message according to the 802.1AS standard and sends the processed time synchronization message to the first cyclic redundancy check calculation module; After the first cyclic redundancy check calculation waits and obtains the time synchronization message, a cyclic redundancy check code is generated according to the message content and added to the end of the message, and the time synchronization message with the added cyclic redundancy check code is sent to the output selection module.

3. The method for controlling TSN time synchronization message output according to claim 2, wherein: The data sending side of the output selection module is connected to the sending side MAC processing module, and the outputting of the time synchronization message specifically outputs the time synchronization message to the sending side MAC processing module, and the outputting of other Ethernet messages specifically outputs other Ethernet messages to the sending side MAC processing module. After outputting the time synchronization message to the sending side MAC processing module and outputting other Ethernet messages to the sending side MAC processing module, the method further includes: The sending side MAC processing module waits for and obtains the time synchronization message or Ethernet message, adds a preamble and a message start symbol before the Ethernet header of the time synchronization message or Ethernet message, switches the message transmission clock domain, and then outputs the processed time synchronization message or Ethernet message.

4. The method for controlling TSN time synchronization message output according to claim 3, wherein: The specified processing delay is a constant value, specifically the sum of the processing delays of the message data in the protocol port processing module, the first cyclic redundancy check calculation module, the output selection module, and the sending side MAC processing module.

5. The method for controlling TSN time synchronization message output according to claim 1, wherein: The second output buffer module is connected to the data receiving side of the output selection module through the second cyclic redundancy check calculation module. When the output selection module obtains other Ethernet messages from the second output buffer module, the method specifically includes: The output selection module sends a request signal to the second output buffer module, and the second output buffer module outputs the corresponding other Ethernet messages after receiving the request signal; After waiting for and obtaining other Ethernet messages, the second cyclic redundancy check calculation module generates a cyclic redundancy check code according to the message content and adds it to the end of the message, and sends the other Ethernet messages with the added cyclic redundancy check code to the output selection module.

6. The method for controlling TSN time synchronization message output according to claim 1, wherein: The priority of the time synchronization message is the lowest priority, or the other Ethernet messages include low-priority Ethernet messages with a lower priority than the priority of the time synchronization message, and high-priority Ethernet messages with a higher priority than the priority of the time synchronization message; when the output selection module obtains other Ethernet messages from the second output buffer module, it specifically obtains the Ethernet message with the highest priority in the second output buffer module.

7. A message output control system, characterized in that: It includes a first output buffer module, a second output buffer module and an output selection module, wherein the first output buffer module and the second output buffer module are both connected to the data receiving side of the output selection module, and a protocol port processing module is provided between the first output buffer module and the output selection module, wherein: The first output buffer module is used to send and receive time synchronization messages; The second output buffer module is used to send and receive other Ethernet messages; The output selection module is used to detect the messages waiting to be output in the first output buffer module and the second output buffer module in an idle state; if the first output buffer module has a time synchronization message waiting to be output and the second output buffer module has no other Ethernet messages with a higher priority than the time synchronization message waiting to be output, then the time synchronization message is obtained from the first output buffer module, and then the time synchronization message is output and the idle state is returned. When the output selection module obtains the time synchronization message from the first output buffer module, it includes: after the protocol port processing module waits for and obtains the time synchronization message from the first output buffer module, the local time when the time synchronization message is obtained is recorded; the sum of the local time and the specified processing delay is calculated to obtain the compensated local time; If the second output buffer module has other Ethernet messages waiting to be output and the first output buffer module has no time synchronization messages waiting to be output, or the first output buffer module has a time synchronization message waiting to be output and the second output buffer module has other Ethernet messages waiting to be output with a higher priority than the time synchronization message, then obtain the other Ethernet messages from the second output buffer module, then output the other Ethernet messages and return to the idle state.

8. The message output control system according to claim 7, characterized in that: The first output buffer module is connected to the data receiving side of the output selection module through the protocol port processing module and the first cyclic redundancy check calculation module in sequence. When the output selection module obtains the time synchronization message from the first output buffer module: The output selection module is used to send a request signal to the first output buffer module; The first output buffer module is used to output a corresponding time synchronization message after obtaining a request signal; The protocol port processing module is used to wait for and obtain the time synchronization message, perform port processing of the time synchronization message according to the 802.1AS standard, and send the processed time synchronization message to the first cyclic redundancy check calculation module; The first cyclic redundancy check calculation is used to wait for and obtain the time synchronization message, generate a cyclic redundancy check code according to the message content and add it to the end of the message, and send the time synchronization message with the added cyclic redundancy check code to the output selection module.

9. The message output control system according to claim 7, characterized in that: The second output buffer module is connected to the data receiving side of the output selection module through the second cyclic redundancy check calculation module. When the output selection module obtains other Ethernet packets from the second output buffer module: The output selection module is used to send a request signal to the second output buffer module; The second output buffer module is used to output corresponding other Ethernet messages after obtaining the request signal; The second cyclic redundancy check calculation module is used to wait for and obtain other Ethernet messages, generate a cyclic redundancy check code according to the message content and add it to the end of the message, and send the other Ethernet messages with the added cyclic redundancy check code to the output selection module.

10. The message output control system according to claim 7, characterized in that: The data sending side of the output selection module is connected to the sending side MAC processing module, and the sending side MAC processing module waits for and obtains the time synchronization message or Ethernet message, adds a preamble and a message start symbol before the Ethernet header of the time synchronization message or Ethernet message, switches the message transmission clock domain, and then outputs the processed time synchronization message or Ethernet message.

Citation Information

Patent Citations

  • Priority-based intelligent high-voltage switch network message sending method and system

    CN111865825A