Scheduling and forwarding method and system for mixed traffic of time-sensitive network

By combining strict priority, gating and CBS scheduling algorithms, high-priority data is sent first and the CBS scheduling algorithm is used to process sub-priority data, which solves the problem of untimely transmission of priority queue data in the existing technology and realizes the TSN network Efficient data frame transmission and real-time performance.

CN118540288APending Publication Date: 2024-08-23XIAN MICROELECTRONICS TECH INST
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410762775.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-06-13
Publication Date
2024-08-23

AI Technical Summary

Technical Problem

In the existing technology, the strict priority scheduling algorithm has the problem that the lower priority queue cannot be sent before the high priority queue data is sent. The gated scheduling algorithm has high requirements on the calculation of time slots of all types of data frames and is difficult to guarantee real-time performance. CBS The scheduling algorithm cannot accurately guarantee the real-time nature of the data frame.

Method used

Combining the strict priority scheduling algorithm, gated scheduling algorithm and CBS scheduling algorithm, by obtaining the priority and gated status of each queue data, high-priority data is sent first, and CBS scheduling is performed for sub-priority data to ensure the real-time performance of the data frame. and forwarding efficiency.

Benefits of technology

It achieves efficient scheduling of different priority queues, ensures the real-time performance and forwarding efficiency of data frames, avoids the problem that low-priority queues cannot be sent before the high-priority queues are sent, and simplifies the difficulty of the gated scheduling algorithm. Improved time determinism of TSN network.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN118540288A
    Figure CN118540288A
Patent Text Reader

Abstract

The invention belongs to the technical field of time-sensitive networks, and relates to a scheduling and forwarding method and system for mixed traffic of a time-sensitive network. The priority of each queue data is obtained, the current gating state of each queue data is obtained through a gating scheduling algorithm, the queue data with high priority is preferentially sent according to a strict priority scheduling algorithm for the queue data with the gating state being open, and in the data sending process, the priority of the queue data is not influenced. And the next frame of data is sent after the previous frame of data is sent, so that the integrity of data frame sending is ensured. And the secondary priority data is sent by executing the CBS scheduling algorithm, so that the sending of the data with low priority is facilitated, and the problem that the data of the queue with low priority cannot be sent before the data of the queue with high priority is sent is avoided. According to the method, the advantages of a strict priority scheduling algorithm, a gating scheduling algorithm and a CBS scheduling algorithm are taken into consideration, queues with different priorities are efficiently scheduled, and the real-time performance of data frames and the high forwarding efficiency are ensured.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the technical field of time-sensitive networks, and relates to a scheduling and forwarding method and system for time-sensitive network mixed traffic. Background Art

[0002] Time Sensitive Networking, abbreviated as TSN, also known as time-sensitive networking, is a series of standards developed by the IEEE802.1 working group. It particularly emphasizes ultra-low latency of transmission and the certainty of transmission time. Its networking equipment is mainly composed of TSN network controllers and TSN network switches.

[0003] The network controller is the interface between the computer and the transmission medium, and the network switch is used to connect multiple network terminals to allow them to interconnect in the network. The control and switching circuit can not only realize the physical connection and electrical signal matching between the LAN transmission medium, but also involves the sending and receiving of frames, the unpacking and unpacking of frames, media access control, data encoding and decoding, and data caching.

[0004] In the process of scheduling queues with different priorities, in order to make data frames of different priorities enjoy the support of corresponding priorities, TSN networks generally adopt CBS (Credit Based Shapper), gated queue scheduling algorithms, or absolute priority scheduling algorithms based on protocols such as IEEE802.1Qav and IEEE802.1Qbv. However, with the development of TSN networks, the requirements for the timeliness and time determinism of network data frames are getting higher and higher, and the requirements for scheduling algorithms are also getting higher and higher. The three scheduling algorithms each have their own advantages and disadvantages.

[0005] The strict priority scheduling algorithm divides different queues into different priorities, thereby ensuring that data in high-priority queues is sent first. However, data in lower-priority queues cannot be sent before data in higher-priority queues is sent.

[0006] The gated scheduling algorithm divides the sending time of each queue based on time slots. Only when the gate of the queue is open can the data of the queue be scheduled for sending. However, the calculation of time slots for all types of data frames places very high demands on the software algorithm. Sometimes it is even difficult to complete the scheduling calculation and it is difficult to ensure the real-time and forwarding efficiency of the data frames.

[0007] The CBS scheduling algorithm schedules the data in the queue based on the credit value, which can simplify the calculation of the time slot, but cannot accurately guarantee the real-time performance of the data frame.

[0008] To sum up, in the prior art, the strict priority scheduling algorithm has the problem that the data of the lower priority queue cannot be sent before the data of the higher priority queue is sent; the gated scheduling algorithm calculates the time slots for all types of data frames, which has very high requirements for the software algorithm, and sometimes it is even difficult to complete the scheduling calculation; the CBS scheduling algorithm cannot accurately guarantee the real-time performance of the data frames. Summary of the invention

[0009] The purpose of the present invention is to provide a scheduling and forwarding method and system for time-sensitive network mixed traffic to solve the technical problems existing in the absolute priority algorithm, gated scheduling algorithm and CBS scheduling algorithm in the prior art. The present invention combines the advantages of the strict priority scheduling algorithm, the gated scheduling algorithm and the CBS scheduling algorithm, and efficiently schedules queues of different priorities in the TSN network controller and switch circuit, thereby ensuring the most significant advantage of the TSN network over ordinary Ethernet, and ensuring the real-time nature of data frames and the high efficiency of forwarding.

[0010] In order to achieve the above object, the present invention adopts the following technical solutions:

[0011] The present invention discloses a scheduling and forwarding method for time-sensitive network mixed traffic, comprising the following steps:

[0012] Obtain the priority of each queue data, and obtain the current gating status of each queue data through the gating scheduling algorithm;

[0013] For queue data with the gated state turned on, the queue data with high priority is sent first according to the strict priority scheduling algorithm. During the data transmission process, the next frame of data will be sent after the previous frame of data is sent. The CBS scheduling algorithm is used to send the lower priority data.

[0014] Furthermore, the priority of each queue data includes: high priority, secondary priority and low priority.

[0015] Furthermore, for queue data whose gating state is on, queue data with a higher priority is sent first according to the strict priority scheduling algorithm. If there are queue data with the same priority, the data of the advanced queue is sent first.

[0016] Furthermore, the steps of the CBS scheduling algorithm are executed for the lower priority data, which are as follows:

[0017] Determine whether gated scheduling and CBS scheduling are enabled, and send the secondary priority data according to whether gated scheduling and CBS scheduling are enabled;

[0018] There are four situations to determine whether gated scheduling and CBS scheduling are enabled:

[0019] Gating scheduling is disabled, CBS scheduling is disabled;

[0020] Gating scheduling is disabled, CBS scheduling is enabled;

[0021] Gating scheduling is enabled, CBS scheduling is disabled;

[0022] Gating scheduling is enabled, CBS scheduling is enabled.

[0023] Furthermore, if gated scheduling is disabled and CBS scheduling is disabled, a strict priority scheduling algorithm is executed to send data.

[0024] Furthermore, if gated scheduling is not enabled and CBS scheduling is enabled, other queues are monitored to see if there is data being transmitted. If so, the sending of the currently transmitted data frame is guaranteed. If not, the high-priority queue data is sent first according to the strict priority scheduling algorithm. During the sending of sub-priority data, the credit value decreases. When the sub-priority data queue is not empty and the gate is opened but the data stream cannot be sent, the credit value increases.

[0025] Furthermore, if gated scheduling is enabled and CBS scheduling is not enabled, the gating status of the current sub-priority data queue is monitored to see if it is open. If the gating is not open, no data transmission is performed. If the gating is open, it is necessary to confirm whether the high-priority data queue is gated. If the high-priority data is not gated, the sub-priority data queue performs data stream transmission. If the high-priority data is gated, it is confirmed whether the high-priority data queue is empty. If the high-priority data queue is empty, the sub-priority data queue performs data stream transmission. If the high-priority data queue is not empty, the data of the high-priority queue is sent first.

[0026] Furthermore, gated scheduling is enabled, CBS scheduling is enabled, and queue data with high priority and open status is sent first according to the strict priority scheduling algorithm. When the gate of the sub-priority data queue is opened, and there is no high-priority data that needs to be scheduled in the queue with the gate opened, the sub-priority data is scheduled to be sent. During the sub-priority data sending process, the credit value corresponding to its queue decreases. When the sub-priority data queue is not empty, the gate is opened but the data stream cannot be sent, the credit value increases.

[0027] Furthermore, during the transmission of sub-priority data, the credit value decreases, and after the sub-priority data queue is empty:

[0028] If the credit value is greater than zero, the queue credit value is set to zero;

[0029] If the credit value of the secondary priority data queue is zero, it remains unchanged;

[0030] If the credit value of the secondary priority data queue is negative, the credit value is accumulated at the rate of Idleslope until it reaches 0, during which time other data flows of the secondary priority data queue are not allowed to be sent.

[0031] Based on the above method, the present invention also discloses a scheduling and forwarding system for time-sensitive network mixed traffic, including a data judgment module and a data sending module, as follows:

[0032] Data judgment module: used to obtain the priority of each queue data and obtain the current gating status of each queue data through the gating scheduling algorithm;

[0033] Data sending module: for queue data with the gated state open, it is used to send high-priority queue data according to the strict priority scheduling algorithm. During the data sending process, the next frame of data will be sent after the previous frame of data is sent. The CBS scheduling algorithm is used to send the second-priority data.

[0034] Compared with the prior art, the present invention has the following beneficial effects:

[0035] 1. The method of the present invention obtains the priority of each queue data and the current gating state of each queue data through the gating scheduling algorithm, so as to send the data in combination with the priority of the data and the gating state. For the queue data with the gating state being open, the queue data with high priority is sent preferentially according to the strict priority scheduling algorithm, which ensures the real-time transmission of the high-priority data frame and the high efficiency of forwarding. During the data transmission process, the next frame of data is sent after the previous frame of data is sent, which ensures the integrity of the data frame transmission. The CBS scheduling algorithm is executed for the transmission of the secondary priority data, which is conducive to the transmission of the low-priority data and avoids the problem that the data of the lower priority queue cannot be sent before the data of the higher priority queue is sent. The present invention takes into account the advantages of the strict priority scheduling algorithm, the gating scheduling algorithm and the CBS scheduling algorithm, and efficiently schedules queues of different priorities, ensuring the real-time transmission of the data frame and the high efficiency of forwarding. BRIEF DESCRIPTION OF THE DRAWINGS

[0036] Figure 1 A schematic diagram of the data frame division queue in the TSN network controller and switch of the present invention;

[0037] Figure 2 A schematic diagram of a state machine for selecting a scheduling algorithm of the present invention;

[0038] Figure 3 A schematic diagram of a credit value calculation state machine for a scheduling algorithm of the present invention;

[0039] Figure 4 This is a functional simulation diagram of an embodiment of the present invention;

[0040] Figure 5 is a flow chart of the method of the present invention;

[0041] Figure 6 It is a system module diagram of the present invention;

[0042] Figure 7 It is a logic diagram of the present invention;

[0043] Figure 8 A system module diagram of an embodiment of the present invention. DETAILED DESCRIPTION

[0044] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work should fall within the scope of protection of the present invention.

[0045] It should be noted that the terms "first", "second", etc. in the specification and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0046] The present invention is further described in detail below in conjunction with the accompanying drawings:

[0047] See also Figure 5 The present invention discloses a scheduling and forwarding method for time-sensitive network mixed traffic, comprising the following steps:

[0048] S1. Obtain the priority of each queue data and obtain the current gating status of each queue data through the gating scheduling algorithm;

[0049] The priority of each queue data includes: high priority, secondary priority and low priority.

[0050] S2. For queue data with the gated state turned on, the queue data with high priority is sent first according to the strict priority scheduling algorithm. During the data transmission process, the next frame of data is sent after the previous frame of data is sent. The CBS scheduling algorithm is used to send the lower priority data.

[0051] Preferably, if there are queue data with the same priority, the data in the advanced queue is sent first.

[0052] Preferably, the steps of executing the CBS scheduling algorithm for the secondary priority data are as follows:

[0053] Determine whether gated scheduling and CBS scheduling are enabled, and send the secondary priority data according to whether gated scheduling and CBS scheduling are enabled;

[0054] There are four situations to determine whether gated scheduling and CBS scheduling are enabled:

[0055] If gated scheduling is not enabled and CBS scheduling is not enabled, the strict priority scheduling algorithm is executed to send data;

[0056] If gated scheduling is disabled and CBS scheduling is enabled, monitor other queues to see if they are transmitting data. If so, ensure that the currently transmitted data frame is sent. If not, send the data of the queue with high priority first according to the strict priority scheduling algorithm. During the transmission of sub-priority data, the credit value decreases. When the sub-priority data queue is not empty and the gate is open but the data stream cannot be sent, the credit value increases.

[0057] If gated scheduling is enabled and CBS scheduling is not enabled, the gated status of the current secondary priority data queue is monitored to see if it is open. If the gate is not open, no data transmission is performed. If the gate is open, it is necessary to confirm whether the high priority data queue is gated. If the high priority data is not gated, the secondary priority data queue performs data stream transmission. If the high priority data is gated, it is confirmed whether the high priority data queue is empty. If the high priority data queue is empty, the secondary priority data queue performs data stream transmission. If the high priority data queue is not empty, the data of the high priority queue is sent first.

[0058] Gated scheduling is enabled, CBS scheduling is enabled, and the queue data with high priority and open status is sent first according to the strict priority scheduling algorithm. When the gating of the sub-priority data queue is opened, and there is no high-priority data to be scheduled in the queue with the gate opened, the sub-priority data is scheduled to be sent. During the sub-priority data sending process, the credit value corresponding to its queue decreases. When the sub-priority data queue is not empty, the gating is opened but the data stream cannot be sent, the credit value increases.

[0059] Preferably, during the transmission of the sub-priority data, the credit value decreases, and after the sub-priority data queue is empty,

[0060] If the credit value is greater than zero, the queue credit value is set to zero;

[0061] If the credit value of the secondary priority data queue is zero, it remains unchanged;

[0062] If the credit value of the secondary priority data queue is negative, the credit value is accumulated at the rate of Idleslope until it reaches 0, during which time other data flows of the secondary priority data queue are not allowed to be sent.

[0063] See also Figure 5 In another feasible embodiment of the present invention, the following is adaptively modified according to the situation. Obtain the priority of each queue data, and obtain the current gating state of each queue data through the gating scheduling algorithm, so as to send the data in combination with the priority of the data and the gating state, and prepare for complying with the gating scheduling, CBS scheduling and strict priority scheduling algorithms in multi-queue data scheduling. For queue data with a gating state of on, the queue data with a high priority is sent first according to the strict priority scheduling algorithm, which ensures the real-time transmission of high-priority data frames and the high efficiency of forwarding. During the data transmission process, the next frame of data is sent after the previous frame of data is sent, which ensures the integrity of the data frame transmission. The secondary priority data executes the CBS scheduling algorithm to send data on the basis of complying with the gated scheduling, which is conducive to taking into account the sending of low priority data and avoiding the problem that the data of the lower priority queue cannot be sent before the data of the higher priority queue is sent. After integrating the three scheduling algorithms, the difficulty of gated planning can be simplified because it is very difficult or even difficult to plan the time window for distinguishing the priorities of more queues. At the same time, due to the addition of the CBS scheduling algorithm, it is guaranteed that the low priority queue still has a certain opportunity to be scheduled before it is sent and cleared in the higher priority queue. And because the CBS algorithm can accumulate a certain amount of credit value, it supports a certain amount of burst for the secondary priority queue, ensuring its high real-time performance. The present invention takes into account the advantages of the strict priority scheduling algorithm, the gated scheduling algorithm and the CBS scheduling algorithm, simplifies the difficulty of planning the gated scheduling algorithm, and efficiently schedules queues of different priorities in the TSN network controller and the switch circuit, thereby ensuring the most significant advantage of the TSN network compared to the ordinary Ethernet, and ensuring the real-time performance and forwarding efficiency of the data frame.

[0064] Embodiment 1:

[0065] This embodiment discloses a scheduling and forwarding method for time-sensitive network mixed traffic, and the main problem to be solved is: in the TSN controller and the switch, data frames are divided into ST frames, RC frames, CFG frames and BE frames according to the network forwarding priority, and they are stored in corresponding multiple queues, such as Figure 1Among them, ST frame is a time-determined data frame, which has the highest priority and is a high-priority data frame, and can be stored in three queues with the highest priority; RC frame is a data frame with the second highest priority and corresponds to two RC queues; CFG frame is a configuration frame; BE frame is a data frame sent with the best effort and has the lowest priority and is a low-priority data frame.

[0066] If only the absolute priority algorithm is used, the high-priority queue will have absolute priority. Before all data in the high-priority queue is sent, the data in the low-priority queue cannot be sent, and the sending time determinism of the ST stream cannot be guaranteed. With the addition of the gated scheduling algorithm, by writing the gated list and controlling the gate switches of each queue at different times, the ST frame sending time can be planned, thereby ensuring the sending time determinism of the ST frame. However, planning the sending time for non-time-deterministic data streams will make time planning difficult or even difficult to complete. Therefore, the two second-highest priority RC queues are scheduled through the CBS scheduling algorithm to avoid the problem that the lower-priority CFG queue and BE queue cannot be sent before the high-priority queue is sent. At the same time, the difficulty of implementing planning for the gated scheduling algorithm is simplified.

[0067] The specific steps of this embodiment are as follows:

[0068] The CBS scheduling algorithm and the gated scheduling algorithm are set to two levels. In order to ensure the determinism of the forwarding time of time-sensitive data streams, gated scheduling is performed first. By querying the gated time list, the current gating status of each queue data is obtained. The gating status has two states: on and off, indicating whether the data frames of the queue are scheduled at the current moment. These states are then sent to the CBS scheduling module for integration. After the CBS and SP (strict priority) algorithm scheduling is performed in the CBS module, the final scheduling result is handed over to the sending control module to schedule the data frames of the specified queue for sending. During the scheduling process, the strict priority scheduling algorithm is always valid, and CBS and gated scheduling are configurable and enabled. Under the same conditions, data from high-priority queues are sent first. In the same queue, the data frame that enters the queue first is sent first. According to the enabling configuration of gating and CBS, the following situations are handled:

[0069] 1. Gating and CBS are not enabled. Strict priority policy is implemented, that is, the high-priority queue will send frames only if there are frames, and the low-priority queue will send frames only if there are no frames. For example, if the RC queue has data to send, it will monitor whether other queues have data and whether they are transmitting: if no other queues are currently transmitting and the high-priority ST queue has no data flow, the RC queue will start transmitting.

[0070] 2. Gating is disabled, and CBS is enabled. For the RC queue, monitor whether other queues have data and are transmitting: if the RC queue has data streams to be transmitted, no other queues are currently transmitting, and the ST queue has no data stream, the RC queue starts transmitting. During transmission, the CBS algorithm is followed to increase or decrease the credit value: if the RC queue is not empty and other queues are transmitting, or the ST queue is not empty, it is necessary to prioritize the transmission of the currently transmitted data frame or the data frame of the ST queue, and the RC queue is temporarily suspended from sending, and its credit value accumulates until it reaches the maximum value; when the data frames being sent by other queues are completed or the ST queue is empty, the RC queue data stream is started to be transmitted, and the credit value is reduced. After the RC queue is empty, if the credit value is greater than zero, the credit value of the queue is set to zero; if the credit value is zero, it remains unchanged; if the credit value is negative, the credit value is accumulated at the rate of Idleslope until it reaches 0. During this period, other data streams of the RC queue are not allowed to be sent.

[0071] 3. Gating is enabled, CBS is not enabled. For the RC queue, monitor whether the gating status of the current RC queue is open. If the gating is not open, no data transmission is performed; if the gating is open, it is also necessary to confirm whether the ST queue is gated. If the ST gating is not open, the RC queue transmits data streams; if the ST gating is open, it is also necessary to confirm whether the ST queue is empty.

[0072] 4. Both gating and CBS are enabled. Similar to case 2, when the RC queue is not empty, gating is on but data cannot be sent, the credit value increases. This situation includes: 1. Other queues are sending data; 2. No other queues are sending data, RC gating is on, but ST queue gating is on and ST queue is not empty. If the RC queue gating is off, the credit value remains unchanged.

[0073] According to the above division, a two-level state machine is used to implement the fusion scheduling of the three scheduling algorithms, such as Figure 2 As shown. The first state machine is the scheduling algorithm selection state machine, which can realize the state switching of different scheduling algorithm enabling conditions. It consists of four states: NG_NC, NG_C, G_NC, and G_C, which correspond to the above four situations respectively. After initialization, it defaults to the NG_NC state. Figure 3 The second-level state machine shown is a credit value state description state machine in the CBS scheduling algorithm, which reflects the increase or decrease of the credit value under different conditions, so as to integrate the gating and absolute priority scheduling algorithms and implement the CBS algorithm. It consists of three states: C_ZERO, C_ADD, and C_DEL.

[0074] The present invention implements the CBS and strict priority scheduling algorithms, and effectively uses a two-level state machine in the TSN network controller and switch to implement the fusion scheduling of gating, CBS and absolute priority, avoiding the problem of low-priority data being unable to be sent before all data in the high-priority queue is sent when a single strict priority scheduling algorithm is used. At the same time, it also avoids the time planning of all queues, including non-time-deterministic data queues, using the gating scheduling algorithm, reducing the difficulty of implementing the gating scheduling algorithm, saving software and hardware logic resources, and being verified to meet the design requirements.

[0075] By performing functional simulation on the invention, the gated scheduling algorithm, the CBS scheduling algorithm and the strict priority scheduling algorithm are configured to be enabled at the same time. Figure 4 As shown in the figure, after the simulation starts, the gates of all queues are turned on. The be0 queue, i.e., queue 6, is not empty first, indicating that there is a BE frame to be sent. At this time, all other queues are empty, so the data frames in queue 6 are sent first. After that, the cfg queue of queue 5 and the rc1 queue of queue 4 are not empty one after another. Since queue 6 is sending, the two queues cannot send data temporarily. In addition, the rc1 queue is intervened by the CBS scheduling algorithm. The state machine jumps to the C_ADD state and begins to accumulate credits at the configured Idleslope rate until the BE frame of queue 6 is sent at the TimeA time point in the figure. At this time, the queues that are not empty are the rc1 queue, the cfg queue, and the be1 queue. Among them, the rc1 queue has the highest priority and starts to send data frames of this queue. The corresponding CBS state machine jumps to the C_DEL state. The credit value of this queue decreases at the configured sendslope rate until the TIME B moment. During this period, a total of 4 frames of rc1 queue data are sent. During the transmission of the 4th frame, the credit value of this queue is negative and the queue is empty. At TIME B, the st2 queue is not empty, and this queue is the queue with the highest priority at this time, so from this moment on, the data frame of the st2 queue is sent. During the frame transmission, the st1 queue is not empty and becomes the highest priority queue, so after the current frame of the st2 queue is sent, the st1 queue data starts to be sent. Through verification, the present invention can complete the queue scheduling of corresponding priorities for different types of data frames in the TSN network, and can effectively ensure the real-time performance and forwarding efficiency of the TSN network data frames.

[0076] Use VIVADO tool software to synthesize, layout and route the data transmission link logic and generate download files to implement logic functions on FPGA. Use an Ethernet tester that supports TSN function as the host to send different types of data frames and test the scheduling results under different scheduling algorithm enabling conditions. The test results are in line with expectations. Then control the tester to send large amounts of RC queue data frames, enable the CBS function, and adjust the idleslope, sendslope, hicredit, lowcredit and other parameters of the CBS scheduling algorithm. Configure the CBS scheduling bandwidth of different RC data frames with a granularity of 10%, observe the statistical results of the sent data, and the list is shown in Table 1. The results basically meet the design expectations with small errors.

[0077] Table 1: Comparison of configured CBS scheduling bandwidth and actual test bandwidth data:

[0078] Configuring CBS Scheduling Bandwidth Test actual bandwidth 10% 10.50% 20% 19.95% 30% 29.65% 40% 39.45% 50% 49.25% 60% 59.05% 70% 68.85% 80% 78.10% 90% 87.75%

[0079] By applying the present invention, after integrating CBS and strict priority, gating only needs to reserve a part of the time window for non-ST queues, which simplifies the gating scheduling algorithm and avoids the problem of difficulty in dividing the time window when gating schedules multiple queues.

[0080] Embodiment 2:

[0081] See also Figure 5 and Figure 7 This embodiment discloses a scheduling and forwarding method for time-sensitive network hybrid traffic, which is as follows:

[0082] The present invention relates to mapping different priority data frames to multiple queues in a TSN network controller and a switch, for example Figure 1 As shown, it is mapped to eight queues. Among them, ST frame is a time-deterministic data frame with the highest priority; RC frame is the second highest priority data frame, corresponding to two RC queues; CFG frame is a configuration frame; BE frame is a best-effort data frame, and it has the lowest priority. Each queue has a sending priority from high to low according to the queue number. The smaller the queue number, the higher the priority. Under the same conditions, the data frames in the queue with a smaller queue number are sent first. This is the absolute priority scheduling algorithm. The gated scheduling algorithm is also valid for each queue. When the gate of the queue is opened, the data frames of the queue are sent within this time period. How to integrate the three scheduling algorithms to reasonably schedule the data frames of each queue has become a design focus and difficulty of the TSN controller.

[0083] The scheduling algorithm selects the state machine as Figure 2 As shown, the two register enable status signals of gating and CBS can be jumped at any time.

[0084] Through Figure 3 The control of the state machine shown increases, decreases or maintains the credit value under different scheduling algorithm enabling state configurations, implements the CBS scheduling algorithm, and determines whether the data frames of the current RC queue can be forwarded.

[0085] After initialization, the default state is C_ZERO, and the current credit value is 0. At this time, if the RC queue has data to be sent, and the gating state of the queue is open, it will jump into the C_DEL state to start reducing the credit value until the frame data is sent. The credit value is negative, and the state machine will jump into the C_ADD state to accumulate credit values ​​until the credit value returns to 0. If the queue still has data frames to be sent and there is no higher priority queue preemption, it will enter the C_DEL state again, schedule the data frame to be sent and consume credit values. If there are no data frames to be sent or there is a higher priority queue preemption, it will enter the C_ZERO state. When in the C_ADD or C_DEL state, if the gating is closed, after the current frame scheduling is completed, it will enter the C_HOLD state, and the credit value will remain unchanged until the gating state of the queue is opened again, and the state machine jumps back to C_ADD or C_DEL.

[0086] When the RC queue data frames cannot be sent due to the limitation of the CBS scheduling algorithm, the low-priority CFG frames and BE frames can be sent, ensuring the opportunity for the low-priority data queue to be sent.

[0087] like Figure 4 As shown, this is a functional simulation of the present invention. Through verification, the present invention can complete queue scheduling of corresponding priorities for different types of data frames in the TSN network, and can effectively ensure the real-time and forwarding efficiency of the TSN network data frames.

[0088] like Figure 4 As shown:

[0089] 1. When the corresponding gated window is opened, queue 6 is not empty first, be0_emp=0, and other queues are empty. Queue 6 is scheduled to be sent, q6_trans=1.

[0090] 2. Afterwards, queues 5, 4, and 7 are not empty successively, that is, cfg_emp=0, rc1_emp=0, be1_emp=0, but since queue 6 is in the process of sending, the data frames in queue 5 that arrived earlier cannot be scheduled. After queue 4 is not empty, since the data frames in queue 6 are being sent, queue 4 applies the CBS scheduling algorithm and enters the state of accumulating credit values, rc1_cbs_cs=020. The more credit values ​​are accumulated, the more burst data frames are allowed when scheduling to this queue.

[0091] 3. When the data frames in queue 6 are sent, multiple queues are not empty and their gated time windows are all open. According to the strict priority algorithm, queue 4 has the highest priority, so queue 4 is scheduled to send, q4_trans = 1. At this time, the CBS scheduling state of the queue enters a state of credit value reduction, rc1_cbs_cs = 040, until the credit value of the queue is reduced to a negative value, rc1_crd_neg = 1.

[0092] 4. When the CBS scheduling algorithm credit value of queue 4 is negative, the data frame currently being sent by the queue needs to be sent. During this process, the CBS credit value continues to decrease. After the current frame is sent, since the queue credit value is negative, the queue data frame cannot be scheduled anymore. The credit value of the queue begins to accumulate, rc1_cbs_cs=020.

[0093] 5. At this time, queue 2 of high priority data frames is not empty, st2_emp = 0, so the data frames of this queue are scheduled to be sent, q2_trans = 1. Since queue 4 is already empty, its CBS credit value will not increase after accumulating to 0, rc1_cbs_cs = 010, rc1_crd = 0.

[0094] Through simulation, it can be seen that during the period when the CBS credit value of the second highest priority queue is negative, if the ST high priority queue is empty or the gated window is closed, the data frames in the low priority CFG or BE queue can be scheduled to be sent. By integrating the three scheduling algorithms, it can be ensured that the high priority queue (ST queue) enjoys the highest sending priority. During the sending process of the ST queue, if the second priority queue (RC queue) is not empty, the credit value can be accumulated through the CBS scheduling algorithm. When the ST queue is empty or its scheduled scheduling gated window is closed, the RC queue can perform burst transmission of multiple data frames based on the previously accumulated credit value until the credit value is negative. At this time, the low priority queues (CFG queue and BE queue) can be scheduled for sending, which ensures that the low priority queues have a certain chance to be scheduled and avoids the defect of waiting until the higher priority queue is completely empty before being scheduled. At the same time, due to the integration of the burst-supporting CBS and strict priority scheduling algorithms, it avoids the inefficiency of relying solely on the opening and closing of the gated time window to control the sending of each queue, and there is no data to be sent during the period when the gate of a queue is open, which simplifies the problem that the gated scheduling algorithm is difficult to efficiently plan the scheduling of multiple queues.

[0095] Based on the above method, see Figure 6 The present invention discloses a scheduling and forwarding system for time-sensitive network mixed traffic, including: a data judgment module and a data sending module, which are as follows:

[0096] Data judgment module: used to obtain the priority of each queue data and obtain the current gating status of each queue data through the gating scheduling algorithm;

[0097] Data sending module: for queue data with the gated state open, it is used to send high-priority queue data according to the strict priority scheduling algorithm. During the data sending process, the next frame of data will be sent after the previous frame of data is sent. The CBS scheduling algorithm is used to send the second-priority data.

[0098] The data judgment module includes: a data classification mapping module and a data storage module, see Figure 7 and Figure 8 ;

[0099] Data classification mapping module: used to map data frames to corresponding priority queues according to their different priorities;

[0100] Data storage module: used to store data frames of queues of different priorities into the specified address interval;

[0101] Among them, the data sending module includes: a data scheduling decision module and a sending module;

[0102] Data scheduling decision module: used to determine the storage status of data in each priority queue (whether the queue is not empty), implement and integrate gating, CBS and strict priority scheduling algorithms. First, determine whether the gating time window of each queue is open. In the queue where the gating window is open, apply the CBS scheduling algorithm to the second highest priority queue, and apply the strict priority scheduling algorithm to other queues. If the high priority queue is not empty, the high priority queue will be scheduled first until the high priority queue is empty. During this period, if the second highest priority queue is not empty, the credit value can be accumulated. When the queue is allowed to be scheduled, it can support burst transmission of data equivalent to the accumulated credit value;

[0103] Sending module: used to read and send data from the specified address in the data storage module according to the results of the data scheduling decision module.

[0104] See also Figure 5In another feasible embodiment of the present invention, the following is adaptively modified according to the situation. It includes: a data judgment module and a data sending module: the data judgment module is used to obtain the priority of each queue data, and obtain the current gating state of each queue data through the gating scheduling algorithm; the data sending module is used to preferentially send the queue data with high priority according to the strict priority scheduling algorithm for the queue data with the gating state being open. During the data sending process, the next frame of data will be sent after the previous frame of data is sent, and the CBS scheduling algorithm will be executed for the data of the lower priority to send. The various modules cooperate with each other to realize the efficient scheduling of queues of different priorities in the TSN network controller and switch circuit, thereby ensuring the most significant advantage of the TSN network compared to ordinary Ethernet, and ensuring the real-time and forwarding efficiency of data frames.

[0105] The present invention can be used in network cards and switching devices in TSN networks. By adopting an efficient Ethernet data multi-queue scheduling algorithm proposed by the present invention, the advantages of the gated scheduling algorithm, the CBS scheduling algorithm and the absolute priority scheduling algorithm can be integrated, thereby avoiding the problem that low-priority data cannot be sent before all data in the high-priority queue are sent completely when a single strict priority scheduling algorithm is used. At the same time, the time planning of all queues, including non-time-deterministic data queues, using the gated scheduling algorithm is also avoided, thereby reducing the difficulty of implementing the gated scheduling algorithm, saving software and hardware logic resources, effectively ensuring the time determinism of the TSN network for time-sensitive data transmission, and ensuring the real-time transmission of key data traffic.

[0106] According to the above method and system, the logic design of each module in the present invention is described in Verilog language, and it is integrated with other modules in the network card and switch chip to perform system-level verification. The verification results show that the present invention realizes the design function and the performance meets expectations.

[0107] The above contents are only for explaining the technical idea of ​​the present invention and cannot be used to limit the protection scope of the present invention. Any changes made on the basis of the technical solution in accordance with the technical idea proposed by the present invention shall fall within the protection scope of the claims of the present invention.

Claims

1. A scheduling and forwarding method for time-sensitive network mixed traffic, characterized in that: The following steps are involved: Obtain the priority of each queue data, and obtain the current gating status of each queue data through the gating scheduling algorithm; For queue data with the gated state turned on, the queue data with high priority is sent first according to the strict priority scheduling algorithm. During the data transmission process, the next frame of data will be sent after the previous frame of data is sent. The CBS scheduling algorithm is used to send the lower priority data.

2. The method for scheduling and forwarding mixed traffic in a time-sensitive network according to claim 1, characterized in that: The priorities of the data in each queue include: high priority, secondary priority and low priority.

3. The method for scheduling and forwarding mixed traffic in a time-sensitive network according to claim 1, characterized in that: For the queue data whose gated state is open, the queue data with a higher priority is sent first according to the strict priority scheduling algorithm. If there are queue data with the same priority, the data of the advanced queue is sent first.

4. The method for scheduling and forwarding mixed traffic in a time-sensitive network according to claim 1, characterized in that: The steps of executing the CBS scheduling algorithm for the secondary priority data are as follows: Determine whether gated scheduling and CBS scheduling are enabled, and send the secondary priority data according to whether gated scheduling and CBS scheduling are enabled; There are four situations to determine whether gated scheduling and CBS scheduling are enabled: Gating scheduling is disabled, CBS scheduling is disabled; Gating scheduling is disabled, CBS scheduling is enabled; Gating scheduling is enabled, CBS scheduling is disabled; Gating scheduling is enabled, CBS scheduling is enabled.

5. The method for scheduling and forwarding mixed traffic in a time-sensitive network according to claim 4, characterized in that: If the gated scheduling is not enabled and the CBS scheduling is not enabled, the strict priority scheduling algorithm is executed to send data.

6. The method for scheduling and forwarding mixed traffic in a time-sensitive network according to claim 4, characterized in that: If the gated scheduling is not enabled and CBS scheduling is enabled, monitor whether other queues are transmitting data. If so, ensure that the currently transmitted data frame is sent. If not, give priority to sending the queue data with high priority according to the strict priority scheduling algorithm. During the sending of sub-priority data, the credit value decreases. When the sub-priority data queue is not empty and the gate is opened but the data stream cannot be sent, the credit value increases.

7. The method for scheduling and forwarding mixed traffic in a time-sensitive network according to claim 4, characterized in that: If the gated scheduling is enabled and the CBS scheduling is not enabled, the gated state of the current secondary priority data queue is monitored to see if it is on. If the gated state is not on, data transmission is not performed; If the gating is on, it is necessary to confirm whether the high-priority data queue is gated on. If the high-priority data gating is not on, the second-priority data queue will transmit the data stream. If the high-priority data gating is on, it is necessary to confirm whether the high-priority data queue is empty. If the high-priority data queue is empty, the second-priority data queue will transmit the data stream. If the high-priority data queue is not empty, the data of the high-priority queue will be sent first.

8. The method for scheduling and forwarding mixed traffic in a time-sensitive network according to claim 4, characterized in that: The gated scheduling is enabled, CBS scheduling is enabled, and queue data with high priority and open status is sent first according to the strict priority scheduling algorithm. When the sub-priority data queue is gated and there is no high-priority data that needs to be scheduled in the gated queue, the sub-priority data is scheduled to be sent. During the sub-priority data sending process, the credit value corresponding to its queue is reduced. When the sub-priority data queue is not empty, the gate is opened but the data stream cannot be sent, the credit value increases.

9. The method for scheduling and forwarding mixed traffic in a time-sensitive network according to claim 4, characterized in that: During the transmission of the sub-priority data, the credit value decreases. After the sub-priority data queue is empty: If the credit value is greater than zero, the queue credit value is set to zero; If the credit value of the secondary priority data queue is zero, it remains unchanged; If the credit value of the secondary priority data queue is negative, the credit value is accumulated at the rate of Idleslope until it reaches 0, during which time other data flows of the secondary priority data queue are not allowed to be sent.

10. A scheduling and forwarding system for time-sensitive network mixed traffic, characterized in that: The method according to any one of claims 1 to 9 includes a data judgment module and a data sending module, which are specifically as follows: Data judgment module: used to obtain the priority of each queue data and obtain the current gating status of each queue data through the gating scheduling algorithm; Data sending module: for queue data with the gated state open, it is used to send high-priority queue data according to the strict priority scheduling algorithm. During the data sending process, the next frame of data will be sent after the previous frame of data is sent. The CBS scheduling algorithm is used to send the second-priority data.