Switch traffic adaptive control method and system
By prioritizing and controlling the flow rate of switch data frames, the problem of traditional switches being unable to guarantee critical services and withstand sudden traffic surges is solved, achieving efficient adaptive flow control and ensuring stable transmission of critical services and smooth network operation.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- WUHAN KUANLU INFORMATION TECHNOLOGY CO LTD
- Filing Date
- 2026-05-28
- Publication Date
- 2026-07-28
AI Technical Summary
Traditional switches cannot distinguish the service priority of data streams when the port receiving rate exceeds the link capacity, resulting in the dropping or delay of critical service data frames. Furthermore, they lack the ability to proactively control sudden abnormal traffic, leading to network paralysis.
By sampling the switch data frames, high-priority and low-priority traffic is distinguished, the traffic rate is calculated, and low-priority traffic is paused or dropped when the limit is exceeded, ensuring the transmission of high-priority traffic. Traffic control is performed by combining the exponentially weighted moving average and the dynamic adaptive rate threshold.
It ensures continuity of critical business operations, blocks abnormal traffic surges, ensures network stability and reduces pressure on downstream devices, and is suitable for high-speed hardware implementation.
Smart Images

Figure CN122476069A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of network operation and maintenance technology, specifically relating to a switch traffic adaptive control method and system. Background Technology
[0002] Traditional switches typically employ tail drop or simple random early detection (RED) strategies when the port receive rate exceeds the link capacity. These methods fail to differentiate data flow priorities, potentially causing critical service data frames (such as real-time control signaling, VoIP, and financial transaction flows) to be dropped or severely delayed along with ordinary data frames, compromising service quality. Furthermore, when facing sudden abnormal traffic spikes (such as DDoS attacks or broadcast storms caused by equipment failures), traditional methods lack proactive, priority-sensitive adaptive control capabilities, easily leading to the paralysis of the entire port or even the switching plane. Summary of the Invention
[0003] The purpose of this invention is to provide a switch traffic adaptive control method and system to solve the above-mentioned problems existing in the prior art.
[0004] To achieve the above objectives, the present invention adopts the following technical solution: Firstly, a switch traffic adaptive control method is provided, including: S1. Sample the data frames received by the switch in real time, and extract the number of bytes and priority of the data frames, wherein the priority is high priority or low priority; S2. Determine the nominal rate of the switch, and the first total number of bytes of all high-priority data frames and the second total number of bytes of all low-priority data frames received by the switch in the current time window. Divide the first total number of bytes and the second total number of bytes by the duration of the current time window to obtain the high-priority traffic rate and the low-priority traffic rate. S3. Add the high-priority flow rate to the low-priority flow rate to get the total flow rate. If the total flow rate is greater than the nominal rate, subtract the nominal rate from the total flow rate to get the over-limit flow rate for the current time window. S4. Compare the over-limit flow rate with the low-priority flow rate. If the over-limit flow rate is greater than the low-priority flow rate, subtract the low-priority flow rate from the over-limit flow rate to get the flow rate difference, and subtract the flow rate difference from the high-priority flow rate to get the limit rate. S5. Control the switch to pause receiving low-priority data frames and receive high-priority data frames at a limited rate. After the switch receives the next high-priority data frame, determine the third total number of bytes of all data frames buffered by the switch. S6. When the total number of bytes exceeds the set stable number of bytes but does not exceed the set maximum tolerable number of bytes, determine the number of bytes to be sent per unit time based on the total number of bytes and the limiting rate, and control the switch to send high-priority data frames in the subsequent unit time. S7. Repeat steps S5-S6 until the total number of bytes is less than the set stable number of bytes, then remove the switch's restriction on receiving low-priority data frames and return to step S1.
[0005] In one possible design, after adding the high-priority flow rate to the low-priority flow rate to obtain the total flow rate, the method further includes: Determine the exponentially weighted moving average R of the over-limit traffic rate of the switch over several historical time windows. EMA ; Using the exponentially weighted moving average R EMA and nominal rate R B Calculate the dynamic adaptive rate threshold R a R a =R B -α×R EMA , where α is the set smoothing congestion coefficient; If the total flow rate is greater than the dynamic adaptive rate threshold, the excess flow rate for the current time window is obtained by subtracting the dynamic adaptive rate threshold from the total flow rate.
[0006] In one possible design, determining the number of bytes sent per unit time based on the third total number of bytes and the rate limit includes: Using the third total number of bytes B s and limiting rate R target Calculate the number of bytes B sent within the subsequent unit time Δt. f B f =min(B s R target ×Δt), where min represents taking the minimum value.
[0007] In one possible design, when the third total number of bytes exceeds a set stable number of bytes but does not exceed a set maximum tolerable number of bytes, the method further includes: Using the limited rate R target Calculate the transmission rate R within the subsequent unit time Δt. out R out =β×R target +(1-β)×R out ', where β is the set weighting coefficient, R out 'This represents the transmission rate of the switch in the previous unit of time.' The control switch transmits at a rate R within the subsequent unit time Δt. out Send high-priority data frames.
[0008] In one possible design, if the over-limit flow rate is greater than the low-priority flow rate, the method further includes: directly using the nominal rate as the limit rate.
[0009] In one possible design, the method further includes: If the excess flow rate is less than or equal to the low priority flow rate, subtract the excess flow rate from the low priority flow rate to get the quota rate difference, and multiply the quota rate difference by the duration of the current time window to get the quota bytes. Control the switch to discard some low-priority data frames received within the current time window, so that the sum of the bytes of the discarded low-priority data frames is greater than or equal to the quota bytes.
[0010] In one possible design, the method further includes: When the total number of bytes in the third phase is greater than or equal to the set maximum tolerable number of bytes, the control switch will suspend receiving any data frames. Based on the third total number of bytes and the rate limit, the number of bytes to be sent per unit time is determined, and the switch is controlled to send high-priority data frames in the subsequent unit time until the third total number of bytes does not exceed the set maximum tolerable number of bytes, and then the switch's restriction on receiving high-priority data frames is lifted.
[0011] In one possible design, the method further includes: When the total traffic rate is less than or equal to the nominal rate, maintain normal data frame transmission and reception of the switch and return to step S1.
[0012] Secondly, a switch traffic adaptive control system is provided, comprising a data sampling unit, a rate extraction unit, a rate determination unit, a rate comparison unit, a receiving control unit, a transmitting control unit, and a limit removal unit, wherein: The data sampling unit is used to sample the data frames received by the switch in real time, and extract the number of bytes and priority of the data frames, wherein the priority is high priority or low priority. The rate extraction unit is used to determine the nominal rate of the switch, as well as the first total number of bytes of all high-priority data frames and the second total number of bytes of all low-priority data frames received by the switch in the current time window, and to obtain the high-priority traffic rate and low-priority traffic rate by dividing the first total number of bytes and the second total number of bytes by the duration of the current time window, respectively. The rate determination unit is used to add the high-priority flow rate to the low-priority flow rate to obtain the total flow rate. If the total flow rate is greater than the nominal rate, the over-limit flow rate of the current time window is obtained by subtracting the nominal rate from the total flow rate. The rate comparison unit is used to compare the over-limit flow rate with the low-priority flow rate. If the over-limit flow rate is greater than the low-priority flow rate, the over-limit flow rate is subtracted from the low-priority flow rate to obtain the flow rate difference, and the high-priority flow rate is subtracted from the flow rate difference to obtain the limit rate. The receiving control unit is used to control the switch to pause receiving low-priority data frames and receive high-priority data frames at a limited rate. After the switch receives the next high-priority data frame, it determines the third total number of bytes of all data frames buffered by the switch. The transmission control unit is used to determine the number of bytes to be transmitted per unit time based on the third total number of bytes and the limiting rate when the third total number of bytes exceeds the set stable number of bytes but does not exceed the set maximum tolerable number of bytes, and to control the switch to transmit high-priority data frames in the subsequent unit time. The restriction removal unit is used to remove the switch's restriction on receiving low-priority data frames when the total number of bytes is less than the set number of stable bytes.
[0013] Thirdly, a switch traffic adaptive control system is provided, including: Memory, used to store instructions; The processor is configured to read instructions stored in the memory and execute any one of the switch traffic adaptive control methods described in the first aspect above, according to the instructions.
[0014] Fourthly, a computer-readable storage medium is provided, on which instructions are stored, which, when executed on a computer, cause the computer to perform any one of the switch traffic adaptive control methods described in the first aspect. Simultaneously, a computer program product is also provided, which, when executed on a computer, performs any one of the switch traffic adaptive control methods described in the first aspect.
[0015] Beneficial effects: This invention samples data frames from the switch to strictly distinguish the priority of transmitted data. Based on the priority distinction, it determines the traffic rate and analyzes rate overruns. When the rate exceeds the limit, it suspends or discards low-priority traffic to prevent it from consuming too much of the switch's transmission bandwidth, thus ensuring the continuity of high-priority traffic. This solves the problem in existing technologies where switch congestion cannot guarantee the performance of critical services and network resources are easily exhausted by abnormal traffic. At the same time, by limiting the rate of high-priority traffic and smoothing the output, it can eliminate sudden problems, completely block the impact of abnormal traffic on the switch, stabilize the output flow, and reduce the pressure on downstream devices. Furthermore, all determination processes are based on simple rate conversion, suitable for high-line-speed hardware implementation, do not require complex queue management, and are easy to deploy and apply. Attached Figure Description
[0016] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0017] Figure 1 This is a flowchart illustrating the method in Embodiment 1 of the present invention; Figure 2 This is a schematic diagram of the system configuration in Embodiment 2 of the present invention; Figure 3 This is a schematic diagram of the system configuration in Embodiment 3 of the present invention. Detailed Implementation
[0018] It should be noted that the descriptions of these embodiments are intended to aid in understanding the invention and do not constitute a limitation thereof. The specific structural and functional details disclosed herein are merely for describing exemplary embodiments of the invention. However, the invention may be embodied in many alternative forms and should not be construed as being limited to the embodiments described herein.
[0019] It should be understood that, unless otherwise explicitly specified and limited, the corresponding terms should be interpreted broadly. For example, "connection" can be a fixed connection, a detachable connection, or an integral connection; it can be a direct connection or an indirect connection through an intermediate medium; it can be a connection within two components. Those skilled in the art can understand the specific meaning of the above terms in the embodiments according to the specific circumstances.
[0020] Specific details are provided in the following description to provide a complete understanding of the exemplary embodiments. However, those skilled in the art will understand that the exemplary embodiments can be implemented without these specific details. For example, apparatus may be shown in block diagrams to avoid obscuring the examples with unnecessary details. In other embodiments, well-known processes, structures, and techniques may be omitted with non-essential details to avoid obscuring the embodiments.
[0021] Example 1: This embodiment provides a switch traffic adaptive control method, which can be applied to the switch's operation controller, such as... Figure 1 As shown, the method includes the following steps: S1. Sample the data frames received by the switch in real time, and extract the number of bytes and priority of the data frames, wherein the priority is high priority or low priority.
[0022] In practice, during the process of the switch sending and receiving data frames, the controller can sample the data frames received by the switch in real time, extract the number of bytes and priority of the data frames. The priority is divided into high priority and low priority, which can be determined based on the priority mark in the data frame header (such as the PCP field in the VLAN Tag or the DSCP value in the IP header).
[0023] S2. Determine the nominal rate of the switch, and the first total number of bytes of all high-priority data frames and the second total number of bytes of all low-priority data frames received by the switch in the current time window. Divide the first total number of bytes and the second total number of bytes by the duration of the current time window to obtain the high-priority traffic rate and the low-priority traffic rate.
[0024] In practice, the controller first determines the nominal speed of the switch and then determines the first total number of bytes of all high-priority data frames and the second total number of bytes of all low-priority data frames received by the switch within the current time window. The high-priority traffic rate is then obtained by dividing the first total number of bytes by the duration of the current time window, and the low-priority traffic rate is obtained by dividing the second total number of bytes by the duration of the current time window.
[0025] S3. Add the high-priority flow rate to the low-priority flow rate to get the total flow rate. If the total flow rate is greater than the nominal rate, subtract the nominal rate from the total flow rate to get the over-limit flow rate for the current time window.
[0026] In practice, the controller can add the high-priority traffic rate to the low-priority traffic rate to obtain the total traffic rate, and then compare the total traffic rate with the switch's nominal rate. If the total traffic rate is less than or equal to the nominal rate, the switch maintains normal data frame transmission and reception, and returns to step S1. If the total traffic rate is greater than the nominal rate, the controller subtracts the nominal rate from the total traffic rate to obtain the over-limit traffic rate for the current time window.
[0027] Alternatively, after obtaining the total traffic rate, the controller can determine the exponentially weighted moving average R of the switch's over-limit traffic rates over several historical time windows. EMA Then, the exponentially weighted moving average R is used. EMA and nominal rate R B Calculate the dynamic adaptive rate threshold R a R a =R B -α×R EMA Where α is the set smoothing congestion coefficient. If the total flow rate is greater than the dynamic adaptive rate threshold, the control subtracts the dynamic adaptive rate threshold from the total flow rate to obtain the over-limit flow rate for the current time window.
[0028] S4. Compare the over-limit flow rate with the low-priority flow rate. If the over-limit flow rate is greater than the low-priority flow rate, subtract the low-priority flow rate from the over-limit flow rate to get the flow rate difference, and subtract the flow rate difference from the high-priority flow rate to get the limit rate.
[0029] In practice, the controller compares the over-limit traffic rate with the low-priority traffic rate. If the over-limit traffic rate is greater than the low-priority traffic rate, the over-limit traffic rate is subtracted from the low-priority traffic rate to obtain the traffic rate difference. The high-priority traffic rate is then subtracted from the traffic rate difference to obtain the limit rate. Alternatively, the nominal rate of the switch can be used directly as the limit rate.
[0030] S5. Control the switch to pause receiving low-priority data frames and receive high-priority data frames at a limited rate. After the switch receives the next high-priority data frame, determine the third total number of bytes of all data frames buffered by the switch.
[0031] In practice, the controller controls the switch to pause receiving low-priority data frames and receive high-priority data frames at a limited rate. After the switch receives the next high-priority data frame, the third total number of bytes of all data frames buffered by the switch is determined.
[0032] If, in step S4, the excess flow rate is less than or equal to the low-priority flow rate, the controller subtracts the excess flow rate from the low-priority flow rate to obtain the quota rate difference, and multiplies this difference by the duration of the current time window to obtain the quota byte count. Then, the controller controls the switch to discard some low-priority data frames received within the current time window, ensuring that the sum of the bytes in the discarded low-priority data frames is greater than or equal to the quota byte count. After the switch receives the next data frame (regardless of whether it's a high-priority or low-priority data frame), the controller determines the third total byte count of all data frames buffered by the switch.
[0033] S6. When the third total number of bytes exceeds the set stable number of bytes but does not exceed the set maximum tolerable number of bytes, determine the number of bytes to be sent per unit time based on the third total number of bytes and the limiting rate, and control the switch to send high-priority data frames in the subsequent unit time.
[0034] In practice, if the total number of bytes exceeds the set stable number of bytes but does not exceed the set maximum tolerable number of bytes (the stable number of bytes is less than the maximum tolerable number of bytes), the controller can determine the number of bytes to be sent per unit time based on the total number of bytes and the rate limit, i.e., using the total number of bytes B. s and limiting rate R target Calculate the number of bytes B sent within the subsequent unit time Δt. f B f =min(B s R target ×Δt), where min represents taking the minimum value, and then controlling the switch to send high-priority data frames in subsequent unit time intervals. Alternatively, the controller can use rate limiting R target Calculate the transmission rate R within the subsequent unit time Δt. out R out =β×R target +(1-β)×R out ', where β is the set weighting coefficient, R out 'This represents the transmission rate of the switch in the previous unit of time, and then controls the switch to maintain a transmission rate R in subsequent unit of time Δt.' out Send high-priority data frames.
[0035] If the third total number of bytes is greater than or equal to the set maximum tolerable number of bytes, the controller can control the switch to suspend receiving any data frames, and then determine the number of bytes to be sent per unit time based on the third total number of bytes and the rate limit, and control the switch to send high-priority data frames in the subsequent unit time until the third total number of bytes does not exceed the set maximum tolerable number of bytes, and then release the switch from the restriction on receiving high-priority data frames.
[0036] S7. Repeat steps S5-S6 until the total number of bytes is less than the set stable number of bytes, then remove the switch's restriction on receiving low-priority data frames and return to step S1.
[0037] In practice, the controller can repeat steps S5-S6 until the corresponding third total number of bytes is less than the set stable number of bytes. At this time, the controller can release the switch from the restriction on receiving low-priority data frames and return to step S1.
[0038] This method samples data frames from the switch to strictly distinguish the priority of transmitted data. Based on the priority distinction, it determines the traffic rate and analyzes rate overruns. When the rate exceeds the limit, it suspends or discards low-priority traffic to prevent it from consuming too much of the switch's transmission bandwidth, thus ensuring the continuity of high-priority traffic. This solves the problem in existing technologies where switch congestion cannot guarantee the performance of critical services and network resources are easily exhausted by abnormal traffic. At the same time, by rate limiting and smoothing the output of high-priority traffic, it can eliminate sudden problems, completely block the impact of abnormal traffic on the switch, stabilize the output flow, and reduce the pressure on downstream devices. Furthermore, all determination processes are based on simple rate conversion, making them suitable for high-line-speed hardware implementation without the need for complex queue management, and facilitating deployment and application.
[0039] Example 2: This embodiment provides a switch traffic adaptive control system, such as Figure 2 As shown, it includes a data sampling unit, a rate extraction unit, a rate determination unit, a rate comparison unit, a receiving control unit, a transmitting control unit, and a limit removal unit, wherein: The data sampling unit is used to sample the data frames received by the switch in real time, and extract the number of bytes and priority of the data frames, wherein the priority is high priority or low priority. The rate extraction unit is used to determine the nominal rate of the switch, as well as the first total number of bytes of all high-priority data frames and the second total number of bytes of all low-priority data frames received by the switch in the current time window, and to obtain the high-priority traffic rate and low-priority traffic rate by dividing the first total number of bytes and the second total number of bytes by the duration of the current time window, respectively. The rate determination unit is used to add the high-priority flow rate to the low-priority flow rate to obtain the total flow rate. If the total flow rate is greater than the nominal rate, the over-limit flow rate of the current time window is obtained by subtracting the nominal rate from the total flow rate. The rate comparison unit is used to compare the over-limit flow rate with the low-priority flow rate. If the over-limit flow rate is greater than the low-priority flow rate, the over-limit flow rate is subtracted from the low-priority flow rate to obtain the flow rate difference, and the high-priority flow rate is subtracted from the flow rate difference to obtain the limit rate. The receiving control unit is used to control the switch to pause receiving low-priority data frames and receive high-priority data frames at a limited rate. After the switch receives the next high-priority data frame, it determines the third total number of bytes of all data frames buffered by the switch. The transmission control unit is used to determine the number of bytes to be transmitted per unit time based on the third total number of bytes and the limiting rate when the third total number of bytes exceeds the set stable number of bytes but does not exceed the set maximum tolerable number of bytes, and to control the switch to transmit high-priority data frames in the subsequent unit time. The restriction removal unit is used to remove the switch's restriction on receiving low-priority data frames when the total number of bytes is less than the set number of stable bytes.
[0040] Example 3: This embodiment provides a switch traffic adaptive control system, such as Figure 3 As shown, at the hardware level, it includes: The data interface is used to establish data communication between the processor and external data terminals; Memory, used to store instructions; The processor is used to read instructions stored in the memory and execute the switch traffic adaptive control method in Embodiment 1 according to the instructions.
[0041] Optionally, the system also includes an internal bus, through which the processor, memory, and data interface can be interconnected. This internal bus can be a PCIe (Peripheral Component Interconnect Eexpress) bus, which can be divided into an address bus, a data bus, a control bus, etc. The memory can include, but is not limited to, Random Access Memory (RAM), Read Only Memory (ROM), Flash Memory, First Input First Output (FIFO), and / or First In Last Out (FILO). The processor can be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; it can also be a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components.
[0042] Example 4: This embodiment provides a computer-readable storage medium storing instructions that, when executed on a computer, cause the computer to perform the switch traffic adaptive control method of Embodiment 1. The computer-readable storage medium refers to a data storage medium, which may include, but is not limited to, floppy disks, optical disks, hard disks, flash memory, USB flash drives, and / or Memory Sticks. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable devices.
[0043] This embodiment also provides a computer program product that, when run on a computer, executes the switch traffic adaptive control method of Embodiment 1. The computer can be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device.
[0044] Finally, it should be noted that the above description is merely a preferred embodiment of the present invention and is not intended to limit the scope of protection of the present invention. 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 adaptive flow control of a switch, characterized in that, include: S1. Sample the data frames received by the switch in real time, and extract the number of bytes and priority of the data frames, wherein the priority is high priority or low priority; S2. Determine the nominal rate of the switch, and the first total number of bytes of all high-priority data frames and the second total number of bytes of all low-priority data frames received by the switch in the current time window. Divide the first total number of bytes and the second total number of bytes by the duration of the current time window to obtain the high-priority traffic rate and the low-priority traffic rate. S3. Add the high-priority flow rate to the low-priority flow rate to get the total flow rate. If the total flow rate is greater than the nominal rate, subtract the nominal rate from the total flow rate to get the over-limit flow rate for the current time window. S4. Compare the over-limit flow rate with the low-priority flow rate. If the over-limit flow rate is greater than the low-priority flow rate, subtract the low-priority flow rate from the over-limit flow rate to get the flow rate difference, and subtract the flow rate difference from the high-priority flow rate to get the limit rate. S5. Control the switch to pause receiving low-priority data frames and receive high-priority data frames at a limited rate. After the switch receives the next high-priority data frame, determine the third total number of bytes of all data frames buffered by the switch. S6. When the total number of bytes exceeds the set stable number of bytes but does not exceed the set maximum tolerable number of bytes, determine the number of bytes to be sent per unit time based on the total number of bytes and the limiting rate, and control the switch to send high-priority data frames in the subsequent unit time. S7. Repeat steps S5-S6 until the total number of bytes is less than the set stable number of bytes, then remove the switch's restriction on receiving low-priority data frames and return to step S1.
2. The switch traffic adaptive control method according to claim 1, characterized in that, After adding the high-priority flow rate to the low-priority flow rate to obtain the total flow rate, the method further includes: Determine the exponentially weighted moving average R of the over-limit traffic rate of the switch over several historical time windows. EMA ; Using the exponentially weighted moving average R EMA and nominal rate R B Calculate the dynamic adaptive rate threshold R a R a =R B -α×R EMA , where α is the set smoothing congestion coefficient; If the total flow rate is greater than the dynamic adaptive rate threshold, the excess flow rate for the current time window is obtained by subtracting the dynamic adaptive rate threshold from the total flow rate.
3. The switch traffic adaptive control method according to claim 1, characterized in that, The determination of the number of bytes to be sent per unit time based on the third total number of bytes and the rate limit includes: Using the third total number of bytes B s and limiting rate R target Calculate the number of bytes B sent within the subsequent unit time Δt. f B f =min(B s R target ×Δt), where min represents taking the minimum value.
4. The switch traffic adaptive control method according to claim 1, characterized in that, When the total number of bytes exceeds the set stable number of bytes but does not exceed the set maximum tolerable number of bytes, the method further includes: Using the limited rate R target Calculate the transmission rate R within the subsequent unit time Δt. out R out =β×R target +(1-β)×R out ', where β is the set weighting coefficient, R out 'This represents the transmission rate of the switch in the previous unit of time.' The control switch transmits at a rate R within the subsequent unit time Δt. out Send high-priority data frames.
5. The switch traffic adaptive control method according to claim 1, characterized in that, If the over-limited flow rate is greater than the low-priority flow rate, the method further includes: directly using the nominal rate as the limit rate.
6. The switch traffic adaptive control method according to claim 1, characterized in that, The method further includes: If the excess flow rate is less than or equal to the low priority flow rate, subtract the excess flow rate from the low priority flow rate to get the quota rate difference, and multiply the quota rate difference by the duration of the current time window to get the quota bytes. Control the switch to discard some low-priority data frames received within the current time window, so that the sum of the bytes of the discarded low-priority data frames is greater than or equal to the quota bytes.
7. The switch traffic adaptive control method according to claim 1, characterized in that, The method further includes: When the total number of bytes in the third phase is greater than or equal to the set maximum tolerable number of bytes, the control switch will suspend receiving any data frames. Based on the third total number of bytes and the rate limit, the number of bytes to be sent per unit time is determined, and the switch is controlled to send high-priority data frames in the subsequent unit time until the third total number of bytes does not exceed the set maximum tolerable number of bytes, and then the switch's restriction on receiving high-priority data frames is lifted.
8. The switch traffic adaptive control method according to claim 1, characterized in that, The method further includes: When the total traffic rate is less than or equal to the nominal rate, maintain normal data frame transmission and reception of the switch and return to step S1.
9. A switch flow adaptive control system, characterized in that, It includes a data sampling unit, a rate extraction unit, a rate determination unit, a rate comparison unit, a receiving control unit, a transmitting control unit, and a limit removal unit, wherein: The data sampling unit is used to sample the data frames received by the switch in real time, and extract the number of bytes and priority of the data frames, wherein the priority is high priority or low priority. The rate extraction unit is used to determine the nominal rate of the switch, as well as the first total number of bytes of all high-priority data frames and the second total number of bytes of all low-priority data frames received by the switch in the current time window, and to obtain the high-priority traffic rate and low-priority traffic rate by dividing the first total number of bytes and the second total number of bytes by the duration of the current time window, respectively. The rate determination unit is used to add the high-priority flow rate to the low-priority flow rate to obtain the total flow rate. If the total flow rate is greater than the nominal rate, the over-limit flow rate of the current time window is obtained by subtracting the nominal rate from the total flow rate. The rate comparison unit is used to compare the over-limit flow rate with the low-priority flow rate. If the over-limit flow rate is greater than the low-priority flow rate, the over-limit flow rate is subtracted from the low-priority flow rate to obtain the flow rate difference, and the high-priority flow rate is subtracted from the flow rate difference to obtain the limit rate. The receiving control unit is used to control the switch to pause receiving low-priority data frames and receive high-priority data frames at a limited rate. After the switch receives the next high-priority data frame, it determines the third total number of bytes of all data frames buffered by the switch. The transmission control unit is used to determine the number of bytes to be transmitted per unit time based on the third total number of bytes and the limiting rate when the third total number of bytes exceeds the set stable number of bytes but does not exceed the set maximum tolerable number of bytes, and to control the switch to transmit high-priority data frames in the subsequent unit time. The restriction removal unit is used to remove the switch's restriction on receiving low-priority data frames when the total number of bytes is less than the set number of stable bytes.
10. A switch flow adaptive control system, characterized in that, include: Memory, used to store instructions; A processor is configured to read instructions stored in the memory and execute, according to any one of claims 1-8, a switch traffic adaptive control method.