[go: up one dir, main page]

CN102263701B - Queue regulation method and device - Google Patents

Queue regulation method and device Download PDF

Info

Publication number
CN102263701B
CN102263701B CN201110240078.7A CN201110240078A CN102263701B CN 102263701 B CN102263701 B CN 102263701B CN 201110240078 A CN201110240078 A CN 201110240078A CN 102263701 B CN102263701 B CN 102263701B
Authority
CN
China
Prior art keywords
queue
threshold
qos
buffer
borrowed
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201110240078.7A
Other languages
Chinese (zh)
Other versions
CN102263701A (en
Inventor
李建国
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
ZTE Corp
Original Assignee
ZTE Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by ZTE Corp filed Critical ZTE Corp
Priority to CN201110240078.7A priority Critical patent/CN102263701B/en
Publication of CN102263701A publication Critical patent/CN102263701A/en
Priority to PCT/CN2012/077762 priority patent/WO2013026324A1/en
Application granted granted Critical
Publication of CN102263701B publication Critical patent/CN102263701B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/30Flow control; Congestion control in combination with information about buffer occupancy at either end or at transit nodes
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/50Queue scheduling
    • H04L47/62Queue scheduling characterised by scheduling criteria
    • H04L47/6215Individual queue per QOS, rate or priority
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L49/00Packet switching elements
    • H04L49/90Buffering arrangements
    • H04L49/9084Reactions to storage capacity overflow

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

本发明公开了一种队列调整方法及装置,其中,队列调整方法包括:比较当前服务质量QOS出队列的内存空间被占用长度与设定的第一阈值和第二阈值的关系,其中,第一阈值和第二阈值均小于当前QOS出队列的内存空间长度,第一阈值小于第二阈值;若当前QOS出队列的内存空间被占用长度大于第二阈值,则从其它的内存空间被占用长度小于第一阈值的QOS出队列中选择一个队列,其中,当前QOS出队列和其它QOS出队列中均设置有借用缓冲区;将选择的QOS出队列的借用缓冲区借用到当前QOS出队列的队尾。通过本发明,达到了充分利用QOS出队列整体资源,提高服务质量的效果。

The invention discloses a queue adjustment method and device, wherein the queue adjustment method includes: comparing the relationship between the occupied length of the memory space of the current quality of service (QOS) out of the queue and the set first threshold and the second threshold, wherein the first Both the threshold and the second threshold are less than the length of the memory space of the current QOS dequeue, and the first threshold is less than the second threshold; if the occupied length of the memory space of the current QOS dequeue is greater than the second threshold, the occupied length of other memory spaces is less than Select a queue from the QOS out-queue of the first threshold, wherein the current QOS out-of-queue and other QOS out-of-queues are set with borrow buffers; borrow the borrowed buffer of the selected QOS out-of-queue to the tail of the current QOS out-of-queue . Through the present invention, the effect of making full use of the overall resource of the QOS queue and improving the service quality is achieved.

Description

队列调整方法及装置Queue adjustment method and device

技术领域technical field

本发明涉及通信领域,具体而言,涉及一种服务质量(Quality Of Service,QOS)出队列的队列调整方法及装置。The present invention relates to the communication field, in particular, to a queue adjustment method and device for quality of service (Quality Of Service, QOS) dequeue.

背景技术Background technique

服务质量QOS是指允许用户在吞吐量、延迟、抖动、丢包率等方面获得可预期的服务水平的一系列技术的集合。Quality of Service (QOS) refers to a collection of a series of technologies that allow users to obtain predictable service levels in terms of throughput, delay, jitter, and packet loss rate.

对于QOS出队列,端口QOS出队列长度是平均分配来实现的,交换机为所有端口各分配了8个相同长度的队列。目前,QOS出队列技术是当一个QOS出队列满时,放入该队列的报文就会被丢弃,而此时,其他QOS出队列则可能是空闲的。例如,当端口1的某个队列(例如队列7)满时,队列7上的新增加的报文就会被丢弃,这时,该端口的其它队列则有可能是空闲的或者报文很少,此外,其它端口的QOS出队列也可能是空闲的或者报文很少。For QOS outgoing queues, the port QOS outgoing queue lengths are evenly distributed, and the switch allocates 8 queues of the same length to all ports. At present, the QOS dequeuing technology is that when a QOS dequeue is full, the packets put in the queue will be discarded, and at this time, other QOS dequeues may be idle. For example, when a certain queue (such as queue 7) of port 1 is full, the newly added message on queue 7 will be discarded. At this time, other queues of this port may be idle or have few messages , In addition, the QOS queues of other ports may also be idle or have few packets.

可见,在实际的使用中,大多数情况是较少的队列会满,而较多的队列是空闲或者报文很少,队列资源不能充分利用。It can be seen that in actual use, in most cases, fewer queues will be full, while more queues are idle or there are few packets, and the queue resources cannot be fully utilized.

由此,目前的QOS出队列技术方案中存在当部分端口的队列因队列满而导致丢包时,其它的QOS出队列此时可能是空闲或者使用的很少,从而使得QOS出队列在整体上队列资源没有被充分使用的问题。Therefore, in the current QOS dequeuing technical scheme, when the queues of some ports are full and cause packet loss, other QOS dequeues may be idle or rarely used at this time, so that the overall QOS dequeue Queue resources are not fully used.

发明内容Contents of the invention

本发明的主要目的在于提供一种QOS出队列的队列调整方法及装置,以至少解决上述现有QOS出队列在整体上队列资源没有被充分使用的问题。The main purpose of the present invention is to provide a queue adjustment method and device for QOS out-of-queue, so as to at least solve the above-mentioned problem that the existing QOS out-of-queue resources are not fully used as a whole.

根据本发明的一个方面,提供了一种队列调整方法,包括:比较当前服务质量QOS出队列的内存空间被占用长度与设定的第一阈值和第二阈值的关系,其中,第一阈值和第二阈值均小于当前QOS出队列的内存空间长度,第一阈值小于第二阈值;若当前QOS出队列的内存空间被占用长度大于第二阈值,则从其它的内存空间被占用长度小于第一阈值的QOS出队列中选择一个队列,其中,当前QOS出队列和其它QOS出队列中均设置有借用缓冲区;将选择的QOS出队列的借用缓冲区借用到当前QOS出队列的队尾。According to one aspect of the present invention, a queue adjustment method is provided, including: comparing the relationship between the occupied length of the memory space of the current quality of service QOS out of the queue and the set first threshold and the second threshold, wherein the first threshold and The second thresholds are smaller than the length of the memory space of the current QOS queue, and the first threshold is smaller than the second threshold; if the occupied length of the memory space of the current QOS queue is greater than the second threshold, the occupied length of other memory spaces is smaller than the first threshold. Select a queue in the QOS queue of the threshold value, wherein, the current QOS queue and other QOS queues are all provided with borrow buffers; the borrow buffer of the selected QOS queue is borrowed to the tail of the current QOS queue.

优选地,借用缓冲区的长度为:借用缓冲区的长度=QOS出队列长度-第二阈值+(第二阈值-第一阈值)×N%,其中,N为0-100之间的整数。Preferably, the length of the borrowed buffer is: the length of the borrowed buffer=the length of the QOS queue-the second threshold+(the second threshold-the first threshold)×N%, where N is an integer between 0-100.

优选地,队列调整方法还包括:若当前QOS出队列的内存空间被占用长度小于第一阈值,则设置当前QOS出队列为可借用队列,允许向其它QOS出队列供出其借用缓冲区。Preferably, the queue adjustment method further includes: if the occupied length of the memory space of the current QOS dequeue is less than the first threshold, then setting the current QOS dequeue as a borrowable queue, allowing other QOS dequeues to supply their borrow buffers.

优选地,队列调整方法还包括:若当前QOS出队列的内存空间被占用长度小于或等于第二阈值且大于或等于第一阈值,则当前QOS出队列判断其借用缓冲区是否借出;若是,则收回其借用缓冲区,并为借用其借用缓冲区的QOS出队列重新分配借用缓冲区;若否,则设置当前QOS出队列为不可借用队列,拒绝向其它QOS队列借出其借用缓冲区。Preferably, the queue adjustment method also includes: if the occupied length of the memory space of the current QOS out of the queue is less than or equal to the second threshold and greater than or equal to the first threshold, then the current QOS out of the queue judges whether its borrowed buffer is borrowed; if so, Then take back its borrowed buffer, and redistribute the borrowed buffer for the QOS that borrowed its borrowed buffer to go out of the queue; if not, then set the current QOS going out of the queue as a queue that cannot be borrowed, and refuse to lend its borrowed buffer to other QOS queues.

优选地,队列调整方法还包括:当当前QOS出队列的内存空间被占用长度由大于第二阈值减小到小于或等于第二阈值,则当前QOS出队列归还借用的借用缓冲区。Preferably, the queue adjustment method further includes: when the occupied length of the memory space of the current QOS dequeue decreases from greater than the second threshold to less than or equal to the second threshold, then the current QOS dequeues and returns the borrowed buffer.

优选地,队列调整方法还包括:系统保存当前QOS出队列和其借用的借用缓冲区所属的QOS出队列的对应关系,并实时更新。Preferably, the queue adjustment method further includes: the system saves the corresponding relationship between the current QOS out-queue and the QOS out-queue to which the borrowed buffer belongs, and updates it in real time.

根据本发明的另一方面,提供了一种队列调整装置,包括:比较模块,用于比较当前服务质量QOS出队列的内存空间被占用长度与设定的第一阈值和第二阈值的关系,其中,第一阈值和第二阈值均小于当前QOS出队列的内存空间长度,第一阈值小于第二阈值;第一分配模块,用于当比较模块的比较结果为当前QOS出队列的内存空间被占用长度大于第二阈值时,从其它的内存空间被占用长度小于第一阈值的QOS出队列中选择一个队列,其中,当前QOS出队列和其它QOS出队列中均设置有借用缓冲区;将选择的QOS出队列的借用缓冲区借用到当前QOS出队列的队尾。According to another aspect of the present invention, a queue adjustment device is provided, including: a comparison module, which is used to compare the relationship between the occupied length of the memory space of the current quality of service QOS out of the queue and the set first threshold and the second threshold, Wherein, the first threshold and the second threshold are all less than the memory space length of the current QOS out of the queue, and the first threshold is less than the second threshold; the first allocation module is used for when the comparison result of the comparison module is that the memory space of the current QOS out of the queue is When the occupied length is greater than the second threshold, a queue is selected from other QOS queues whose memory space occupied length is less than the first threshold, wherein, the current QOS queue and other QOS queues are all provided with a borrow buffer; The borrow buffer of the QOS dequeue is borrowed to the end of the current QOS dequeue.

优选地,借用缓冲区的长度为:借用缓冲区的长度=QOS出队列长度-第二阈值+(第二阈值-第一阈值)×N%,其中,N为0-100之间的整数。Preferably, the length of the borrowed buffer is: the length of the borrowed buffer=the length of the QOS queue-the second threshold+(the second threshold-the first threshold)×N%, where N is an integer between 0-100.

优选地,队列调整装置还包括:第二分配模块,用于若比较模块的比较结果为当前QOS出队列的内存空间被占用长度小于第一阈值,则设置当前QOS出队列为可借用队列,允许向其它QOS出队列供出其借用缓冲区;和/或,第三分配模块,用于若比较模块的比较结果为当前QOS出队列的内存空间被占用长度小于或等于第二阈值且大于或等于第一阈值,则当前QOS出队列判断其借用缓冲区是否借出;若是,则收回其借用缓冲区,并为借用其借用缓冲区的QOS出队列重新分配借用缓冲区;若否,则设置当前QOS出队列为不可借用队列,拒绝向其它QOS队列借出其借用缓冲区。Preferably, the queue adjustment device also includes: a second allocation module, used to set the current QOS out of the queue as a borrowable queue if the comparison result of the comparison module is that the memory space of the current QOS out of the queue is occupied by a length less than the first threshold, allowing Provide its borrowed buffer to other QOS queues; and/or, the third allocation module, if the comparison result of the comparison module is that the occupied length of the memory space of the current QOS queue is less than or equal to the second threshold and greater than or equal to the second threshold A threshold, then the current QOS out of the queue judges whether its borrowed buffer is borrowed; if it is, then withdraw its borrowed buffer, and redistribute the borrowed buffer for the QOS out of the queue that borrowed its borrowed buffer; if not, set the current QOS The outgoing queue is a non-borrowable queue, and refuses to lend its borrow buffer to other QOS queues.

优选地,队列调整装置还包括:归还模块,用于当当前QOS出队列的内存空间被占用长度由大于第二阈值减小到小于或等于第二阈值,则当前QOS出队列归还借用的借用缓冲区。Preferably, the queue adjustment device further includes: a return module, used for when the occupied length of the memory space of the current QOS dequeue is reduced from greater than the second threshold to less than or equal to the second threshold, then the current QOS dequeues and returns the borrowed buffer Area.

通过本发明,采用对所有QOS出队列都划分出一个可以共享的队列缓冲区,当某个QOS出队列的使用超过第二阈值时,将其它使用队列长度小于第一阈值的QOS出队列中的队列缓冲区借用增加到该队列,使得该队列的长度大于原先初始分配的长度,从而使得当该QOS出队列中的报文超过该QOS出队列初始长度时,报文仍可以缓存在该QOS出队列中,而不会被丢弃,从而解决了现有QOS出队列在整体上队列资源没有被充分使用的问题,进而达到了充分利用QOS出队列整体资源,提高服务质量的效果。Through the present invention, a queue buffer that can be shared is divided into all QOS queues. When the use of a certain QOS queue exceeds the second threshold, other QOS queues whose queue length is less than the first threshold are used. The queue buffer is borrowed and added to the queue, so that the length of the queue is greater than the original initially allocated length, so that when the message in the QOS out queue exceeds the initial length of the QOS out queue, the message can still be cached in the QOS out queue. In the queue, it will not be discarded, thus solving the problem that the existing QOS queue resources are not fully used as a whole, and then achieve the effect of making full use of the overall resources of the QOS queue and improving the quality of service.

附图说明Description of drawings

此处所说明的附图用来提供对本发明的进一步理解,构成本申请的一部分,本发明的示意性实施例及其说明用于解释本发明,并不构成对本发明的不当限定。在附图中:The accompanying drawings described here are used to provide a further understanding of the present invention and constitute a part of the application. The schematic embodiments of the present invention and their descriptions are used to explain the present invention and do not constitute improper limitations to the present invention. In the attached picture:

图1是根据本发明实施例一的一种队列调整方法的步骤流程图;FIG. 1 is a flowchart of steps of a queue adjustment method according to Embodiment 1 of the present invention;

图2是根据本发明实施例二的一种队列调整方法的步骤流程图;FIG. 2 is a flowchart of steps of a queue adjustment method according to Embodiment 2 of the present invention;

图3是根据本发明实施例三的一种队列调整方法中的队列初始分配图;Fig. 3 is a queue initial allocation diagram in a queue adjustment method according to Embodiment 3 of the present invention;

图4是根据本发明实施例三的一种队列调整方法中的缓冲队列管理图;4 is a buffer queue management diagram in a queue adjustment method according to Embodiment 3 of the present invention;

图5是根据本发明实施例三的一种队列调整方法中的队列可借用长度图;FIG. 5 is a graph of queue borrowable lengths in a queue adjustment method according to Embodiment 3 of the present invention;

图6是根据本发明实施例三的一种队列调整方法中的缓冲队列回收图;Fig. 6 is a buffer queue recovery diagram in a queue adjustment method according to Embodiment 3 of the present invention;

图7是根据本发明实施例三的一种队列调整方法中的缓冲队列借用图;7 is a buffer queue borrowing diagram in a queue adjustment method according to Embodiment 3 of the present invention;

图8是根据本发明实施例三的一种队列调整方法中的缓冲队列归还图;FIG. 8 is a buffer queue return diagram in a queue adjustment method according to Embodiment 3 of the present invention;

图9是根据本发明实施例三的一种队列调整方法中的缓冲队列借用管理图;FIG. 9 is a management diagram of buffer queue borrowing in a queue adjustment method according to Embodiment 3 of the present invention;

图10是根据本发明实施例四的一种队列调整装置的结构框图。Fig. 10 is a structural block diagram of a queue adjustment device according to Embodiment 4 of the present invention.

具体实施方式detailed description

下文中将参考附图并结合实施例来详细说明本发明。需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互组合。Hereinafter, the present invention will be described in detail with reference to the drawings and examples. It should be noted that, in the case of no conflict, the embodiments in the present application and the features in the embodiments can be combined with each other.

实施例一Embodiment one

参照图1,示出了根据本发明实施例一的一种队列调整方法的步骤流程图。Referring to FIG. 1 , it shows a flowchart of steps of a queue adjustment method according to Embodiment 1 of the present invention.

本实施例的队列调整方法包括以下步骤:The queue adjustment method in this embodiment includes the following steps:

步骤S102:比较当前QOS出队列的内存空间被占用长度与设定的第一阈值和第二阈值的关系;Step S102: compare the relationship between the occupied length of the memory space of the current QOS queue and the set first threshold and the second threshold;

其中,第一阈值和第二阈值均小于当前QOS出队列的内存空间长度,并且,第一阈值小于第二阈值。Wherein, both the first threshold and the second threshold are smaller than the memory space length of the current QOS dequeuing, and the first threshold is smaller than the second threshold.

本实施例中,一个端口的所有QOS出队列中均设置有借用缓冲区,当一个QOS出队列空闲或使用的很少时,其借用缓冲区可以借出给其它QOS出队列使用;相反当一个QOS出队列很满时,则可以借用其它可借用的借用缓冲区来增加队列长度,扩展队列空间。In this embodiment, all the QOS queues of a port are provided with borrow buffers. When a QOS queue is idle or rarely used, its borrow buffer can be lent to other QOS queues; When the QOS outgoing queue is very full, other borrowable buffers can be borrowed to increase the queue length and expand the queue space.

在本实施例中,当队列空间占用长度小于第一阈值时,说明该队列较空闲,还有较多的空闲队列空间可被使用,可以向其它队列借出;当队列占用空间长度大于等于第一阈值且小于等于第二阈值时,说明该队列较忙,不能向其它队列借出其借用缓冲区,且有可能向其它队列借用可借用的借用缓冲区;当队列占用空间长度大于第二阈值时,则说明该队列很忙,需要向其它可借出缓冲区的队列借用相应的借用缓冲区。In this embodiment, when the queue space occupied length is less than the first threshold, it indicates that the queue is relatively idle, and there is still more free queue space that can be used and can be borrowed from other queues; when the queue occupied space length is greater than or equal to the first threshold When a threshold is less than or equal to the second threshold, it means that the queue is busy and cannot lend its borrowed buffer to other queues, and it is possible to borrow borrowed buffers from other queues; when the length of the queue occupied space is greater than the second threshold , it means that the queue is very busy and needs to borrow corresponding borrow buffers from other queues that can lend buffers.

步骤S104:若当前QOS出队列的内存空间被占用长度大于第二阈值,则从其它的内存空间被占用长度小于第一阈值的QOS出队列中选择一个队列;Step S104: If the occupied length of the memory space of the current QOS out-queue is greater than the second threshold, select a queue from other QOS out-queues whose memory space occupied length is less than the first threshold;

其中,当前QOS出队列和其它QOS出队列中均设置有借用缓冲区,该借用缓冲区是一个共享缓冲区,可以在必要时向其它QOS出队列借出。Wherein, both the current QOS exit queue and other QOS exit queues are provided with a borrow buffer, and the borrow buffer is a shared buffer that can be borrowed from other QOS exit queues when necessary.

步骤S106:将选择的QOS出队列的借用缓冲区借用到当前QOS出队列的队尾。Step S106: Borrow the borrow buffer of the selected QOS exit queue to the tail of the current QOS exit queue.

通过将选择的QOS出队列的借用缓冲区借用到当前QOS出队列的队尾,可以扩展当前QOS出队列的缓存空间,以便于缓存更多的报文。借用的方式可以由本领域技术人员根据实际情况灵活设置,如使用链表方式,或使用表格记录方式等等,只要能够确定提供的借用缓冲区的地址,以便于存储报文数据即可。By borrowing the borrow buffer of the selected QOS dequeue to the end of the current QOS dequeue, the buffer space of the current QOS dequeue can be expanded so as to buffer more messages. The method of borrowing can be flexibly set by those skilled in the art according to the actual situation, such as using a linked list method, or using a table record method, etc., as long as the address of the provided borrowing buffer can be determined to store message data.

相关技术中,QOS出队列技术方案中存在当部分端口的队列因队列满而导致丢包时,其它的QOS出队列此时可能是空闲或者使用的很少,从而使得QOS出队列在整体上队列资源没有被充分使用。通过本实施例,采用对所有QOS出队列都划分出一个可以共享的队列缓冲区,当某个QOS出队列的使用超过第二阈值时,将其它使用队列长度小于第一阈值的QOS出队列中的队列缓冲区借用增加到该队列,使得该队列的长度大于原先初始分配的长度,从而使得当该QOS出队列中的报文超过该QOS出队列初始长度时,报文仍可以缓存在该QOS出队列中,而不会被丢弃,从而解决了现有QOS出队列在整体上队列资源没有被充分使用的问题,进而达到了充分利用QOS出队列整体资源,提高服务质量的效果。In related technologies, in the QOS out-of-queue technical solution, when the queues of some ports are full and cause packet loss, other QOS out-of-queues may be idle or rarely used at this time, so that the QOS out-of-queue queues in the overall queue Resources are underutilized. Through this embodiment, a queue buffer that can be shared is divided into all QOS dequeues. When the use of a certain QOS dequeue exceeds the second threshold, other QOS dequeues whose queue length is less than the first threshold are dequeued. The queue buffer of the queue is borrowed and added to the queue, so that the length of the queue is greater than the original initial allocation length, so that when the message in the QOS out-queue exceeds the initial length of the QOS out-queue, the message can still be cached in the QOS In the queue, it will not be discarded, thus solving the problem that the existing QOS queue resources are not fully used on the whole, and then achieve the effect of making full use of the overall resources of the QOS queue and improving the quality of service.

实施例二Embodiment two

参照图2,示出了根据本发明实施例二的一种队列调整方法的步骤流程图。Referring to FIG. 2 , it shows a flowchart of steps of a queue adjustment method according to Embodiment 2 of the present invention.

本实施例中,对所有QOS出队列都划分出一个可以共享的队列缓冲区,在某个队列满时,借用其它的空闲队列来增加该队列的长度,减少丢包数量,提供更好的QOS服务。In this embodiment, a queue buffer that can be shared is divided into all QOS outgoing queues. When a queue is full, other idle queues are used to increase the length of the queue, reduce the number of lost packets, and provide better QOS Serve.

本实施例的队列调整方法包括以下步骤:The queue adjustment method in this embodiment includes the following steps:

步骤S202:针对每个端口的每个QOS出队列,分别设置最小缓冲归还阀值(即第一阈值)和最大缓冲借用阀值(即第二阈值)。Step S202: For each QOS dequeue of each port, set the minimum buffer return threshold (ie, the first threshold) and the maximum buffer borrowing threshold (ie, the second threshold).

步骤S204:将所有QOS出队列中使用的队列长度未超过最小缓冲归还阀值的队列,由软件统一管理;对于已经借用的队列,记录借用与被借用的关系,由软件系统统一管理。Step S204: All the queues whose queue length used in the QOS dequeue does not exceed the minimum buffer return threshold are managed by the software; for the queues that have been borrowed, the relationship between borrowing and being borrowed is recorded and managed by the software system.

其中,可以采用链表的方式对所有QOS出队列中使用的队列长度未超过最小缓冲归还阀值的队列进行统一管理,也可以采用表格登记的方式进行统一管理,当然,本领域技术人员也可以采用其它适当方式,本发明对此不作限制。通过对所有QOS出队列中使用的队列长度未超过最小缓冲归还阀值的队列的统一管理,可以在有QOS出队列需要借用其它队列的缓存空间时,方便快捷地获取和提供可借出缓存空间的队列,并且,也便于实时了解和获取可借出缓存空间的队列的情况,提高系统效率。Among them, the queues whose queue lengths used in all QOS output queues do not exceed the minimum buffer return threshold can be uniformly managed by means of linked lists, or can be managed uniformly by means of table registration. Of course, those skilled in the art can also use Other suitable ways, the present invention is not limited thereto. Through the unified management of the queue length used in all QOS queues that do not exceed the minimum buffer return threshold, it is possible to obtain and provide loanable cache space conveniently and quickly when there is a QOS queue that needs to borrow cache space from other queues In addition, it is also convenient to understand and obtain the situation of the queues that can lend buffer space in real time, and improve system efficiency.

对于已经借用的队列,借用缓存空间的队列和被借用缓存空间的队列之间存在一一对应的关系,及时记录该关系,一方面可以及时了解队列中借用和被借用的情况,另一方面,在借用缓存空间的队列不再需要借用时,可以及时有效地归还被借用的借用缓冲区给相应的队列。For the queues that have been borrowed, there is a one-to-one correspondence between the queues that borrow the cache space and the queues that are borrowed. Record this relationship in time. On the one hand, you can keep track of the borrowing and borrowing in the queue. On the other hand, When the queue that borrows the cache space no longer needs to borrow, the borrowed buffer can be returned to the corresponding queue in a timely and effective manner.

每个QOS出队列可供借用的长度可以为大于最大缓冲借用阀值的剩余队列。优选地,每个QOS出队列可供借用的长度可以由两部分组成,一部分是大于最大缓冲借用阀值的剩余队列,另一部分是最大缓冲借用阀值与最小缓冲归还阀值的差值乘以可以配置的百分比的空间长度。The borrowable length of each QOS outqueue can be the remaining queue greater than the maximum buffer borrowing threshold. Preferably, the borrowable length of each QOS queue can be composed of two parts, one part is the remaining queue greater than the maximum buffer borrow threshold, and the other part is the difference between the maximum buffer borrow threshold and the minimum buffer return threshold multiplied by A configurable percentage of the space length.

步骤S206:根据当前QOS出队列的内存空间被占用长度,进行相应的队列调整处理。Step S206: Perform corresponding queue adjustment processing according to the occupied length of the memory space of the current QOS out-queue.

具体地,specifically,

当队列的使用超过最小缓冲归还阀值,将该队列的借用缓冲区设置为不可借用。如果该队列的借用缓冲区已经借出,则需要收回,可从系统中重新分配一个队列的借用缓冲区给借用者使用。When the usage of the queue exceeds the minimum buffer return threshold, the borrow buffer of the queue is set to be unborrowable. If the borrowed buffer of the queue has been borrowed, it needs to be withdrawn, and the borrowed buffer of a queue can be reallocated from the system to the borrower.

当队列的使用由最小缓冲归还阀值变为超过最大缓冲借用阀值,从空闲缓冲队列列表中找出一个借用,增加该队列的长度。空闲缓冲队列的查找优先选用借用队列所在端口的其它队列,如果其它队列不能借出或者已经借出,再选用其它端口的队列借用。When the use of the queue changes from the minimum buffer return threshold to exceeding the maximum buffer borrow threshold, a borrow is found from the idle buffer queue list, and the length of the queue is increased. The search for the idle buffer queue gives priority to other queues on the port where the borrowed queue is located. If other queues cannot be borrowed or have already been borrowed, the queues on other ports are used to borrow.

当队列的使用由超过最大缓冲借用阀值变为小于最大缓冲借用阀值,归还借用的借用缓冲区。When the usage of the queue changes from exceeding the maximum buffer borrowing threshold to being less than the maximum buffer borrowing threshold, the borrowed buffer is returned.

当队列的使用由超过最小缓冲归还阀值变为小于最小缓冲归还阀值,将该队列的借用缓冲区设置为可借用。When the usage of the queue changes from exceeding the minimum buffer return threshold to being less than the minimum buffer return threshold, the borrow buffer of the queue is set as available for borrowing.

通过本实施例提供的具有动态调整队列大小的方案,针对每个端口的每个QOS出队列,分别设置最小缓冲归还阀值(本文中也简称为最小阀值)和最大缓冲借用阀值(本文中也简称为最大阀值),并将超出最大阀值的那部分队列以及最小阀值和最大阀值之间的部分队列共同设置为可以借用的队列(本文中也称之为缓冲队列),当端口的使用队列长度超过最小阀值,则上报软件指明该队列不能借出缓冲队列(默认所有端口都是可以借出缓冲队列的)。当队列长度超过最大阀值,软件可以检测还有哪些端口的缓冲队列可以借用,查到之后将空闲的缓冲队列借用到繁忙队列上,增加该队列的长度,减少空闲队列长度,一旦空闲队列的开始繁忙起来了,即使用队列长度超过最小阀值,借用的缓冲要予以归还。为了防止缓冲震荡,每个队列可以设定了一个高位的最大阀值,一个低位的最小阀值,使用队列长度由最小阀值增加到最大阀值时,触发高位,使用队列长度由最大阀值减小到最小阀值时,触发低位。Through the scheme of dynamically adjusting the queue size provided by this embodiment, for each QOS queue of each port, the minimum buffer return threshold (also referred to as the minimum threshold in this paper) and the maximum buffer borrowing threshold (this paper) are respectively set. is also referred to as the maximum threshold), and the part of the queue that exceeds the maximum threshold and the part of the queue between the minimum threshold and the maximum threshold are jointly set as queues that can be borrowed (also referred to as buffer queues in this article), When the length of the used queue of the port exceeds the minimum threshold, the reporting software indicates that the queue cannot lend out the buffer queue (by default, all ports can lend out the buffer queue). When the queue length exceeds the maximum threshold, the software can detect which other port buffer queues can be borrowed. After finding out, borrow the idle buffer queue to the busy queue, increase the length of the queue, and reduce the length of the idle queue. It starts to get busy, even if the queue length exceeds the minimum threshold, the borrowed buffer must be returned. In order to prevent buffer shocks, each queue can set a high maximum threshold and a low minimum threshold. When the queue length increases from the minimum threshold to the maximum threshold, the high level is triggered, and the queue length is increased from the maximum threshold. When it decreases to the minimum threshold, the low bit is triggered.

与现有技术相比较,本实施例通过共享队列的部分资源,动态调整队列大小,使队列资源利用更充分。当某个队列的使用超过最大阀值时,将其它使用队列长度小于最小阀值的缓冲队列增加到该队列,使得该队列的长度大于原先初始分配的长度,当队列中的报文超过队列初始长度时,报文仍可以缓存在该队列中,而不会被丢弃,从而提高了服务质量。Compared with the prior art, this embodiment dynamically adjusts the size of the queue by sharing part of the resources of the queue, so that the resource utilization of the queue is more fully utilized. When the use of a certain queue exceeds the maximum threshold, add other buffer queues whose queue length is less than the minimum threshold to the queue, so that the length of the queue is greater than the original initial allocation length. When the length is long, the packets can still be buffered in the queue without being discarded, thereby improving the quality of service.

实施例三Embodiment Three

本实施例中,以一个QOS出队列的队列使用动态变化过程中的队列调整为例,详细说明本发明QOS队列调整方法。In this embodiment, the QOS queue adjustment method of the present invention is described in detail by taking the queue adjustment during the dynamic change process of a QOS out-queue queue usage as an example.

首先,参照图3,示出了根据本发明实施例三的一种队列调整方法中的队列初始分配图。如图3所示,本实施例将每个QOS出队列划分为三部分:小于最小阀值(即第一阈值)的部分(图中竖条纹部分)、最小阀值与最大阀值(即第二阈值)之间部分(图中斜条纹部分)和大于最大阀值部分(图中斜条纹部分后面的剩余队列,即十字条纹部分)。First, referring to FIG. 3 , it shows a queue initial allocation diagram in a queue adjustment method according to Embodiment 3 of the present invention. As shown in Figure 3, the present embodiment divides each QOS dequeuing into three parts: the part (vertical stripe part in the figure) that is less than the minimum threshold (ie the first threshold), the minimum threshold and the maximum threshold (ie the first threshold) The part between the two thresholds (the diagonal stripe part in the figure) and the part greater than the maximum threshold (the remaining queue behind the diagonal stripe part in the figure, that is, the cross stripe part).

其中,当队列的内存空间被占用长度位于小于最小阀值部分时,即,当队列的使用小于最小阀值时,将队列设置为可借用队列,允许向其它QOS出队列借出其缓存;当队列的内存空间被占用长度位于最小阀值与最大阀值之间部分时,即,当队列的使用介于最小阀值和最大阀值之间时,该队列设置为不可借用队列,此时,拒绝向其它QOS出队列借出其缓存;当队列的内存空间被占用长度位于大于最大阀值部分时,即,当队列的使用大于最大阀值后,说明该队列的使用快要达到队列的最大值,因此需要从别的队列借用,来增加该队列可供使用的长度。Among them, when the occupied length of the memory space of the queue is less than the minimum threshold, that is, when the use of the queue is less than the minimum threshold, the queue is set as a borrowable queue, allowing to lend its cache to other QOS queues; when When the occupied length of the memory space of the queue is between the minimum threshold and the maximum threshold, that is, when the usage of the queue is between the minimum threshold and the maximum threshold, the queue is set as a non-borrowable queue. At this time, Refuse to lend its cache to other QOS queues; when the occupied length of the memory space of the queue is greater than the maximum threshold, that is, when the usage of the queue is greater than the maximum threshold, it means that the usage of the queue is about to reach the maximum value of the queue , so it needs to be borrowed from other queues to increase the available length of the queue.

参照图4,示出了根据本发明实施例三的一种队列调整方法中的缓冲队列管理图。如图4所示,本实施例在系统初始阶段,将所有空闲队列(即队列内存空间占用长度小于最小阀值的队列)都管理起来,连成一个可供借用的链表,该链表只记录该队列使用小于最小阀值的队列。同时,将所有借用队列和被借用队列连成一个链表,记录链表的借用情况和被借用情况,便于借用后归还。Referring to FIG. 4 , it shows a buffer queue management diagram in a queue adjustment method according to Embodiment 3 of the present invention. As shown in Figure 4, in the initial stage of the system, this embodiment manages all idle queues (that is, queues whose memory space occupation length is less than the minimum threshold), and connects them into a linked list available for borrowing, and the linked list only records the Queues use queues smaller than the minimum threshold. At the same time, all the borrowing queues and borrowed queues are connected into a linked list, and the borrowing and borrowing status of the linked list are recorded, which is convenient for returning after borrowing.

参照图5,示出了根据本发明实施例三的一种队列调整方法中的队列可借用长度图。如图5所示,本实施例设计可供借用的队列长度的计算,获取可供借用的队列。队列可供借用的长度由两部分组成,一部分是大于最大阀值的剩余队列,另一部分是最大阀值与最小阀值差值乘以可以配置的百分比,该百分比可以配置,根据实际使用情况进行调节。可供借用的长度的位置从队列的尾部向前分配,如图中的横条纹部分。Referring to FIG. 5 , it shows a queue borrowable length diagram in a queue adjustment method according to Embodiment 3 of the present invention. As shown in FIG. 5 , this embodiment designs the calculation of the length of the queues available for borrowing, and acquires the queues available for borrowing. The length of the queue that can be borrowed is composed of two parts, one is the remaining queue that is greater than the maximum threshold, and the other is the difference between the maximum threshold and the minimum threshold multiplied by a configurable percentage, which is configurable and determined according to the actual usage adjust. The position of the length available for borrowing is allocated from the tail of the queue forward, as shown in the horizontal stripes in the figure.

具体地,可借用队列长度=队列长度-最大阀值+(最大阀值-最小阀值)*N%,其中,N的大小为0-100之间的整数,可以根据实际需要灵活配置。Specifically, the borrowable queue length=queue length-maximum threshold+(maximum threshold-minimum threshold)*N%, where N is an integer between 0-100 and can be flexibly configured according to actual needs.

参照图6,示出了根据本发明实施例三的一种队列调整方法中的缓冲队列回收图。Referring to FIG. 6 , it shows a buffer queue reclamation diagram in a queue adjustment method according to Embodiment 3 of the present invention.

如图6所示,当队列(例如端口1的队列7)使用的内存空间由小于最小阀值增加到大于最小阀值时,需要将该队列设置为不可借用队列。如果该队列没有被其它队列借用,即该队列在可供借用的队列中,将该队列从可供借用的队列中取出,即该队列不能再被借用;如果该队列已经被其它队列所借用,则强行收回该队列借出的队列,从已借用队列表中删除,同时,再为借用该队列的队列从可借用队列中重新分配一个可借用队列。As shown in FIG. 6 , when the memory space used by a queue (for example, queue 7 of port 1 ) increases from less than the minimum threshold to greater than the minimum threshold, the queue needs to be set as a non-borrowable queue. If the queue is not borrowed by other queues, that is, the queue is in the queue available for borrowing, take the queue out of the queue available for borrowing, that is, the queue can no longer be borrowed; if the queue has been borrowed by other queues, Then forcibly take back the queue borrowed by the queue, delete it from the borrowed queue list, and at the same time, re-allocate a borrowable queue from the borrowable queues for the queue that borrowed the queue.

具体地,包括:Specifically, including:

步骤S602:从可借用队列中,查找该队列,如果找到,说明该队列没有被借用,将该队列从可借用队列中删除,不再执行后面的步骤;如果没有找到,执行步骤S604。Step S602: Search for the queue from the borrowable queue, if found, it means that the queue is not borrowed, delete the queue from the borrowable queue, and do not perform the following steps; if not found, execute step S604.

步骤S604:该队列已经被借用,从已借用关系表中查找该队列,找到借用该队列的借用者,从借用者收回该借用队列。Step S604: the queue has been borrowed, the queue is searched from the borrowed relationship table, the borrower who borrows the queue is found, and the borrowed queue is withdrawn from the borrower.

步骤S606:给借用本队列的借用者从可借用队列中重新借用一个队列,如果可借用队列为空,借用者将借用不到队列。Step S606: Borrow a new queue from the borrowable queue for the borrower who borrowed this queue. If the borrowable queue is empty, the borrower will not be able to borrow the queue.

参照图7,示出了根据本发明实施例三的一种队列调整方法中的缓冲队列借用图。Referring to FIG. 7 , it shows a buffer queue borrowing diagram in a queue adjustment method according to Embodiment 3 of the present invention.

如图7所示,当队列(如图中端口1的队列7)使用的内存空间由小于最大阀值到超过最大阀值后,该队列的使用快要超过队列的最大值,需要借用其它队列来增加队列的大小,从可借用队列中查找一个可供借用的队列(如图中的端口1的队列6),将借用的队列放入当前队列的尾部,增加队列的长度,同时减小借用队列的长度。As shown in Figure 7, when the memory space used by a queue (queue 7 of port 1 in the figure) changes from less than the maximum threshold to exceeding the maximum threshold, the usage of the queue is about to exceed the maximum value of the queue, and other queues need to be borrowed to Increase the size of the queue, find a queue that can be borrowed from the borrowable queue (queue 6 of port 1 in the figure), put the borrowed queue at the end of the current queue, increase the length of the queue, and reduce the borrowed queue at the same time length.

具体地,包括:Specifically, including:

步骤S702:从可借用队列中找出一个可供借用的队列(如图中的端口1的队列6),如果找不到可供借用的队列,不做任何操作,即下面的步骤不用执行;如果找到可供借用的队列,进行步骤S704。Step S702: Find a queue that can be borrowed from the queues that can be borrowed (queue 6 of port 1 in the figure), if no queue can be found for borrowing, do nothing, that is, the following steps do not need to be executed; If a queue available for borrowing is found, go to step S704.

步骤S704:将借用队列(如图中的端口1的队列6)从可供借用队列中删除,防止其它队列借用。Step S704: Delete the borrowing queue (queue 6 of port 1 in the figure) from the available queues to prevent other queues from borrowing.

当然,在实际操作中,也可以通过其它方式,如对该借用队列进行标记的方式,以区别其是否被借出。Of course, in actual operation, other ways, such as marking the borrowing queue, can also be used to distinguish whether it is borrowed or not.

步骤S706:将借用队列(如图中的端口1的队列7)和被借用队列(如图中的端口1的队列6)加入到借用队列关系表。Step S706: Add the borrowing queue (queue 7 of port 1 in the figure) and the borrowed queue (queue 6 of port 1 in the figure) into the borrowing queue relationship table.

步骤S708:将被借用队列(如图中端口1的队列6)增加到借用队列(如图中端口1的队列7)的尾部,增加队列的长度。Step S708: Add the borrowed queue (such as queue 6 of port 1 in the figure) to the end of the borrowing queue (such as queue 7 of port 1 in the figure), and increase the length of the queue.

参照图8,示出了根据本发明实施例三的一种队列调整方法中的缓冲队列归还图。Referring to FIG. 8 , it shows a buffer queue return diagram in a queue adjustment method according to Embodiment 3 of the present invention.

如图8所示,当队列(如图中端口1的队列7)使用的内存空间由大于最大阀值降低到小于最大阀值后,该队列的长度足够使用,需要归还已借用的其它队列,更新队列借用关系表。As shown in Figure 8, when the memory space used by the queue (queue 7 of port 1 in the figure) is reduced from greater than the maximum threshold to less than the maximum threshold, the length of the queue is sufficient, and other queues that have been borrowed need to be returned. Update the queue borrowing relationship table.

具体地,包括:Specifically, including:

步骤S802:检查队列借用关系表,查找是否有该队列借用其它队列的记录,如果有,执行步骤S804;如果没有,不做任何操作,即下面的步骤不用执行。Step S802: Check the queue borrowing relationship table to find out whether there is a record of the queue borrowing other queues, if yes, execute step S804; if not, do nothing, that is, the following steps do not need to be executed.

步骤S804:将被借用队列(如图中的端口1的队列6)从借用队列(如图中的端口1的队列7)的尾部去掉,归还给被借用队列。Step S804: Remove the borrowed queue (queue 6 of port 1 in the figure) from the end of the borrowing queue (queue 7 of port 1 in the figure) and return it to the borrowed queue.

步骤S806:将借用队列关系表中,借用队列和被借用队列的借用关系删除。Step S806: Delete the borrowing relationship between the borrowing queue and the borrowed queue in the borrowing queue relationship table.

步骤S808:将被借用队列(如图中端口1的队列6)增加到可供借用队列链表中,需要借用队列的其它队列可以借用该队列。Step S808: Add the queue to be borrowed (for example, the queue 6 of port 1 in the figure) to the list of queues available for borrowing, and other queues that need to borrow the queue can borrow the queue.

参照图9,示出了根据本发明实施例三的一种队列调整方法中的缓冲队列借用管理图。Referring to FIG. 9 , it shows a buffer queue borrowing management diagram in a queue adjustment method according to Embodiment 3 of the present invention.

如图9所示,当队列(如图中端口1的队列7)使用的内存空间由大于最小阀值降低到小于最小阀值后,该队列的使用比较空闲,可设置为可借用队列,增加到可借用队列的链表中。As shown in Figure 9, when the memory space used by the queue (queue 7 of port 1 in the figure) is reduced from greater than the minimum threshold to less than the minimum threshold, the queue is relatively idle and can be set as a borrowable queue, increasing to the linked list of the borrowable queue.

通过本实施例,采用共享每个QOS出队列的部分资源,动态调整队列大小,使队列资源利用更充分,提高了服务质量。Through this embodiment, the queue size is dynamically adjusted by sharing part of the resources out of each QOS queue, so that the queue resources are more fully utilized and the service quality is improved.

实施例四Embodiment four

参照图10,示出了根据本发明实施例四的一种队列调整装置的结构框图。Referring to FIG. 10 , it shows a structural block diagram of a queue adjustment device according to Embodiment 4 of the present invention.

本实施例的队列调整装置包括:比较模块1002,用于比较当前QOS出队列的内存空间被占用长度与设定的第一阈值和第二阈值的关系,其中,第一阈值和第二阈值均小于当前QOS出队列的内存空间长度,第一阈值小于第二阈值;第一分配模块1004,用于当比较模块1002的比较结果为当前QOS出队列的内存空间被占用长度大于第二阈值时,从其它的内存空间被占用长度小于第一阈值的QOS出队列中选择一个队列,其中,当前QOS出队列和其它QOS出队列中均设置有借用缓冲区;将选择的QOS出队列的借用缓冲区借用到当前QOS出队列的队尾。The queue adjustment device of this embodiment includes: a comparison module 1002, which is used to compare the relationship between the occupied length of the memory space of the current QOS dequeue and the set first threshold and the second threshold, wherein the first threshold and the second threshold are both Less than the memory space length of the current QOS dequeue, the first threshold is less than the second threshold; the first allocation module 1004, when the comparison result of the comparison module 1002 is that the occupied length of the memory space of the current QOS dequeue is greater than the second threshold, Select a queue from other QOS out-queues whose memory space occupied length is less than the first threshold, wherein, the current QOS out-queue and other QOS out-queues are all provided with a borrow buffer; the borrowed buffer of the selected QOS out of the queue Borrow to the tail of the current QOS queue.

优选地,借用缓冲区的长度为:借用缓冲区的长度=QOS出队列长度-所述第二阈值+(所述第二阈值-所述第一阈值)×N%,其中,N为0-100之间的整数。Preferably, the length of the borrow buffer is: the length of the borrow buffer=QOS queue length-the second threshold+(the second threshold-the first threshold)×N%, wherein, N is 0- Integer between 100.

优选地,本实施例的队列调整装置还包括:第二分配模块1006,用于若比较模块1002的比较结果为当前QOS出队列的内存空间被占用长度小于第一阈值,则设置当前QOS出队列为可借用队列,允许向其它QOS出队列供出其借用缓冲区;和/或,第三分配模块1008,用于若比较模块1002的比较结果为当前QOS出队列的内存空间被占用长度小于或等于第二阈值且大于或等于第一阈值,则当前QOS出队列判断其借用缓冲区是否借出;若是,则收回其借用缓冲区,并为借用其借用缓冲区的QOS出队列重新分配借用缓冲区;若否,则设置当前QOS出队列为不可借用队列,拒绝向其它QOS队列借出其借用缓冲区。Preferably, the queue adjustment device of this embodiment further includes: a second distribution module 1006, configured to set the current QOS queue out if the length of the memory space occupied by the current QOS out of the queue is less than the first threshold if the comparison result of the comparison module 1002 For a borrowable queue, it is allowed to provide its borrowed buffer to other QOS queues; and/or, the third distribution module 1008 is used for if the comparison result of the comparison module 1002 is that the occupied length of the memory space of the current QOS queue is less than or equal to The second threshold is greater than or equal to the first threshold, then the current QOS out of the queue judges whether its borrowed buffer is lent; ; If not, set the current QOS out queue as a non-borrowable queue, and refuse to lend its borrow buffer to other QOS queues.

优选地,本实施例的队列调整装置还包括:归还模块,用于当当前QOS出队列的内存空间被占用长度由大于第二阈值减小到小于或等于第二阈值,则当前QOS出队列归还借用的借用缓冲区。Preferably, the queue adjustment device of this embodiment also includes: a return module, used to return the current QOS out of the queue when the occupied length of the memory space of the current QOS out of the queue is reduced from greater than the second threshold to less than or equal to the second threshold The borrow buffer for borrowing.

优选地,本实施例的队列调整装置还包括:保存模块,用于系统保存当前QOS出队列和其借用的借用缓冲区所属的QOS出队列的对应关系,并实时更新。Preferably, the queue adjustment device of this embodiment further includes: a saving module, used for the system to save the corresponding relationship between the current QOS out-queue and the QOS out-queue to which the borrowed buffer belongs, and update it in real time.

本实施例实现的方法可以参照前述相应方法实施例的相关描述,并具有上述实施例的有益效果,在此不再赘述。For the method implemented in this embodiment, reference may be made to the related descriptions of the aforementioned corresponding method embodiments, and it has the beneficial effects of the aforementioned embodiments, so details are not repeated here.

从以上的描述中,可以看出,本发明提供的QOS出队列在分布式交换机上的队列调整技术方案,根据QOS出队列的队列使用情况进行动态的调整,通过共享队列的部分资源,使队列资源利用更充分。尤其当某个队列的使用超过最大阀值时,将其它使用队列长度小于最小阀值的缓冲队列增加到该队列,使得该队列的长度大于原先初始分配的长度,当队列中的报文超过队列初始长度时,报文仍可以缓存在该队列中,而不会被丢弃,从而提高了服务质量。From the above description, it can be seen that the QOS out-queue queue adjustment technical solution on the distributed switch provided by the present invention dynamically adjusts according to the queue usage of the QOS out-queue, and by sharing some resources of the queue, the queue Resources are more fully utilized. Especially when the use of a certain queue exceeds the maximum threshold, add other buffer queues whose queue length is less than the minimum threshold to the queue, so that the length of the queue is greater than the original initial allocation length. When the packets in the queue exceed the queue When the original length is set, the packets can still be buffered in the queue without being discarded, thus improving the quality of service.

显然,本领域的技术人员应该明白,上述的本发明的各模块或各步骤可以用通用的计算装置来实现,它们可以集中在单个的计算装置上,或者分布在多个计算装置所组成的网络上,可选地,它们可以用计算装置可执行的程序代码来实现,从而,可以将它们存储在存储装置中由计算装置来执行,并且在某些情况下,可以以不同于此处的顺序执行所示出或描述的步骤,或者将它们分别制作成各个集成电路模块,或者将它们中的多个模块或步骤制作成单个集成电路模块来实现。这样,本发明不限制于任何特定的硬件和软件结合。Obviously, those skilled in the art should understand that each module or each step of the above-mentioned present invention can be realized by a general-purpose computing device, and they can be concentrated on a single computing device, or distributed in a network formed by multiple computing devices Alternatively, they may be implemented in program code executable by a computing device so that they may be stored in a storage device to be executed by a computing device, and in some cases in an order different from that shown here The steps shown or described are carried out, or they are separately fabricated into individual integrated circuit modules, or multiple modules or steps among them are fabricated into a single integrated circuit module for implementation. As such, the present invention is not limited to any specific combination of hardware and software.

以上所述仅为本发明的优选实施例而已,并不用于限制本发明,对于本领域的技术人员来说,本发明可以有各种更改和变化。凡在本发明的精神和原则之内,所作的任何修改、等同替换、改进等,均应包含在本发明的保护范围之内。The above descriptions are only preferred embodiments of the present invention, and are not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and changes. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principles of the present invention shall be included within the protection scope of the present invention.

Claims (10)

1.一种队列调整方法,其特征在于,包括:1. A queue adjustment method, characterized in that, comprising: 比较当前服务质量QOS出队列的内存空间被占用长度与设定的第一阈值和第二阈值的关系,其中,所述第一阈值和所述第二阈值均小于所述当前QOS出队列的内存空间长度,所述第一阈值小于所述第二阈值;Comparing the relationship between the occupied length of the memory space of the current quality of service QOS out of the queue and the set first threshold and the second threshold, wherein the first threshold and the second threshold are smaller than the memory of the current QOS out of the queue a spatial length, the first threshold being smaller than the second threshold; 若所述当前QOS出队列的内存空间被占用长度大于所述第二阈值,则从其它的内存空间被占用长度小于所述第一阈值的QOS出队列中选择一个队列,其中,所述当前QOS出队列和其它QOS出队列中均设置有借用缓冲区;If the occupied length of the memory space of the current QOS dequeue is greater than the second threshold, select a queue from other QOS dequeues whose memory space occupied length is less than the first threshold, wherein the current QOS Borrowing buffers are set in the outgoing queue and other QOS outgoing queues; 将选择的所述QOS出队列的所述借用缓冲区借用到所述当前QOS出队列的队尾。Borrowing the borrow buffer of the selected QOS dequeue to the tail of the current QOS dequeue. 2.根据权利要求1所述的方法,其特征在于,所述借用缓冲区的长度为:2. The method according to claim 1, wherein the length of the borrow buffer is: 所述借用缓冲区的长度=QOS出队列长度-所述第二阈值+(所述第二阈值-所述第一阈值)×N%,其中,N为0-100之间的整数。The length of the borrow buffer=QOS dequeue length-the second threshold+(the second threshold-the first threshold)×N%, where N is an integer between 0-100. 3.根据权利要求1或2所述的方法,其特征在于,还包括:3. The method according to claim 1 or 2, further comprising: 若所述当前QOS出队列的内存空间被占用长度小于所述第一阈值,则设置所述当前QOS出队列为可借用队列,允许向其它QOS出队列供出其借用缓冲区。If the occupied length of the memory space of the current QOS dequeue is less than the first threshold, then set the current QOS dequeue as a borrowable queue, allowing other QOS dequeues to supply their borrow buffers. 4.根据权利要求1或2所述的方法,其特征在于,还包括:4. The method according to claim 1 or 2, further comprising: 若所述当前QOS出队列的内存空间被占用长度小于或等于所述第二阈值且大于或等于所述第一阈值,则所述当前QOS出队列判断其借用缓冲区是否借出;若是,则收回其借用缓冲区,并为借用其借用缓冲区的QOS出队列重新分配借用缓冲区;若否,则设置所述当前QOS出队列为不可借用队列,拒绝向所述其它QOS队列借出其借用缓冲区。If the occupied length of the memory space of the current QOS dequeue is less than or equal to the second threshold and greater than or equal to the first threshold, then the current QOS dequeues to determine whether its borrowed buffer is borrowed; if so, then Take back its borrowed buffer, and redistribute the borrowed buffer for the QOS that borrowed its borrowed buffer; if not, then set the current QOS out of the queue as a non-borrowable queue, and refuse to lend its borrowed buffer to the other QOS queues buffer. 5.根据权利要求1所述的方法,其特征在于,还包括:5. The method according to claim 1, further comprising: 当所述当前QOS出队列的内存空间被占用长度由大于所述第二阈值减小到小于或等于所述第二阈值,则所述当前QOS出队列归还借用的所述借用缓冲区。When the occupied length of the memory space of the current QOS dequeue decreases from greater than the second threshold to less than or equal to the second threshold, the current QOS dequeues and returns the borrowed buffer. 6.根据权利要求1所述的方法,其特征在于,还包括:6. The method according to claim 1, further comprising: 系统保存所述当前QOS出队列和其借用的所述借用缓冲区所属的QOS出队列的对应关系,并实时更新。The system saves the corresponding relationship between the current QOS out queue and the QOS out queue to which the borrowed buffer belongs, and updates it in real time. 7.一种队列调整装置,其特征在于,包括:7. A queue adjustment device, characterized in that it comprises: 比较模块,用于比较当前服务质量QOS出队列的内存空间被占用长度与设定的第一阈值和第二阈值的关系,其中,所述第一阈值和所述第二阈值均小于所述当前QOS出队列的内存空间长度,所述第一阈值小于所述第二阈值;The comparison module is used to compare the relationship between the occupied length of the memory space of the current quality of service QOS dequeuing and the set first threshold and the second threshold, wherein the first threshold and the second threshold are both smaller than the current The memory space length of the QOS dequeuing, the first threshold is less than the second threshold; 第一分配模块,用于当所述比较模块的比较结果为所述当前QOS出队列的内存空间被占用长度大于所述第二阈值时,从其它的内存空间被占用长度小于所述第一阈值的QOS出队列中选择一个队列,其中,所述当前QOS出队列和其它QOS出队列中均设置有借用缓冲区;将选择的所述QOS出队列的所述借用缓冲区借用到所述当前QOS出队列的队尾。The first allocation module is configured to, when the comparison result of the comparison module is that the occupied length of the memory space of the current QOS dequeuing is greater than the second threshold, the occupied length of other memory spaces is less than the first threshold Select a queue in the QOS out of the queue, wherein, the current QOS out of the queue and other QOS out of the queue are all provided with a borrow buffer; the borrowed buffer of the selected QOS out of the queue is borrowed to the current QOS Dequeue the tail of the queue. 8.根据权利要求7所述的装置,其特征在于,所述借用缓冲区的长度为:8. The device according to claim 7, wherein the length of the borrow buffer is: 所述借用缓冲区的长度=QOS出队列长度-所述第二阈值+(所述第二阈值-所述第一阈值)×N%,其中,N为0-100之间的整数。The length of the borrow buffer=QOS dequeue length-the second threshold+(the second threshold-the first threshold)×N%, where N is an integer between 0-100. 9.根据权利要求7或8所述的装置,其特征在于,所述装置还包括:9. The device according to claim 7 or 8, characterized in that the device further comprises: 第二分配模块,用于若所述比较模块的比较结果为所述当前QOS出队列的内存空间被占用长度小于所述第一阈值,则设置所述当前QOS出队列为可借用队列,允许向其它QOS出队列供出其借用缓冲区;The second allocation module is used to set the current QOS queue as a borrowable queue if the comparison result of the comparison module is that the occupied length of the memory space of the current QOS out of the queue is less than the first threshold, allowing the queue to be borrowed. Other QOS dequeues for their borrowed buffers; 和/或,and / or, 第三分配模块,用于若所述比较模块的比较结果为所述当前QOS出队列的内存空间被占用长度小于或等于所述第二阈值且大于或等于所述第一阈值,则所述当前QOS出队列判断其借用缓冲区是否借出;若是,则收回其借用缓冲区,并为借用其借用缓冲区的QOS出队列重新分配借用缓冲区;若否,则设置所述当前QOS出队列为不可借用队列,拒绝向所述其它QOS队列借出其借用缓冲区。The third allocation module is configured to: if the comparison result of the comparison module is that the occupied length of the memory space of the current QOS queue is less than or equal to the second threshold and greater than or equal to the first threshold, the current QOS goes out queue and judges whether its borrowed buffer is borrowed; If so, then reclaims its borrowed buffer, and redistributes borrowed buffer for the QOS that borrows its borrowed buffer goes out queue; If not, then setting described current QOS goes out queue as A non-borrowable queue refuses to lend its borrow buffer to the other QOS queues. 10.根据权利要求7所述的装置,其特征在于,所述装置还包括:10. The device according to claim 7, further comprising: 归还模块,用于当所述当前QOS出队列的内存空间被占用长度由大于所述第二阈值减小到小于或等于所述第二阈值,则所述当前QOS出队列归还借用的所述借用缓冲区。Returning module, for when the occupied length of the memory space of the current QOS out of the queue is reduced from greater than the second threshold to less than or equal to the second threshold, then the current QOS out of the queue returns the borrowed buffer.
CN201110240078.7A 2011-08-19 2011-08-19 Queue regulation method and device Active CN102263701B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201110240078.7A CN102263701B (en) 2011-08-19 2011-08-19 Queue regulation method and device
PCT/CN2012/077762 WO2013026324A1 (en) 2011-08-19 2012-06-28 Queue adjustment method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201110240078.7A CN102263701B (en) 2011-08-19 2011-08-19 Queue regulation method and device

Publications (2)

Publication Number Publication Date
CN102263701A CN102263701A (en) 2011-11-30
CN102263701B true CN102263701B (en) 2017-03-22

Family

ID=45010167

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201110240078.7A Active CN102263701B (en) 2011-08-19 2011-08-19 Queue regulation method and device

Country Status (2)

Country Link
CN (1) CN102263701B (en)
WO (1) WO2013026324A1 (en)

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102263701B (en) * 2011-08-19 2017-03-22 中兴通讯股份有限公司 Queue regulation method and device
CN103248583B (en) * 2012-02-09 2016-04-13 迈普通信技术股份有限公司 A kind of first in first out message queue management method based on finite depth and device
CN102984083B (en) * 2012-11-19 2018-07-24 南京中兴新软件有限责任公司 queue management method and device
CN104022971B (en) * 2014-05-26 2018-04-06 上海斐讯数据通信技术有限公司 Optimal change machine message up sending method and its system
CN107346265B (en) * 2016-05-05 2021-05-18 北京忆恒创源科技有限公司 Method and device for realizing QoS
CN106970827A (en) * 2017-03-27 2017-07-21 联想(北京)有限公司 Information processing method, information processor, electronic equipment
CN109947798A (en) * 2017-09-18 2019-06-28 中国移动通信有限公司研究院 Method and device for processing stream events
CN108040019B (en) * 2017-12-21 2021-12-24 杭州迪普科技股份有限公司 Message forwarding method and device
CN109495401B (en) * 2018-12-13 2022-06-24 迈普通信技术股份有限公司 Cache management method and device
CN114995748B (en) * 2022-05-09 2025-01-24 阿里巴巴(中国)有限公司 Request processing method and device

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100359489C (en) * 2004-07-13 2008-01-02 中兴通讯股份有限公司 Method for internal memory allocation in the embedded real-time operation system
CN101094181B (en) * 2007-07-25 2010-12-08 华为技术有限公司 Device and method for dispatching messages into queue and out of queue
CN101141399A (en) * 2007-10-16 2008-03-12 武汉烽火网络有限责任公司 Dual-threshold port queue control method for sharing storage exchange supporting multicast
CN101521624B (en) * 2008-02-26 2012-01-11 大唐移动通信设备有限公司 Method and device for distributing downlink bandwidth of lub port
US7864676B2 (en) * 2008-07-14 2011-01-04 The Mitre Corporation Network cross-domain precedence and service quality conflict mitigation
CN101800699A (en) * 2010-02-09 2010-08-11 上海华为技术有限公司 Method and device for dropping packets
CN102263701B (en) * 2011-08-19 2017-03-22 中兴通讯股份有限公司 Queue regulation method and device

Also Published As

Publication number Publication date
CN102263701A (en) 2011-11-30
WO2013026324A1 (en) 2013-02-28

Similar Documents

Publication Publication Date Title
CN102263701B (en) Queue regulation method and device
US10341260B2 (en) Early queueing network device
US12199886B2 (en) Queue protection using a shared global memory reserve
US11381515B2 (en) On-demand packet queuing in a network device
US9426099B2 (en) Router, method for controlling router, and program
US9225668B2 (en) Priority driven channel allocation for packet transferring
CN102447610B (en) Method and device for realizing message buffer resource sharing
US9774461B2 (en) Network switch with dynamic multicast queues
US8989037B2 (en) System for performing data cut-through
CN107665146A (en) Memory management apparatus and method
CN112783644B (en) A distributed oblique stream processing method and system based on high-frequency key-value counting
US20140052938A1 (en) Clumsy Flow Control Method and Apparatus for Improving Performance and Energy Efficiency in On-Chip Network
CN102857446B (en) The buffer memory management method and device of Ethernet switching chip
CN103428099B (en) A kind of method of universal multi-core network processor flow control
CN104572498B (en) The buffer memory management method and device of message
CN106294191B (en) The method for handling table, the method and apparatus for accessing table
CN111756586A (en) A priority queue-based fair bandwidth allocation method, switch and readable storage medium in a data center network
US8976802B2 (en) Prediction-based switch allocator
CN118210629A (en) Memory allocation method and electronic device
CN105704037B (en) A table item saving method and controller
CN100452761C (en) Method of data packet storage in communication equipment
US9128785B2 (en) System and method for efficient shared buffer management
CN113660160A (en) UCMP load sharing method and device
Lin et al. Two-stage fair queuing using budget round-robin
EP3299965B1 (en) Method and physical device for managing linked lists

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant