Traffic scheduling method and device, electronic equipment and readable storage medium

CN122934480APending Publication Date: 2026-10-16SUZHOU CENTEC COMM CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611296712.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-08-25
Publication Date
2026-10-16

AI Technical Summary

Technical Problem

但是,这种方式存在“过保护”行为,比如队列中只有几个64B的报文,但是保护带设置为9600B相应的传输时间,在下一个时隙到达之前,完全可以完成传输完毕,但却被限制传输

Benefits of technology

[0010]The traffic scheduling method, apparatus, electronic device, and readable storage medium provided in this application first obtain the target remaining transmittable data volume corresponding to the current time slot; then, determine whether the target data volume of the target message to be transmitted in the target queue corresponding to the current time slot is greater than the target remaining transmittable data volume, and obtain a determination result; next, transmit or block the target message to be transmitted according to the obtained determination result; and update the remaining transmittable data volume information corresponding to the current time slot. The target remaining transmittable data volume is obtained by subtraction based on the pre-configured total transmittable data volume corresponding to the current time slot, the data volume of each message already transmitted in the current time slot, and the preset data volume corresponding to a preset time unit; the preset data volume is pre-calculated based on the transmission rate of the target port corresponding to the current time slot and the preset time unit; the remaining transmittable data volume information is used to obtain the target remaining transmittable data volume. This avoids wasted transmission bandwidth due to the setting of a fixed guard band, ensures high transmission efficiency, and eliminates the need for complex circuits such as multipliers and dividers.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122934480A_ABST
    Figure CN122934480A_ABST
Patent Text Reader

Abstract

The application provides a traffic scheduling method and device, electronic equipment and readable storage medium, and relates to the technical field of communication. The method comprises the following steps: obtaining a target residual transmissible data amount corresponding to a current time slot, wherein the target residual transmissible data amount is obtained by subtraction processing based on a pre-configured total transmissible data amount corresponding to the current time slot, data amounts of messages transmitted in the current time slot, and a preset data amount corresponding to a preset time unit; determining whether a target data amount of a target message to be transmitted corresponding to the current time slot is greater than the target residual transmissible data amount to obtain a determination result; transmitting or preventing the target message to be transmitted according to the determination result; and updating residual transmissible data amount information corresponding to the current time slot, wherein the residual transmissible data amount information is used to obtain the target residual transmissible data amount. In this way, the situation that the transmission bandwidth is wasted due to the fixed guard band can be avoided, and complex circuits such as multipliers and dividers are not required.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of communication technology, and more specifically, to a traffic scheduling method, apparatus, electronic device, and readable storage medium. Background Technology

[0002] Time-Sensitive Networks (TSNs) are commonly used in networks requiring high precision and low latency, and one of their characteristics is relatively low traffic volume. Due to cost considerations, dedicated TSN networks are often integrated with regular networks. However, this introduces new requirements: TSN traffic must not be affected by non-TSN traffic and must still maintain the transmission performance of a dedicated network (low latency, high precision, and low jitter).

[0003] The IEEE 802.1Qbv protocol defines a Time-Aware Shaper (TAS) to address this issue in TSN networks by controlling the scheduling of data traffic. It operates based on Precise Timing Protocol (PTP) time and uses global time slot allocation to ensure that time-sensitive service traffic is transmitted with high precision and low latency jitter. For ease of description, it will be referred to as the Qbv scheduler below.

[0004] Currently, the Qbv scheduler schedules packets in the scheduling queue based on the GCL (Gate Control List). To prevent packet out-of-bounds behavior during scheduling, which could degrade the reliability of network service transmission, a fixed guard band is set. This guard band is typically set according to the maximum packet length (i.e., maximum data frame length) in the current system. Within this guard band, no packets are transmitted, thus providing a dedicated, interference-free time window for TSN streams. However, this method suffers from "overprotection." For example, if there are only a few 64-byte packets in the queue, but the guard band is set to 9600 bytes, the corresponding transmission time could be completed before the next time slot arrives, but transmission is restricted. Therefore, this method leads to a waste of bandwidth resources and reduces the transmission quality of BE (Best Effort) streams. Summary of the Invention

[0005] This application provides a traffic scheduling method, apparatus, electronic device, and readable storage medium, which can avoid the waste of transmission bandwidth due to the setting of a fixed guard band, ensure high transmission efficiency, and eliminate the need for complex circuits such as multipliers and dividers.

[0006] The embodiments of this application can be implemented as follows: In a first aspect, embodiments of this application provide a traffic scheduling method, the method comprising: The remaining transmittable data volume corresponding to the current time slot is obtained by subtraction based on the pre-configured total transmittable data volume corresponding to the current time slot, the data volume of each message already transmitted in the current time slot, and the preset data volume corresponding to the preset time unit. The preset data volume is pre-calculated based on the transmission rate of the target port corresponding to the current time slot and the preset time unit. Determine whether the target data volume of the target message to be transmitted in the target queue corresponding to the current time slot is greater than the remaining transmittable data volume of the target, and obtain the determination result; Based on the judgment result, the target message to be transmitted is transmitted or blocked; Update the remaining transmittable data amount information corresponding to the current time slot, wherein the remaining transmittable data amount information is used to obtain the target remaining transmittable data amount.

[0007] Secondly, embodiments of this application provide a traffic scheduling device, the device comprising: The information acquisition module is used to obtain the remaining transmittable data volume of the target corresponding to the current time slot. The remaining transmittable data volume of the target is obtained by subtraction based on the pre-configured total transmittable data volume of the current time slot, the data volume of each message already transmitted in the current time slot, and the preset data volume corresponding to the preset time unit. The preset data volume is pre-calculated based on the transmission rate of the target port corresponding to the current time slot and the preset time unit. The judgment module is used to determine whether the target data volume of the target message to be transmitted in the target queue corresponding to the current time slot is greater than the remaining transmittable data volume of the target, and obtain the judgment result; The processing module is used to transmit or block the target message to be transmitted based on the judgment result; The processing module is also used to update the remaining transmittable data amount information corresponding to the current time slot, wherein the remaining transmittable data amount information is used to obtain the target remaining transmittable data amount.

[0008] Thirdly, embodiments of this application provide an electronic device, including a processor and a memory, wherein the memory stores machine-executable instructions that can be executed by the processor, and the processor can execute the machine-executable instructions to implement the traffic scheduling method described in the foregoing embodiments.

[0009] Fourthly, embodiments of this application provide a readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the traffic scheduling method as described in the foregoing embodiments.

[0010] The traffic scheduling method, apparatus, electronic device, and readable storage medium provided in this application first obtain the target remaining transmittable data volume corresponding to the current time slot; then, determine whether the target data volume of the target message to be transmitted in the target queue corresponding to the current time slot is greater than the target remaining transmittable data volume, and obtain a determination result; next, transmit or block the target message to be transmitted according to the obtained determination result; and update the remaining transmittable data volume information corresponding to the current time slot. The target remaining transmittable data volume is obtained by subtraction based on the pre-configured total transmittable data volume corresponding to the current time slot, the data volume of each message already transmitted in the current time slot, and the preset data volume corresponding to a preset time unit; the preset data volume is pre-calculated based on the transmission rate of the target port corresponding to the current time slot and the preset time unit; the remaining transmittable data volume information is used to obtain the target remaining transmittable data volume. This avoids wasted transmission bandwidth due to the setting of a fixed guard band, ensures high transmission efficiency, and eliminates the need for complex circuits such as multipliers and dividers. Attached Figure Description

[0011] To more clearly illustrate the technical solutions of the embodiments of this application, the accompanying drawings used in the embodiments will be briefly introduced below. It should be understood that the following drawings only show some embodiments of this application and should not be regarded as a limitation of the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0012] Figure 1 This is a scheduling diagram of the Qbv scheduler; Figure 2 This is a diagram illustrating message out-of-bounds behavior. Figure 3 A schematic diagram illustrating the working principle of the protective belt technology; Figure 4 A block diagram illustrating an electronic device provided in an embodiment of this application; Figure 5 A flowchart illustrating the traffic scheduling method provided in an embodiment of this application; Figure 6 for Figure 5 A flowchart illustrating the sub-steps included in step S140; Figure 7 This is a diagram illustrating two types of gating lists; Figure 8 A schematic diagram illustrating the execution process of the traffic scheduling method provided in the embodiments of this application; Figure 9 This is a block diagram of a traffic scheduling device provided in an embodiment of this application.

[0013] Icons: 100 - Electronic device; 110 - Memory; 120 - Processor; 130 - Communication unit; 200 - Traffic scheduling device; 210 - Information acquisition module; 220 - Judgment module; 230 - Processing module. Detailed Implementation

[0014] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. The components of the embodiments of this application described and shown in the accompanying drawings can generally be arranged and designed in various different configurations.

[0015] Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely to illustrate selected embodiments of the application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.

[0016] It should be noted that relational terms such as "first" and "second" are used merely to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitations, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.

[0017] The Qbv scheduler supports up to eight different service queues. Time slots are allocated using a flexibly configurable GCL (GateControl List). Within each time slot, scheduling control is applied to these eight different queues: only queues with open gates can be scheduled. After each time slot reaches its end time, the process switches to the next time slot.

[0018] The gating list contains multiple gating entries, with each entry corresponding to a time slot. Each gating entry can include the gating status for each queue, as well as the gating time, i.e., the gating duration.

[0019] like Figure 1The gating list shown assumes that the Qbv scheduler is currently at time slot 0. At this time, according to the time slot configuration of the gating list, the state of queue 7 is open, that is, the message of the scheduling queue 7 is transmitted.

[0020] The following is combined Figure 1 and Figure 2 This section introduces the behavior of messages crossing boundaries.

[0021] At time T0, slot 0 is entered, and queue 7 is empty at this time. The gating time of slot 0 is 700ns.

[0022] At time T1 (300ns), a 625-byte message (5000 bits) arrives. The message takes 500ns to transmit on the corresponding 10G port.

[0023] The transmission is completed at time T3 (i.e., at 800ns), which means that the transmission time of time slot 1 has been occupied. This situation is called message out-of-bounds behavior.

[0024] Time slot 1 was originally allocated to queue 0 for scheduling time-sensitive messages, but it has to wait in line for the previous message to be transmitted, adding an extra 100ns delay.

[0025] Outbound message behavior increases uncertainty and significantly reduces the reliability of network service transmission.

[0026] The guard band is the core technology used to solve this problem, preventing message out-of-bounds transmission. The guard band defines a restricted area; before the start of the restricted area, data frames can be transmitted freely, and even after the start of the restricted area, complete data frames can still be transmitted; however, after the start of the restricted area, no new data frames can be transmitted. For example... Figure 3 As shown: At time T0, the message enters time slot 0; at time T1, frame 1 (i.e., the message) begins transmission and continues until time T2 when frame 1 is fully transmitted. Frame 2 is prohibited from transmission due to guard band limitations and waits in the queue for the system to allocate the next time slot to its corresponding queue. In this way, by setting a guard band in the time slots of the best-effort (BE) stream, the time-sensitive stream (TSN) is ensured to be unaffected by BE (Best Effort) stream interference during transmission, thus guaranteeing the deterministic communication of the TSN stream.

[0027] The guard band mechanism is a key part of the TAS (Time-Aware Shaper) and is used to prevent packet out-of-bounds behavior, providing a dedicated, interference-free time window for TSN flows.

[0028] Currently, a fixed guard band length is typically set based on the maximum packet length (i.e., the maximum data frame length) in the current system; this is referred to as a "fixed guard band." Depending on the Ethernet deployment in different application scenarios, common maximum data frame lengths include 1518 bytes and 9600 bytes. Setting the guard band based on the maximum packet length ensures that when a TSN timeslot opens, packets from previous timeslots can be transmitted completely. This fixed guard band is relatively simple and easy to implement.

[0029] However, a fixed guard band requires a fixed maximum packet length, which wastes bandwidth resources and reduces the transmission quality of the BE stream. This method also exhibits "overprotection" behavior. For example, if there are only a few 64-byte packets in the queue, but the guard band is set to 9600 bytes for the corresponding transmission time, these 64-byte packets could be transmitted within the guard band's corresponding time period before the next time slot arrives, but their transmission is restricted. Therefore, the fixed guard band method wastes time slot utilization to some extent, thus reducing network bandwidth performance.

[0030] The inventors of this application have discovered through research that message out-of-bounds phenomena can also be avoided by the following methods.

[0031] Before transmission begins, each message in the queue is checked to see if it can be transmitted within the remaining time slot window. If it can be transmitted, transmission is allowed; otherwise, transmission is prohibited. This is called a "flexible guard band".

[0032] Flexible protection bands require real-time maintenance of a time slot's margin and comparison with the real-time data frame length at the service queue header. This comparison can be made either in the time dimension or in the number of transmitted bits dimension. When comparing in the time dimension, the transmission time is calculated based on the length of the message to be transmitted: Time = Message bits / Port rate. This method requires a divider. When comparing in the number of transmitted bits dimension, the number of transmittable bits is calculated based on the remaining time slot length: Transmittable bits = Remaining time * Port rate. This method requires a multiplier.

[0033] Multipliers and dividers are relatively complex circuits with high combinational logic levels, poor timing, and are not area-friendly.

[0034] Given that existing "fixed guard band" technology wastes transmission bandwidth and "flexible guard band" is complex to implement and has issues with timing and area requirements, embodiments of this application provide a traffic scheduling method, apparatus, electronic device, and readable storage medium. This is a new "flexible guard band" implementation scheme that retains the high transmission efficiency of traditional "flexible guard band" without requiring complex circuits such as multipliers and dividers.

[0035] The following detailed description of some embodiments of this application is provided in conjunction with the accompanying drawings. Unless otherwise specified, the following embodiments and features can be combined with each other.

[0036] Please refer to Figure 4 , Figure 4 This is a block diagram of an electronic device 100 provided in an embodiment of this application. The electronic device 100 may be, but is not limited to, a computer, a server, etc. The electronic device 100 may include a memory 110, a processor 120, and a communication unit 130. The memory 110, processor 120, and communication unit 130 are electrically connected to each other directly or indirectly to achieve data transmission or interaction. For example, these components can be electrically connected to each other through one or more communication buses or signal lines.

[0037] The memory 110 is used to store programs or data. The memory 110 may be, but is not limited to, random access memory (RAM), read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), etc.

[0038] The processor 120 is used to read / write data or programs stored in the memory 110 and execute corresponding functions. For example, the memory 110 stores a traffic scheduling device 200, which includes at least one software function module that can be stored in the memory 110 in the form of software or firmware. The processor 120 executes various functional applications and data processing by running the software programs and modules stored in the memory 110, such as the traffic scheduling device 200 in the embodiments of this application, thereby implementing the traffic scheduling method in the embodiments of this application.

[0039] The communication unit 130 is used to establish a communication connection between the electronic device 100 and other communication terminals through the network, and to send and receive data through the network.

[0040] It should be understood that, Figure 4 The structure shown is only a schematic diagram of the electronic device 100. The electronic device 100 may also include components that are larger than... Figure 4 The more or fewer components shown, or having the same Figure 4 The different configurations shown. Figure 4 The components shown can be implemented using hardware, software, or a combination thereof.

[0041] Please refer to Figure 5 , Figure 5 This is a flowchart illustrating the traffic scheduling method provided in this application embodiment. This method can be applied to Ethernet environments with high requirements for real-time, deterministic, and reliable data transmission, such as industrial control, the Internet of Things, and vehicle networks. The method can be applied to the aforementioned electronic devices. The specific flow of the traffic scheduling method is described in detail below. In this embodiment, the method may include steps S110 to S140.

[0042] Step S110: Obtain the remaining transmittable data amount corresponding to the current time slot.

[0043] In this embodiment, the total amount of data that can be transmitted for each time slot can be pre-configured. The total amount of data that can be transmitted for a time slot can be calculated based on the transmission rate of the port corresponding to that time slot and the gating time (i.e., gating duration) corresponding to that time slot, and then saved. The specific storage location can be determined according to actual needs. For example, the total amount of data that can be transmitted for each of the multiple time slots can be saved in a separate table.

[0044] The current timeslot represents the timeslot at the current moment. The remaining transmittable data amount corresponding to the current timeslot represents the total amount of data that can still be transmitted within the remaining time of the current timeslot. For example, assuming the gate time of the current timeslot is t2 and the elapsed time of the current timeslot is t1, then the remaining time of the current timeslot is t2-t1. The product of the remaining time of the current timeslot t2-t1 and the transmission rate of the target port corresponding to the current timeslot is the remaining transmittable data amount corresponding to the current timeslot.

[0045] A preset data volume corresponding to a preset time unit can also be pre-configured. This preset data volume is calculated based on the transmission rate of the target port corresponding to the current time slot and the preset time unit, and is then saved. The specific save location can be determined according to actual needs; for example, the preset data volume can be saved to the table mentioned above that stores the total transmittable data volume. The preset time unit can be set according to actual needs, such as 1ns or 10ns, without specific limitations here.

[0046] In this embodiment, the remaining transmittable data amount is obtained by subtraction based on the pre-configured total transmittable data amount corresponding to the current time slot, the data amount of each message already transmitted in the current time slot, and the preset data amount corresponding to the preset time unit. The specific calculation method can be determined according to the actual situation and is not specifically limited here.

[0047] Step S120: Determine whether the target data volume of the target message to be transmitted in the target queue corresponding to the current time slot is greater than the remaining transmittable data volume of the target, and obtain the determination result.

[0048] Step S130: Based on the judgment result, transmit or block the target message to be transmitted.

[0049] The target queue is the schedulable queue corresponding to the current time slot, and the queue can store messages that need to be transmitted. Given the remaining transmittable data volume of the target queue, it can be determined whether the target data volume of the target messages to be transmitted in the target queue is greater than the remaining transmittable data volume, thus obtaining a determination result. Here, the target messages to be transmitted are the messages currently to be scheduled in the target queue.

[0050] After obtaining the judgment result, it can be determined whether to start transmitting the target message to be transmitted or to prevent the transmission of the target message to be transmitted based on the judgment result.

[0051] Step S140: Update the remaining transmittable data amount information corresponding to the current time slot.

[0052] To facilitate subsequent traffic scheduling based on the target remaining transmittable data volume corresponding to the current time slot, the remaining transmittable data volume information corresponding to the current time slot is also updated based on a pre-set update method, so that the target remaining transmittable data volume can be obtained based on this remaining transmittable data volume information.

[0053] Thus, determining whether to transmit the target message based on whether the target data volume of the target message to be transmitted is greater than the target remaining transmittable data volume can avoid the waste of transmission bandwidth caused by setting a fixed guard band, and can ensure high transmission efficiency. In addition, in the above method, the target remaining transmittable data volume is obtained by subtraction based on the pre-configured total transmittable data volume corresponding to the current time slot, the data volume of each message already transmitted in the current time slot, and the preset data volume corresponding to the preset time unit, so there is no need for complex circuits such as multipliers and dividers.

[0054] Optionally, as a possible implementation, a gating list can be pre-configured. The gating list includes gating information corresponding to each time slot, and the gating information includes the gating status of multiple queues in that time slot. If the gating status of a queue in a time slot is open, it means that the queue can be scheduled in that time slot. The gating information may also include the gating time. The gating information may also include the total amount of data that can be transmitted in that time slot.

[0055] That is, for each time slot, the total amount of data that can be transmitted is calculated in advance based on the gating duration of that time slot and the transmission rate of the port corresponding to that time slot. This total amount of data that can be transmitted is then stored in the gating information corresponding to that time slot. In this way, when scheduling based on the gating list, the required total amount of data that can be transmitted can be directly obtained from the gating list.

[0056] When the gating list is configured as described above, optionally, upon entering a time slot, the gating information of the current time slot (i.e., the entered time slot) can be obtained from the pre-configured gating list. Then, based on this gating information, the target queue corresponding to the current time slot is determined, i.e., the queue with the gating state open, and the total amount of data that can be transmitted corresponding to the current time slot is obtained.

[0057] Optionally, the protection band function can be enabled by default for each queue.

[0058] Alternatively, each queue can be pre-configured functionally to obtain configuration information corresponding to each queue. This configuration information can indicate whether the corresponding queue has its protection band function enabled. Optionally, the user can configure whether each queue is allowed to cross boundaries, based on actual needs. If a queue is not allowed to cross boundaries, it means that the protection band function is enabled for that queue. The configuration information of the target queue corresponding to the current time slot can be obtained first. When the configuration information indicates that the protection band function is enabled, step S110 is executed.

[0059] It is understandable that, for a given time slot, this process can be executed only once within a gating cycle: obtaining the gating information for the current time slot and the configuration information for the target queue.

[0060] Optionally, before step S110, it can be determined whether the current conditions are met, and if the current conditions are met, step S110 is executed. In this way, the amount of remaining transmittable data corresponding to the current time slot can be obtained unnecessarily.

[0061] The preset conditions are: the gating state corresponding to the current time slot includes an open state, there are packets in the target queue, and the target port corresponding to the current time slot is currently idle. That is, it is determined whether previous packets have been transmitted, whether there are still packets to be transmitted in the target queue, and whether the gating state of one of the queues corresponding to the target port is open.

[0062] In this embodiment, information on the remaining transmittable data volume can be stored. Based on this information, the target remaining transmittable data volume corresponding to the current time slot can be obtained. This target remaining transmittable data volume is then compared with the target data volume of the target message to be transmitted, i.e., it is determined whether the target data volume is greater than the target remaining transmittable data volume, resulting in a determination result. If the determination result indicates that the target data volume is greater than the target remaining transmittable data volume, it is determined that the current time slot is not in a guard band, and the target message to be transmitted is transmitted. If the determination result indicates that the target data volume is not greater than the target remaining transmittable data volume, it is determined that the current time slot is in a guard band, and the transmission of the target message to be transmitted is blocked until the current time slot ends. Furthermore, the remaining transmittable data volume information corresponding to the current time slot is updated.

[0063] As one possible implementation, the remaining transmissible data amount information includes a first remaining transmissible data amount and a second remaining transmissible data amount, which can be achieved through... Figure 6 Update as shown. Please refer to... Figure 6 , Figure 6 for Figure 5 A flowchart illustrating the sub-steps included in step S140. In this embodiment, step S140 may include sub-steps S141 to S142.

[0064] Sub-step S141: Within the current time slot, the first remaining transmittable data amount is periodically reduced based on the preset data amount according to the preset time unit to obtain the updated first remaining transmittable data amount.

[0065] Sub-step S142: In the current time slot, while transmitting the target message to be transmitted, the second remaining transmittable data amount is reduced according to the target data amount of the target message to be transmitted, so as to obtain the updated second remaining transmittable data amount.

[0066] In this embodiment, two remaining transmittable data amounts are maintained, namely, the remaining transmittable data amount information includes a first remaining transmittable data amount and a second remaining transmittable data amount. Initially, both the first remaining transmittable data amount and the second remaining transmittable data amount are the pre-configured total transmittable data amount corresponding to the current time slot.

[0067] Within the current time slot, the initial remaining transmittable data amount is the total transmittable data amount corresponding to the current time slot; then, according to the preset time unit, the first remaining transmittable data amount is periodically subtracted from the preset data amount corresponding to the preset time unit, and the value after the reduction is used as the updated first remaining transmittable data amount.

[0068] Within the current time slot, the initial second remaining transmittable data amount is the total transmittable data amount corresponding to the current time slot. Each time the target message to be transmitted is transmitted, the second remaining transmittable data amount is subtracted from the target data amount of the target message to be transmitted in this transmission, and the reduced value is used as the updated second remaining transmittable data amount. Optionally, the above reduction process can be performed when determining to transmit the target message to be transmitted; alternatively, it can be performed after the target message to be transmitted has been transmitted, depending on actual needs.

[0069] When it is necessary to obtain the target remaining transmittable data amount corresponding to the current time slot, the current remaining transmittable data amount information can be obtained, and the first remaining transmittable data amount and the second remaining transmittable data amount in the remaining transmittable data amount information can be compared. The smaller value between the first remaining transmittable data amount and the second remaining transmittable data amount is taken as the target remaining transmittable data amount corresponding to the current time slot.

[0070] In this embodiment, after the current time slot ends, it can be determined whether the current time slot is the last time slot within the gating cycle. If the current time slot is not the last time slot within the gating cycle, the process proceeds to the next time slot. If the current time slot is the last time slot within the gating cycle, the process enters an idle state and waits for the next gating cycle. In this way, the above scheme can be executed periodically.

[0071] The following is combined with Figure 7 and Figure 8 The execution process of the above-described flow method is explained, which can be used as a time-aware shaper. In the following description, the units for the total transmittable data volume, the first remaining transmittable data volume, the second remaining transmittable data volume, and the target remaining transmittable data volume are bits; and it is assumed that guard bands are enabled for each queue.

[0072] like Figure 7 As shown in (a), the GCL entry of a traditional 10G rate port includes the gating state and gating time.

[0073] In this scheme, before configuring the GCL table, the total number of bits that can be transmitted in each time slot is calculated based on the allocated time window length and the corresponding port rate. The traditional GCL table entries are expanded by adding a new entry: Total Number of Transmittable Bits. For example... Figure 7 As shown in (b), the GCL of a certain 10G rate port after adjustment includes gating state, gating time, and total number of transmittable bits. The gating time of slot 0 is 700ns, and the corresponding total number of transmittable bits is 7000 bits; the gating time of slot 1 is 400ns, and the corresponding total number of transmittable bits is 4000 bits.

[0074] In this scheme, the guard band interval can be flexibly varied according to the length of the message to be transmitted, and no complex algorithm is required.

[0075] According to the IEEE 802.1Qbv protocol, the system operates periodically and regularly. After the system starts working according to the configuration, the time-aware shaper is periodically activated. Proceed to step S1.

[0076] Step S1: Obtain the gating information corresponding to this time slot (i.e., the current time slot) from the GCL list.

[0077] The gating information includes the total number of bits that can be transmitted (i.e., the total amount of data that can be transmitted), the gating status, and the gating time.

[0078] Step S2: Maintain information on the remaining number of transmittable bits (i.e., information on the remaining amount of transmittable data).

[0079] When entering this time slot, the total number of transmittable bits in the gating information corresponding to this time slot is used as the first remaining transmittable bit number (i.e., the first remaining transmittable data amount) and the second remaining transmittable bit number (i.e., the second remaining transmittable data amount) in the remaining transmittable data amount information.

[0080] Step S3: Determine whether the previous message has been transmitted, whether there are still messages to be transmitted in the target queue, and whether the gating state is open.

[0081] If the gating state of a queue is open, there are messages waiting to be sent in the queue, and all previously transmitted messages have been sent, then proceed to step S4; otherwise, proceed to step S2. Based on the preset number of bits corresponding to the preset time unit, reduce the first remaining transmittable bits to complete the update. The preset number of bits is pre-configured data, calculated in advance based on the preset time unit and the corresponding port transmission rate.

[0082] Step S4: Determine whether the target number of bits in the target message to be transmitted is greater than the target number of remaining transmittable bits.

[0083] If the determination result in step S3 is yes, it is necessary to determine whether the current state is within the guard band: whether the number of bits in the target message to be transmitted is greater than the target remaining transmittable bits. Here, the target number of bits is the number of bits in the target message to be transmitted. The target remaining transmittable bits is the smaller of the current first remaining transmittable bits and the second remaining transmittable bits.

[0084] Step S5: If the value is greater than the target value, then start the transmission of the target message to be transmitted.

[0085] Step S6: If it is not greater than, then prevent the transmission of the target message to be transmitted until the end of this time slot.

[0086] If the number of bits in the target message to be transmitted is greater than the number of remaining transmittable bits, meaning it is not in the guard band, then message transmission is initiated, and the process returns to step S2 to reduce the second number of remaining transmittable bits based on the number of bits in the target message to be transmitted, thereby completing the update. If the number of bits in the target message to be transmitted is not greater than the number of remaining transmittable bits, meaning it is in the guard band, then message transmission is blocked until the end of the current time slot, and then the process proceeds to step S7.

[0087] Step S7: Determine whether the current time slot is the last time slot within the gating cycle.

[0088] If the current time slot is not the last time slot within the gating cycle, proceed to the next cycle and repeat step S2. If the current time slot is the last time slot within the gating cycle, proceed to step S8.

[0089] Step S8: The system enters an idle state, waiting for the time-aware shaper to start in the next cycle.

[0090] The flow control method provided in this embodiment is equivalent to a software-coordinated implementation of a time-aware shaper, which can achieve dynamic packet length protection bandwidth function. In this scheme, through the coordinated work of software and hardware, the GCL timeslot table is adjusted to include the total amount of data that can be transmitted. Subsequently, based on the total amount of data that can be transmitted, the amount of data in each packet already transmitted in the current timeslot, and the preset amount of data corresponding to a preset time unit, the target remaining amount of data that can be transmitted is obtained through subtraction. The transmission of the packet is then determined based on the relationship between the target remaining amount of data that can be transmitted and the amount of data in the packet to be transmitted. In this way, a timing-friendly and area-friendly time-aware shaper can be implemented without complex algorithms, with relatively simple software and hardware implementation, and the time determinism of the TSN stream can be guaranteed.

[0091] To perform the corresponding steps in the above embodiments and various possible methods, an implementation of a traffic scheduling device 200 is given below. Optionally, the traffic scheduling device 200 can adopt the above-described... Figure 4 The device structure of the electronic device 100 shown. Further, please refer to... Figure 9 , Figure 9 This is a block diagram of the traffic scheduling device 200 provided in this embodiment. It should be noted that the basic principle and technical effects of the traffic scheduling device 200 provided in this embodiment are the same as those in the above embodiments. For the sake of brevity, any parts not mentioned in this embodiment can be referred to the corresponding content in the above embodiments. In this embodiment, the traffic scheduling device 200 may include: an information acquisition module 210, a judgment module 220, and a processing module 230.

[0092] The information acquisition module 210 is used to obtain the target remaining transmittable data volume corresponding to the current time slot. The target remaining transmittable data volume is obtained by subtraction based on the pre-configured total transmittable data volume corresponding to the current time slot, the data volume of each message already transmitted within the current time slot, and the preset data volume corresponding to a preset time unit. The preset data volume is pre-calculated based on the transmission rate of the target port corresponding to the current time slot and the preset time unit.

[0093] The judgment module 220 is used to determine whether the target data volume of the target message to be transmitted in the target queue corresponding to the current time slot is greater than the remaining transmittable data volume of the target, and obtain the judgment result.

[0094] The processing module 230 is used to transmit or block the target message to be transmitted based on the judgment result.

[0095] The processing module 230 is further configured to update the remaining transmittable data amount information corresponding to the current time slot. The remaining transmittable data amount information is used to obtain the target remaining transmittable data amount.

[0096] Optionally, in this embodiment, the information acquisition module 210 is further configured to: obtain the gating information of the current time slot from a pre-configured gating list, wherein the gating information includes the total amount of data that can be transmitted and the gating status, and the gating status is used to determine the target queue corresponding to the current time slot.

[0097] Optionally, in this embodiment, the judgment module 220 is further configured to: determine whether a preset condition is currently met. The preset condition includes the following: the gating state corresponding to the current time slot includes an open state; a message exists in the target queue; and the target port corresponding to the current time slot is currently idle. If the preset condition is met, the information acquisition module 210 obtains the remaining transmittable data amount corresponding to the target in the current time slot.

[0098] Optionally, in this embodiment, the information acquisition module 210 is further configured to: acquire configuration information of the target queue corresponding to the current time slot. When the configuration information of the target queue indicates that the guard band function is enabled, the information acquisition module 210 acquires the remaining transmittable data amount of the target corresponding to the current time slot.

[0099] Optionally, in this embodiment, the determination module 220 is further configured to: determine whether the current time slot is the last time slot in the gating cycle; if the current time slot is not the last time slot in the gating cycle, then proceed to the next time slot; if the current time slot is the last time slot in the gating cycle, then enter an idle state and wait for the next gating cycle.

[0100] Optionally, the above modules can be stored in the form of software or firmware. Figure 4 The memory 110 shown is either stored in or embedded in the operating system (OS) of the electronic device 100, and can be used by... Figure 4 The processor 120 executes the program. Meanwhile, the data and program code required to execute the above modules can be stored in the memory 110.

[0101] This application also provides a readable storage medium storing a computer program thereon, which, when executed by a processor, implements the traffic scheduling method described above.

[0102] In summary, this application provides a traffic scheduling method, apparatus, electronic device, and readable storage medium. First, the remaining transmittable data volume corresponding to the current time slot is obtained. Then, it is determined whether the target data volume of the target message to be transmitted in the target queue corresponding to the current time slot is greater than the remaining transmittable data volume, and a determination result is obtained. Next, the target message to be transmitted is transmitted or blocked according to the obtained determination result. Finally, the remaining transmittable data volume information corresponding to the current time slot is updated. The remaining transmittable data volume is obtained by subtraction based on the pre-configured total transmittable data volume corresponding to the current time slot, the data volume of each message already transmitted in the current time slot, and the preset data volume corresponding to a preset time unit. The preset data volume is pre-calculated based on the transmission rate of the target port corresponding to the current time slot and the preset time unit. The remaining transmittable data volume information is used to obtain the remaining transmittable data volume. This avoids wasted transmission bandwidth due to fixed guard bands, ensures high transmission efficiency, and eliminates the need for complex circuits such as multipliers and dividers.

[0103] In the several embodiments provided in this application, it should be understood that the disclosed apparatus and methods can also be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods, and computer program products according to various embodiments of this application. 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 marked in the blocks may occur in a different order than those marked in the drawings. For example, two consecutive 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 a block diagram and / or flowchart, and combinations of blocks in block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or action, or using a combination of dedicated hardware and computer instructions.

[0104] In addition, the functional modules in the various embodiments of this application can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.

[0105] If the aforementioned functions are implemented as software functional modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a portion of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.

[0106] The above description is merely an optional embodiment of this application and is not intended to limit this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the protection scope of this application.

Claims

1. A traffic scheduling method, characterized in that, The method includes: The remaining transmittable data volume corresponding to the current time slot is obtained by subtraction based on the pre-configured total transmittable data volume corresponding to the current time slot, the data volume of each message already transmitted in the current time slot, and the preset data volume corresponding to the preset time unit. The preset data volume is pre-calculated based on the transmission rate of the target port corresponding to the current time slot and the preset time unit. Determine whether the target data volume of the target message to be transmitted in the target queue corresponding to the current time slot is greater than the remaining transmittable data volume of the target, and obtain the determination result; Based on the judgment result, the target message to be transmitted is transmitted or blocked; Update the remaining transmittable data amount information corresponding to the current time slot, wherein the remaining transmittable data amount information is used to obtain the target remaining transmittable data amount.

2. The method according to claim 1, characterized in that, The remaining transmittable data amount information includes a first remaining transmittable data amount and a second remaining transmittable data amount. Updating the remaining transmittable data amount information corresponding to the current time slot includes: Within the current time slot, the first remaining transmittable data amount is periodically reduced based on the preset data amount according to the preset time unit to obtain the updated first remaining transmittable data amount, wherein initially the first remaining transmittable data amount is the total transmittable data amount; In the current time slot, when transmitting the target message to be transmitted, the second remaining transmittable data amount is reduced according to the target data amount of the target message to be transmitted to obtain an updated second remaining transmittable data amount. Initially, the second remaining transmittable data amount is the total transmittable data amount, and the target remaining transmittable data amount is the smaller value between the first remaining transmittable data amount and the second remaining transmittable data amount.

3. The method according to claim 1 or 2, characterized in that, The method further includes: The gating information of the current time slot is obtained from a pre-configured gating list. The gating information includes the total amount of data that can be transmitted and the gating status. The gating status is used to determine the target queue corresponding to the current time slot.

4. The method according to claim 1 or 2, characterized in that, The method further includes: Determine whether the current condition is met, wherein the preset condition is that the gating state corresponding to the current time slot includes the open state, there is a message in the target queue, and the target port corresponding to the current time slot is currently in an idle state; If the preset conditions are met, the step of obtaining the target remaining transmittable data amount corresponding to the current time slot is executed.

5. The method according to claim 1 or 2, characterized in that, The method further includes: Obtain the configuration information of the target queue corresponding to the current time slot; When the configuration information of the target queue indicates that the guard band function is enabled, the step of obtaining the remaining transmittable data amount of the target corresponding to the current time slot is executed.

6. The method according to claim 1 or 2, characterized in that, The step of transmitting or blocking the target message to be transmitted based on the judgment result includes: If the determination result is that the target data volume is greater than the target remaining transmittable data volume, the target message to be transmitted is transmitted. If the determination result is that the target data volume is not greater than the target remaining transmittable data volume, the transmission of the target message to be transmitted is blocked until the current time slot ends.

7. The method according to claim 1 or 2, characterized in that, After the current time slot ends, the method further includes: Determine whether the current time slot is the last time slot within the gating cycle; If the current time slot is not the last time slot within the gating cycle, proceed to the next time slot; If the current time slot is the last time slot in the gating cycle, then it enters an idle state and waits for the next gating cycle.

8. A traffic flow scheduling device, characterized in that, The device includes: The information acquisition module is used to obtain the remaining transmittable data volume of the target corresponding to the current time slot. The remaining transmittable data volume of the target is obtained by subtraction based on the pre-configured total transmittable data volume of the current time slot, the data volume of each message already transmitted in the current time slot, and the preset data volume corresponding to the preset time unit. The preset data volume is pre-calculated based on the transmission rate of the target port corresponding to the current time slot and the preset time unit. The judgment module is used to determine whether the target data volume of the target message to be transmitted in the target queue corresponding to the current time slot is greater than the remaining transmittable data volume of the target, and obtain the judgment result; The processing module is used to transmit or block the target message to be transmitted based on the judgment result; The processing module is also used to update the remaining transmittable data amount information corresponding to the current time slot, wherein the remaining transmittable data amount information is used to obtain the target remaining transmittable data amount.

9. An electronic device, characterized in that, It includes a processor and a memory, the memory storing machine-executable instructions that can be executed by the processor, the processor executing the machine-executable instructions to implement the traffic scheduling method according to any one of claims 1-7.

10. A readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the traffic scheduling method as described in any one of claims 1-7.