TSN time synchronization message output control method and system

By separating the port output processing of time synchronization messages and other Ethernet messages, and using the output selection module with priority strategy, the fault tolerance design complexity caused by the common port processing module in the existing technology is solved, and flexible fault tolerance design and efficient message output scheduling are realized.

CN120050243AActive Publication Date: 2025-05-27NAT UNIV OF DEFENSE TECH
View PDF 7 Cites 0 Cited by

Patent Information

Application Number
CN202510527333.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-04-25
Publication Date
2025-05-27
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, making it difficult to realize the fault-tolerant design of the system in aerospace scenarios, increasing the complexity of system design and implementation.

Method used

By separating the output processing of the time synchronization message port from the ordinary Ethernet message port processing, and designing the output selection module to determine the message output sequence with the priority policy, ensuring that the output of the time synchronization message does not affect the output scheduling of the high-priority Ethernet message.

Benefits of technology

It realizes that the output of time-synchronous packets does not affect the output of high-priority traffic, reduces the complexity of system design and implementation, and supports the implementation of fault-tolerant mechanisms such as COM/MON.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120050243A_ABST
    Figure CN120050243A_ABST
Patent Text Reader

Abstract

The invention discloses a TSN time synchronization message output control method and a TSN time synchronization message output control system, which are applied to a message output control system, and the message output control system comprises a first output buffer module for receiving and transmitting a time synchronization message and a second output buffer module for receiving and transmitting other Ethernet messages. The first output buffer module and the second output buffer module are both connected with the output selection module. The method comprises the following steps: detecting messages to be output in the first output buffer module and the second output buffer module when the output selection module is idle; if the first output buffer module has the time synchronization message waiting for output and the second output buffer module does not have other Ethernet messages with the priority higher than that of the time synchronization message waiting for output, obtaining the time synchronization message from the first output buffer module, outputting the time synchronization message and returning to the idle state; otherwise, the output selection module obtains other Ethernet messages from the second output buffer module, outputs the other Ethernet messages and returns to the idle state. According to the method, the flexibility for the fault-tolerant design requirement is ensured.
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, when messages of different traffic flows are output from the same port, congestion is likely to occur, causing messages to queue up at the port. Since the length of this waiting time is uncertain, traditional Ethernet cannot guarantee that the delay and jitter of message transmission are within a given upper limit. Unlike traditional Ethernet, time-sensitive networking (TSN) can provide certain delay and jitter for the transmission of key traffic in the network. This makes TSN have a wide range of application value in many fields such as automotive, industrial control, aerospace, etc.

[0003] TSN plans and schedules the transmission time for traffic in the network based on the clock synchronized across the entire network, thus avoiding message congestion and uncertain queuing waiting time. In order to achieve clock synchronization between devices across the entire network, TSN defines a distributed time synchronization protocol in its 802.1AS standard. Devices in the network process time synchronization messages and achieve synchronization based on this protocol. The implementation of the 802.1AS protocol, that is, the processing logic of time synchronization messages, is a key component of TSN devices (switches / network cards).

[0004] An important part 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 the port outputs this type of message, it 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 the implementation of TSN devices, time synchronization messages share the same port processing module with other types of Ethernet messages, that is, the port processing module classifies and processes messages according to their types. Although this shared port processing module implementation saves hardware resources, it lacks flexibility in the aerospace scenario when facing the system fault-tolerant design requirements. In the aerospace scenario, ion irradiation in the environment can easily cause bit flip failures in the circuit. In order to achieve fault-tolerant operation of the system, a common system design method is to redundancy and replication of the hardware logic that needs to be protected. Since the probability of multiple logics failing at the same time due to ion irradiation is extremely low, the system can detect faults and perform corresponding processing by comparing the results of multiple logic executions. For example, the COM / MON mechanism widely used in the aerospace field is to copy the execution logic into two copies, COM and MON, and detect faults by comparing the execution results of COM and MON. TSN can protect the key logic of its time synchronization message processing by applying the COM / MON mechanism. However, since the time synchronization message and other Ethernet messages share the port processing module, when the system replicates the time synchronization message processing logic, it needs to consider the impact of the replication of the port processing part on the output of other types of 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, thereby 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 other Ethernet message port outputs.

[0007] In order to solve the above technical problems, the technical solution proposed by the present invention is: A method for controlling TSN time synchronization message output is applied to a message output control system, wherein the message output control system comprises a first output buffer module for sending and receiving time synchronization messages, and also comprises a second output buffer module for sending and receiving other Ethernet messages, wherein the first output buffer module and the second output buffer module are both connected to a data receiving side of an output selection module, and the method comprises: 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; 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, 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.

[0008] Further, 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, and when the output selection module obtains the time synchronization message from the first output buffer module, it specifically includes: The output selection module sends a request signal to the first output buffer module, and the first output buffer module outputs a corresponding time synchronization message after obtaining the request signal; After the protocol port processing module waits for and obtains the time synchronization message, it performs port processing of 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.

[0009] Further, the data sending side of the output selection module is connected to the sending side MAC processing module, and the output of the time synchronization message is specifically to output the time synchronization message to the sending side MAC processing module, and the output of other Ethernet messages is specifically to output 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, it also 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.

[0010] Furthermore, after the protocol port processing module waits for and obtains the time synchronization message, it also includes a clock compensation step, which specifically includes: Record the local time when the time synchronization message is obtained; The sum of the local time and the specified processing delay is calculated to obtain the compensated local time, where 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.

[0011] 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, and when the output selection module obtains other Ethernet messages from the second output buffer module, it specifically includes: The output selection module sends a request signal to the second output buffer module, and the second output buffer module outputs 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.

[0012] 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.

[0013] 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: The first output buffer module is used to send and receive time synchronization messages; The second output buffer module is used for sending and receiving other Ethernet messages; 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 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.

[0014] Further, 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, and 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.

[0015] 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, and when the output selection module obtains other Ethernet messages 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 other corresponding 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.

[0016] 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 code 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.

[0017] Compared with the prior art, the advantages of the present invention are: 1. The present invention designs an architecture that separates the time synchronization message port output processing from the ordinary Ethernet message port processing, and determines the current output message through the message priority, which can ensure that the output of the time synchronization message does not affect the output scheduling of high-priority Ethernet messages such as time-sensitive flows.

[0018] 2. The present invention sets the protocol port processing module for time calculation after the first output buffer module, and combines the design of the specific state machine of the output selection module to ensure at the hardware level that even in the scenario where the time synchronization message output needs to wait, its timestamp record and resident delay calculation include the uncertain delay experienced by the time synchronization message while waiting for output, and are accurate. BRIEF DESCRIPTION OF THE DRAWINGS

[0019] Figure 1 It is a schematic diagram of the flow of output processing of time synchronization messages and other Ethernet messages at a port according to an embodiment of the present invention.

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

[0021] Figure 3 It is a schematic diagram of the state machine design of the output buffer module of an embodiment of the present invention.

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

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

[0024] Embodiment 1 This embodiment proposes a method for controlling the output of TSN time synchronization messages, which separates the port output processing of time synchronization messages from the port processing of other Ethernet messages. When the time synchronization message and other Ethernet messages are output to the port at the same time, the output selection module selects which side of the message is output to the port according to the priority strategy.

[0025] 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 also includes 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, and the data sending side of the output selection module is connected to the sending side MAC processing module.

[0026] like Figure 1As shown, through the above structure, when the time synchronization message is output to the port, it first enters the first output buffer module to wait. The first output buffer module interacts with the output selection module to output control signals to control whether the message content is sent to the subsequent module. When the first output buffer module starts to output the time synchronization message, the time synchronization message is processed by the protocol port processing module, the first cyclic redundancy check calculation module, the output selection module and the sending side MAC processing message module in sequence and then output.

[0027] When other Ethernet messages are output to the port, they first enter the second output buffer module to wait. The second output buffer module interacts with the output selection module to output control signals to control whether the message content is sent to the subsequent module. When the second output buffer module starts to output messages, the messages are processed by the second cyclic redundancy check calculation module, the output selection module and the sending side MAC processing message module in turn before being output.

[0028] The protocol port processing module in this embodiment is responsible for port processing of time synchronization messages according to the 802.1AS standard. The first cyclic redundancy check calculation module and the second cyclic redundancy check calculation module are both responsible for performing cyclic redundancy check calculations according to the message content, generating the corresponding cyclic redundancy check code CRC and adding it to the end of the message. The sending side MAC processing module is responsible for adding a preamble and a message start symbol before the message Ethernet header, and switching the message transmission clock domain.

[0029] Considering that the time synchronization message and other Ethernet messages may be output at the same time after separation, it is necessary to determine the output order of the time synchronization message and the Ethernet message when the message is output. The design of the output selection module is challenging in two aspects. On the one hand, when the time synchronization message and the 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 part of the 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 flows.

[0030] 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: idle_s: idle state. In this state, when there are messages waiting in the buffer, the output selection is judged and the corresponding state is jumped according to the message information of the buffer provided by the output buffer module. When there are time synchronization messages waiting to be output and there are no other Ethernet messages with higher priority, jump to t_send_req_s to start outputting the time synchronization message; otherwise, jump to n_send_req_s state to output other Ethernet messages.

[0031] 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, and jumps to t_trans_wait_s after the sending is completed.

[0032] t_trans_wait_s: Time synchronization message transmission waiting state, in this state, wait for the first beat message from the time synchronization processing module to arrive at the output selection module. After receiving the first beat message, enter the t_trans_s state.

[0033] 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.

[0034] 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, and jumps to n_trans_wait_s after the sending is completed.

[0035] n_trans_wait_s: Other Ethernet message transmission waiting state, in this state, wait for the first beat message from other Ethernet message side to arrive at the output selection module. After receiving the first beat message, enter the n_trans_s state.

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

[0037] 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 messages with higher priority waiting to be output, the output selection module will give priority to the output of high-priority messages. If the port is outputting time synchronization messages when high-priority traffic messages arrive, the high-priority messages need to wait in the output buffer module, but the output selection module will return to the idle state and reselect the output buffer module for the next output message after each message transmission is completed. Therefore, the maximum waiting time for high-priority messages will not exceed the transmission time of a maximum time synchronization message.

[0038] The setting of the output selection module priority strategy can be customized according to the actual scenario. A relatively simple implementation method is to make the time synchronization message have the lowest priority, that is, once there are other Ethernet messages waiting to be output, other Ethernet messages will be output first. Another implementation method is to determine that the priority of the time synchronization message is higher than the priority of the best-effort forwarding traffic in the network. At this time, in order to make a priority determination, the output buffer module needs to feedback to the output selection module whether the currently waiting message has high-priority traffic. This implementation method is more complicated than the previous one, but it can avoid the output of the time synchronization message being affected by the output of the best-effort forwarding traffic when there is a lot of best-effort forwarding traffic in the network.

[0039] 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.

[0040] In order to solve the problem that the time synchronization message needs to wait for an uncertain time after being output after the ordinary Ethernet message in the above problem. First, the time calculation of the time synchronization message is analyzed: the 802.1AS standard of TSN specifies the processing methods for different types of time synchronization messages. For SYNC messages, port processing needs to calculate the resident 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 resident delay calculation and the timestamp in the follow_up message, the protocol port processing module needs to use accurate local time when processing, that is, the local time it records needs to correspond to the actual output time of the message from the TSN device.

[0041] Therefore, this embodiment avoids the impact of the design of separating the time synchronization message port processing from other Ethernet message port processing on the accuracy of the above local time record through two aspects of design: 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 there is no need to calculate the waiting time of the time synchronization message in the first output buffer module again.

[0042] On the other hand, the protocol port processing module can appropriately compensate for the value of the local time when processing the time synchronization message. The design of the protocol port processing module 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 part of the 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 sending side MAC processing modules, which is a constant value. Therefore, the protocol port processing module compensates the value of the local time, that is, superimposes a constant processing delay on the local time, that is, the sum of the processing delays of the message data in the protocol port processing, CRC calculation, output selection and sending side MAC processing modules. The compensation mechanism enables the local time used by the protocol port processing module in its processing process to accurately reflect the time point when the message is output from the sending side MAC processing module.

[0043] It can be seen that by setting the protocol port processing module used for time calculation after the first output buffer module, combined 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.

[0044] 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: idle_s: idle state. When there are messages waiting to be output in the buffer, wait_req_s is entered.

[0045] 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.

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

[0047] Based on the message output control system of this embodiment, and the state machines of the output buffer module and the output selection module, as shown in FIG. Figure 4 As shown, the method of this embodiment includes the following steps: 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. 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; 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, and 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 to reach the output selection module, and then the output selection module outputs the time synchronization message to the sending side MAC processing module and returns to the idle state; 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 other Ethernet messages from the second output buffer module, and the time synchronization message sent by the second output buffer module reaches the output selection module through the second cyclic redundancy check calculation module, and then the output selection module outputs other Ethernet messages to the sending side MAC processing module and returns to the idle state.

[0048] Through the above steps, the output selection module determines whether to output the time synchronization message or other Ethernet messages according to the waiting conditions of the time synchronization message and other Ethernet messages in the corresponding output buffer modules and the priorities of the waiting messages.

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

[0050] 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: S201) The output selection module sends a request signal to the first output buffer module, and the first output buffer module outputs a corresponding time synchronization message after receiving the request signal; S202) After the protocol port processing module waits for and obtains the time synchronization message, it performs port processing of 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; 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.

[0051] 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: S301) The output selection module sends a request signal to the second output buffer module, and the second output buffer module outputs corresponding other Ethernet messages after receiving the request signal; S302) After waiting 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.

[0052] 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: 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.

[0053] In step S103 of this embodiment, for 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 priorities are lower than the priority of the time synchronization message, and high-priority Ethernet messages whose priorities are higher than the priority 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.

[0054] According to the aforementioned content about 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, which specifically includes: S401) recording the local time when the time synchronization message is obtained; S402) Calculate the sum of the local time and the specified processing delay to obtain the 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 sending side MAC processing module.

[0055] Embodiment 2 This embodiment provides a message output control system, including 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, wherein: The first output buffer module is used to send and receive time synchronization messages; The second output buffer module is used for sending and receiving other Ethernet messages; 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 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.

[0056] 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: 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; 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 realizing clock compensation, and 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; 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.

[0057] 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 messages 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 other corresponding 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.

[0058] 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 code 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.

[0059] In summary, the present invention proposes a method for controlling the output of TSN time synchronization messages, and proposes a corresponding message output control system, designs an architecture in which the port output processing of time synchronization messages is separated from the port processing of ordinary Ethernet messages, and ensures that the output of time synchronization messages does not affect the output scheduling of high-priority Ethernet messages such as time-sensitive flows through the architecture design. In addition, by setting the protocol port processing module for time calculation after the output buffer module, combined with the design of the specific state machine of the output selection module, it is ensured that even in the scenario where the output of the time synchronization message needs to wait, its timestamp record and resident delay calculation are still accurate (that is, this part of the calculation includes the uncertain delay experienced by the time synchronization message when waiting for output). Thus, the current design of the port output processing of the time synchronization message and other Ethernet messages sharing the same port output module lacks flexibility when facing the fault-tolerant design requirements in aerospace scenarios, and it is difficult to support the implementation of common fault-tolerant mechanisms such as COM / MON, and can be used to support the implementation of fault-tolerant design based on the COM / MON mechanism to protect the time synchronization message processing logic in TSN equipment.

[0060] The above is only a preferred embodiment of the present invention, and does not limit the present invention in any form. Although the present invention has been disclosed as a preferred embodiment, it is not intended to limit the present invention. Therefore, any simple modification, equivalent change and modification made to the above embodiment according to the technical essence of the present invention without departing from the content of the technical solution 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 the output selection module, and 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; 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, 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, 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, it specifically includes: The output selection module sends a request signal to the first output buffer module, and the first output buffer module outputs a corresponding time synchronization message after obtaining the request signal; After the protocol port processing module waits for and obtains the time synchronization message, it performs port processing of 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, characterized in that: The data transmission side of the output selection module is connected to the transmission side MAC processing module, and the output of the time synchronization message is specifically to output the time synchronization message to the transmission side MAC processing module, and the output of other Ethernet messages is specifically to output other Ethernet messages to the transmission side MAC processing module. After outputting the time synchronization message to the transmission side MAC processing module and outputting other Ethernet messages to the transmission 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, characterized in that: After the protocol port processing module waits for and obtains the time synchronization message, it also includes a clock compensation step, which specifically includes: Record the local time when the time synchronization message is obtained; The sum of the local time and the specified processing delay is calculated to obtain the compensated local time, where 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, 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, and when the output selection module obtains other Ethernet messages from the second output buffer module, it specifically includes: The output selection module sends a request signal to the second output buffer module, and the second output buffer module outputs 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, characterized in that: 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 the priority of the time synchronization message, and high-priority Ethernet messages whose priority is higher 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, wherein: The first output buffer module is used to send and receive time synchronization messages; The second output buffer module is used for sending and receiving other Ethernet messages; 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 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.

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 messages 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 other corresponding 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, 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

  • Data transmission method, device and storage medium

    CN107634915A

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

    CN111865825A

  • Network port PTP time service function extension device and extension method

    CN114629586A

  • TSN message scheduling method, switch, equipment and storage medium

    CN115086245A

  • Terminal Ethernet scheduling method and system, storage medium and computer

    CN116545953A