Switch qos scheduling method, apparatus, device, and storage medium
By classifying data packets by priority labels and calculating dynamic weights in the switch, combined with weighted round-robin and interrupt-first forwarding, the deterministic latency and low-priority traffic starvation problems of the switch under high load are solved, achieving efficient network resource management and quality of service assurance.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- SHENZHEN FENGRUNDA TECH CO LTD
- Filing Date
- 2026-02-26
- Publication Date
- 2026-06-19
AI Technical Summary
Existing switches struggle to simultaneously guarantee deterministic latency limits for real-time services and eliminate low-priority traffic starvation under high-load burst traffic conditions. Static weighted polling cannot respond promptly to sudden traffic changes, and purely strict priority scheduling leads to long-term blocking of low-priority traffic.
A deep inspection module is used to classify data packets by priority tags. Based on the priority tags, data packets are written into the corresponding queues and dedicated cache resources are reserved. Dynamic weight calculation is performed by collecting real-time bandwidth utilization and queue waiting time. Combined with weighted round-robin and interrupt-first forwarding mechanisms, dynamic scheduling is achieved.
Provides millisecond-level latency guarantees for target queues under high-load environments, prevents low-priority traffic starvation, achieves deterministic latency and adaptive scheduling, and improves network service quality and resource utilization.
Smart Images

Figure CN122247946A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of network communication technology, and in particular to a QoS scheduling method, apparatus, device, and storage medium for a switch. Background Technology
[0002] With the explosive growth of real-time services such as high-definition video, cloud gaming, and industrial internet, society has put forward a rigid demand for network transmission with "deterministic low latency and zero starvation". Operators and data centers urgently need switch technology that can provide millisecond-level latency guarantee for critical services under high load burst scenarios.
[0003] Existing switches generally use static weighted round-robin or pure strict priority scheduling. The former cannot respond to sudden changes in traffic in a timely manner, resulting in excessive latency for real-time services, while the latter blocks low-priority traffic for a long time under high load. It lacks dynamic adjustment and resource reservation mechanisms, making it difficult to simultaneously meet the dual goals of "strict latency limit" and "fair resource allocation".
[0004] The above content is only used to help understand the technical solution of the present invention and does not represent an admission that the above content is prior art. Summary of the Invention
[0005] The main objective of this invention is to provide a QoS scheduling method, apparatus, device, and storage medium for switches, aiming to solve the technical problem of how to simultaneously guarantee the deterministic latency limit of real-time services and eliminate low-priority traffic starvation under high-load burst traffic.
[0006] To achieve the above objectives, the present invention provides a QoS scheduling method for a switch, the QoS scheduling method for a switch comprising the following steps: Receive input data packets, perform deep detection on the input data packets according to a preset service feature library, and obtain classified data packets with priority labels; Based on the priority label, the classified data packet is written into the corresponding priority queue, and exclusive cache resources are reserved for the target queue in the priority queue. Collect the real-time bandwidth utilization and queue waiting time of each priority queue, and perform dynamic weight calculation on the real-time bandwidth utilization and queue waiting time to obtain the target weight sequence; According to the target weight sequence, a weighted round-robin transmission is performed on the non-target queues in the priority queue; If a data packet is detected in the target queue of the priority queue and the waiting time of the queue exceeds a preset delay threshold, the weighted polling transmission is interrupted, and the data packet of the target queue is forwarded first.
[0007] In one embodiment, the step of writing the classified data packet into the corresponding priority queue based on the priority label and reserving exclusive cache resources for the target queue in the priority queue includes: Extract the priority tag value of the classified data packet; The classified data packet is written into the corresponding priority queue according to the priority label value; Identify the highest priority among the priority tag values and set the corresponding queue as the target queue; Allocate an exclusive buffer to the target queue and mark the usage permission of the exclusive buffer as available only to the target queue.
[0008] In one embodiment, the step of collecting the real-time bandwidth utilization and queue waiting time of each priority queue, and dynamically weighting the real-time bandwidth utilization and queue waiting time to obtain a target weight sequence includes: The exit byte counter of each priority queue is periodically sampled to obtain the real-time bandwidth utilization rate; The queue waiting time is determined based on the enqueue timestamp and dequeue timestamp of the data packets in the priority queue. The burst coefficient is obtained by calculating the ratio between the real-time bandwidth utilization rate and the historical average bandwidth utilization rate. The burst coefficient, the queue waiting time, the preset priority coefficient, and the preset minimum satisfaction level are input into the weight calculation model to calculate the weight value of each priority queue. The weight values are normalized to obtain the target weight sequence.
[0009] In one embodiment, the step of performing weighted round-robin transmission on non-target queues in the priority queue according to the target weight sequence includes: The target weight sequence is converted into the transmission quota for each non-target queue; Weighted round-robin sending is performed based on the sending quota, and the number of bytes sent for each non-target queue is accumulated; When the cumulative value reaches the corresponding sending quota, stop sending to the current non-target queue, obtain the next non-target queue from the polling schedule table, and continue to execute weighted polling sending; Continuously monitor the target queue for data packets, and pause the weighted polling sending step when a data packet is detected.
[0010] In one embodiment, the step of interrupting the weighted polling transmission and prioritizing the forwarding of data packets from the target queue when a data packet is detected in the target queue of the priority queue and the queue waiting time exceeds a preset delay threshold includes: Scan the head pointer of the target queue in the priority queue; The queue waiting time for reading the data packet at the head of the queue when the head pointer is not null; The queue waiting time is compared with a preset delay threshold to obtain the comparison result; When the comparison result indicates that the queue waiting time exceeds the preset delay threshold, the non-target queue identifier and remaining quota of the currently polled queue are saved. Switch the sending resource from the current non-target queue to the target queue, and forward the data packets in the target queue; When there are no data packets in the target queue or the queue waiting time is lower than a preset delay threshold, the weighted polling sending step is resumed according to the non-target queue identifier and the remaining quota.
[0011] In one embodiment, the method further includes: Detect the amount of cache already used in the target queue; If the amount of cached data exceeds a preset cache threshold, a cache warning message will be generated. The cache warning information is sent to the dynamic weight calculation step to increase the weight value of the target queue based on the cache warning information.
[0012] In one embodiment, the method further includes: When the weighted polling transmission is interrupted, record the current polling position and the remaining quota; Once the data packet forwarding to the target queue is complete, weighted round-robin transmission is resumed based on the non-target queue identifier and the remaining quota, and the remaining data packets are continued to be sent. The data packets sent before the interruption, the target queue data packets that were prioritized for forwarding, and the remaining data packets sent after recovery are all combined as the scheduling output to obtain the complete scheduled data packets.
[0013] Furthermore, to achieve the above objectives, the present invention also proposes a switch QoS scheduling device, the device comprising: The depth detection module is used to receive input data packets and perform depth detection on the input data packets according to a preset business feature library to obtain classified data packets with priority labels. The writing module is used to write the classified data packet into the corresponding priority queue based on the priority label, and reserve exclusive cache resources for the target queue in the priority queue. The acquisition and calculation module is used to acquire the real-time bandwidth utilization rate and queue waiting time of each priority queue, and to perform dynamic weight calculation on the real-time bandwidth utilization rate and queue waiting time to obtain the target weight sequence. The polling and sending module is used to perform weighted polling and sending on the non-target queues in the priority queue according to the target weight sequence; The interrupt priority module is used to interrupt the weighted polling transmission and prioritize forwarding the data packets of the target queue when it is detected that there are data packets in the target queue in the priority queue and the waiting time of the queue exceeds a preset delay threshold.
[0014] Furthermore, to achieve the above objectives, the present invention also proposes a switch QoS scheduling device, the device comprising: a memory, a processor, and a switch QoS scheduling program stored in the memory and executable on the processor, the switch QoS scheduling program being configured to implement the steps of the switch QoS scheduling method described above.
[0015] In addition, to achieve the above objectives, the present invention also proposes a storage medium storing a switch QoS scheduler, wherein the switch QoS scheduler, when executed by a processor, implements the steps of the switch QoS scheduling method described above.
[0016] In addition, to achieve the above objectives, this application also provides a computer program product, which includes a computer program that, when executed by a processor, implements the steps of the switch QoS scheduling method described above.
[0017] One or more technical solutions proposed in this application have at least the following technical effects: By reserving dedicated cache, dynamic weight calculation, and a closed-loop mechanism of interrupt-priority forwarding, the switch can still provide millisecond-level latency guarantees for the target queue under burst traffic. At the same time, it uses backpressure and tail dropping to prevent low-priority traffic from crowding out resources, thereby achieving a combination of deterministic latency, zero starvation, and adaptive scheduling in high-load environments, significantly improving network service quality and resource utilization. Attached Figure Description
[0018] The accompanying drawings, which are incorporated in and form part of this specification, illustrate embodiments consistent with this application and, together with the description, serve to explain the principles of this application.
[0019] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, for those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0020] Figure 1 This is a flowchart illustrating an embodiment of the QoS scheduling method for switches in this application. Figure 2 This is a flowchart illustrating Embodiment 2 of the QoS scheduling method for switches in this application. Figure 3 This is a schematic diagram of the module structure of the switch QoS scheduling device according to an embodiment of this application; Figure 4 This is a schematic diagram of the device structure of the hardware operating environment involved in the switch QoS scheduling method in this application embodiment.
[0021] The purpose, features, and advantages of this application will be further explained in conjunction with the embodiments and with reference to the accompanying drawings. Detailed Implementation
[0022] It should be understood that the specific embodiments described herein are merely illustrative of the technical solutions of this application and are not intended to limit this application.
[0023] To better understand the technical solution of this application, a detailed description will be provided below in conjunction with the accompanying drawings and specific implementation methods.
[0024] It should be noted that the executing entity in this embodiment can be a computing service device with data processing, network communication, and program execution functions, such as a tablet computer, personal computer, or mobile phone, or an electronic device or switch QoS scheduling device capable of performing the above functions. The following description uses a switch QoS scheduling device as an example to illustrate this embodiment and the subsequent embodiments.
[0025] Based on this, embodiments of this application provide a switch QoS scheduling method, referring to... Figure 1 , Figure 1 This is a flowchart illustrating the first embodiment of the QoS scheduling method for switches in this application.
[0026] In this embodiment, the switch QoS scheduling method includes steps S10 to S50: Step S10: Receive the input data packet, perform deep detection on the input data packet according to the preset service feature library, and obtain a classified data packet with priority label; The system architecture of this invention adopts a closed-loop design of "perception-decision-scheduling-feedback", mainly including five core modules and two supporting units. Each module is interconnected through a high-speed internal bus (transmission rate ≥10Gbps) to ensure the real-time performance and reliability of data transmission.
[0027] The system architecture includes: a traffic monitoring module, responsible for real-time collection, parsing, and analysis of network traffic data to provide data support for policy decisions; a QoS policy engine, the core decision-making unit of the system, responsible for service classification, policy generation, and dynamic weight calculation; a scheduler module, responsible for executing scheduling policies and realizing the fusion scheduling of strict mode SP and dynamic WRR; a data storage unit, storing real-time traffic data, historical records, policy configurations, service feature libraries, etc.; and a user interface module, providing visual configuration, monitoring, and alarm functions.
[0028] It should be noted that the preset service feature library is a set of identification rules pre-stored within the switch. These rules describe common services using source IP address, destination IP address, source port, destination port, protocol type, and deep packet inspection feature values, such as VoIP, video conferencing, and industrial control signals. When a data packet enters the switch, the switch compares the packet header five-tuple and payload features with each rule. If there is a complete match, the corresponding priority label is assigned, thus completing the service classification.
[0029] Understandably, the switch compares the header 5-tuple and payload characteristics of the input data packet with the preset service feature database one by one. If a rule is completely matched, the corresponding priority tag is written into the packet header to form a classified data packet. This data packet is then sent to the priority queue to complete the service level classification.
[0030] Step S20: Write the classified data packets into the corresponding priority queue based on the priority label, and reserve exclusive cache resources for the target queue in the priority queue; It should be noted that the priority label is a scheduling level identifier assigned to a data packet by the switch. It is represented by an integer value, with a smaller value indicating a higher priority. The label is carried throughout the process of the data packet within the switch and is used to determine which priority queue the data packet enters and its subsequent scheduling order.
[0031] Understandably, the switch extracts the priority tag value of the classified data packets, writes the data packets into the corresponding priority queue according to the tag value, sets the queue with the highest tag value as the target queue, allocates an exclusive buffer for the queue, and sets the access control policy to allow only the target queue to write, thereby ensuring that critical services have a fixed buffer space under high load.
[0032] In one feasible implementation, step S20 includes steps A11 to A14: A11: Extract the priority label value of the classified data packet; It should be noted that the priority label value is an integer field in the data packet header, used to identify the service scheduling level. The smaller the value, the higher the priority.
[0033] Understandably, the switch reads this integer value from the header of the classified data packet to provide a basis for selecting the corresponding priority queue.
[0034] A12: Write the classified data packets into the corresponding priority queue according to the priority label value; It should be noted that priority queues are independent buffer spaces within the switch, divided according to priority. Each queue has its own inbound and outbound ports.
[0035] Understandably, the switch maps priority tag values to queue numbers, writes classified data packets into the mapped queue, and completes the queuing by priority.
[0036] A13: Identify the highest priority among the priority tag values and set the corresponding queue as the target queue; It should be noted that the highest priority refers to the level with the lowest tag value, and the target queue is the queue that has been granted strict scheduling privileges.
[0037] Understandably, the switch iterates through all priority tag values, selects the queue corresponding to the minimum value as the target queue, and determines the object for subsequent resource reservation.
[0038] A14: Allocate an exclusive buffer to the target queue and mark the access permission of the exclusive buffer as available only to the target queue.
[0039] It should be noted that the exclusive cache is a dedicated storage area designated by the hardware, with a fixed capacity and physical isolation from other queues.
[0040] Understandably, the switch sets the exclusive buffer write permission register to be writable only by the target queue, denying access to any non-target queue, thereby ensuring that the target queue has a stable buffer space under high load.
[0041] It should be understood that the QoS policy engine internally performs intelligent classification, strict mode configuration, and dynamic weight calculation. The classification side supports multi-dimensional combination rules based on IP range, port range, protocol number, DSCP or 802.1p identifier, and DPI characteristics, and users can customize entries. The engine has built-in fingerprints for over a hundred services, including Skype, Zoom, Tencent Meeting, HTTP / 2, and FTP, which are automatically identified and assigned default priorities upon power-on. Overall traffic is divided into five levels, from P0 to P4. P0 carries industrial control or VoIP, while P4 is reserved for logs and background traffic. The maximum allowable latency, jitter, and bandwidth reservation ratio for each level can be set by the user. By default, P0 has ≤10 ms latency, ≤2 ms jitter, and 20% dedicated link bandwidth. P1 has a default of 15%, and the reserved segment only serves the services of this level. When P0 / P1 traffic exceeds the reservation, it can preempt idle bandwidth while ensuring the lowest bandwidth for lower priorities, thus avoiding starvation. The weight calculation process reads the bandwidth utilization, priority coefficient, burst coefficient, and minimum guarantee satisfaction from the traffic monitoring unit in real time. The weight is updated every 10 ms. The weight of high priority is no less than 80% of the base value, and the weight of low priority is no less than 50%. The generated new weight, along with queue allocation, preemption and other policies, is sent to the scheduler every 5 ms. If the user's static configuration conflicts with the dynamic results, the engine will automatically correct it according to the principle of "core business priority" and report an alarm.
[0042] The engine obtains real-time data, analysis results, and anomaly alarms from the traffic monitoring module through the internal bus. The delay in sending scheduling policies to the scheduler module does not exceed 3 ms. The user interface can adjust parameters such as priority rules, basic weights, and latency thresholds in real time via API. The engine provides immediate feedback on the execution status and stores the business feature library, policy templates, and historical weight records in the data storage unit to achieve persistence and traceability of configuration and running status.
[0043] Step S30: Collect the real-time bandwidth utilization and queue waiting time of each priority queue, and perform dynamic weight calculation on the real-time bandwidth utilization and queue waiting time to obtain the target weight sequence; It should be noted that real-time bandwidth utilization is the instantaneous bandwidth usage rate obtained by the switch through periodic sampling of the number of bytes dequeued from each queue. The sampling period is configurable and is usually set to the millisecond level. The utilization rate is expressed as a percentage and is used to reflect the current load level of the queue.
[0044] Understandably, the switch periodically reads the egress byte counter and records the timestamp, calculates the bandwidth utilization and waiting time, inputs them into the weight model, and outputs the target weight sequence to provide a basis for the polling ratio in the next round.
[0045] In one feasible implementation, step S30 includes steps A21 to A24: A21: Periodically sample the exit byte counters of each priority queue to obtain the real-time bandwidth utilization rate; It should be noted that the exit byte counter is located at the exit point of each queue and is used to accumulate the number of bytes sent in the current cycle.
[0046] Understandably, the switch reads the counter value at fixed intervals, calculates the number of bytes per unit time, obtains the real-time bandwidth utilization, and provides data for subsequent burst detection.
[0047] A22: Determine the queue waiting time based on the enqueue timestamp and dequeue timestamp of the data packets in the priority queue; It should be noted that the enqueue timestamp and dequeue timestamp are local time values written by the switch when allocating buffers for data packets, with a precision of nanoseconds.
[0048] Understandably, when a switch reads the enqueue timestamp and dequeue timestamp of the same data packet, the difference between the two is the queue waiting time, which directly reflects the degree of queue congestion.
[0049] A23: The burst coefficient is obtained by calculating the ratio between the real-time bandwidth utilization rate and the historical average bandwidth utilization rate; It should be noted that the burst factor is the ratio of real-time bandwidth utilization to historical average bandwidth utilization, used to quantify the intensity of traffic bursts.
[0050] Understandably, the switch divides the real-time bandwidth utilization rate by the historical average bandwidth utilization rate to obtain the burst coefficient, which provides a burst metric for subsequent weight adjustments.
[0051] A24: Input the burst factor, queue waiting time, preset priority factor, and preset minimum satisfaction level into the weight calculation model to calculate the weight value of each priority queue; It should be noted that the preset priority coefficient is a fixed weight multiplier used to reflect the differences in business levels, and the preset minimum guarantee satisfaction is the ratio of the actual bandwidth obtained by the queue to the minimum guaranteed bandwidth, used to measure the degree of resource guarantee.
[0052] Understandably, the switch inputs the burst factor, queue waiting time, preset priority factor, and preset minimum satisfaction level into the weight calculation model to calculate the weight value of each queue, providing a basis for the subsequent polling ratio.
[0053] A25: Normalize the weight values to obtain the target weight sequence.
[0054] It should be noted that normalization scaling is a process that scales the weight values of each queue proportionally, so that the sum of the weights is a fixed value, which makes it easier to allocate sending quotas.
[0055] Understandably, the switch divides the weight value of each queue by the sum of the weights to obtain the target weight sequence, which determines the polling ratio for the next round.
[0056] It should be understood that the traffic monitoring unit collects all data packets flowing through the switch in a comprehensive manner. On the basic side, it synchronously records the source IP, destination IP, source port, destination port, protocol type, packet length, number of packets, and bandwidth utilization for each flow, with an accuracy controlled within 0.1%. On the latency side, it adds an enqueue / dequeue timestamp to each packet with an accuracy of ≤10ns, and calculates end-to-end latency and queue waiting latency in real time. On the quality side, it continuously monitors packet loss rate, retransmission rate, and bit error rate. Using deep packet inspection technology, the unit can identify typical services such as VoIP, video conferencing, HTTP, FTP, and industrial Modbus, and extract key features such as bitrate, frame interval, and priority identifier. After collection, the system aggregates data by service type, priority, address range, and time period to generate a traffic distribution map. Using preset thresholds combined with the isolated forest algorithm, it immediately triggers an alarm and pushes it to the QoS policy engine when bandwidth suddenly increases by ≥50%, packet loss rate increases by ≥5%, or latency exceeds the limit by 20%. The sliding window algorithm predicts trends for the next 1-5 seconds within a 10-second window, providing forward-looking input for dynamic weight adjustment. All raw data and analysis results are synchronized to the QoS policy engine and data storage unit via an internal streaming protocol at 10ms intervals. The transmission process uses CRC32 checksum to ensure integrity and can enable 10:1 compression to reduce bandwidth consumption.
[0057] Physically, the monitoring unit is connected to the service port of the core scheduling switch via a high-speed Ethernet interface to ensure full traffic visibility; logically, it interacts with the QoS policy engine and storage unit via an internal bus, with data latency ≤5ms; in terms of control, it receives real-time updates to the collection frequency, detection threshold, and service identification rules from the user interface to dynamically refresh parameters.
[0058] Step S40: Based on the target weight sequence, perform weighted round-robin sending on the non-target queues in the priority queue; It should be noted that non-target queues refer to the remaining queues that are not set to strict priority, and these queues share the remaining bandwidth according to their weight ratio.
[0059] Understandably, the switch performs weighted round-robin transmission on non-target queues according to the target weight sequence to ensure that each queue gets a transmission opportunity according to its weight ratio, while continuously detecting whether there are data packets in the target queue, providing triggering conditions for subsequent priority forwarding.
[0060] In one feasible implementation, step S40 includes steps A31 to A34: A31: Convert the target weight sequence into the transmission quota for each non-target queue; It should be noted that the sending quota is the upper limit of bytes converted from the target weight sequence after normalization, and the quota value is proportional to the weight.
[0061] Understandably, the switch multiplies the target weight sequence by the total number of bytes in the polling period to obtain the sending quota for each non-target queue, providing a quantitative basis for subsequent polling.
[0062] A32: Weighted round-robin sending based on sending quota, and cumulatively counting the number of bytes sent for each non-target queue; It should be noted that weighted polling is a process of sending data packets to each queue in sequence according to the quota ratio, and the cumulative number of bytes sent is used to determine whether the quota has been reached.
[0063] Understandably, the switch sends data packets to each non-target queue in sequence according to the quota ratio and accumulates the number of bytes sent. When the accumulated value reaches the quota, the current queue stops sending and switches to the next queue to ensure that each queue gets a chance to send according to its weight ratio.
[0064] A33: When the cumulative value reaches the corresponding sending quota, stop sending to the current non-target queue, obtain the next non-target queue from the polling schedule table, and continue to execute weighted polling sending; It should be noted that the polling schedule table is a hardware table entry that stores the sending quota of each non-target queue and is used to guide the polling order.
[0065] Understandably, when the cumulative value reaches the quota, the switch retrieves the next non-target queue from the polling schedule table and continues to perform weighted polling to ensure that each queue gets a transmission opportunity according to its weight ratio.
[0066] A34: Continuously detect whether there are data packets in the target queue, and pause the weighted polling sending step when a data packet is detected.
[0067] It should be noted that pausing weighted polling transmission provides the triggering condition for subsequent priority forwarding, ensuring that data packets in the target queue are processed in a timely manner.
[0068] Understandably, during the polling process, the switch continuously checks whether there are data packets in the target queue. Once a data packet is detected, it immediately pauses polling to create conditions for subsequent priority forwarding.
[0069] In step S50, if a data packet is detected in the target queue in the priority queue and the queue waiting time exceeds the preset delay threshold, the weighted polling transmission is interrupted and the data packet of the target queue is forwarded first.
[0070] It should be noted that the preset delay threshold is the upper limit of the waiting time configured by the user, which is used to trigger the priority forwarding mechanism.
[0071] Understandably, when a switch detects that there are data packets in the target queue and the queue waiting time exceeds the preset delay threshold, it immediately interrupts the weighted polling transmission and prioritizes forwarding data packets in the target queue to ensure that real-time services can still obtain deterministic latency guarantees under burst traffic.
[0072] It should be understood that the scheduler unit is responsible for executing the converged scheduling mechanism, enabling the collaborative operation of strict mode SP and dynamic WRR. Internally, queues are prioritized from P0 to P4, with high-priority queues receiving data packets first. During forwarding, the waiting latency of high-priority queues is checked in real time; if the latency exceeds a threshold, expedited forwarding is triggered, skipping low-priority forwarding to ensure critical service latency meets standards. Simultaneously, independent bandwidth is reserved for high-priority queues, which low-priority queues can only temporarily borrow from when high-priority queues have not exhausted their reserved bandwidth. Weighted bandwidth allocation is based on dynamic weights issued by the QoS policy engine, allocating bandwidth proportionally to each queue. Round-robin forwarding is used within the same priority queue to ensure data flow fairness within the queue. When queue traffic surges, idle bandwidth from other queues can be temporarily borrowed, automatically returning it after traffic recovers. After a data packet is enqueued, the scheduler first checks the high-priority queue; if there is a data packet, it is forwarded according to SP rules until the queue is empty or the reserved bandwidth limit is reached. When a high-priority queue has no data packets or has exhausted its reserved bandwidth, low-priority queues are forwarded in round-robin according to dynamic WRR weights. In the event of a traffic surge, the scheduler receives new weights and adjusts the bandwidth allocation ratio. When the queue cache reaches the 80% threshold, a cache warning is triggered, the QoS policy engine is notified to adjust the weights, and low-priority queue packets are dropped at the tail to prevent high-priority queue cache overflow; it supports remarking the DSCP / 802.1p priority identifier of inbound packets to ensure that downstream devices follow the same QoS policy; it monitors the forwarding status of each queue in real time and feeds it back to the traffic monitoring unit to form a closed-loop feedback.
[0073] The scheduler unit receives scheduling policies from the QoS policy engine via the internal bus, including priority rules, dynamic weights, queue configurations, etc.; receives network traffic classified by the traffic monitoring unit and sends it to the corresponding physical queue according to the queue allocation rules; forwards the scheduled traffic to the target port or downstream network device; and feeds back the forwarding status data of each queue to the traffic monitoring unit via the internal bus, including forwarding rate, buffer occupancy rate, packet loss rate, etc., to achieve close coordination between policy execution and status monitoring.
[0074] Furthermore, this plan also includes: Detect the amount of cache already used in the target queue; If the amount of cached data used exceeds a preset cache threshold, a cache warning message will be generated. The cache warning information is sent to the dynamic weight calculation step to increase the weight value of the target queue based on the cache warning information.
[0075] It should be noted that the used cache amount is the number of storage units currently occupied by the target queue. It is obtained by accumulating the written bytes and subtracting the read bytes in real time through the queue management counter. The counter precision is one cache line.
[0076] Understandably, the switch periodically reads this counter, and when the value exceeds the preset cache threshold, it immediately generates a cache warning message and sends the message to the weight calculation stage, so that the target queue gets a higher weight in the next weight cycle, thereby increasing the sending quota, quickly reducing cache pressure, and preventing data packets from being dropped due to cache overflow.
[0077] Furthermore, this plan also includes: When weighted polling is interrupted, record the current polling position and remaining quota; Once the packet forwarding to the target queue is complete, weighted round-robin transmission resumes based on the non-target queue identifier and the remaining quota, and the remaining packets are sent. The data packets sent before the interruption, the target queue data packets that were prioritized for forwarding, and the remaining data packets sent after recovery are all combined as the scheduling output to obtain the complete scheduled data packets.
[0078] It should be noted that the polling position is the queue identifier of the non-target queue at the moment of interruption, and the remaining quota is the unused transmission byte quota of the queue. Both are latched in real time by the transmission control register to ensure that the field information is not lost.
[0079] Understandably, after the last data packet in the target queue leaves the dequeue, the switch immediately resumes the transmission of the corresponding non-target queue based on the recorded polling position and remaining quota, continues to consume the remaining quota, and then outputs the data sent before the interruption, the target data forwarded in the priority phase, and the data sent in the recovery phase in the dequeue order, forming a complete post-scheduled data packet flow without gaps or out-of-order delivery, thus ensuring the integrity of the overall forwarding.
[0080] In its implementation, this solution comprises three phases: During the initialization phase, after the core scheduling switch powers on, each module sequentially completes a self-test, covering key items such as hardware status, interface connections, and software version. Upon successful self-test, the module enters the ready state. Subsequently, the user selects a policy template or manually configures basic parameters through the user interface module, including service classification rules, priorities, basic weights, and latency thresholds. After configuration, these parameters are sent to the QoS policy engine. Next, the QoS policy engine loads its built-in service feature library, and the traffic monitoring module loads data collection rules. Based on the user-configured basic weights and default service features, the QoS policy engine calculates the initial dynamic weights and sends the results to the scheduler. The scheduler, based on the initial weights and reserved bandwidth configuration, initializes the buffer size and bandwidth allocation ratio for each priority queue, and then enters a waiting state for traffic.
[0081] During operation, when network traffic enters the core scheduling switch, the traffic monitoring module collects full-dimensional characteristics of the traffic and identifies the service type using Deep Packet Inspection (DPI) technology. Based on the classification rules of the QoS policy engine, the traffic is accurately allocated to the corresponding priority queues (P0-P4). The traffic monitoring module simultaneously transmits real-time traffic data, such as bandwidth utilization, latency, and packet loss rate, to the QoS policy engine and data storage unit. Based on this real-time traffic data, the QoS policy engine uses a dynamic weight adjustment algorithm to calculate the current weight of each queue and, combined with the configuration rules of strict mode SP (latency threshold, reserved bandwidth), generates a fusion scheduling policy covering elements such as queue weight, forwarding order, and preemption rules. This policy is then sent to the scheduler at 5ms intervals. The scheduler receives data packets and stores them by queue, executing the fusion scheduling of SP and dynamic WRR according to the issued scheduling policy. High-priority queues follow the SP rules for priority forwarding to ensure latency meets targets; low-priority queues are forwarded in round-robin fashion according to dynamic weights to avoid starvation. The scheduler also feeds back queue forwarding status, including bandwidth utilization, cache utilization, latency, etc., to the traffic monitoring module.
[0082] During the anomaly handling phase, the traffic monitoring module monitors traffic in real time. Upon identifying anomalies such as traffic bursts (bandwidth utilization surge ≥50%), excessive packet loss (≥5%), or excessive latency (exceeding preset thresholds), it immediately triggers an alarm and pushes it to the QoS policy engine. If a link failure occurs, such as a disconnection between upstream and downstream devices, the switch detects the fault via the LLDP protocol and notifies the traffic monitoring module and the QoS policy engine. Upon receiving the anomaly alarm, the QoS policy engine quickly adjusts dynamic weights, increasing the adjustment frequency to once every 5ms. For example, the weight of a traffic burst queue is increased, while the weight of the queue corresponding to the faulty link is temporarily decreased. If high-priority services experience excessive latency, a latency protection algorithm is triggered, adjusting reserved bandwidth, queue buffering, or forwarding priority. The scheduler receives the adjusted policy and immediately adjusts the bandwidth allocation ratio and forwarding order, prioritizing core service transmission. If a link failure causes traffic switching, the scheduler quickly switches traffic from the faulty link to a backup link and executes scheduling according to the new policy. After the anomaly is resolved, if traffic returns to normal and the link is repaired, the QoS policy engine gradually restores parameters such as weights and reserved bandwidth to normal levels. The user interface module records the exception handling process and results, generates exception event reports, and provides feedback to the user.
[0083] This embodiment provides a QoS scheduling method for switches. Through an innovative "strict mode SP + dynamic WRR fusion scheduling" architecture, intelligent weight adjustment algorithm, and precise traffic management mechanism, it achieves deterministic latency guarantee, fair resource allocation, and simplified operation and maintenance in dynamic network environments, meeting the QoS requirements of different types of services.
[0084] Based on the first embodiment of this application, in the second embodiment of this application, the content that is the same as or similar to that in the first embodiment described above can be referred to the above description, and will not be repeated hereafter. Based on this, please refer to... Figure 2 Step S60 includes steps S401 to S406: Step S401: Scan the head pointer of the target queue in the priority queue; It should be noted that the head pointer is a read address register maintained by the hardware queue management unit. Its value points to the starting position of the data packet to be sent in the buffer. If the pointer is zero, it means that the queue is idle.
[0085] Understandably, the switch reads this pointer at the beginning of each transmission cycle and quickly confirms whether there are data packets waiting to be forwarded in the target queue by judging that the state is not empty, thus providing a trigger condition for subsequent latency detection.
[0086] Step S402: If the head pointer is not null, read the queue waiting time of the head data packet. It should be noted that the queue waiting time is the difference between the timestamp of the same data packet entering the queue and the timestamp of the current dequeue. The timestamp is written by the switch into a special field in the packet header when the packet enters the buffer and when it leaves the buffer, with a precision of nanoseconds.
[0087] Understandably, when the head of the queue pointer is not null, the switch immediately extracts the enqueue timestamp from the head of the queue data packet and subtracts it from the local current time to obtain the accurate waiting time, which is used to measure the degree of delay of the packet in the queue.
[0088] Step S403: Compare the queue waiting time with the preset delay threshold to obtain the comparison result; It should be noted that the preset delay threshold is the upper limit of the waiting time configured by the user through the management interface. The value is fixed in the register and different thresholds can be set for different services such as VoIP or industrial control.
[0089] Understandably, the switch compares the calculated waiting time with the threshold. If the waiting time is greater than the threshold, it outputs an over-threshold signal, triggering the subsequent interruption and saving process to ensure that real-time services are responded to in a timely manner.
[0090] Step S404: When the comparison result shows that the queue waiting time exceeds the preset delay threshold, save the non-target queue identifier and the remaining quota of the current polling. It should be noted that the non-target queue identifier is the queue number currently being polled, and the remaining quota is the number of bytes that the queue has not yet used up in this cycle. Both are maintained in real time by the transmission control logic.
[0091] Understandably, when the comparison result indicates that the threshold has been exceeded, the switch immediately writes the identifier and the remaining quota into the field register to ensure that it can accurately return to the interruption point during subsequent recovery and avoid the loss of polling status.
[0092] Step S405: Switch the sending resource from the current non-target queue to the target queue, and forward the data packets in the target queue; It should be noted that the transmission resources include the dequeue pointer, the buffer read enable signal, and the bandwidth time slot. The switching action is completed by the multiplexer, which can complete the pointer change within a single clock cycle.
[0093] Understandably, after completing the site save, the switch immediately switches the aforementioned resources to the target queue and begins to continuously forward data packets in the target queue until the queue is idle or the waiting time falls below the threshold, thereby ensuring the latency requirements of critical services.
[0094] Step S406: When there are no data packets in the target queue or the queue waiting time is lower than the preset delay threshold, resume the weighted polling sending step according to the non-target queue identifier and the remaining quota.
[0095] It should be noted that the absence of data packets is indicated by the head of the queue pointer being zero, and the waiting time being indicated by the comparator outputting a low level. Recovery is triggered when either of these two conditions is met.
[0096] Understandably, under these conditions, the switch reads the previously saved identifier and remaining quota, immediately switches the transmission resources back to the original non-target queue, continues to consume the remaining quota, completes this round of polling, and ensures the fairness of overall bandwidth allocation and the integrity of scheduling.
[0097] This embodiment provides a QoS scheduling method for switches. By scanning the head pointer, the system quickly identifies data packets in the target queue. Combined with a real-time comparison of the queue waiting time and a preset latency threshold, the system completes on-site saving and transmission resource switching the instant the threshold is exceeded. This allows the target queue data packets to obtain an immediate transmission channel, thereby stabilizing the latency of real-time services below the threshold. When the target queue is empty or the waiting time returns to normal, the system seamlessly resumes polling based on the saved non-target queue identifier and remaining quota. This not only ensures the deterministic latency of critical services but also maintains the fairness and integrity of the overall scheduling, significantly improving service quality and resource utilization under high-load burst traffic.
[0098] It should be noted that the above examples are only for understanding this application and do not constitute a limitation on the QoS scheduling method of the switch in this application. Any simple modifications based on this technical concept are within the protection scope of this application.
[0099] This application also provides a switch QoS scheduling device, please refer to... Figure 3 The switch QoS scheduling device includes: The depth detection module 10 is used to receive input data packets, perform depth detection on the input data packets according to a preset business feature library, and obtain classified data packets with priority labels. The writing module 20 is used to write classified data packets into the corresponding priority queue based on priority tags, and reserve exclusive cache resources for the target queue in the priority queue. The acquisition and calculation module 30 is used to acquire the real-time bandwidth utilization rate and queue waiting time of each priority queue, and to perform dynamic weight calculation on the real-time bandwidth utilization rate and queue waiting time to obtain the target weight sequence. The polling sending module 40 is used to perform weighted polling sending on non-target queues in the priority queue according to the target weight sequence; The interrupt priority module 50 is used to interrupt weighted polling and forward data packets to the target queue when a data packet is detected in the target queue in the priority queue and the queue waiting time exceeds a preset delay threshold.
[0100] The switch QoS scheduling device provided in this application, employing the switch QoS scheduling method in the above embodiments, can solve the technical problem of simultaneously ensuring the deterministic latency limit of real-time services and eliminating low-priority traffic starvation under high-load burst traffic. Compared with the prior art, the beneficial effects of the switch QoS scheduling device provided in this application are the same as those of the switch QoS scheduling method provided in the above embodiments, and other technical features in the switch QoS scheduling device are the same as those disclosed in the methods of the above embodiments, and will not be repeated here.
[0101] In one embodiment, the writing module 20 is also used to extract the priority tag value of the classified data packet; Classified data packets are written to the corresponding priority queue based on priority label values; Identify the highest priority among the priority label values and set the corresponding queue as the target queue; Allocate an exclusive buffer to the target queue and mark the access permission of the exclusive buffer as available only to the target queue.
[0102] In one embodiment, the acquisition and calculation module 30 is also used to periodically sample the exit byte counters of each priority queue to obtain the real-time bandwidth utilization rate. The queue waiting time is determined based on the enqueue timestamp and dequeue timestamp of the data packets in the priority queue. The burst coefficient is obtained by calculating the ratio between the real-time bandwidth utilization rate and the historical average bandwidth utilization rate. Input the burst factor, queue waiting time, preset priority factor, and preset minimum satisfaction level into the weight calculation model to calculate the weight value of each priority queue; The weight values are normalized to obtain the target weight sequence.
[0103] In one embodiment, the polling sending module 40 is further configured to convert the target weight sequence into sending quotas for each non-target queue; Weighted round-robin sending is performed based on sending quotas, and the number of bytes sent for each non-target queue is accumulated; When the cumulative value reaches the corresponding sending quota, stop sending to the current non-target queue, obtain the next non-target queue from the polling schedule table, and continue to execute weighted polling sending; Continuously monitor the target queue for data packets, and pause the weighted polling sending step when a data packet is detected.
[0104] In one embodiment, the interrupt priority module 50 is also used to scan the head pointer of the target queue in the priority queue; The queue waiting time for reading the data packet at the head of the queue when the head pointer is not null; The queue waiting time is compared with a preset delay threshold to obtain the comparison result; When the comparison result indicates that the queue waiting time exceeds the preset delay threshold, save the non-target queue identifier and remaining quota of the current polling queue; Switch the sending resource from the current non-target queue to the target queue, and forward the data packets in the target queue; When there are no data packets in the target queue or the queue waiting time is lower than the preset delay threshold, the weighted polling sending step is resumed based on the non-target queue identifier and the remaining quota.
[0105] In one embodiment, the interrupt priority module 50 is also used to detect the amount of cache already used in the target queue; If the amount of cached data used exceeds a preset cache threshold, a cache warning message will be generated. The cache warning information is sent to the dynamic weight calculation step to increase the weight value of the target queue based on the cache warning information.
[0106] In one embodiment, the interrupt priority module 50 is further configured to record the current polling position and the remaining quota when interrupt-weighted polling is sent; Once the packet forwarding to the target queue is complete, weighted round-robin transmission resumes based on the non-target queue identifier and the remaining quota, and the remaining packets are sent. The data packets sent before the interruption, the target queue data packets that were prioritized for forwarding, and the remaining data packets sent after recovery are all combined as the scheduling output to obtain the complete scheduled data packets.
[0107] This application provides a switch QoS scheduling device, which includes: at least one processor; and a memory communicatively connected to the at least one processor; wherein the memory stores instructions executable by the at least one processor, which are executed by the at least one processor to enable the at least one processor to perform the switch QoS scheduling method in Embodiment 1 above.
[0108] The following is for reference. Figure 4 This document illustrates a schematic diagram of a switch QoS scheduling device suitable for implementing embodiments of this application. The switch QoS scheduling device in these embodiments may include, but is not limited to, mobile terminals such as mobile phones, laptops, digital broadcast receivers, PDAs (Personal Digital Assistants), PADs (Portable Application Description), PMPs (Portable Media Players), and in-vehicle terminals (e.g., in-vehicle navigation terminals), as well as fixed terminals such as digital TVs and desktop computers. Figure 4The switch QoS scheduling device shown is merely an example and should not impose any limitations on the functionality and scope of use of the embodiments of this application.
[0109] like Figure 4 As shown, the switch QoS scheduling device may include a processing unit 1001 (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in ROM (Read Only Memory) 1002 or a program loaded from storage device 1003 into RAM (Random Access Memory) 1004. RAM 1004 also stores various programs and data required for the operation of the switch QoS scheduling device. The processing unit 1001, ROM 1002, and RAM 1004 are interconnected via bus 1005. Input / output (I / O) interface 1006 is also connected to the bus. Typically, the following systems can be connected to I / O interface 1006: input devices 1007 including, for example, touch screens, touchpads, keyboards, mice, image sensors, microphones, accelerometers, gyroscopes, etc.; output devices 1008 including, for example, liquid crystal displays (LCDs), speakers, vibrators, etc.; storage devices 1003 including, for example, magnetic tapes, hard disks, etc.; and communication devices 1009. Communication device 1009 allows the switch QoS scheduling device to communicate wirelessly or wiredly with other devices to exchange data. While the figure shows switch QoS scheduling devices with various systems, it should be understood that implementation or possession of all the systems shown is not required. More or fewer systems may be implemented alternatively.
[0110] Specifically, according to the embodiments disclosed in this application, the processes described above with reference to the flowcharts can be implemented as computer software programs. For example, embodiments disclosed in this application include a computer program product comprising a computer program carried on a computer-readable medium, the computer program containing program code for performing the methods shown in the flowcharts. In such embodiments, the computer program can be downloaded and installed from a network via a communication device, or installed from storage device 1003, or installed from ROM 1002. When the computer program is executed by processing device 1001, it performs the functions defined in the methods of the embodiments disclosed in this application.
[0111] The switch QoS scheduling device provided in this application, employing the switch QoS scheduling method in the above embodiments, can solve the technical problem of simultaneously ensuring the deterministic latency limit of real-time services and eliminating low-priority traffic starvation under high-load burst traffic. Compared with the prior art, the beneficial effects of the switch QoS scheduling device provided in this application are the same as those of the switch QoS scheduling method provided in the above embodiments, and other technical features in this switch QoS scheduling device are the same as those disclosed in the previous embodiment method, and will not be repeated here.
[0112] It should be understood that the various parts disclosed in this application can be implemented using hardware, software, firmware, or a combination thereof. In the description of the above embodiments, specific features, structures, materials, or characteristics can be combined in any suitable manner in one or more embodiments or examples.
[0113] The above are merely specific embodiments of this application, but the scope of protection of this application is not limited thereto. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application. Therefore, the scope of protection of this application should be determined by the scope of the claims.
[0114] This application provides a computer-readable storage medium having computer-readable program instructions (i.e., a computer program) stored thereon, the computer-readable program instructions being used to execute the switch QoS scheduling method in the above embodiments.
[0115] The computer-readable storage medium provided in this application may be, for example, a USB flash drive, but is not limited to, electrical, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or any combination thereof. More specific examples of computer-readable storage media may include, but are not limited to: electrical connections having one or more wires, portable computer disks, hard disks, RAM (Random Access Memory), ROM (Read Only Memory), EPROM (Erasable Programmable Read Only Memory or Flash Memory), optical fibers, CD-ROM (CD-Read Only Memory), optical storage devices, magnetic storage devices, or any suitable combination thereof. In this embodiment, the computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, system, or device. The program code contained on the computer-readable storage medium may be transmitted using any suitable medium, including but not limited to: wires, optical cables, RF (Radio Frequency), etc., or any suitable combination thereof.
[0116] The aforementioned computer-readable storage medium may be included in the switch QoS scheduling device; or it may exist independently and not be assembled into the switch QoS scheduling device.
[0117] The aforementioned computer-readable storage medium carries one or more programs. When these programs are executed by the switch's QoS scheduling device, the switch's QoS scheduling device performs the following actions: performs deep inspection on the input data packets according to a preset service feature library to obtain classified data packets with priority tags; writes the classified data packets into the corresponding priority queues based on the priority tags, and reserves exclusive buffer resources for the target queues in the priority queues; dynamically calculates the target weight sequence by weighting the real-time bandwidth utilization rate and the queue waiting time; performs weighted round-robin transmission on the non-target queues in the priority queues according to the target weight sequence; and interrupts the weighted round-robin transmission and prioritizes forwarding the data packets of the target queues when it detects that there are data packets in the target queues in the priority queues and the queue waiting time exceeds a preset delay threshold.
[0118] Computer program code for performing the operations of this application can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, and C++, as well as conventional procedural programming languages such as the "C" language or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including LAN (Local Area Network) or WAN (Wide Area Network)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0119] The flowcharts and block diagrams in the accompanying drawings illustrate the architecture, functionality, and operation of possible implementations of systems, methods, and computer program products according to various embodiments of this 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 indicated in the blocks may occur in a different order than those indicated in the drawings. For example, two consecutively indicated blocks may actually be executed substantially in parallel, and they may sometimes be executed in reverse order, depending on the functions involved. It should also be noted that each block in the block diagrams and / or flowcharts, and combinations of blocks in the block diagrams and / or flowcharts, can be implemented using a dedicated hardware-based system that performs the specified function or operation, or using a combination of dedicated hardware and computer instructions.
[0120] The modules described in the embodiments of this application can be implemented in software or hardware. The names of the modules do not necessarily limit the functionality of the unit itself.
[0121] The readable storage medium provided in this application is a computer-readable storage medium that stores computer-readable program instructions (i.e., a computer program) for executing the above-described switch QoS scheduling method. This solves the technical problem of simultaneously ensuring the deterministic latency limit for real-time services and eliminating low-priority traffic starvation under high-load burst traffic conditions. Compared with the prior art, the beneficial effects of the computer-readable storage medium provided in this application are the same as those of the switch QoS scheduling method provided in the above embodiments, and will not be elaborated upon here.
[0122] This application also provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the switch QoS scheduling method described above.
[0123] The computer program product provided in this application can solve the technical problem of simultaneously ensuring the deterministic latency limit of real-time services and eliminating low-priority traffic starvation under high-load burst traffic. Compared with the prior art, the beneficial effects of the computer program product provided in this application are the same as those of the switch QoS scheduling method provided in the above embodiments, and will not be repeated here.
[0124] The above description is only a part of the embodiments of this application and does not limit the patent scope of this application. All equivalent structural transformations made under the technical concept of this application and using the contents of the specification and drawings of this application, or direct / indirect applications in other related technical fields, are included in the patent protection scope of this application.
Claims
1. A QoS scheduling method for a switch, characterized in that, The method includes: Receive input data packets, perform deep detection on the input data packets according to a preset service feature library, and obtain classified data packets with priority labels; Based on the priority label, the classified data packet is written into the corresponding priority queue, and exclusive cache resources are reserved for the target queue in the priority queue. Collect the real-time bandwidth utilization and queue waiting time of each priority queue, and perform dynamic weight calculation on the real-time bandwidth utilization and queue waiting time to obtain the target weight sequence; According to the target weight sequence, a weighted round-robin transmission is performed on the non-target queues in the priority queue; If a data packet is detected in the target queue of the priority queue and the waiting time of the queue exceeds a preset delay threshold, the weighted polling transmission is interrupted, and the data packet of the target queue is forwarded first.
2. The method as described in claim 1, characterized in that, The step of writing the classified data packet into the corresponding priority queue based on the priority label, and reserving exclusive cache resources for the target queue in the priority queue, includes: Extract the priority tag value of the classified data packet; The classified data packet is written into the corresponding priority queue according to the priority label value; Identify the highest priority among the priority label values and set the corresponding queue as the target queue; Allocate an exclusive buffer to the target queue and mark the access permission of the exclusive buffer as available only to the target queue.
3. The method as described in claim 1, characterized in that, The step of collecting the real-time bandwidth utilization and queue waiting time of each priority queue, and dynamically calculating the weights of the real-time bandwidth utilization and queue waiting time to obtain the target weight sequence includes: The exit byte counter of each priority queue is periodically sampled to obtain the real-time bandwidth utilization rate; The queue waiting time is determined based on the enqueue timestamp and dequeue timestamp of the data packets in the priority queue. The burst coefficient is obtained by calculating the ratio between the real-time bandwidth utilization rate and the historical average bandwidth utilization rate. The burst coefficient, the queue waiting time, the preset priority coefficient, and the preset minimum satisfaction level are input into the weight calculation model to calculate the weight value of each priority queue. The weight values are normalized to obtain the target weight sequence.
4. The method as described in claim 1, characterized in that, The step of performing weighted round-robin transmission on the non-target queues in the priority queue according to the target weight sequence includes: The target weight sequence is converted into the transmission quota for each non-target queue; Weighted round-robin sending is performed based on the sending quota, and the number of bytes sent for each non-target queue is accumulated; When the cumulative value reaches the corresponding sending quota, stop sending to the current non-target queue, obtain the next non-target queue from the polling schedule table, and continue to execute weighted polling sending; The system continuously checks whether there are data packets in the target queue, and pauses the weighted polling sending step when a data packet is detected.
5. The method as described in claim 1, characterized in that, The step of interrupting the weighted polling transmission and prioritizing the forwarding of data packets from the target queue when a data packet is detected in the target queue of the priority queue and the queue waiting time exceeds a preset delay threshold includes: Scan the head pointer of the target queue in the priority queue; The queue waiting time for reading the data packet at the head of the queue when the head pointer is not null; The queue waiting time is compared with a preset delay threshold to obtain the comparison result; When the comparison result indicates that the queue waiting time exceeds the preset delay threshold, the identifier of the currently polled non-target queue and the remaining quota are saved. Switch the sending resource from the current non-target queue to the target queue, and forward the data packets in the target queue; When there are no data packets in the target queue or the queue waiting time is lower than a preset delay threshold, the weighted polling sending step is resumed according to the non-target queue identifier and the remaining quota.
6. The method as described in claim 1, characterized in that, The method further includes: Detect the amount of cache already used in the target queue; If the amount of cached data exceeds a preset cache threshold, a cache warning message will be generated. The cache warning information is sent to the dynamic weight calculation step to increase the weight value of the target queue based on the cache warning information.
7. The method as described in claim 1, characterized in that, The method further includes: When the weighted polling transmission is interrupted, record the current polling position and the remaining quota; Once the data packet forwarding to the target queue is complete, weighted round-robin transmission is resumed based on the non-target queue identifier and the remaining quota, and the remaining data packets are continued to be sent. The data packets sent before the interruption, the target queue data packets that were prioritized for forwarding, and the remaining data packets sent after recovery are all combined as the scheduling output to obtain the complete scheduled data packets.
8. A QoS scheduling device for a switch, characterized in that, The device includes: The depth detection module is used to receive input data packets and perform depth detection on the input data packets according to a preset business feature library to obtain classified data packets with priority labels. The writing module is used to write the classified data packet into the corresponding priority queue based on the priority label, and reserve exclusive cache resources for the target queue in the priority queue. The acquisition and calculation module is used to acquire the real-time bandwidth utilization rate and queue waiting time of each priority queue, and to perform dynamic weight calculation on the real-time bandwidth utilization rate and queue waiting time to obtain the target weight sequence. The polling and sending module is used to perform weighted polling and sending on the non-target queues in the priority queue according to the target weight sequence; The interrupt priority module is used to interrupt the weighted polling transmission and prioritize forwarding the data packets of the target queue when it is detected that there are data packets in the target queue in the priority queue and the waiting time of the queue exceeds a preset delay threshold.
9. A QoS scheduling device for a switch, characterized in that, The device includes: a memory, a processor, and a computer program stored in the memory and executable on the processor, the computer program being configured to implement the steps of the switch QoS scheduling method as described in any one of claims 1 to 7.
10. A storage medium, characterized in that, The storage medium is a computer-readable storage medium, and a computer program is stored on the storage medium. When the computer program is executed by a processor, it implements the steps of the switch QoS scheduling method as described in any one of claims 1 to 7.