Flow scheduling algorithm switching method and device, equipment and storage medium

By configuring traffic shaping for ports and hardware send queues and clearing the cache, the problem of slow switching chip scheduling algorithm activation was solved, enabling fast switching and efficient traffic scheduling, and ensuring service stability.

CN120980031APending Publication Date: 2025-11-18MAIPU COMM TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202511315580.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-09-15
Publication Date
2025-11-18

AI Technical Summary

Technical Problem

In existing technologies, switching chips cannot quickly take effect when equipped with traffic switching scheduling algorithms, resulting in increased data latency, jitter, and packet loss rate, which affects business operations.

Method used

By configuring traffic shaping for ports and hardware send queues, clearing the cache and switching to the target traffic scheduling algorithm, and then restoring traffic policing, the scheduling algorithm can be made effective quickly when there is traffic.

Benefits of technology

The traffic scheduling algorithm enables rapid switching on device ports, improving switching efficiency, avoiding data latency and packet loss, and ensuring stable business operation.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120980031A_ABST
    Figure CN120980031A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a traffic scheduling algorithm switching method and device, equipment and a storage medium, and relates to the technical field of traffic forwarding of data communication, and the method comprises the steps: obtaining an exit speed limit value corresponding to a traffic shaping function configured by a port, and configuring a traffic supervision function for the port according to the exit speed limit value; acquiring a queue speed limit value corresponding to a traffic shaping function configured by a hardware sending queue of the port, configuring a traffic monitoring function for the hardware sending queue according to the queue speed limit value, and forbidding the traffic shaping function of the port and the traffic shaping function of the traffic queue; switching the traffic scheduling algorithm of the port into a target traffic scheduling algorithm in the configuration command, and emptying the cache of the hardware sending queue; and starting a traffic shaping function of the port and a traffic shaping function of the hardware transmit queue, and forbidding a traffic supervision function of the port and a traffic supervision function of the hardware transmit queue, so that the target traffic scheduling algorithm takes effect. According to the invention, the traffic scheduling algorithm can take effect quickly after being switched.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of traffic forwarding technology in data communication, and more specifically, to a method, apparatus, device, and storage medium for switching traffic scheduling algorithms. Background Technology

[0002] Due to the rapid development of the data communication industry, the requirements for networks in campuses and data centers are becoming increasingly stringent. Simultaneously, more granular traffic management is being implemented, leading to the widespread application of QoS (Quality of Service) technology. QoS is a ubiquitous concept in various scenarios involving service supply and demand, assessing a service provider's ability to meet customer service needs. QoS technology supports configuring traffic rate limiting and traffic management when device traffic congestion occurs. By rate limiting and switching scheduling modes for outbound traffic, it ensures that high-priority customers receive a better network experience.

[0003] QoS features have led to the widespread application of QoS technology in many scenarios. However, some switching chips cannot immediately implement traffic switching scheduling algorithms, sometimes requiring several minutes to complete the algorithm switch. During this process, necessary data may not be prioritized for forwarding, increasing traffic latency, jitter, packet loss rate, and impacting the operation of corresponding services. Therefore, this invention proposes a solution to the problem of traffic scheduling algorithms not taking effect quickly when implementing traffic switching. Summary of the Invention

[0004] In view of this, the purpose of the present invention is to provide a switching method, apparatus, device and storage medium for traffic scheduling algorithms to solve the problems in the prior art.

[0005] To achieve the above objectives, the technical solutions adopted in the embodiments of the present invention are as follows: In a first aspect, embodiments of the present invention provide a method for switching traffic scheduling algorithms, comprising: The system receives a traffic scheduling algorithm configuration command for switching a certain port, obtains the outgoing rate limit value corresponding to the traffic shaping function configured for the port, and configures the traffic monitoring function for the port based on the outgoing rate limit value; the port is a traffic sending port with the traffic shaping function enabled. Obtain the queue rate limit value corresponding to the traffic shaping function configured in the hardware sending queue of the port; configure the traffic monitoring function in the hardware sending queue according to the queue rate limit value; and disable the traffic shaping function of the port and the traffic shaping function of the hardware sending queue. Switch the traffic scheduling algorithm of the port to the target traffic scheduling algorithm in the configuration command, and clear the cache of the hardware sending queue; Re-enable the traffic shaping function of the port and the traffic shaping function of the hardware sending queue, and disable the traffic policing function of the port and the traffic policing function of the hardware sending queue, so that the target traffic scheduling algorithm can take effect.

[0006] In an optional implementation, the step of obtaining the outgoing rate limit value corresponding to the traffic shaping function configured on the port includes: When it is determined that the port is in a congested state and the traffic shaping function is enabled, the outgoing rate limit value is obtained.

[0007] In an optional implementation, the step of determining that the port is in a congested state includes: Obtain the traffic forwarding value of the port and the egress rate limit value. If the traffic forwarding value is greater than the egress rate limit value, then determine that the port is in the congested state; and / or Obtain the ingress rate of the hardware transmission queue and the port rate of the port. If the ingress rate is greater than the port rate, then determine that the port is in the congested state.

[0008] In an optional implementation, the step of configuring traffic policing function for the hardware transmission queue based on the queue rate limit value includes: Based on the access control list, a traffic priority identifier is generated for the traffic ingress port corresponding to the port, and a rate limit value for the traffic monitoring function is generated based on the queue rate limit value. The traffic monitoring function is configured for the hardware transmission queue based on the traffic priority identifier and the rate limit value.

[0009] Secondly, embodiments of the present invention provide a switching device for a traffic scheduling algorithm, comprising: The port configuration module is used to receive configuration commands for switching the traffic scheduling algorithm of a certain port, obtain the outgoing rate limit value corresponding to the traffic shaping function configured for the port, and configure the traffic monitoring function for the port according to the outgoing rate limit value; the port is a traffic sending port with the traffic shaping function enabled. The queue configuration module is used to obtain the queue rate limit value corresponding to the traffic shaping function of the hardware sending queue configuration of the port, configure the traffic monitoring function of the hardware sending queue according to the queue rate limit value, and disable the traffic shaping function of the port and the traffic shaping function of the hardware sending queue. The algorithm switching module is used to switch the scheduling algorithm of the port to the target traffic scheduling algorithm in the configuration command, and clear the cache of the hardware sending queue. The algorithm triggering module is used to re-enable the traffic shaping function of the port and the traffic shaping function of the hardware sending queue, and disable the traffic policing function of the port and the traffic policing function of the hardware sending queue, so that the target traffic scheduling algorithm takes effect.

[0010] In an optional implementation, the switching device for the traffic scheduling algorithm is further configured to: When it is determined that the port is in a congested state and the traffic shaping function is enabled, the outgoing rate limit value is obtained.

[0011] In an optional implementation, the switching device for the traffic scheduling algorithm is further configured to: Obtain the traffic forwarding value of the port and the egress rate limit value. If the traffic forwarding value is greater than the egress rate limit value, then determine that the port is in the congested state; and / or The system obtains the traffic inflow rate of the hardware sending queue and the port rate of the port. If the traffic inflow rate is greater than the port rate, the system determines that the port is in the congested state.

[0012] In an optional implementation, the switching device for the traffic scheduling algorithm is further configured to: Based on the access control list, a traffic priority identifier is generated for the traffic ingress port corresponding to the port, and a rate limit value for the traffic monitoring function is generated based on the queue rate limit value. The traffic monitoring function is configured for the hardware transmission queue based on the traffic priority identifier and the rate limit value.

[0013] Thirdly, embodiments of the present invention provide an electronic device, including a processor, a memory, and a communication module. The memory stores a computer program that can be executed by the processor, and the processor can execute the computer program to implement the switching method of the traffic scheduling algorithm described in the first aspect.

[0014] Fourthly, embodiments of the present invention provide a computer-readable storage medium having a computer program stored thereon, wherein the computer program, when executed by a processor, implements the switching method of the traffic scheduling algorithm as described in the first aspect.

[0015] This invention provides a method, apparatus, device, and storage medium for switching traffic scheduling algorithms. By configuring traffic shaping functionality for ports and hardware transmission queues, then clearing the hardware transmission queue buffer and switching to the target flow scheduling algorithm, the switching algorithm can be completed quickly even with traffic congestion. Finally, traffic policing functionality is restored to ensure the target traffic scheduling algorithm takes effect rapidly. This invention can switch traffic scheduling algorithms when traffic congestion occurs on device ports, and the switched algorithm takes effect quickly, improving the switching efficiency of traffic scheduling algorithms.

[0016] To make the above-mentioned objects, features and advantages of the present invention more apparent and understandable, preferred embodiments are described below in detail with reference to the accompanying drawings. Attached Figure Description

[0017] To more clearly illustrate the technical solutions of the embodiments of the present invention, 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 the present invention and should not be regarded as a limitation on the scope. For those skilled in the art, other related drawings can be obtained based on these drawings without creative effort.

[0018] Figure 1 A block diagram of an electronic device provided by an embodiment of the present invention is shown; Figure 2 A flowchart illustrating a switching method for a traffic scheduling algorithm provided in an embodiment of the present invention is shown. Figure 3 This diagram illustrates a traffic forwarding principle provided by an embodiment of the present invention. Figure 4 This diagram illustrates a method for forwarding multiple traffic flows with the same priority, as provided in an embodiment of the present invention. Figure 5 The diagram shows a functional module schematic of a switching device for a traffic scheduling algorithm provided in an embodiment of the present invention.

[0019] Icons: 100 - Electronic device; 110 - Memory; 120 - Processor; 130 - Communication module; 500 - Switching device for traffic scheduling algorithm; 501 - Port configuration module; 502 - Queue configuration module; 503 - Algorithm switching module; 504 - Algorithm triggering module. Detailed Implementation

[0020] The technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. The components of the embodiments of the present invention described and shown in the accompanying drawings can generally be arranged and designed in various different configurations.

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

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

[0023] Explanation of relevant terms in this embodiment: Congestion management is a necessary measure to resolve resource contention. It involves buffering packets in the port's hardware transmission queue and using a scheduling algorithm to arrange the forwarding order of packets, typically operating on the outbound direction of the port. Common scheduling algorithms include: SP (Strict Priority), RR (Round Robin), WRR (Weighted Round Robin), and WDRR (Weighted Deficit Round Robin).

[0024] Traffic shaping, also known as traffic shaping, is a flow control measure that actively adjusts the output rate of a flow to adapt the traffic to the network resources available to downstream devices, avoiding unnecessary packet drop and congestion. It is typically applied to the outbound direction of an interface. When the outbound packet rate is too high, some packets are buffered in the buffer area, and then these buffered packets are sent evenly under the control of the token bucket.

[0025] Traffic policing, also known as traffic policing, is a method of limiting the traffic rate of a device. When the traffic rate exceeds the limit, different actions can be taken, such as dropping packets. Compared to traffic shaping, which consumes a portion of the switching chip's buffer, traffic policing does not buffer traffic.

[0026] Please refer to Figure 1 , Figure 1This is a block diagram of an electronic device 100. The electronic device 100 includes a memory 110, a processor 120, and a communication module 130. The memory 110, processor 120, and communication module 130 are electrically connected to each other directly or indirectly to realize data transmission or interaction. For example, these components can be electrically connected to each other through one or more communication buses or signal lines.

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

[0028] The processor 120 is used to read / write data or programs stored in memory and to perform corresponding functions.

[0029] The communication module 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.

[0030] It should be understood that, Figure 1 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 1 The more or fewer components shown, or having the same Figure 1 The different configurations shown. Figure 1 The components shown can be implemented using hardware, software, or a combination thereof.

[0031] Please refer to Figure 2 , Figure 2 This is a flowchart illustrating a switching method for a traffic scheduling algorithm provided in this embodiment. The method includes: S201. Receive a configuration command to switch the traffic scheduling algorithm of a certain port, obtain the outgoing rate limit value corresponding to the traffic shaping function configured for the port, configure the traffic monitoring function for the port according to the outgoing rate limit value, and the port is a traffic sending port with the traffic shaping function enabled.

[0032] Normally, in order to switch the traffic scheduling algorithm of a port, the traffic scheduling algorithm is reconfigured. At this time, the traffic scheduling algorithm in the configuration command (i.e., the target traffic scheduling algorithm) is different from the current traffic scheduling algorithm of the port, thereby achieving the purpose of switching the traffic scheduling algorithm.

[0033] When a port experiences traffic congestion, in order to adapt the traffic to the network resources available to downstream devices and avoid unnecessary packet loss and congestion, the port is usually configured with a traffic shaping function to buffer some traffic packets before sending them out later.

[0034] When there are traffic packets in the hardware sending queue, the switched traffic scheduling algorithm cannot take effect immediately. At this time, the hardware sending queue and port need to be adjusted accordingly so that the switched scheduling algorithm can take effect immediately.

[0035] Traffic policing can discard traffic exceeding the rate limit to prevent new port congestion and avoid the buffer from being occupied by new traffic. Therefore, a traffic policing function can be configured for the port based on the outbound rate limit corresponding to the traffic shaping function configured on the port. The rate limit of the traffic policing function can be the same as the outbound rate limit.

[0036] S202. Obtain the queue rate limit value corresponding to the traffic shaping function configured in the hardware sending queue of the port, configure the traffic monitoring function in the hardware sending queue according to the queue rate limit value, and disable the traffic shaping function of the port and the traffic shaping function of the hardware sending queue.

[0037] When the inbound rate of traffic entering the hardware sending queue exceeds the outbound rate, the hardware sending queue will first buffer a portion of the traffic. If the inbound rate continues to exceed the outbound rate, traffic congestion may occur. Therefore, a traffic policing function can be configured for the hardware sending queue. The rate limit value of the traffic policing function of the hardware sending queue can be the same as the queue rate limit value. Then, the traffic shaping function of the port and the traffic shaping function of the hardware sending queue are disabled. At this time, even if new traffic enters the hardware sending queue or port, the traffic policing function will discard traffic exceeding the processing capacity of the hardware sending queue and port, so the hardware sending queue and port will not experience new congestion.

[0038] S203. Switch the traffic scheduling algorithm of the port to the target traffic scheduling algorithm in the configuration command, and clear the cache of the hardware sending queue.

[0039] Traffic scheduling algorithms generally include four common modes: SP, RR, WRR, and WDRR. For example, if the current traffic scheduling algorithm is SP mode and the target traffic scheduling algorithm is WRR mode, after switching the traffic scheduling algorithm from SP to WRR, the WRR mode will not take effect immediately because the hardware sending queue buffer may contain traffic. Therefore, the hardware sending queue buffer needs to be cleared.

[0040] S204. Re-enable the traffic shaping function of the port and the traffic shaping function of the hardware sending queue, and disable the traffic policing function of the port and the traffic policing function of the hardware sending queue, so that the target traffic scheduling algorithm takes effect.

[0041] Since traffic scheduling algorithms do not arbitrarily discard traffic under normal circumstances, meaning that hardware sending queues and ports are usually configured with traffic shaping functions, it is necessary to switch the hardware sending queues and ports back to the corresponding traffic shaping functions after switching traffic scheduling algorithms.

[0042] This embodiment configures traffic shaping for the port and hardware sending queue, then clears the hardware sending queue's buffer and switches to the target flow scheduling algorithm. This allows the scheduling algorithm to quickly switch over even with traffic. Then, the traffic policing function is restored, enabling the target flow scheduling algorithm to take effect quickly. This embodiment can switch flow scheduling algorithms when traffic congestion occurs on a device port, and the new algorithm takes effect quickly, improving the efficiency of flow scheduling algorithm switching.

[0043] Please refer to Figure 3 , Figure 3 This is a schematic diagram illustrating a traffic forwarding principle provided in this embodiment.

[0044] like Figure 3 As shown, when different users interact with each other via a switching device (the switching device of the traffic scheduling algorithm in this embodiment of the invention), for example, when user 1 and user 2 send information to user 3 or user 4, the data traffic generated by user 1 and user 2 will enter the switching device from the traffic inlet port 1, and then be sent to user 3 or user 4 through port 2. Traffic scheduling is usually configured on port 2.

[0045] In one implementation, the step of obtaining the outgoing rate limit value corresponding to the traffic shaping function configured on the port includes: When it is determined that the port is in a congested state and the traffic shaping function is enabled, the outgoing rate limit value is obtained.

[0046] Congestion is a common state during traffic exchange. If the hardware sending queue is not congested, meaning it has no buffered traffic, switching traffic scheduling algorithms will take effect immediately. However, in most cases, the hardware sending queue's buffer is not empty, requiring the method described in this embodiment to switch traffic scheduling algorithms.

[0047] To determine whether the traffic scheduling algorithm can be switched directly, it is necessary to first determine whether the port and hardware sending queue meet the conditions for direct switching. Since the presence of traffic in the hardware sending queue does not affect the switching of the traffic scheduling algorithm, it is only necessary to determine whether the buffer of the hardware sending queue is occupied or whether the traffic port is in a congested state. If either of these conditions is met, the traffic scheduling algorithm cannot be switched directly.

[0048] In one implementation, the step of determining that the port is in a congested state includes: Obtain the traffic forwarding value of the port and the egress rate limit value. If the traffic forwarding value is greater than the egress rate limit value, then determine that the port is in the congested state; and / or The system obtains the traffic inflow rate of the hardware sending queue and the port rate of the port. If the traffic inflow rate is greater than the port rate, the system determines that the port is in the congested state.

[0049] like Figure 3 As shown, since port2 is configured with traffic shaping, when the traffic inflow rate to port1 is greater than the traffic shaping rate, port2 will become congested.

[0050] Alternatively, if the inflow rate of port 1 is 10G and the inflow rate of port 2 is 1G, then port 2 will also experience congestion.

[0051] Alternatively, there may be multiple inbound ports, and traffic may enter from multiple inbound ports simultaneously, but all traffic needs to be forwarded out through port2. If the sum of the inbound traffic rates of the multiple inbound ports is greater than the outbound traffic rate of port2, then port2 will also become congested.

[0052] If any of the above three situations occur, it means that the traffic scheduling algorithm cannot be switched directly at present.

[0053] This embodiment analyzes the status of the hardware transmission queue and the port to determine whether the port and the hardware transmission queue can meet the direct switching requirements of the traffic scheduling algorithm, thereby avoiding invalid switching of the traffic scheduling algorithm and improving the switching efficiency of the traffic scheduling algorithm.

[0054] In one implementation, the step of configuring traffic policing function for the hardware transmission queue based on the queue rate limit value includes: Based on the access control list, a traffic priority identifier is generated for the traffic ingress port corresponding to the port, and a rate limit value for the traffic monitoring function is generated based on the queue rate limit value. The traffic monitoring function is configured for the hardware transmission queue based on the traffic priority identifier and the rate limit value.

[0055] When a port is configured with traffic shaping, to ensure that the rate limit of the traffic queue remains unchanged after configuring traffic policing, the rate limit of the traffic policing function needs to be configured using a flow-based approach. First, a traffic priority identifier is generated using the access control list of the incoming traffic port. Then, based on the traffic priority identifier and the port's rate limit, a flow-based rate limit for traffic policing is generated.

[0056] Flow-based rate limiting is a technique for limiting the rate of specific data flows in a network. A flow typically refers to a collection of data packets that share certain common characteristics. For example, data packets with the same five-tuple information, such as source IP address, destination IP address, source port, destination port, and transport layer protocol, can constitute a flow.

[0057] Please refer to Figure 4 , Figure 4 This embodiment provides a schematic diagram of traffic forwarding with the same traffic priority but different weights.

[0058] Figure 4 In a forwarding environment where multiple traffic flows with the same priority but different weights need to be forwarded, the device needs to forward each flow using a weighted round-robin approach based on the user's weight. In this case, the scheduling method for the traffic outgoing port 2 should be WRR scheduling to meet the requirements of this traffic scenario. If the current traffic scheduling algorithm is SP, then the traffic scheduling algorithm switching method of this invention is required for switching.

[0059] Please refer to Figure 5 , Figure 5 This embodiment provides a functional module diagram of a traffic scheduling algorithm switching device. It should be noted that the basic principle and technical effects of the traffic scheduling algorithm switching device 500 provided in this embodiment are the same as those in the above-described method embodiments. For the sake of brevity, any parts not mentioned in this embodiment can be referred to the corresponding content in the above embodiments. The traffic scheduling algorithm switching device 500 includes: The port configuration module 501 is used to receive a configuration command for switching the traffic scheduling algorithm of a certain port, obtain the outgoing rate limit value corresponding to the traffic shaping function configured for the port, and configure the traffic monitoring function for the port according to the outgoing rate limit value; the port is a traffic sending port with the traffic shaping function enabled. The queue configuration module 502 is used to obtain the queue rate limit value corresponding to the traffic shaping function of the hardware sending queue configuration of the port, configure the traffic monitoring function of the hardware sending queue according to the queue rate limit value, and disable the traffic shaping function of the port and the traffic shaping function of the hardware sending queue. The algorithm switching module 503 is used to switch the traffic scheduling algorithm of the port to the target traffic scheduling algorithm in the configuration command, and clear the cache of the hardware sending queue. The algorithm triggering module 504 is used to re-enable the traffic shaping function of the port and the traffic shaping function of the hardware sending queue, and disable the traffic policing function of the port and the traffic policing function of the hardware sending queue, so that the target traffic scheduling algorithm takes effect.

[0060] In one embodiment, the switching device for the traffic scheduling algorithm is further configured to: When it is determined that the port is in a congested state and the traffic shaping function is enabled, the outgoing rate limit value is obtained.

[0061] In one embodiment, the switching device for the traffic scheduling algorithm is further configured to: Obtain the traffic forwarding value of the port and the egress rate limit value. If the traffic forwarding value is greater than the egress rate limit value, then determine that the port is in the congested state; and / or Obtain the inbound port rate of the traffic queue and the port rate of the port. If the inbound port rate is greater than the port rate, then determine that the port is in the congested state.

[0062] In one embodiment, the switching device for the traffic scheduling algorithm is further configured to: Based on the access control list, a traffic priority identifier is generated for the traffic ingress port corresponding to the port, and a rate limit value for the traffic monitoring function is generated based on the queue rate limit value. The traffic monitoring function is configured for the hardware transmission queue based on the traffic priority identifier and the rate limit value.

[0063] 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 the present invention. 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.

[0064] In addition, the functional modules in the various embodiments of the present invention 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.

[0065] 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 invention, 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 invention. 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.

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

Claims

1. A method for switching traffic scheduling algorithms, characterized in that, include: The system receives a configuration command to switch the traffic scheduling algorithm of a certain port, obtains the outgoing rate limit value corresponding to the traffic shaping function configured for the port, and configures the traffic monitoring function for the port based on the outgoing rate limit value; the port is a traffic sending port with the traffic shaping function enabled. Obtain the queue rate limit value corresponding to the traffic shaping function configured in the hardware sending queue of the port; configure the traffic monitoring function in the hardware sending queue according to the queue rate limit value; and disable the traffic shaping function of the port and the traffic shaping function of the hardware sending queue. Switch the traffic scheduling algorithm of the port to the target traffic scheduling algorithm in the configuration command, and clear the cache of the hardware sending queue; Re-enable the traffic shaping function of the port and the traffic shaping function of the hardware sending queue, and disable the traffic policing function of the port and the traffic policing function of the hardware sending queue, so that the target traffic scheduling algorithm can take effect.

2. The switching method of the traffic scheduling algorithm according to claim 1, characterized in that, The step of obtaining the outbound rate limit value corresponding to the traffic shaping function configured on the port includes: When it is determined that the port is in a congested state and the traffic shaping function is enabled, the outgoing rate limit value is obtained.

3. The switching method of the traffic scheduling algorithm according to claim 2, characterized in that, The step of determining that the port is in a congested state includes: Obtain the traffic forwarding value of the port and the egress rate limit value. If the traffic forwarding value is greater than the egress rate limit value, then determine that the port is in the congested state; and / or The system obtains the traffic inflow rate of the hardware sending queue and the port rate of the port. If the traffic inflow rate is greater than the port rate, the system determines that the port is in the congested state.

4. The switching method of the traffic scheduling algorithm according to claim 1, characterized in that, The step of configuring traffic monitoring function for the hardware transmission queue based on the queue rate limit value includes: Based on the access control list, a traffic priority identifier is generated for the traffic ingress port corresponding to the port, and a rate limit value for the traffic monitoring function is generated based on the queue rate limit value. The traffic monitoring function is configured for the hardware transmission queue based on the traffic priority identifier and the rate limit value.

5. A switching device for a traffic scheduling algorithm, characterized in that, include: The port configuration module is used to receive configuration commands for switching the traffic scheduling algorithm of a certain port, obtain the outgoing rate limit value corresponding to the traffic shaping function configured for the port, and configure the traffic monitoring function for the port according to the outgoing rate limit value; the port is a traffic sending port with the traffic shaping function enabled. The queue configuration module is used to obtain the queue rate limit value corresponding to the traffic shaping function of the hardware sending queue configuration of the port, configure the traffic monitoring function of the hardware sending queue according to the queue rate limit value, and disable the traffic shaping function of the port and the traffic shaping function of the hardware sending queue. The algorithm switching module is used to switch the traffic scheduling algorithm of the port to the target traffic scheduling algorithm in the configuration command, and clear the cache of the hardware sending queue. The algorithm triggering module is used to re-enable the traffic shaping function of the port and the traffic shaping function of the hardware sending queue, and disable the traffic policing function of the port and the traffic policing function of the hardware sending queue, so that the target traffic scheduling algorithm takes effect.

6. The switching device for the traffic scheduling algorithm according to claim 5, characterized in that, The switching device for the traffic scheduling algorithm is also used for: When it is determined that the port is in a congested state and the traffic shaping function is enabled, the outgoing rate limit value is obtained.

7. The switching device for the traffic scheduling algorithm according to claim 6, characterized in that, The switching device for the traffic scheduling algorithm is also used for: Obtain the traffic forwarding value of the port and the egress rate limit value. If the traffic forwarding value is greater than the egress rate limit value, then determine that the port is in the congested state; and / or The system obtains the traffic inflow rate of the hardware sending queue and the port rate of the port. If the traffic inflow rate is greater than the port rate, the system determines that the port is in the congested state.

8. The switching device for the traffic scheduling algorithm according to claim 5, characterized in that, The switching device for the traffic scheduling algorithm is also used for: Based on the access control list, a traffic priority identifier is generated for the traffic ingress port corresponding to the port, and a rate limit value for the traffic monitoring function is generated based on the queue rate limit value. The traffic monitoring function is configured for the hardware transmission queue based on the traffic priority identifier and the rate limit value.

9. An electronic device, characterized in that, The system includes a processor, a memory, and a communication module. The memory stores a computer program that can be executed by the processor, which can execute the computer program to implement the switching method of the traffic scheduling algorithm according to any one of claims 1-4.

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