Queue congestion aging method and apparatus, network device, and storage medium

By updating the queue status in network devices and prioritizing the clearing of aging queues, the problem of insufficient cache resources is solved, the utilization rate of cache resources and packet forwarding efficiency of network devices are improved, and network stability and service quality are ensured.

CN116781633BActive Publication Date: 2026-07-24SUZHOU CENTEC COMM CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
SUZHOU CENTEC COMM CO LTD
Filing Date
2023-08-01
Publication Date
2026-07-24

AI Technical Summary

Technical Problem

In large network environments such as high-speed networks and data centers, network devices have limited cache resources. When network traffic is too high or congested, existing methods of controlling traffic based on token buckets and aging data packets in queues cannot quickly and flexibly release cache resources, leading to problems such as data packet loss and latency, which affect network stability and service quality.

Method used

By sequentially obtaining the queue information and the on/off status of the preset aging switch for each queue, the queue status is updated to either aging or normal. The aging queue is cleared first, and the normal queue is scheduled from high to low priority to quickly release cache resources.

Benefits of technology

It enables timely detection and release of cache resources in aging queues, avoiding prolonged queue congestion, improving network quality and cache resource utilization, and ensuring the timeliness of packet forwarding in high-priority queues.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN116781633B_ABST
    Figure CN116781633B_ABST
Patent Text Reader

Abstract

Embodiments of the present application provide a queue congestion aging method and device, network equipment and storage medium, and relate to the technical field of resource management. The method sequentially acquires queue information of each queue and a switch state of a preset aging switch, and updates a queue state of the queue according to the queue information of the queue and the switch state of the preset aging switch. The queue state includes an aging state and a normal state, thereby ensuring timely updating of the aging state or the normal state of the queue. Aging queues with the queue state being the aging state are emptied in priority, and normal queues with the queue state being the normal state are scheduled according to priority from high to low, thereby quickly releasing cache resources by preferentially emptying the aging queues, avoiding long-time congestion of the queues, and further improving network quality and cache resource utilization of the network equipment, and ensuring timeliness of data packet forwarding in high-priority queues.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of resource management technology, and more specifically, to a queue congestion aging method, apparatus, network device, and storage medium. Background Technology

[0002] In large network environments such as high-speed networks and data centers, it is typically necessary to handle massive data streams and network traffic while ensuring network stability and quality of service. Network devices store data packets to be forwarded in queues of different priorities to manage and control network traffic. However, the buffer resources of network devices are limited. When network traffic is too high or congestion occurs, insufficient buffer resources may result, leading to problems such as packet loss and latency, which significantly reduces network stability, performance, and quality of service.

[0003] Currently, common traffic control methods used in network devices include token bucket-based traffic control and queue congestion-based packet aging. However, token bucket-based traffic control is affected by the token generation speed, which may lead to delayed packet forwarding and thus affect network real-time performance. Queue congestion-based packet aging sets an aging time for each packet and releases resources queue by queue according to priority, which cannot quickly and flexibly release the buffered resources of the congestion queue. Summary of the Invention

[0004] In view of this, the purpose of the present invention is to provide a queue congestion aging method, apparatus, network device and storage medium that can detect aging queues in a timely manner and release the cache resources of aging queues first, thereby improving network quality and the utilization rate of cache resources of network devices.

[0005] To achieve the above objectives, the technical solutions adopted in the embodiments of the present invention are as follows:

[0006] In a first aspect, the present invention provides a queue congestion aging method, the method comprising:

[0007] Sequentially obtain the queue information of each queue and the on / off status of the preset aging switch;

[0008] The queue status is updated based on the queue information and the on / off state of the preset aging switch; the queue status includes aging status and normal status.

[0009] Clear the aging queue whose queue status is the aging state;

[0010] The normal queues whose queue status is in the normal state are scheduled in descending order of priority.

[0011] In an optional implementation, the queue information includes an aging count and a queue status, the preset aging switch includes triggering the aging switch and canceling the aging switch, and updating the queue status according to the queue information and the on / off status of the preset aging switch includes:

[0012] When the queue status is the aging state and the switch status of cancel aging is on, or when the queue status is the aging state and the queue is empty, the queue status is set to the normal state and the aging count of the queue is set to the initial value.

[0013] When the queue status is the normal state, the aging count is not greater than the aging threshold, the queue is not empty, and the aging switch is on, the queue status is set to the aging state.

[0014] When the queue is not empty and the aging count is greater than the aging threshold, the aging count is subtracted from the preset threshold.

[0015] In an optional implementation, the method further includes:

[0016] Update the status of the cancel aging switch or the trigger aging switch based on the switch name and switch status modified by the user.

[0017] In an optional implementation, the queue information includes an aging count and a queue status, and clearing the aging queue whose queue status is the aging state includes:

[0018] Clear all data packets in the aging queue, set the aging count of the aging queue to the initial value, and set the queue status of the aging queue to the normal state.

[0019] In an optional implementation, clearing all data packets in the aging queue includes:

[0020] Data packets are sequentially retrieved from the aging queue, and the retrieved data packets are set to the discard state.

[0021] In an optional implementation, the queue information includes an aging count and a queue status, and the step of scheduling normal queues with the queue status in the normal state according to priority from high to low includes:

[0022] When the aging count of the normal queue is not greater than the aging threshold, the queue state of the normal queue is set to the aging state, and all data packets in the normal queue are cleared; after clearing all data packets in the normal queue, the queue state of the normal queue is set to the normal state, and the aging count of the normal queue is set to the initial value.

[0023] When the aging count of the normal queue is greater than the aging threshold, the data packets in the normal queue are forwarded, and the aging count of the normal queue is set to the initial value.

[0024] In an optional implementation, the initial value is set according to the priority of the queue, wherein the higher the priority, the larger the initial value.

[0025] In a second aspect, the present invention provides a queue congestion aging device, the device comprising:

[0026] The scanning module is used to sequentially acquire the queue information of each queue and the on / off state of the preset aging switch; update the queue state of the queue according to the queue information of the queue and the on / off state of the preset aging switch; the queue state includes aging state and normal state.

[0027] The scheduling module is used to clear the aging queues whose queue status is the aging state; and to schedule the normal queues whose queue status is the normal state according to their priority from high to low.

[0028] Thirdly, the present invention provides a network device, the network device including a memory and a processor, the memory being used to store a computer program, and the processor being used to execute the queue congestion aging method as described in any of the foregoing embodiments when the computer program is invoked.

[0029] Fourthly, the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the queue congestion aging method as described in any of the foregoing embodiments.

[0030] Compared to existing technologies, the queue congestion aging method, apparatus, network device, and storage medium provided in this invention sequentially acquire queue information and the on / off state of a preset aging switch for each queue, and update the queue state based on the queue information and the on / off state of the preset aging switch. The queue state includes an aging state and a normal state, thereby ensuring timely updates to the aging or normal state of the queue. Aging queues in the aging state are cleared first, and normal queues in the normal state are scheduled from high to low priority. This quickly releases cache resources by prioritizing the clearing of aging queues, avoiding prolonged queue congestion, thereby improving network quality and the utilization rate of network device cache resources, and ensuring the timeliness of packet forwarding in high-priority queues.

[0031] 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

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

[0033] Figure 1 A schematic diagram of a queue congestion aging method provided in an embodiment of the present invention is shown.

[0034] Figure 2 It shows Figure 1 A schematic diagram of the sub-steps in steps S20-S40.

[0035] Figure 3 A block diagram of a queue congestion aging device provided in an embodiment of the present invention is shown.

[0036] Figure 4 A block diagram of a network device provided in an embodiment of the present invention is shown.

[0037] Icons: 10-Network device; 110-Memory; 120-Processor; 130-Communication module; 200-Queue congestion aging device; 201-Scanning module; 202-Scheduling module; 203-Configuration module. Detailed Implementation

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

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

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

[0041] In large network environments such as data center networks, wide area networks (WANs), local area networks (LANs), and mobile communication networks, it is typically necessary to handle large volumes of data streams and network traffic to ensure data transmission efficiency and quality. In these environments, network devices, as core network equipment, play a crucial role, and their performance and stability have a vital impact on the entire network.

[0042] For example, switches use queues of different priorities to store packets to be forwarded in order to manage and control network traffic. However, switches have limited buffer resources. When network traffic is too high or congestion occurs, insufficient buffer resources may lead to problems such as packet loss and delays, which greatly reduces network performance and quality of service. Currently, to solve the problem of insufficient switch buffer resources, token buckets are commonly used to control traffic or to age packets in congestion queues.

[0043] Token bucket traffic control refers to generating tokens at a certain frequency and storing them in a token bucket. Each token represents the transmission permission of a data packet, and the transmission speed of data packets is controlled by the number of tokens. When a data packet needs to be transmitted, it first needs to obtain a token from the token bucket. Data packets with a token are forwarded normally. If there are not enough tokens in the bucket, the packet must wait until a token is obtained before it can be sent. In the event of a sudden surge in data traffic within a short period of time, the delayed generation of tokens may cause data packets to be delayed, thus affecting the real-time performance of the network.

[0044] The aging congestion queue refers to the process of monitoring the status of data packets in a network queue when congestion occurs. When a data packet has been in the queue for longer than a preset aging time, it is aged packet by packet, and the status of the packet removed from the queue is set to discard, facilitating its subsequent dropping. Because aging is done packet by packet, it's difficult to control the queue length and quickly release the buffer resources occupied by the entire queue, potentially causing newly received data packets to be dropped due to insufficient buffer resources. Furthermore, using the same aging time for all data packets may result in high-priority packets being frequently dropped or low-priority packets not being aged due to lack of scheduling, leading to a decline in network service quality, stability, and performance.

[0045] Based on this, embodiments of the present invention provide a queue congestion aging method, apparatus, network device, and storage medium, which can detect aging queues in a timely manner and release the cache resources of aging queues first, thereby improving network quality and the utilization rate of cache resources of network devices.

[0046] The embodiments of the present invention will now be described in detail with reference to the accompanying drawings.

[0047] Figure 1 This diagram illustrates a queue congestion aging method provided in an embodiment of the present invention. This method is applied to network devices. Please refer to... Figure 1 The method includes the following steps:

[0048] Step S10: Sequentially obtain the queue information of each queue and the on / off status of the preset aging switch.

[0049] In this embodiment of the invention, the network device creates a scanner when the system is powered on, sets the scanner's scanning interval, and sets the queue status of all queues to normal. The scanner periodically traverses and scans all queues, obtaining queue information and the on / off status of a preset aging switch for each queue. The traversal method can be sorting by priority or by the order of queue information. The aging switch can be set to apply to all queues or to have one aging switch for each queue. This invention does not limit the specific settings and allows for configuration based on actual application requirements.

[0050] Step S20: Update the queue status according to the queue information and the on / off status of the preset aging switch; the queue status includes aging status and normal status.

[0051] In this embodiment of the invention, the scanner updates the queue status of the queues according to the queue information of each queue and the status of the aging switch, and promptly updates the queues that meet the aging conditions from the normal state to the aging state so that the cache resources of the subsequent aging queues can be released; and updates the queues that have completed aging or canceled aging from the aging state to the normal state.

[0052] It should be noted that when the scanner's timer is triggered, all queues are traversed to update their queue states. After all queues have been processed, the scanner waits for the timer to be triggered again before starting the next round of scanning.

[0053] Step S30: Clear the aging queue that is in the aging state.

[0054] In this embodiment of the invention, the network device creates a scheduler when the system powers on. The scheduler monitors and schedules all queues in real time, filters out non-empty queues, and divides them into aging queues and normal queues based on their status. An aging queue represents a queue in an aging state, while a normal queue represents a queue in a normal state. To release the network device's cache resources as quickly as possible, the aging queue is prioritized for clearing.

[0055] Step S40: Schedule the normal queues in the normal state according to their priority from high to low.

[0056] In this embodiment of the invention, after the scheduler clears all aging queues, it schedules normal queues in descending order of priority and updates the queue status based on the queue information of the normal queues.

[0057] In summary, the queue congestion aging method provided in this embodiment of the invention is applied to network devices. This method sequentially acquires the queue information of each queue and the on / off state of a preset aging switch, and updates the queue state based on the queue information and the on / off state of the preset aging switch. The queue state includes an aging state and a normal state, thereby ensuring timely updates to the aging or normal state of the queues. Aging queues in the aging state are prioritized for clearing, while normal queues in the normal state are scheduled from high to low priority. This method quickly releases cache resources by prioritizing the clearing of aging queues, avoiding prolonged queue congestion, thereby improving network quality and the utilization rate of network device cache resources, and ensuring the timeliness of packet forwarding in high-priority queues.

[0058] Optionally, in practical applications, queue information includes aging count and queue status. Preset aging switches include triggering the aging switch and canceling the aging switch. The aging count and queue status of each queue are updated based on the trigger status of the aging switch, the cancel status of the aging switch, and the aging count and queue status of each queue. Please refer to [reference needed]. Figure 2 The sub-steps of step S20 may include:

[0059] Step S201: When the queue status is aging and the aging cancellation switch is on, or when the queue status is aging and the queue is empty, set the queue status to normal and set the queue aging count to the initial value.

[0060] In this embodiment of the invention, the scanner periodically scans each queue. When the cancel aging switch is set to the on state or the aging queue is empty, it indicates that the aging operation of the queue needs to be stopped or the aging queue has been completed. Then, the queue status of the aging queue is set to the normal state, and the aging count of the queue is set to the initial value.

[0061] As one implementation method, a parameter can be set in the queue information of each queue to indicate whether the queue is empty. Assuming the parameter is an empty queue identifier, when the empty queue identifier is true or yes, it indicates that the queue is empty; when the empty queue identifier is false or no, it indicates that the queue is not empty.

[0062] As another implementation, the queue can be checked to determine whether it is not empty. When the queue length is greater than 0 or there is a data packet in the queue, the queue is not empty; when the queue length is 0 or there is no data packet in the queue, the queue is empty.

[0063] Step S202: When the queue status is normal, the aging count is not greater than the aging threshold, the queue is not empty, and the switch that triggers the aging switch is in the on state, the queue status is set to the aging state.

[0064] In this embodiment of the invention, when the trigger aging switch is set to the on state, it is determined whether the aging count of the non-empty normal queue is less than or equal to the aging threshold. If the aging count is less than or equal to the aging threshold, it indicates that the non-empty normal queue needs to be aged, and the queue state is set to the aging state. Thus, it can be seen that the aging count of the queue in the aging state is always less than or equal to the aging threshold.

[0065] Step S203: When the queue is not empty and the aging count is greater than the aging threshold, subtract the preset threshold from the aging count.

[0066] In this embodiment of the invention, when the queue is not empty, if the aging count is greater than the aging threshold, it indicates that the queue has not yet reached the aging condition. The aging count is then subtracted from the preset threshold in order to proceed with the next round of scanning.

[0067] It should be noted that when the network device powers on, it initializes the aging switch cancellation state to off and the aging switch trigger state to on. Simultaneously, it initializes the aging threshold and preset threshold, for example, initializing the aging threshold to 0 and the preset threshold to 1. In practical applications, the initialization settings can be adjusted according to the application scenario, and this invention does not limit this.

[0068] Optionally, in practical applications, users can modify the switching state of the aging switch to trigger or cancel it as needed. The queue congestion aging method also includes the following steps:

[0069] Update the switch status of canceling or triggering aging switches based on the switch name and switch status modified by the user.

[0070] In this embodiment of the invention, the user logs into the network system on the client and modifies the on / off state of the aging switch through the system webpage or command line. The client generates the corresponding modification operation based on the user input.

[0071] In one implementation, the network system can provide a setting command that updates the switch status of triggering or canceling the aging switch by carrying two parameters: switch name and switch status.

[0072] As another implementation, the network system can provide a setting command for triggering the aging switch and canceling the aging switch respectively. The setting command for triggering the aging switch carries the switch status update of the aging switch, and the setting command for canceling the aging switch carries the switch status update of the aging switch.

[0073] Optionally, in practical applications, after the aging queue is cleared, the corresponding cache resources have been released, and the queue can receive data packets normally. Queue information includes aging count and queue status; please refer to [link / reference]. Figure 2 The sub-steps of step S30 may include:

[0074] Step S301: Clear all data packets in the aging queue, set the aging count of the aging queue to the initial value, and set the queue status of the aging queue to the normal state.

[0075] In this embodiment of the invention, the scheduler sequentially clears all data packets in each aging queue. After the aging queue is cleared, the aging count of the aging queue is set to the initial value, and the queue status is set to the normal state, so that the aging queue can receive and forward data packets normally.

[0076] Optionally, in practical applications, to facilitate the discarding of data packets, aged data packets can be set to a discard state. The sub-step in step S301 that clears all data packets in the aging queue may include:

[0077] Retrieve data packets from the aging queue in sequence and set the retrieved data packets to the discard state.

[0078] In this embodiment of the invention, the scheduler can retrieve data packets from the aging queue in a first-in-first-out (FIFO) order and set the retrieved data packets to a discard state so that subsequent processes will discard the discarded data packets. The specific method of retrieving data packets from the aging queue is not limited; the scheduler can process aging data packets in one go, or it can set the number of data packets to age or the aging time in one go.

[0079] Optionally, in practical applications, queue information includes aging counts and queue status, and normal queues are rationally scheduled based on the aging count of each normal queue. Please refer to [reference needed]. Figure 2 The sub-steps of step S40 may include:

[0080] Step S401: When the aging count of the normal queue is not greater than the aging threshold, set the queue state of the normal queue to the aging state and clear all data packets in the normal queue; after clearing all data packets in the normal queue, set the queue state of the normal queue to the normal state and set the aging count of the normal queue to the initial value.

[0081] In this embodiment of the invention, when the aging count of the normal queue is less than or equal to the aging threshold, it indicates that the normal queue needs to release cache resources through aging. Therefore, the queue state of the normal queue is set to the aging state to ensure that the queue is prioritized for aging during the next scheduling. Data packets are sequentially retrieved from the normal queue and set to the discard state. After the normal queue is cleared of all data packets, the queue state of the normal queue is reset to the normal state, and the aging count of the normal state is set to the initial value.

[0082] Step S402: When the aging count of the normal queue is greater than the aging threshold, the data packets in the normal queue are forwarded and the aging count of the normal queue is set to the initial value.

[0083] In this embodiment of the invention, when the aging count of the normal queue is greater than the aging threshold, it indicates that the normal queue does not meet the aging conditions. Then, the data packets in the normal queue are forwarded in sequence. Since the queue has been normally scheduled, the aging count needs to be recalculated. Therefore, the aging count of the normal queue is set to the initial value.

[0084] Optionally, in practical applications, to release resources more flexibly and reasonably from aging queues, users can set the initial value for each queue for aging based on queue priority. The initial values ​​used in the sub-steps of steps S20-S40 above are set according to the priority of the queue, wherein the higher the priority, the larger the initial value.

[0085] In this embodiment of the invention, when configuring the priority of each port queue of a network device, such as a switch, the user sets an initial value for the aging count for each queue based on its priority. A higher queue priority indicates that the data packets in the queue are more important. To ensure the timeliness and stability of data packets in high-priority queues, the aging interval of high-priority queues is lengthened as much as possible. Therefore, the initial value of the aging count for high-priority queues is set larger. Conversely, data packets in low-priority queues are relatively less important, and the initial value of the aging count can be set smaller. This allows for frequent optimization of low-priority queues to quickly release cache resources, thereby improving the cache resource utilization of the network device and reducing the forwarding load of the network device, ultimately ensuring that data packets in high-priority queues are forwarded in a timely manner.

[0086] Based on the same inventive concept, this embodiment of the invention also provides a queue congestion aging device. Its basic principle and the resulting technical effects are the same as those in the above embodiments. For the sake of brevity, any parts not mentioned in this embodiment can be referred to the corresponding content in the above embodiments.

[0087] Please refer to Figure 3 , Figure 3 A block diagram of a queue congestion aging device 200 provided in an embodiment of the present invention is shown. The queue congestion aging device 200 includes a scanning module 201 and a scheduling module 202.

[0088] The scanning module 201 is used to sequentially acquire the queue information of each queue and the on / off status of the preset aging switch; update the queue status of the queue according to the queue information and the on / off status of the preset aging switch; the queue status includes aging status and normal status.

[0089] The scheduling module 202 is used to clear the aging queues in the aging state and schedule the normal queues in the normal state according to their priority from high to low.

[0090] In summary, the queue congestion aging device provided in this embodiment of the invention includes a scanning module and a scheduling module. The scanning module is used to sequentially acquire queue information and the on / off state of a preset aging switch for each queue, and update the queue state according to the queue information and the on / off state of the preset aging switch. The queue state includes an aging state and a normal state, thereby ensuring timely updates to the aging or normal state of the queue. The scheduling module is used to clear aging queues in the aging state; and to schedule normal queues in the normal state according to their priority from high to low. This allows for the rapid release of cache resources by prioritizing the clearing of aging queues, avoiding prolonged queue congestion, thereby improving network quality and the utilization rate of network device cache resources, and ensuring the timeliness of packet forwarding in high-priority queues.

[0091] Optionally, the queue information includes an aging count and a queue status, and the preset aging switch includes triggering the aging switch and canceling the aging switch. The scanning module 201 is specifically used to set the queue status to normal and set the queue aging count to an initial value when the queue status is aging and the cancel aging switch is enabled, or when the queue status is aging and the queue is empty; when the queue status is normal, the aging count is not greater than the aging threshold, the queue is not empty, and the trigger aging switch is enabled; and when the queue is not empty and the aging count is greater than the aging threshold, the aging count is subtracted from the preset threshold.

[0092] Optionally, the queue congestion aging device 200 also includes a configuration module 203. The configuration module 203 is used to update the switch status of canceling or triggering the aging switch based on the switch name and switch status modified by the user.

[0093] Optionally, the queue information includes aging count and queue status. The scheduling module 202 is specifically used to clear all data packets in the aging queue, set the aging count of the aging queue to the initial value, and set the queue status of the aging queue to the normal state.

[0094] Optionally, the scheduling module 202 is specifically used to sequentially retrieve data packets from the aging queue and set the retrieved data packets to a discarded state.

[0095] Optionally, the queue information includes an aging count and a queue status. The scheduling module 202 is specifically used to: when the aging count of the normal queue is not greater than the aging threshold, set the queue status of the normal queue to the aging state and clear all data packets in the normal queue; after clearing all data packets in the normal queue, set the queue status of the normal queue to the normal state and set the aging count of the normal queue to the initial value; when the aging count of the normal queue is greater than the aging threshold, forward the data packets in the normal queue and set the aging count of the normal queue to the initial value.

[0096] Optionally, the configuration module 203 is also used to set the initial value according to the priority of the queue, wherein the higher the priority, the larger the initial value.

[0097] Please refer to Figure 4 , Figure 4 This diagram illustrates a block illustration of a network device 10 according to an embodiment of the present invention. The network device 10 can be a router, switch, load balancer, or other device that uses queues to store data packets to be forwarded. The network device 10 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 achieve data transmission or interaction. For example, these components can be electrically connected to each other through one or more communication buses or signal lines.

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

[0099] The processor 120 is used to read / write data or programs stored in the memory 110 and perform corresponding functions. For example, when a computer program stored in the memory 110 is executed by the processor 120, the queue congestion aging method disclosed in the above embodiments can be implemented.

[0100] The communication module 130 is used to establish a communication connection between the network device 10 and other communication terminals through the network, and to send and receive data through the network.

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

[0102] This invention also provides a computer-readable storage medium storing a computer program that, when executed by a processor 120, implements the queue congestion aging method disclosed in the above embodiments.

[0103] In the several embodiments provided by this invention, 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 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.

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

[0105] If the aforementioned functions are implemented as software functional modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this invention, essentially, 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.

[0106] 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 queue congestion aging method, characterized in that, The method includes: Sequentially obtain the queue information of each queue and the on / off status of the preset aging switch; The queue status is updated based on the queue information and the on / off state of the preset aging switch; the queue status includes aging status and normal status. Clear the aging queue whose queue status is the aging state; The normal queues whose queue status is in the normal state are scheduled in descending order of priority; The queue information includes an aging count and a queue status. The preset aging switch includes triggering the aging switch and canceling the aging switch. Updating the queue status based on the queue information and the on / off status of the preset aging switch includes: When the queue status is the aging state and the switch status of cancel aging is on, or when the queue status is the aging state and the queue is empty, the queue status is set to the normal state and the aging count of the queue is set to the initial value. When the queue status is the normal state, the aging count is not greater than the aging threshold, the queue is not empty, and the aging switch is on, the queue status is set to the aging state. When the queue is not empty and the aging count is greater than the aging threshold, the aging count is subtracted from the preset threshold.

2. The queue congestion aging method according to claim 1, characterized in that, The method further includes: Update the switch status of the cancel aging switch or the trigger aging switch based on the switch name and switch status modified by the user.

3. The queue congestion aging method according to claim 1, characterized in that, The queue information includes an aging count and a queue status. Clearing the aging queue whose queue status is the aging state includes: Clear all data packets in the aging queue, set the aging count of the aging queue to the initial value, and set the queue status of the aging queue to the normal state.

4. The queue congestion aging method according to claim 3, characterized in that, Clearing all data packets in the aging queue includes: Data packets are sequentially retrieved from the aging queue, and the retrieved data packets are set to the discard state.

5. The queue congestion aging method according to claim 1, characterized in that, The queue information includes aging counts and queue status. Scheduling normal queues with the queue status in the normal state according to priority from high to low includes: When the aging count of the normal queue is not greater than the aging threshold, the queue state of the normal queue is set to the aging state, and all data packets in the normal queue are cleared; after clearing all data packets in the normal queue, the queue state of the normal queue is set to the normal state, and the aging count of the normal queue is set to the initial value. When the aging count of the normal queue is greater than the aging threshold, the data packets in the normal queue are forwarded, and the aging count of the normal queue is set to the initial value.

6. The queue congestion aging method according to any one of claims 2-5, characterized in that, The initial value is set according to the priority of the queue, wherein the higher the priority, the larger the initial value.

7. A queue congestion aging device, characterized in that, The device includes: A scanning module is used to sequentially acquire queue information and the on / off state of a preset aging switch for each queue. The queue information includes an aging count and a queue state. The preset aging switch includes a trigger aging switch and a cancel aging switch. The module updates the queue state based on the queue information and the on / off state of the preset aging switch, including: when the queue state is the aging state and the cancel aging switch is on, or when the queue state is the aging state and the queue is empty, setting the queue state to the normal state and setting the queue aging count to an initial value; when the queue state is the normal state, the aging count is not greater than an aging threshold, the queue is not empty, and the trigger aging switch is on, setting the queue state to the aging state; when the queue is not empty and the aging count is greater than the aging threshold, subtracting a preset threshold from the aging count; the queue state includes an aging state and a normal state. The scheduling module is used to clear the aging queues whose queue status is the aging state; and to schedule the normal queues whose queue status is the normal state according to their priority from high to low.

8. A network device, characterized in that, The network device includes a memory and a processor, the memory being used to store a computer program, and the processor being used to execute the queue congestion aging method as described in any one of claims 1-6 when the computer program is invoked.

9. 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 queue congestion aging method as described in any one of claims 1-6.