A method for dynamically adjusting message priority, a TSN switch and a chip
By introducing a dynamic priority adjustment device into the TSN switch, the packet priority is dynamically adjusted and mapped to the available queue, which solves the problem of high-priority packet waiting, realizes efficient burst traffic processing, and improves the reliability and flexibility of the network.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- BEIJING SMARTCHIP MICROELECTRONICS TECHNOLOGY CO LTD
- Filing Date
- 2026-04-01
- Publication Date
- 2026-06-05
AI Technical Summary
Existing TSN switches require waiting for the next opening window when high-priority packets arrive at the closing time, which causes network protocols to fail to interact in a timely manner, potentially leading to system-level failures. Furthermore, some switching chips do not support independent protocol queue design, making it impossible to effectively handle sudden traffic surges.
By using a priority dynamic adjustment device, a specified message is copied and the original gating queue status is queried. The opening time slots of the remaining gating queues are checked in turn, the message priority is adjusted and mapped to the available queues for transmission, thereby realizing cross-queue time slot sharing.
It reduces burst message queuing latency to the microsecond level, avoids network failures, reduces resource waste, improves network reliability and flexibility, and solves the shortcomings of traditional Qbv scheduling in handling burst traffic.
Smart Images

Figure CN122160342A_ABST
Abstract
Description
Technical Field
[0001] This disclosure relates to the field of Time-Sensitive Networking (TSN) data forwarding technology, specifically to a method for dynamically adjusting packet priority, a TSN switch, and a chip. Background Technology
[0002] The IEEE 802.1Qbv protocol is one of the standard technologies of TSN (Transportation Service). It defines a time-triggered queue scheduling mechanism that precisely controls the "open" and "closed" states of each queue through a pre-configured cycle. When a packet carrying a specific priority arrives at the switch, if the corresponding queue is in the open state, the packet can be forwarded immediately from the port; if the queue is in the closed state, the packet will be temporarily stored in the queue buffer, waiting for the next opening opportunity.
[0003] However, if all queues on the switch have Qbv gating enabled, when a high-priority packet arrives during the closing period of its corresponding queue, it still needs to wait until the next opening window before it can be transmitted. If such high-priority packets cannot be forwarded in time due to continuous waiting, it may cause network protocols to oscillate due to the inability to complete timely interaction, or even trigger system-level failures.
[0004] To address these issues, some high-end switching chips are designed with a dedicated protocol queue for each port. These queues are not subject to Qbv gating scheduling, ensuring timely transmission of protocol packets. However, not all switching chips support this independent protocol queue design; therefore, in actual network deployments, a systematic approach to ensuring the smooth operation of high-priority burst traffic scheduling is still necessary. Summary of the Invention
[0005] To address the problems in the related technologies, this disclosure provides a method for dynamically adjusting message priority, a TSN switch, and a chip.
[0006] In a first aspect, embodiments of this disclosure provide a method for dynamically adjusting packet priority, the method being applied to a TSN switch, the method comprising: Receive and parse the specified message to determine the original priority of the specified message; The specified message is mapped to the original gated queue corresponding to the original priority. The gated list includes the mapping relationship between the gated status of multiple gated queues and the corresponding opening time slots. The gated queue has the gated function enabled and is used to transmit messages of the corresponding priority. The specified message is copied and sent to the priority dynamic adjustment device, wherein the specified message copy has the original priority; The priority dynamic adjustment device queries the current gating status of the original gating queue. When the original gating queue is in an open state and the remaining open time slots cannot transmit the specified message, or when the original gating queue is in a closed state, the remaining open time slots of each gating queue are checked sequentially according to the opening time order of the remaining gating queues in the gating list until a gating queue that can transmit the copy of the specified message is determined. The original priority of the copy of the specified message is adjusted to the priority corresponding to the determined gating queue to obtain the adjusted priority of the copy of the specified message. The specified message copy is mapped to a gated queue corresponding to the adjusted priority, the specified message copy is transmitted using the gated queue, and the specified message is deleted from the original gated queue.
[0007] According to embodiments of this disclosure, the step of sequentially checking the remaining opening time slots of each gate control queue in the gate control list according to the opening time order of the remaining gate control queues includes: When the original gated queue is in an open state and the remaining open time slots cannot transmit the specified message, the next gated queue to be opened is determined from the gated list; Starting from the next gate queue to be opened, check sequentially whether the remaining opening time slots in each gate queue of the gate list can transmit the specified message copy.
[0008] According to embodiments of this disclosure, the step of sequentially checking the remaining opening time slots of each gate control queue in the gate control list according to the opening time order of the remaining gate control queues includes: When the original gated queue is in a closed state, determine the gated queue that is currently in an open state from the gated list; Starting with the gate queue that is currently in the open state, check in turn whether the remaining open time slots in each gate queue in the gate list can transmit the specified message copy.
[0009] According to an embodiment of this disclosure, the method further includes: when the original gated queue is in an open state and the remaining open time slots can transmit the specified message, discarding a copy of the specified message through the priority dynamic adjustment device; The specified message is transmitted through the original gated queue.
[0010] According to embodiments of this disclosure: the designated message is a burst high-priority message; For a gated queue that is currently in an open state, the remaining opening time slot of the gated queue is: the difference between the remaining time slot in the opening time slot of the gated queue and the estimated total transmission time of the remaining untransmitted messages; For the next gated queue to be opened, the remaining opening time slot of the gated queue is the difference between the opening time slot of the gated queue and the estimated total transmission time of all messages to be transmitted.
[0011] According to an embodiment of this disclosure: when the remaining gate opening time slot is greater than or equal to the expected transmission time slot of the specified message, it is determined that the corresponding gated queue can transmit the specified message or a copy of the specified message; When the remaining gate opening time slot is zero or less than the expected transmission time slot of the specified message, it is determined that the corresponding gated queue cannot transmit the specified message or a copy of the specified message.
[0012] According to embodiments of this disclosure, the priority dynamic adjustment device is time-synchronized with the TSN switch, and the priority dynamic adjustment device is configured with the gating list.
[0013] According to an embodiment of this disclosure, the opening time order of the remaining gated queues is: the ascending order of the opening times of each gated queue in the remaining gated queues.
[0014] Secondly, embodiments of this disclosure provide a TSN switching chip, comprising: The receiving module is configured to receive and parse a specified message and determine the original priority of the specified message; The mapping module is configured to map the specified message to the original gated queue corresponding to the original priority. The gated list includes the mapping relationship between the gated status of multiple gated queues and the corresponding opening time slots. The gated queues have the gated function enabled and are used to transmit messages of the corresponding priority. The replication module is configured to replicate the specified message and send a copy of the specified message to the priority dynamic adjustment device, wherein the copy of the specified message has the original priority; The priority dynamic adjustment device is configured to query the current gating status of the original gating queue; when the original gating queue is in an open state and the remaining open time slots cannot transmit the specified message, or when the original gating queue is in a closed state, the device sequentially checks the remaining open time slots of each gating queue according to the opening time order of the remaining gating queues in the gating list until a gating queue that can transmit the copy of the specified message is determined; the device adjusts the original priority of the copy of the specified message to the priority corresponding to the determined gating queue, thereby obtaining the adjusted priority of the copy of the specified message; The sending module is configured to map the specified message copy to a gated queue corresponding to the adjusted priority, and use the gated queue to transmit the specified message copy.
[0015] According to embodiments of this disclosure, it further includes: a deletion module; The deletion module is configured to delete the specified message in the original gated queue when transmitting a copy of the specified message using a gated queue corresponding to the adjusted priority.
[0016] According to an embodiment of this disclosure, the priority dynamic adjustment device is further configured to: discard a copy of the specified message when the original gated queue is in an open state and the remaining open time slots can transmit the specified message; The sending module is also configured to transmit the specified message through the original gated queue.
[0017] According to embodiments of this disclosure, the priority dynamic adjustment device is time-synchronized with the TSN switching chip, and the priority dynamic adjustment device is configured with the gating list.
[0018] According to embodiments of this disclosure: The specified message is a burst high-priority message; For a gated queue that is currently in an open state, the remaining opening time slot of the gated queue is: the difference between the remaining time slot in the opening time slot of the gated queue and the estimated total transmission time of the remaining untransmitted messages; For the next gated queue to be opened, the remaining opening time slot of the gated queue is the difference between the opening time slot of the gated queue and the estimated total transmission time of all messages to be transmitted.
[0019] Thirdly, embodiments of this disclosure provide a TSN switching chip, including a memory and a processor; wherein the memory is used to store one or more computer instructions, which are executed by the processor to implement the dynamic adjustment method as described in any of the first aspects.
[0020] Fourthly, embodiments of this disclosure provide a TSN switch, including a TSN switching chip as described in any of the second and third aspects, or including a memory and a processor; wherein the memory is used to store one or more computer instructions, which are executed by the processor to implement the dynamic adjustment method as described in any of the first aspects.
[0021] Fifthly, embodiments of this disclosure provide a computer-readable storage medium having computer instructions stored thereon that, when executed by a processor, implement the dynamic adjustment method as described in any of the first aspects.
[0022] In a sixth aspect, embodiments of this disclosure provide a computer program product including computer instructions that, when executed by a processor, implement the dynamic adjustment method as described in any of the first aspects.
[0023] This disclosure uses a priority dynamic adjustment device to store a copy of a specified message and query the current gating status of the original gating queue. When the original gating queue is in an open state and the remaining open time slots cannot transmit the specified message, or is in a closed state, the remaining open time slots of each gating queue are checked sequentially according to the opening time order of the remaining gating queues in the gating list until a gating queue that can transmit the copy of the specified message is determined. The original priority of the copy of the specified message is adjusted to the priority corresponding to the determined gating queue. The copy of the specified message is transmitted through the gating queue corresponding to the adjusted priority, and the specified message in the original gating queue is deleted.
[0024] This disclosure can dynamically sense time slot availability and intelligently select forwarding queues; it reduces the queuing delay of burst packets from the periodic level to the microsecond level, avoiding various network failures, such as broadcast storms caused by protocol timeout retransmissions and security mechanisms failing due to response delays. It also enables cross-queue time slot sharing, reducing resource waste. While maintaining the deterministic advantages of TSN, it effectively solves the inherent defects of traditional Qbv scheduling in handling burst traffic, providing key technical support for the reliability and flexibility of time-sensitive networks in actual industrial deployments.
[0025] It should be understood that the above general description and the following detailed description are exemplary and explanatory only, and are not intended to limit this disclosure. Attached Figure Description
[0026] Other features, objects, and advantages of this disclosure will become more apparent from the following detailed description of non-limiting embodiments, taken in conjunction with the accompanying drawings. In the drawings: Figure 1 A schematic diagram of an 802.1Qbv gating scheduling mechanism in the prior art is shown; Figure 2 A flowchart illustrating a method for dynamically adjusting message priority according to an embodiment of the present disclosure is shown. Figure 3 This diagram illustrates a method for dynamically adjusting message priority according to an embodiment of the present disclosure to implement message forwarding. Figure 4 A structural block diagram of a TSN switching chip according to an embodiment of the present disclosure is shown. Detailed Implementation
[0027] In the following, exemplary embodiments of the present disclosure will be described in detail with reference to the accompanying drawings to enable those skilled in the art to readily implement them. Furthermore, for clarity, portions unrelated to the description of exemplary embodiments have been omitted from the drawings.
[0028] In this disclosure, it should be understood that terms such as “comprising” or “having” are intended to indicate the presence of features, figures, steps, behaviors, components, parts or combinations thereof disclosed in this specification, and are not intended to exclude the possibility of the presence or addition of one or more other features, figures, steps, behaviors, components, parts or combinations thereof.
[0029] It should also be noted that, unless otherwise specified, the embodiments and features described in this disclosure can be combined with each other. This disclosure will now be described in detail with reference to the accompanying drawings and embodiments.
[0030] As mentioned earlier, after a packet enters the ingress port of the switching chip, it is mapped into different queues (Q7-Q0) according to its priority. These queues are a key component of the 802.1Qbv gating scheduling mechanism. In the 802.1Qbv gating scheduling mechanism, within a single cycle, a gating list contains multiple gating list entries, each defining the "open" or "closed" state of each queue. When the gate is open, packets in the corresponding queue can be forwarded from the egress port; when the gate is closed, packets must wait in the queue until the gate opens again before they can be forwarded.
[0031] like Figure 1 As shown, assuming a cycle length of T = T8 - T0, and defining 8 gating list entries, gate Q7 is opened between T0 and T1, Q6 between T1 and T2, and so on, with Q0 opening between T7 and T8. If a high-priority protocol message suddenly arrives at Q7 at T1, it must wait for T8 - T1 until Q7 opens in the next cycle before the message can be forwarded. If T8 - T1 is long, the message waiting time will be long, potentially causing protocol oscillation.
[0032] While some existing switching chips are designed to address the issue of occasional high-priority packets arriving at switches unexpectedly, and these protocol queues are separate from regular service queues and unaffected by Qbv gating scheduling, not all switching chips support this independent protocol queue design; many switches only provide the standard eight priority queues.
[0033] Furthermore, even with independent protocol queues, there may still be occasional service packets in the network. Since protocol queues are specifically used for transmitting control plane protocol packets (PTP, STP, LLDP, etc.) and cannot transmit service data packets, when such service packets arrive within the closing time of their corresponding queues, they also need to wait for the next opening time before they can be forwarded, and their transmission timeliness cannot be guaranteed.
[0034] This disclosure provides a method for dynamically adjusting packet priority, applied to a TSN switch. The method includes: receiving and parsing a specified packet to determine the original priority of the specified packet; mapping the specified packet to an original gated queue corresponding to the original priority, wherein the gated queue includes a mapping relationship between the gated status of multiple gated queues and corresponding gate opening time slots, the gated queues having gated functionality enabled and used to transmit packets of the corresponding priority; copying the specified packet and sending the copy to a dynamic priority adjustment device, the copy having the original priority; and querying the current gated status of the original gated queue through the dynamic priority adjustment device. When the original gated queue is in an open state and the remaining open time slots cannot transmit the specified message, or when the original gated queue is in a closed state, the remaining open time slots of each gated queue are checked sequentially according to the opening time order of the remaining gated queues in the gated list until a gated queue that can transmit the copy of the specified message is determined; the original priority of the copy of the specified message is adjusted to the priority corresponding to the determined gated queue to obtain the adjusted priority of the copy of the specified message; the copy of the specified message is mapped to the gated queue corresponding to the adjusted priority, the copy of the specified message is transmitted using the gated queue, and the specified message in the original gated queue is deleted.
[0035] This disclosure can dynamically sense time slot availability and intelligently select forwarding queues; it reduces the queuing delay of burst packets from the periodic level to the microsecond level, avoiding various network failures such as broadcast storms caused by protocol timeout retransmission and security mechanisms failing due to response delays, realizing cross-queue time slot sharing, reducing resource waste, and eliminating the need to set up a protocol queue for each switching port.
[0036] Figure 2 A flowchart illustrating a method for dynamically adjusting message priority according to an embodiment of the present disclosure is shown.
[0037] The dynamic adjustment method is applied to TSN switches that support the IEEE 802.1Qbv protocol, such as TSN-Capable switches, TSN-Ready switches, basic TSN switches, etc.
[0038] like Figure 2 As shown, the dynamic adjustment includes steps S201 to S205.
[0039] In step S201, a specified message is received and parsed to determine the original priority of the specified message.
[0040] The specified message is a burst high-priority message, such as a fault notification message sent by an upstream device of the TSN switch detecting an abnormal fault, or a high-priority protocol message sent by the CPU of the TSN switch. After receiving the specified message, the TSN switch parses the priority field of the message to obtain the original priority of the specified message.
[0041] Suppose that the TSN switch defines 8 gating queues Q7-Q0 in the gating list, corresponding to priority levels 7-0 respectively. Only when the original priority of the burst packet belongs to the high priority range will it be identified as the specified packet, such as a packet with priority between 7 and 5, or a packet with priority between 7 and 4. This can be configured as needed.
[0042] In step S202, the specified message is mapped to the original gated queue corresponding to the original priority. The gated list includes the mapping relationship between the gated status of multiple gated queues and the corresponding opening time slots. The gated queue has the gated function enabled and is used to transmit messages of the corresponding priority.
[0043] It is known that each gated queue is used to transmit messages of a corresponding priority. After identifying the original priority of a specified message, it is equivalent to determining which gated queue will transmit the specified message. The gated queue corresponding to the original priority is defined as the original gated queue, and the specified message is mapped to the original gated queue. In this disclosure, "mapping" refers to the process of allocating the message to a specific gated queue according to the priority value of the message and a preset correspondence.
[0044] Furthermore, enabling the gating function in the gating queue indicates that the gating queue is configured for a time-window-controlled scheduling mode.
[0045] In step S203, the specified message is copied and the copy of the specified message is sent to the priority dynamic adjustment device, and the copy of the specified message has the original priority.
[0046] That is, after the TSN switch receives the specified message, it copies the specified message to obtain a copy of the specified message. The copy of the specified message has the same characteristics as the original specified message, and naturally also has the same priority. This copy of the specified message is sent to the priority dynamic adjustment device for storage.
[0047] According to embodiments of this disclosure, a dynamic priority adjustment device is embedded in a TSN switch. This dynamic priority adjustment device can be implemented using an FPGA or a high-performance CPU, but is not limited to these methods. The dynamic priority adjustment device is used to store a specified packet copy and adjust the priority of the specified packet copy according to the state of the gating queue and the remaining opening time slots in the gating queue.
[0048] In step S204, the priority dynamic adjustment device queries the current gating status of the original gating queue; when the original gating queue is in an open state and the remaining open time slots cannot transmit the specified message, or when the original gating queue is in a closed state, the remaining open time slots of each gating queue are checked sequentially according to the opening time order of the remaining gating queues in the gating list, until a gating queue that can transmit the copy of the specified message is determined; the original priority of the copy of the specified message is adjusted to the priority corresponding to the determined gating queue, thus obtaining the adjusted priority of the copy of the specified message.
[0049] According to embodiments of this disclosure, the priority dynamic adjustment device is time-synchronized with the TSN switch, and the priority dynamic adjustment device is configured with the gating list.
[0050] Therefore, the local clock of the priority dynamic adjustment device is consistent with the chip clock of the TSN switch. At the same time, the 802.1Qbv configuration sent to the TSN switch is also recorded in the priority dynamic adjustment device. That is, the priority dynamic adjustment device is also configured with a gating list, so the device knows the opening and closing times of each gating queue.
[0051] According to an embodiment of this disclosure, the opening time order of the remaining gated queues is: the ascending order of the opening times of each gated queue in the remaining gated queues.
[0052] by Figure 1 The gating list shown is explained below. The multiple opening time slots corresponding to queues Q7-Q0 are T0-T1, T1-T2, T2-T3, T3-T4, T4-T5, T5-T6, T6-T7, and T7-T8, respectively. The order of their opening times is T0, T1, T2, T3, T4, T5, T6, and T7 (ascending order). Assuming that the remaining gating queues are Q6-Q0, then the remaining opening time slots of each gating queue need to be checked in the order of Q6, Q5, Q4, Q3, Q2, Q1, and Q0.
[0053] According to embodiments of this disclosure, the remaining opening time slots of each gate control queue are checked sequentially according to the opening time order of the remaining gate control queues in the gate control list, including: When the original gated queue is in an open state and the remaining open time slots cannot transmit the specified message, the next gated queue to be opened is determined from the gated list; Starting from the next gate queue to be opened, check sequentially whether the remaining opening time slots in each gate queue of the gate list can transmit the specified message copy.
[0054] In other words, after the TSN switch receives the specified packet, although the original gated queue is currently open, the remaining opening time slots are insufficient to transmit the specified packet. At this point, the next gated queue to be opened is determined from the gated list. Starting from this next gated queue, the remaining opening time slots in each gated queue are checked sequentially to see if they are sufficient to transmit a copy of the specified packet. For example, if the next gated queue to be opened is Q5, then starting from Q5, the remaining opening time slots in each queue are checked sequentially according to the opening time order of Q5-Q0 to see if they are sufficient to transmit a copy of the specified packet.
[0055] According to embodiments of this disclosure, the remaining opening time slots of each gate control queue are checked sequentially according to the opening time order of the remaining gate control queues in the gate control list, including: When the original gated queue is in a closed state, determine the gated queue that is currently in an open state from the gated list; Starting with the gate queue that is currently in the open state, check in turn whether the remaining open time slots in each gate queue in the gate list can transmit the specified message copy.
[0056] That is, after the TSN switch receives the specified packet, the original gated queue is already in a closed state. At this point, it is necessary to determine the currently opening gated queue from the gated list, and starting from this currently open gated queue, check in turn whether the remaining opening time slots in each gated queue can transmit a copy of the specified packet. For example, if the currently open gated queue is Q4, then starting from Q4, check in turn whether the remaining opening time slots in each gated queue can transmit a copy of the specified packet according to the opening time sequence of Q4-Q0.
[0057] According to an embodiment of this disclosure, for a gated queue that is currently in an open state, the remaining opening time slot of the gated queue is the difference between the remaining time slot in the opening time slot of the gated queue and the estimated total transmission time of the remaining untransmitted messages.
[0058] Suppose that the gated queue currently in the open state is Q6, its corresponding opening time slot is T1-T2, and the remaining time slot in T1-T2 is t1, while the estimated total transmission time of the remaining untransmitted messages in the Q6 queue is t2. Then, the remaining opening time slot for the gated queue Q6 is t = t1 - t2.
[0059] According to an embodiment of this disclosure, for the next gated queue to be opened, the remaining opening time slot of the gated queue is the difference between the opening time slot of the gated queue and the estimated total transmission time of all messages to be transmitted.
[0060] Assuming the next gate queue to be opened is Q5, its corresponding opening time slot is T2-T3, and the estimated total transmission time for all untransmitted messages in queue Q5 is t3, then the remaining opening time slot for gate queue Q5 is t' = (T3-T2)-t3.
[0061] Furthermore, when the remaining gate opening time slot is greater than or equal to the expected transmission time slot of the specified message, it is determined that the corresponding gated queue can transmit the specified message or a copy of the specified message; when the remaining gate opening time slot is zero or less than the expected transmission time slot of the specified message, it is determined that the corresponding gated queue cannot transmit the specified message or a copy of the specified message.
[0062] Furthermore, the estimated total transmission time for the remaining untransmitted messages or all pending messages is related to the following factors: the message length of each untransmitted message or each pending message, the transmission link rate, and the frame interval time specified by the Ethernet protocol.
[0063] In step S205, the specified message copy is mapped to a gated queue corresponding to the adjusted priority, the specified message copy is transmitted using the gated queue, and the specified message in the original gated queue is deleted.
[0064] In this disclosure, after sending a specified message copy with adjusted priority using the corresponding gated queue, the specified message in the original gated queue needs to be deleted to avoid conflicts with the specified message in the original gated queue.
[0065] This disclosure can dynamically sense time slot availability and intelligently select forwarding queues, reducing the queuing delay of burst packets from the periodic level to the microsecond level, avoiding various network failures, reducing production interruption losses caused by network failures, and reducing the cost increase brought by dedicated protocol queue hardware.
[0066] This disclosure also enables cross-queue time slot sharing, avoiding the "starvation" phenomenon caused by fixed priorities. While ensuring critical traffic, it improves overall fairness and effectively solves the inherent defects of traditional Qbv scheduling in handling burst traffic. It provides key technical support for the reliability and flexibility of time-sensitive networks in actual industrial deployments.
[0067] According to an embodiment of this disclosure, when the original gated queue is in an open state and the remaining open time slots are available for transmitting the specified message, the priority dynamic adjustment device discards the copy of the specified message; and the specified message is transmitted through the original gated queue.
[0068] Therefore, when the TSN switch receives the specified message, and the original gated queue is in an open state with sufficient remaining open time slots for transmission, the priority dynamic adjustment device will no longer save a copy of the specified message.
[0069] Figure 3 This diagram illustrates a method for dynamically adjusting message priority according to an embodiment of the present disclosure to implement message forwarding.
[0070] exist Figure 3 In the example shown, after the TSN switch receives the specified packet through the ingress port, it maps it to the original gated queue Q7. At the same time, a copy of the specified packet is sent to the priority dynamic adjustment device for storage. The priority dynamic adjustment device determines that the original gated queue Q7 is in a closed state, while the remaining open time slots in the currently open gated queue Q6 can transmit the specified packet copy. At this time, the priority of the specified packet copy is adjusted to the priority corresponding to that of the gated queue Q6, and the specified packet copy is mapped to the gated queue Q6 for transmission.
[0071] Figure 4 A structural block diagram of a TSN switching chip according to an embodiment of the present disclosure is shown. The TSN switching chip can be implemented as part or all of an electronic device through software, hardware, or a combination of both.
[0072] The TSN switching chip 400 includes a receiving module 410, a mapping module 420, a copying module 430, a priority dynamic adjustment device 440, and a sending module 450.
[0073] The receiving module 410 is configured to receive and parse a specified message to determine the original priority of the specified message. The specified message is a burst high-priority message.
[0074] The mapping module 420 is configured to map the specified message to the original gated queue corresponding to the original priority. The gated list includes the mapping relationship between the gated status of multiple gated queues and the corresponding opening time slots. The gated queues have the gated function enabled and are used to transmit messages of the corresponding priority.
[0075] The copying module 430 is configured to copy the specified message and send a copy of the specified message to the priority dynamic adjustment device, wherein the copy of the specified message has the original priority.
[0076] The priority dynamic adjustment device 440 is configured to query the current gating status of the original gating queue; when the original gating queue is in an open state and the remaining open time slots cannot transmit the specified message, or when the original gating queue is in a closed state, the remaining open time slots of each gating queue are checked sequentially according to the opening time order of the remaining gating queues in the gating list, until a gating queue that can transmit the copy of the specified message is determined; the original priority of the copy of the specified message is adjusted to the priority corresponding to the determined gating queue, thus obtaining the adjusted priority of the copy of the specified message.
[0077] The sending module 450 is configured to map the specified message copy to a gated queue corresponding to the adjusted priority, and use the gated queue to transmit the specified message copy.
[0078] According to an embodiment of this disclosure, the TSN switching chip further includes a deletion module; the deletion module is configured to delete a specified message from the original gated queue when transmitting a copy of the specified message using a gated queue corresponding to the adjusted priority.
[0079] According to an embodiment of this disclosure, the priority dynamic adjustment device 440 is further configured to: discard a copy of the specified message when the original gated queue is in an open state and the remaining open time slots can transmit the specified message.
[0080] According to an embodiment of this disclosure, the sending module 450 is further configured to transmit the designated message through the original gated queue.
[0081] According to embodiments of this disclosure, the priority dynamic adjustment device 440 is time-synchronized with the TSN switching chip, and the priority dynamic adjustment device is configured with the gating list.
[0082] According to embodiments of this disclosure, for a gated queue currently in an open state, the remaining opening time slot of the gated queue is the difference between the remaining time slot in the opening time slot of the gated queue and the estimated total transmission time of the remaining untransmitted messages; for the next gated queue to be opened, the remaining opening time slot of the gated queue is the difference between the opening time slot of the gated queue and the estimated total transmission time of all messages to be transmitted.
[0083] This disclosure also provides a TSN switching chip, including a memory and a processor; wherein the memory is used to store one or more computer instructions, which are executed by the processor to implement the dynamic adjustment method as described in any of the preceding embodiments.
[0084] This disclosure also provides a TSN switch, including a TSN switching chip as described in any of the preceding embodiments, or including a memory and a processor; wherein the memory is used to store one or more computer instructions, which are executed by the processor to implement the dynamic adjustment method described in any of the preceding embodiments.
[0085] In particular, according to embodiments of this disclosure, the methods described above can be implemented as computer software programs. For example, embodiments of this disclosure include a computer program product comprising a computer program tangibly embodied on a machine-readable medium, the computer program containing program code for performing the methods described above. In such embodiments, the computer program can be downloaded and installed from a network via a communication component, and / or installed from a removable medium.
[0086] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this disclosure. In this regard, each block in a flowchart or block diagram may represent a module, segment, or portion of code containing one or more executable instructions for implementing a specified logical function. It should also be noted that in some alternative implementations, the functions indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, may be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0087] The units or modules described in the embodiments of this disclosure can be implemented in software or programmable hardware. The described units or modules can also be located in a processor, and the names of these units or modules do not necessarily constitute a limitation on the unit or module itself.
[0088] In another aspect, this disclosure also provides a computer-readable storage medium, which may be a computer-readable storage medium included in the electronic device or computer system described above; or it may be a standalone computer-readable storage medium not assembled into a device. The computer-readable storage medium stores one or more programs, which are used by one or more processors to perform the methods described in this disclosure.
[0089] The above description is merely a preferred embodiment of this disclosure and an explanation of the technical principles employed. Those skilled in the art should understand that the scope of the invention involved in this disclosure is not limited to technical solutions formed by specific combinations of the above-described technical features, but should also cover other technical solutions formed by arbitrary combinations of the above-described technical features or their equivalents without departing from the inventive concept. For example, technical solutions formed by substituting the above-described features with (but not limited to) technical features disclosed in this disclosure that have similar functions.
Claims
1. A method for dynamically adjusting message priority, characterized in that, The method is applied to a TSN switch, and the method includes: Receive and parse the specified message to determine the original priority of the specified message; The specified message is mapped to the original gated queue corresponding to the original priority. The gated list includes the mapping relationship between the gated status of multiple gated queues and the corresponding opening time slots. The gated queue has the gated function enabled and is used to transmit messages of the corresponding priority. The specified message is copied and sent to the priority dynamic adjustment device, wherein the specified message copy has the original priority; The priority dynamic adjustment device queries the current gating status of the original gating queue. When the original gating queue is in an open state and the remaining open time slots cannot transmit the specified message, or when the original gating queue is in a closed state, the remaining open time slots of each gating queue are checked sequentially according to the opening time order of the remaining gating queues in the gating list until a gating queue that can transmit the copy of the specified message is determined. The original priority of the copy of the specified message is adjusted to the priority corresponding to the determined gating queue to obtain the adjusted priority of the copy of the specified message. The specified message copy is mapped to a gated queue corresponding to the adjusted priority, the specified message copy is transmitted using the gated queue, and the specified message is deleted from the original gated queue.
2. The dynamic adjustment method according to claim 1, characterized in that, The step of sequentially checking the remaining opening time slots of each gate queue according to the opening time order of the remaining gate queues in the gate control list includes: When the original gated queue is in an open state and the remaining open time slots cannot transmit the specified message, the next gated queue to be opened is determined from the gated list; Starting from the next gate queue to be opened, check sequentially whether the remaining opening time slots in each gate queue of the gate list can transmit the specified message copy.
3. The dynamic adjustment method according to claim 1, characterized in that, The step of sequentially checking the remaining opening time slots of each gate queue according to the opening time order of the remaining gate queues in the gate control list includes: When the original gated queue is in a closed state, determine the gated queue that is currently in an open state from the gated list; Starting with the gate queue that is currently in the open state, check in turn whether the remaining open time slots in each gate queue in the gate list can transmit the specified message copy.
4. The dynamic adjustment method according to claim 1, characterized in that, The method further includes: when the original gated queue is in an open state and the remaining open time slots can transmit the specified message, discarding the copy of the specified message through the priority dynamic adjustment device; The specified message is transmitted through the original gated queue.
5. The dynamic adjustment method according to claim 1, characterized in that: The specified message is a burst high-priority message; For a gated queue that is currently in an open state, the remaining opening time slot of the gated queue is: the difference between the remaining time slot in the opening time slot of the gated queue and the estimated total transmission time of the remaining untransmitted messages; For the next gated queue to be opened, the remaining opening time slot of the gated queue is the difference between the opening time slot of the gated queue and the estimated total transmission time of all messages to be transmitted.
6. The dynamic adjustment method according to claim 5, characterized in that: When the remaining gate opening time slot is greater than or equal to the expected transmission time slot of the specified message, it is determined that the corresponding gated queue can transmit the specified message or a copy of the specified message; When the remaining gate opening time slot is zero or less than the expected transmission time slot of the specified message, it is determined that the corresponding gated queue cannot transmit the specified message or a copy of the specified message.
7. The dynamic adjustment method according to claim 1, characterized in that, The priority dynamic adjustment device is time-synchronized with the TSN switch, and the priority dynamic adjustment device is configured with the gating list.
8. The dynamic adjustment method according to claim 1, characterized in that, The opening time order of the remaining gated queues is: the ascending order of the opening times of each gated queue in the remaining gated queues.
9. A TSN switching chip, characterized in that, include: The receiving module is configured to receive and parse a specified message and determine the original priority of the specified message; The mapping module is configured to map the specified message to the original gated queue corresponding to the original priority. The gated list includes the mapping relationship between the gated status of multiple gated queues and the corresponding opening time slots. The gated queues have the gated function enabled and are used to transmit messages of the corresponding priority. The replication module is configured to replicate the specified message and send a copy of the specified message to the priority dynamic adjustment device, wherein the copy of the specified message has the original priority; The priority dynamic adjustment device is configured to query the current gating status of the original gating queue; when the original gating queue is in an open state and the remaining open time slots cannot transmit the specified message, or when the original gating queue is in a closed state, the device sequentially checks the remaining open time slots of each gating queue according to the opening time order of the remaining gating queues in the gating list until a gating queue that can transmit the copy of the specified message is determined; the device adjusts the original priority of the copy of the specified message to the priority corresponding to the determined gating queue, thereby obtaining the adjusted priority of the copy of the specified message; The sending module is configured to map the specified message copy to a gated queue corresponding to the adjusted priority, and use the gated queue to transmit the specified message copy.
10. The TSN switching chip according to claim 9, characterized in that, Also includes: Delete module; The deletion module is configured to delete the specified message in the original gated queue when transmitting a copy of the specified message using a gated queue corresponding to the adjusted priority.
11. The TSN switching chip according to claim 9, characterized in that, The priority dynamic adjustment device is further configured to: discard a copy of the specified message when the original gated queue is in an open state and the remaining open time slots can transmit the specified message; The sending module is also configured to transmit the specified message through the original gated queue.
12. The TSN switching chip according to claim 9, characterized in that, The priority dynamic adjustment device is synchronized with the TSN switching chip in time, and the priority dynamic adjustment device is configured with the gating list.
13. The TSN switching chip according to claim 9, characterized in that: The specified message is a burst high-priority message; For a gated queue that is currently in an open state, the remaining opening time slot of the gated queue is: the difference between the remaining time slot in the opening time slot of the gated queue and the estimated total transmission time of the remaining untransmitted messages; For the next gated queue to be opened, the remaining opening time slot of the gated queue is the difference between the opening time slot of the gated queue and the estimated total transmission time of all messages to be transmitted.
14. A TSN switching chip, characterized in that, It includes a memory and a processor; wherein the memory is used to store one or more computer instructions, which are executed by the processor to implement the dynamic adjustment method according to any one of claims 1 to 8.
15. A TSN switch, characterized in that, It includes the TSN switching chip as described in any one of claims 9 to 14, or includes a memory and a processor; wherein the memory is used to store one or more computer instructions, which are executed by the processor to implement the dynamic adjustment method as described in any one of claims 1 to 8.
16. A computer-readable storage medium storing computer instructions thereon, characterized in that, When the computer instruction is executed by the processor, it implements the dynamic adjustment method as described in any one of claims 1 to 8.
17. A computer program product, characterized in that, It includes computer instructions that, when executed by a processor, implement the dynamic adjustment method according to any one of claims 1 to 8.