WO2016179969A1 - 数据流队列整形的方法、装置及计算机存储介质 - Google Patents

数据流队列整形的方法、装置及计算机存储介质 Download PDF

Info

Publication number
WO2016179969A1
WO2016179969A1 PCT/CN2015/092934 CN2015092934W WO2016179969A1 WO 2016179969 A1 WO2016179969 A1 WO 2016179969A1 CN 2015092934 W CN2015092934 W CN 2015092934W WO 2016179969 A1 WO2016179969 A1 WO 2016179969A1
Authority
WO
WIPO (PCT)
Prior art keywords
weight
compression
data stream
value
queue
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.)
Ceased
Application number
PCT/CN2015/092934
Other languages
English (en)
French (fr)
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.)
Sanechips Technology Co Ltd
Original Assignee
Sanechips Technology Co Ltd
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 Sanechips Technology Co Ltd filed Critical Sanechips Technology Co Ltd
Publication of WO2016179969A1 publication Critical patent/WO2016179969A1/zh
Anticipated expiration legal-status Critical
Ceased legal-status Critical Current

Links

Images

Definitions

  • the present invention relates to the field of data communications, and in particular, to a data stream queue shaping method, apparatus, and computer storage medium.
  • Traffic Shaping is a measure to actively adjust the traffic output rate.
  • the typical function is to forward packets at a negotiated rate, smooth the output of traffic, and reduce downstream congestion.
  • Traffic shaping generally allocates tokens for each data flow queue. Each data flow queue outputs packets of corresponding traffic according to the number of tokens to achieve traffic shaping.
  • the embodiments of the present invention are directed to a data stream queue shaping method, apparatus, and computer storage medium, which can effectively reduce bursts of data flow queues with small traffic, improve traffic shaping effects, and user experience.
  • an embodiment of the present invention provides a data stream queue shaping method, where the method includes:
  • a corresponding second quantity of tokens is delivered for each of the data flow queues in each service.
  • the new weight value of each data stream queue is obtained by using a weight compression rule according to the original weight value of each data stream queue, including:
  • weight compression multiple is less than or equal to the integer value of the maximum compression multiple of the weight, and the weight value after the weight compression is greater than or equal to the integer value of the minimum weight value after the weight compression, compress the multiple of the original weight value according to the weight Perform a compression calculation to obtain a new weight value;
  • the weight compression multiple is greater than the integer value of the maximum compression multiple of the weight, or the weight value after the weight compression is smaller than the integer value of the minimum weight value after the weight compression, the original weight value is not subjected to weight compression calculation, and the new weight is The value is equal to the original weight value.
  • the sending according to the issuing token rule, the corresponding second quantity of tokens for each data flow queue in each service, including:
  • the method before the obtaining the new weight value of each data stream queue, the method further includes: acquiring an original weight value of each data stream queue;
  • the congestion management algorithm is a weighted fair queuing algorithm.
  • an embodiment of the present invention further provides an apparatus for data stream queue shaping, where the apparatus includes:
  • the weight compression module is configured to obtain a new weight value of each data flow queue by using a weight compression rule according to an original weight value of each data flow queue;
  • a token quantity determining module configured to determine, according to a sum of new weight values of the data stream queue, to deliver a first quantity of tokens for each of the data stream queues in each service
  • a service number determining module configured to determine, according to a new weight value of the data flow queue, a service number of each data flow queue by using a congestion management algorithm
  • the token issuing module is configured to deliver a corresponding second quantity of tokens for each of the data flow queues in each service according to the issued token rule.
  • the weight compression module is configured to obtain a weight compression multiple of the original weight value of each data stream queue according to the original weight value of each data stream queue and the weight compression rule; And the weight compression multiple is less than or equal to the integer value of the maximum compression multiple of the weight, and the weight value after the weight compression is greater than or equal to the integer value of the weighted minimum weight value, and then the original weight value is performed according to the weight compression multiple. Compressing a calculation to obtain a new weight value; if the weight compression multiple is greater than an integer value of a weight maximum compression multiple, or the weighted weight value is smaller than an integer value of the weighted minimum weight value, the original weight value is The weight compression calculation is not performed, and the new weight value is equal to the original weight value.
  • the token issuing module is configured to deliver the first quantity of tokens to the data stream queue that has not undergone weight compression; and to deliver the weighted compressed data stream queue A token of a first quantity multiplied by the weight compression multiple.
  • the foregoing apparatus further includes: an obtaining module, configured to acquire an original weight value of each of the data stream queues.
  • the congestion management algorithm is a weighted fair queuing algorithm.
  • an embodiment of the present invention further provides a computer storage medium, where the computer storage medium stores a computer program, and the computer program is used to execute the data stream queue shaping method described above.
  • the method and device for data stream queue shaping provided by the embodiment of the present invention, and the computer storage medium, firstly, according to the original weight value of each data stream queue, a new weight value of each data stream queue is obtained by using a preset weight compression rule; secondly, The number of tokens delivered by each service is determined by the sum of the new weight values. Then, the number of services of each data stream queue is obtained by the weighted fair queuing algorithm according to the new weight value of each data stream queue. Finally, the token is issued according to the weighted fair queuing algorithm. A rule that delivers a corresponding number of tokens for each data flow queue in each service.
  • each data stream queue obtains sufficient tokens, achieving the purpose of line rate shaping of each data stream queue, and also ensuring that traffic is not lost.
  • Embodiment 1 is a flowchart of Embodiment 1 of a method for shaping a data stream queue according to the present invention
  • Embodiment 2 is a flowchart of Embodiment 2 of a method for shaping a data stream queue according to the present invention
  • FIG. 3 is a structural diagram of an apparatus for data stream queue shaping according to the present invention.
  • Embodiment 1 is a flowchart of Embodiment 1 of a method for shaping a data stream queue according to the present invention. As shown in FIG. 1, the method may include:
  • Step 101 Obtain a weight calculation rule according to an original weight value of each data flow queue. The new weight value of each data stream queue.
  • the original weight value of each data stream queue meets the requirements of the weight compression rule, the original weight value is compressed according to the weight compression multiple, and the new weight value after the weight compression is obtained; if the weight is not met For the requirement of the compression rule, the original weight value is not subjected to weight compression calculation, and the new weight value is equal to the original weight value;
  • the weight compression multiple of the original weight value of each data stream queue is obtained by the original weight value of the data stream queue and the weight compression rule.
  • the weight compression rule is: the weight compression multiple is smaller than the integer value of the weight maximum compression multiple, and the weight value after the weight compression is greater than or equal to the integer value of the minimum weight value after the weight compression; correspondingly, the above processing is specifically :
  • weight compression multiple is less than or equal to the integer value of the maximum compression multiple of the weight, and the weight value after the weight compression is greater than or equal to the integer value of the minimum weight value after the weight compression, the original weight value is compressed according to the weight compression multiple, and a new value is obtained.
  • the weight compression multiple is greater than the integer value of the maximum compression multiple of the weight, or the weight value after the weight compression is smaller than the integer weight of the minimum weight value after the weight compression, the weight calculation is not performed on the original weight value, and the new weight value is equal to the original weight. value.
  • the maximum weight multiplier and the weighted minimum weight value may be set according to actual requirements, which is not limited herein. In addition, there is no limit to the number of data stream queues.
  • Step 102 Determine, according to the sum of the new weight values of the data flow queue, to deliver a first quantity of tokens for each of the data flow queues in each service.
  • the new weight for each stream queue After getting the new weight value for each stream queue, the new weight for each stream queue The values are added to obtain the sum of the new weight values of the data stream queue; and the first number of tokens are issued for each data stream queue in each service according to the sum of the new weight values. Among them, the greater the sum of the new weight values, the greater the number of tokens issued in each service, and the relationship between them is proportional.
  • Step 103 Determine, according to a new weight value of the data flow queue, a service number of each data flow queue by using a congestion management algorithm.
  • the number of services corresponding to each data flow queue is determined by the congestion management algorithm, and the number of times of service waiting for each data flow queue depends on The size of the new weight value, the number of services obtained by the data stream queue with a small weight value is small, and the number of services obtained by the data stream queue with a large weight value is large.
  • the congestion management algorithm may be a weighted fair queuing algorithm.
  • Step 104 Deliver a corresponding second quantity of tokens for each of the data flow queues in each service according to the issued token rule.
  • the issuing token rule is a pre-configured rule, the rule includes: delivering a first number of tokens for a data stream queue that has not undergone weight compression; and delivering the first for a weight-compressed data stream queue The number of tokens that are multiplied by the number of weights.
  • a token of the first number and the weight compression multiple product is issued for the weight-compressed data flow queue in each service, that is, the second quantity is equal to the number of the first quantity and the weight compression multiple.
  • the data stream queue shaping method reduces the weight value of the data flow queue of the large traffic by compressing the weight value of the data flow queue of the large traffic, and improves the weight value of the data flow queue of the small traffic. , avoiding excessive differences between weight values, enabling small traffic data queues to obtain more service times, effectively reducing bursts, and improving traffic Shape effects and user experience.
  • each data stream queue obtains sufficient tokens, achieving the purpose of line rate shaping of each data stream queue, and also ensuring that traffic is not lost.
  • Embodiment 2 is a flowchart of Embodiment 2 of a method for shaping a data stream queue according to the present invention. As shown in FIG. 2, the method may include:
  • Step 201 Obtain an original weight value of each data stream queue.
  • Corresponding original weight values are obtained according to the shaping traffic of each data flow queue.
  • three data stream queues Q1, Q2, and Q3 are provided, and the original weight values of the three data stream queues are 60, 7000, and 600, respectively.
  • the number of the data flow queues is only exemplified by three, and the specific number may be set according to actual requirements, which is not limited herein.
  • Step 202 Obtain a new weight value of each data stream queue by using a weight compression rule according to the original weight value of each data stream queue.
  • the original weight value of each data stream queue meets the requirements of the weight compression rule, the original weight value is compressed and calculated according to the weight compression multiple, and the new weight value after the weight compression is obtained; if the weight compression rule is not met , the weight calculation is not performed on the original weight value, and the new weight value is equal to the original weight value;
  • the weight compression multiple of the original weight value of each data stream queue is obtained by the original weight value of the data stream queue and the weight compression rule.
  • the weight compression rule is: the weight compression multiple is smaller than the integer value of the weight maximum compression multiple, and the weight value after the weight compression is greater than or equal to the integer value of the minimum weight value after the weight compression; correspondingly, the above processing is specifically :
  • the original weight value is compressed according to the weight compression multiple to obtain a new weight value.
  • the weight compression multiple is greater than the integer value of the weight maximum compression multiple, or the weighted weight is smaller than the weighted minimum weight, the original weight value is not subjected to weight compression calculation, and the new weight value is equal to the original weight value.
  • the pre-set weight maximum compression multiple is 100, and the weight-compressed minimum weight value is 60.
  • the original weight value is already equal to the minimum weight value, so no weight compression is required, and the new weight value is still 60; for the data stream queue Q2, the original weight value can be compressed, since the weight compression multiple is less than or equal to the weight
  • the integer value of the maximum compression multiple and the weight value after the weight compression is greater than the integer value of the minimum weight value after the weight compression, so the maximum compression can only be 100 times, the compressed new weight value is 70; for the data flow queue Q3, the original weight value can also be compressed, because the weight compression multiple is less than the integer value of the weight maximum compression multiple and the weighted weight value is greater than or equal to the weighted minimum weight value, so it can be compressed 10 times.
  • the new weight value obtained after compression is 60.
  • weight compression a new weight value of three data stream queues is obtained, the data stream queue Q1 is 60, the data stream queue Q2 is 70, and the data stream queue
  • the maximum weight multiplier and the weighted minimum weight value may be set according to actual requirements, which is not limited herein.
  • Step 203 Determine, according to the sum of the new weight values of the data flow queue, to deliver a first quantity of tokens for each of the data flow queues in each service.
  • the new weight values of each data stream queue are added to obtain the sum of the new weight values of the data stream queue; and then according to the sum of the new weight values, each service is obtained.
  • a first number of tokens are issued for each data flow queue. Among them, the greater the sum of the new weight values, the greater the number of tokens issued in each service, and the relationship between them is proportional.
  • the new weight value 60 of the data stream queue Q1 obtained in step 202 the new weight value 70 of the data stream queue Q2, and the new weight value 60 of the data stream queue Q3, the new weight values of the three data stream queues are added.
  • the sum of the new weight values is 190; and 38 tokens are issued for each data stream queue in each service according to the sum 190 of the new weight values, that is, the first quantity is 38.
  • Step 204 Determine, according to the new weight value of the data flow queue, a service number of each data flow queue by using a congestion management algorithm.
  • the number of services corresponding to each data flow queue is determined by the congestion management algorithm, and the number of times of service waiting for each data flow queue depends on The size of the new weight value, the number of services obtained by the data stream queue with a small weight value is small, and the number of services obtained by the data stream queue with a large weight value is large.
  • the congestion management algorithm may be a weighted fair queuing algorithm.
  • the new weight value is 60, and the number of services obtained is 120 times; for the data flow queue Q2, the new weight value is 70, and the number of services obtained is 140 times; for the data flow queue Q1, Its new weight is 60 and the number of services received is 120.
  • Step 205 Deliver a corresponding second quantity of tokens for each of the data flow queues in each service according to the issued token rule.
  • the issuing token rule is a pre-configured rule, the rule includes: delivering a first quantity of tokens for a data stream queue that has not been subjected to weight compression; and delivering the first number of the weighted data stream queues The number of tokens that are multiplied by the number of weights.
  • a token of the first number and the weight compression multiple product is issued for the weight-compressed data flow queue in each service, that is, the second quantity is equal to the number of the first quantity and the weight compression multiple.
  • the data stream queue shaping method provided by the embodiment of the present invention reduces the weight value of the data flow queue of the large traffic by compressing the weight value of the data flow queue of the large traffic, and improves the weight value of the data flow queue of the small traffic.
  • the excessive difference between the weight values is avoided, so that the data flow queue of the small traffic can obtain more service times, effectively reducing the burst, and improving the effect of the traffic shaping and the user experience.
  • each data stream queue obtains sufficient tokens, achieving the purpose of line rate shaping of each data stream queue, and also ensuring that traffic is not lost.
  • the embodiment of the present invention further describes a computer storage medium, where the computer storage medium stores a computer program, and the computer program is used to execute the data flow queue shown in FIG. 1 or FIG. 2 in the embodiment of the present invention.
  • the method of shaping is used to execute the data flow queue shown in FIG. 1 or FIG. 2 in the embodiment of the present invention.
  • the apparatus 03 of this embodiment includes: a weight compression module 031, a token quantity determining module 032, a service number determining module 033, and an order.
  • the card is issued by module 034.
  • the weight compression module 031 is configured to obtain a new weight value of each data flow queue by using a weight compression rule according to an original weight value of each data flow queue;
  • the token quantity determining module 032 is configured to determine, according to the sum of the new weight values of the data stream queue, to deliver a first quantity of tokens for each of the data stream queues in each service;
  • the service number determining module 033 is configured to determine, according to a new weight value of the data flow queue, a service number of each data flow queue by using a congestion management algorithm;
  • the token issuing module 034 is configured to issue a token rule in each service. A second quantity of tokens corresponding to each data stream queue is delivered.
  • the weight compression module 031 is configured to obtain a weight of the original weight value of each data stream queue according to the original weight value of each data stream queue and the weight compression rule. a compression multiplier; if the weight compression multiple is less than or equal to an integer value of a maximum compression multiple of the weight, and the weighted weighted weight value is greater than or equal to an integer value of the weighted minimum weight value, the original weight value is as described
  • the weight compression multiple is compressed to obtain a new weight value; if the weight compression multiple is greater than the integer value of the weight maximum compression multiple, or the weighted weight value is smaller than the weighted minimum value of the weighted minimum weight value, then The original weight value is not subjected to weight compression calculation, and the new weight value is equal to the original weight value.
  • the token issuing module 034 is configured to deliver the first quantity of tokens to the data stream queue that has not undergone weight compression; and is the weighted compressed data stream.
  • the queue issues the token of the first quantity to the weight compression multiple.
  • the apparatus 03 of the embodiment further includes: an obtaining module 035, configured to acquire an original weight value of each data stream queue.
  • the congestion management algorithm is a weighted fair queuing algorithm.
  • the device in this embodiment may be used to implement the technical solution of the foregoing method embodiment, and the implementation principle and the technical effect are similar, and details are not described herein again.
  • the weight compression module 031, the token number determining module 032, the service number determining module 033, the token issuing module 034, and the obtaining module 035 may be a central processing unit (CPU, Central Processing Unit) located on the device. , Microprocessor (MPU), Digital Signal Processor (DSP, Digital Signal Processor) or Field Programmable Gate Array (FPGA).
  • CPU Central Processing Unit
  • MPU Microprocessor
  • DSP Digital Signal Processor
  • FPGA Field Programmable Gate Array
  • embodiments of the present invention can be provided as a method, system, or computer program product. Accordingly, the present invention can take the form of a hardware embodiment, a software embodiment, or a combination of software and hardware. Moreover, the invention may be employed in one or more of its A computer program product embodied on a computer usable storage medium (including but not limited to disk storage and optical storage, etc.) containing computer usable program code.
  • a computer usable storage medium including but not limited to disk storage and optical storage, etc.
  • the computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture comprising the instruction device.
  • the apparatus implements the functions specified in one or more blocks of a flow or a flow and/or block diagram of the flowchart.
  • These computer program instructions can also be loaded onto a computer or other programmable data processing device such that a series of operational steps are performed on a computer or other programmable device to produce computer-implemented processing for execution on a computer or other programmable device.
  • the instructions provide steps for implementing the functions specified in one or more of the flow or in a block or blocks of a flow diagram.
  • the new weight value of each data stream queue is obtained according to the original weight value of each data stream queue by using a preset weight compression rule; the number of tokens issued by each service is determined by the sum of the new weight values; Weighted fairness based on new weight values for each data stream queue
  • the team algorithm obtains the number of times of service of each data flow queue; according to the issued token rule, the corresponding number of tokens are delivered for each data flow queue in each service; thus, the weight of the data flow queue for large traffic is Compression reduces the weight of the large-flow data stream queue, increases the weight of the small-flow data stream queue, and avoids excessive differences between the weight values, so that the small-flow data stream queue can obtain more service times. Effectively reduces bursts and improves traffic shaping and user experience.

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

本发明实施例公开了一种数据流队列整形的方法,包括:根据每个数据流队列的原始权重值,通过权重压缩规则得到所述每个数据流队列的新权重值;根据所述数据流队列的新权重值之和,确定在每次服务中为所述每个数据流队列下发第一数量的令牌;根据所述数据流队列的新权重值,通过拥塞管理算法确定所述每个数据流队列的服务次数;按照下发令牌规则,在每次服务中为所述每个数据流队列下发所对应的第二数量的令牌;本发明实施例还同时公开了一种数据流队列整形的装置及计算机存储价值。

Description

数据流队列整形的方法、装置及计算机存储介质 技术领域
本发明涉及数据通信领域,尤其涉及一种数据流队列整形的方法、装置及计算机存储介质。
背景技术
随着互联网的快速发展,网络带宽迅速增加,人们对于网络也在不停的提出新的服务需求。在实现报文的高速转发处理的同时,人们对于网络连接的服务质量也越来越重视。
其中,流量整形(Traffic Shaping)是一种主动调整流量输出速率的措施,典型作用是使报文在一个协商的速率上转发,平滑流量的输出,降低下游的拥塞。流量整形一般采用为每条数据流队列分配令牌,每条数据流队列根据各自令牌数量的多少输出相应流量的报文,达到流量整形的作用。
在大量不同的数据流队列中,因为大流量的数据流队列具有较多的令牌数量,能够获得较多的服务次数,而小流量的数据流队列具有较少的令牌数量,获得的服务次数较小,这样就会容易引起小流量的数据流队列的突发,降低了流量整形的效果,影响用户体验。
发明内容
有鉴于此,本发明实施例期望提供一种数据流队列整形的方法、装置及计算机存储介质,能有效减少小流量的数据流队列的突发,提高流量整形的效果和用户体验。
为达到上述目的,本发明实施例提供一种数据流队列整形的方法,所述方法包括:
根据每个数据流队列的原始权重值,通过权重压缩规则得到所述每个数据流队列的新权重值;
根据所述数据流队列的新权重值之和,确定在每次服务中为所述每个数据流队列下发第一数量的令牌;
根据所述数据流队列的新权重值,通过拥塞管理算法确定所述每个数据流队列的服务次数;
按照下发令牌规则,在每次服务中为所述每个数据流队列下发所对应的第二数量的令牌。
上述方法中,所述根据所述每个数据流队列的原始权重值,通过权重压缩规则得到所述每个数据流队列的新权重值,包括:
根据所述每个数据流队列的原始权重值与所述权重压缩规则,得到所述每个数据流队列的原始权重值的权重压缩倍数;
若所述权重压缩倍数小于等于权重最大压缩倍数的整数值、且经过权重压缩后的权重值大于等于权重压缩后的最小权重值的整数值,则对所述原始权重值按照所述权重压缩倍数进行压缩计算,得到新权重值;
若所述权重压缩倍数大于权重最大压缩倍数的整数值、或经过权重压缩后的权重值小于权重压缩后的最小权重值的整数值,则对所述原始权重值不进行权重压缩计算,新权重值等于所述原始权重值。
上述方法中,所述按照下发令牌规则,在每次服务中为所述每个数据流队列下发所对应的第二数量的令牌,包括:
为没经过权重压缩的所述数据流队列下发所述第一数量的令牌;为经过权重压缩的所述数据流队列下发所述第一数量与所述权重压缩倍数乘积数量的令牌。
上述方法中,所述得到所述每个数据流队列的新权重值之前,所述方法还包括:获取所述每个数据流队列的原始权重值;
上述方法中,所述拥塞管理算法为加权公平排队算法。
此外,为实现上述目的,本发明实施例还提供一种数据流队列整形的装置,所述装置包括:
权重压缩模块,配置为根据每个数据流队列的原始权重值,通过权重压缩规则得到所述每个数据流队列的新权重值;
令牌数量确定模块,配置为根据所述数据流队列的新权重值之和,确定在每次服务中为所述每个数据流队列下发第一数量的令牌;
服务次数确定模块,配置为根据所述数据流队列的新权重值,通过拥塞管理算法确定所述每个数据流队列的服务次数;
令牌下发模块,配置为按照下发令牌规则,在每次服务中为所述每个数据流队列下发所对应的第二数量的令牌。
上述装置中,所述权重压缩模块,具体配置为根据所述每个数据流队列的原始权重值与所述权重压缩规则,得到所述每个数据流队列的原始权重值的权重压缩倍数;若所述权重压缩倍数小于等于权重最大压缩倍数的整数值、且经过权重压缩后的权重值大于等于权重压缩后的最小权重值的整数值,则对所述原始权重值按照所述权重压缩倍数进行压缩计算,得到新权重值;若所述权重压缩倍数大于权重最大压缩倍数的整数值、或经过权重压缩后的权重值小于权重压缩后的最小权重值的整数值,则对所述原始权重值不进行权重压缩计算,新权重值等于所述原始权重值。
上述装置中,所述令牌下发模块,具体配置为为没经过权重压缩的所述数据流队列下发所述第一数量的令牌;为经过权重压缩的所述数据流队列下发所述第一数量与所述权重压缩倍数乘积数量的令牌。
上述装置中,还包括:获取模块,配置为获取所述每个数据流队列的原始权重值。
上述装置中,所述拥塞管理算法为加权公平排队算法。
此外,为实现上述目的,本发明实施例还提供一种计算机存储介质,所述计算机存储介质中存储有计算机程序,所述计算机程序用于执行以上所述的数据流队列整形的方法。
本发明实施例提供的数据流队列整形的方法、装置及计算机存储介质,首先,根据各个数据流队列的原始权重值通过预先设置的权重压缩规则,得到各个数据流队列的新权重值;其次,以新权重值之和决定每次服务下发的令牌数量;然后,根据各个数据流队列的新权重值通过加权公平排队算法,获得各个数据流队列的服务次数;最后,按照下发令牌规则,在每次服务中为各个数据流队列下发所对应数量的令牌。通过对大流量的数据流队列的权重压缩,降低了大流量的数据流队列的权重,提高了小流量的数据流队列的权重,避免了权重值之间的过大差异,使小流量的数据流队列可以获得更多的服务次数,有效的减少了突发,提高了流量整形的效果和用户体验。另外,通过下发令牌规则使各个数据流队列获得了足够的令牌,达到了各数据流队列线速整形的目的,并且还保证了流量不损失。
附图说明
图1为本发明数据流队列整形的方法实施例一的流程图;
图2为本发明数据流队列整形的方法实施例二的流程图;
图3为本发明数据流队列整形的装置实施例的结构图。
具体实施方式
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述。
图1为本发明数据流队列整形的方法实施例一的流程图,如图1所示,本方法可以包括:
步骤101、根据每个数据流队列的原始权重值,通过权重压缩规则得到 所述每个数据流队列的新权重值。
在一具体实施例中,每个数据流队列的原始权重值如果符合权重压缩规则的要求,则对原始权重值按照权重压缩倍数进行压缩计算,得到权重压缩后的新权重值;如果不符合权重压缩规则的要求,则对所述原始权重值不进行权重压缩计算,新权重值等于原始权重值;
这里,每个数据流队列的原始权重值的权重压缩倍数是由该数据流队列的原始权重值与权重压缩规则得到的。
其中,权重压缩规则为:权重压缩倍数要小于等于权重最大压缩倍数的整数值、且经过权重压缩后的权重值要大于等于权重压缩后的最小权重值的整数值;相应的,上述处理具体为:
根据数据流队列的原始权重值与权重压缩规则中权重压缩后的最小权重值或权重最大压缩倍数,得到该数据流队列的原始权重值的权重压缩倍数;
若权重压缩倍数小于等于权重最大压缩倍数的整数值、且经过权重压缩后的权重值大于等于权重压缩后的最小权重值的整数值,则对原始权重值按照权重压缩倍数进行压缩计算,得到新权重值;
若权重压缩倍数大于权重最大压缩倍数的整数值、或经过权重压缩后的权重值小于权重压缩后的最小权重值的整数值,则对原始权重值不进行权重压缩计算,新权重值等于原始权重值。
这里需要说明的是,在本实施例中,对于权重最大压缩倍数与权重压缩后的最小权重值可以根据实际需求进行设置,在此不加以限定。另外,对于数据流队列的数目也是没有限制的。
步骤102、根据所述数据流队列的新权重值之和,确定在每次服务中为所述每个数据流队列下发第一数量的令牌。
在得到每个数据流队列的新权重值之后,将每个数据流队列的新权重 值相加,得到数据流队列的新权重值之和;再根据该新权重值之和得到在每次服务中为每个数据流队列下发第一数量的令牌。其中,新权重值之和越大,在每次服务中下发的令牌数量也就越大,两者之间成正比关系。
步骤103、根据所述数据流队列的新权重值,通过拥塞管理算法确定所述每个数据流队列的服务次数。
在一具体实施例中,根据上述步骤得出的数据流队列的新权重值,通过拥塞管理算法确定出每个数据流队列所对应的服务次数,每个数据流队列获得服务次数的多少取决于其新权重值的大小,权重值小的数据流队列获得的服务次数少,权重值大的数据流队列获得的服务次数多。其中,拥塞管理算法可以为加权公平排队算法。
步骤104、按照下发令牌规则,在每次服务中为所述每个数据流队列下发所对应的第二数量的令牌。
这里,所述下发令牌规则为预先设置好的规则,该规则包括:为没经过权重压缩的数据流队列下发第一数量的令牌;为经过权重压缩的数据流队列下发第一数量与权重压缩倍数乘积数量的令牌。
相应的,上述处理过程具体为:
在每次服务中为没经过权重压缩的数据流队列下发第一数量的令牌,即第二数量等于第一数量;
在每次服务中为经过权重压缩的数据流队列下发第一数量与权重压缩倍数乘积数量的令牌,即第二数量等于第一数量与权重压缩倍数乘积的数量。
本发明实施例提供的数据流队列整形的方法,通过对大流量的数据流队列的权重值进行压缩,降低了大流量的数据流队列的权重值,提高了小流量的数据流队列的权重值,避免了权重值之间的过大差异,使小流量的数据流队列可以获得更多的服务次数,有效的减少了突发,提高了流量整 形的效果和用户体验。另外,通过下发令牌规则使各个数据流队列获得了足够的令牌,达到了各数据流队列线速整形的目的,并且还保证了流量不损失。
图2为本发明数据流队列整形的方法实施例二的流程图,如图2所示,本方法可以包括:
步骤201、获取每个数据流队列的原始权重值。
根据每条数据流队列的整形流量获得对应的原始权重值。在本实施例中,例如,设有3条数据流队列Q1、Q2和Q3,这三条数据流队列的原始权重值分别为60、7000和600。
这里需要说明的是,对于数据流队列的数目仅以3条来举例说明,具体的数目可以根据实际需求进行设置,在此并不加以限定。
步骤202、根据所述每个数据流队列的原始权重值,通过权重压缩规则得到所述每个数据流队列的新权重值。
具体的,每个数据流队列的原始权重值如果符合权重压缩规则的要求,则对原始权重值按照权重压缩倍数进行压缩计算,得到权重压缩后的新权重值;如果不符合权重压缩规则的要求,则对所述原始权重值不进行权重压缩计算,新权重值等于原始权重值;
这里,每个数据流队列的原始权重值的权重压缩倍数是由该数据流队列的原始权重值与权重压缩规则得到的。
其中,权重压缩规则为:权重压缩倍数要小于等于权重最大压缩倍数的整数值、且经过权重压缩后的权重值要大于等于权重压缩后的最小权重值的整数值;相应的,上述处理具体为:
根据数据流队列的原始权重值与权重压缩规则中的权重压缩后的最小权重值或权重最大压缩倍数得到该数据流队列的原始权重值的权重压缩倍数;
若权重压缩倍数小于等于权重最大压缩倍数的整数值、且经过权重压缩后的权重大于等于权重压缩后的最小权重的整数值,则对原始权重值按照权重压缩倍数进行压缩计算,得到新权重值;
若权重压缩倍数大于权重最大压缩倍数的整数值、或经过权重压缩后的权重小于权重压缩后的最小权重的整数值,则对原始权重值不进行权重压缩计算,新权重值等于原始权重值。
例如,预先设置好的权重最大压缩倍数为100,权重压缩后的最小权重值为60。对于数据流队列Q1,原始权重值已经等于最小权重值,所以不需要进行权重压缩,新的权重值依然为60;对于数据流队列Q2,原始权重值可以压缩,由于权重压缩倍数要小于等于权重最大压缩倍数的整数值且经过权重压缩后的权重值要大于等于权重压缩后的最小权重值的整数值,因此最大只能压缩100倍,经过压缩后的新权重值为70;对于数据流队列Q3,原始权重值也可以压缩,由于权重压缩倍数要小于等于权重最大压缩倍数的整数值且经过权重压缩后的权重值要大于等于权重压缩后的最小权重值的整数值,因此可以压缩10倍,经过压缩后得到的新权重值为60。这样通过权重压缩,得到了三条数据流队列的新权重值,数据流队列Q1为60,数据流队列Q2为70,数据流队列Q3为60。
这里需要说明的是,在本实施例中,对于权重最大压缩倍数与权重压缩后的最小权重值可以根据实际需求进行设置,在此不加以限定。
步骤203、根据所述数据流队列的新权重值之和,确定在每次服务中为所述每个数据流队列下发第一数量的令牌。
在得到每个数据流队列的新权重值之后,将每个数据流队列的新权重值相加,得到数据流队列的新权重值之和;再根据该新权重值之和得到在每次服务中为每个数据流队列下发第一数量的令牌。其中,新权重值之和越大,在每次服务中下发的令牌数量也就越大,两者之间成正比关系。
例如,根据步骤202得到的数据流队列Q1的新权重值60、数据流队列Q2的新权重值70、数据流队列Q3的新权重值60,将这三个数据流队列的新权重值相加,得到新权重值之和为190;在根据新权重值之和190得到在每次服务中为每个数据流队列下发38个令牌,即第一数量为38。
步骤204、根据所述数据流队列的新权重值,通过拥塞管理算法确定所述每个数据流队列的服务次数。
在一具体实施例中,根据上述步骤得出的数据流队列的新权重值,通过拥塞管理算法确定出每个数据流队列所对应的服务次数,每个数据流队列获得服务次数的多少取决于其新权重值的大小,权重值小的数据流队列获得的服务次数少,权重值大的数据流队列获得的服务次数多。其中,拥塞管理算法可以为加权公平排队算法。
例如,对于数据流队列Q1,其新权重值为60,获得的服务次数为120次;对于数据流队列Q2,其新权重值为70,获得的服务次数为140次;对于数据流队列Q1,其新权重值为60,获得的服务次数为120次。
步骤205、按照下发令牌规则,在每次服务中为所述每个数据流队列下发所对应的第二数量的令牌。
其中,所述下发令牌规则为预先设置好的规则,该规则包括:为没经过权重压缩的数据流队列下发第一数量的令牌;为经过权重压缩的数据流队列下发第一数量与权重压缩倍数乘积数量的令牌。
相应的,上述处理过程具体为:
在每次服务中为没经过权重压缩的数据流队列下发第一数量的令牌,即第二数量等于第一数量;
在每次服务中为经过权重压缩的数据流队列下发第一数量与权重压缩倍数乘积数量的令牌,即第二数量等于第一数量与权重压缩倍数乘积的数量。
例如,根据第一数量的令牌,即38个令牌,对于数据流队列Q1,因为权重值没有经过权重压缩,因此在每次服务中下发的令牌个数还是38个;对于数据流队列Q2,因为权重值被压缩了100倍,所以在每次服务中下发的令牌个数为38*100=3800个;对于数据流队列Q3,因为权重值被压缩了10倍,所以在每次服务中下发的令牌个数为38*10=380个。
本发明实施例提供的数据流队列整形的方法,通过对大流量的数据流队列的权重值进行压缩,降低了大流量的数据流队列的权重值,提高了小流量的数据流队列的权重值,避免了权重值之间的过大差异,使小流量的数据流队列可以获得更多的服务次数,有效的减少了突发,提高了流量整形的效果和用户体验。另外,通过下发令牌规则使各个数据流队列获得了足够的令牌,达到了各数据流队列线速整形的目的,并且还保证了流量不损失。
相应地,本发明实施例还记载一种计算机存储介质,所述计算机存储介质中存储有计算机程序,所述计算机程序用于执行本发明实施例中图1、或图2所示的数据流队列整形的方法。
图3为本发明数据流队列整形的装置实施例的结构图,如图3所示,本实施例的装置03包括:权重压缩模块031、令牌数量确定模块032、服务次数确定模块033、令牌下发模块034。
其中,所述权重压缩模块031,配置为根据每个数据流队列的原始权重值,通过权重压缩规则得到所述每个数据流队列的新权重值;
所述令牌数量确定模块032,配置为根据所述数据流队列的新权重值之和,确定在每次服务中为所述每个数据流队列下发第一数量的令牌;
所述服务次数确定模块033,配置为根据所述数据流队列的新权重值,通过拥塞管理算法确定所述每个数据流队列的服务次数;
所述令牌下发模块034,配置为按照下发令牌规则,在每次服务中为所 述每个数据流队列下发所对应的第二数量的令牌。
在一具体实施例中,所述权重压缩模块031,具体配置为根据所述每个数据流队列的原始权重值与所述权重压缩规则,得到所述每个数据流队列的原始权重值的权重压缩倍数;若所述权重压缩倍数小于等于权重最大压缩倍数的整数值、且经过权重压缩后的权重值大于等于权重压缩后的最小权重值的整数值,则对所述原始权重值按照所述权重压缩倍数进行压缩计算,得到新权重值;若所述权重压缩倍数大于权重最大压缩倍数的整数值、或经过权重压缩后的权重值小于权重压缩后的最小权重值的整数值,则对所述原始权重值不进行权重压缩计算,新权重值等于所述原始权重值。
在一具体实施例中,所述令牌下发模块034,具体配置为为没经过权重压缩的所述数据流队列下发所述第一数量的令牌;为经过权重压缩的所述数据流队列下发所述第一数量与所述权重压缩倍数乘积数量的令牌。
在一具体实施例中,本实施例的装置03还包括:获取模块035,所述获取模块035,配置为获取所述每个数据流队列的原始权重值。
在一具体实施例中,所述拥塞管理算法为加权公平排队算法。
本实施例的装置,可以用于执行上述所示方法实施例的技术方案,其实现原理和技术效果类似,此处不再赘述。在实际应用中,所述权重压缩模块031、令牌数量确定模块032、服务次数确定模块033、令牌下发模块034、获取模块035可由位于装置上的中央处理器(CPU,Central Processing Unit)、微处理器(MPU,Micro Processor Unit)、数字信号处理器(DSP,Digital Signal Processor)或现场可编程门阵列(FPGA,Field Programmable Gate Array)等器件实现。
本领域内的技术人员应明白,本发明的实施例可提供为方法、系统、或计算机程序产品。因此,本发明可采用硬件实施例、软件实施例、或结合软件和硬件方面的实施例的形式。而且,本发明可采用在一个或多个其 中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器和光学存储器等)上实施的计算机程序产品的形式。
本发明是参照根据本发明实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。
以上所述,仅为本发明的较佳实施例而已,并非用于限定本发明的保护范围。
工业实用性
本发明实施例中,根据各个数据流队列的原始权重值通过预先设置的权重压缩规则,得到各个数据流队列的新权重值;以新权重值之和决定每次服务下发的令牌数量;根据各个数据流队列的新权重值通过加权公平排 队算法,获得各个数据流队列的服务次数;按照下发令牌规则,在每次服务中为各个数据流队列下发所对应数量的令牌;如此,通过对大流量的数据流队列的权重压缩,降低了大流量的数据流队列的权重,提高了小流量的数据流队列的权重,避免了权重值之间的过大差异,使小流量的数据流队列可以获得更多的服务次数,有效的减少了突发,提高了流量整形的效果和用户体验。

Claims (11)

  1. 一种数据流队列整形的方法,所述方法包括:
    根据每个数据流队列的原始权重值,通过权重压缩规则得到所述每个数据流队列的新权重值;
    根据所述数据流队列的新权重值之和,确定在每次服务中为所述每个数据流队列下发第一数量的令牌;
    根据所述数据流队列的新权重值,通过拥塞管理算法确定所述每个数据流队列的服务次数;
    按照下发令牌规则,在每次服务中为所述每个数据流队列下发所对应的第二数量的令牌。
  2. 根据权利要求1所述的方法,其中,所述根据所述每个数据流队列的原始权重值,通过权重压缩规则得到所述每个数据流队列的新权重值,包括:
    根据所述每个数据流队列的原始权重值与所述权重压缩规则,得到所述每个数据流队列的原始权重值的权重压缩倍数;
    若所述权重压缩倍数小于等于权重最大压缩倍数的整数值、且经过权重压缩后的权重值大于等于权重压缩后的最小权重值的整数值,则对所述原始权重值按照所述权重压缩倍数进行压缩计算,得到新权重值;
    若所述权重压缩倍数大于权重最大压缩倍数的整数值、或经过权重压缩后的权重值小于权重压缩后的最小权重值的整数值,则对所述原始权重值不进行权重压缩计算,新权重值等于所述原始权重值。
  3. 根据权利要求2所述的方法,其中,所述按照下发令牌规则,在每次服务中为所述每个数据流队列下发所对应的第二数量的令牌,包括:
    为没经过权重压缩的所述数据流队列下发所述第一数量的令牌;为经过权重压缩的所述数据流队列下发所述第一数量与所述权重压缩倍数乘积 数量的令牌。
  4. 根据权利要求1、2或3所述的方法,其中,所述得到所述每个数据流队列的新权重值之前,所述方法还包括:获取所述每个数据流队列的原始权重值。
  5. 根据权利要求4所述的方法,其中,所述拥塞管理算法为加权公平排队算法。
  6. 一种数据流队列整形的装置,所述装置包括:
    权重压缩模块,配置为根据每个数据流队列的原始权重值,通过权重压缩规则得到所述每个数据流队列的新权重值;
    令牌数量确定模块,配置为根据所述数据流队列的新权重值之和,确定在每次服务中为所述每个数据流队列下发第一数量的令牌;
    服务次数确定模块,配置为根据所述数据流队列的新权重值,通过拥塞管理算法确定所述每个数据流队列的服务次数;
    令牌下发模块,配置为按照下发令牌规则,在每次服务中为所述每个数据流队列下发所对应的第二数量的令牌。
  7. 根据权利要求6所述的装置,其中,所述权重压缩模块,具体配置为根据所述每个数据流队列的原始权重值与所述权重压缩规则,得到所述每个数据流队列的原始权重值的权重压缩倍数;若所述权重压缩倍数小于等于权重最大压缩倍数的整数值、且经过权重压缩后的权重值大于等于权重压缩后的最小权重值的整数值,则对所述原始权重值按照所述权重压缩倍数进行压缩计算,得到新权重值;若所述权重压缩倍数大于权重最大压缩倍数的整数值、或经过权重压缩后的权重值小于权重压缩后的最小权重值的整数值,则对所述原始权重值不进行权重压缩计算,新权重值等于所述原始权重值。
  8. 根据权利要求7所述的装置,其中,所述令牌下发模块,具体配置 为为没经过权重压缩的所述数据流队列下发所述第一数量的令牌;为经过权重压缩的所述数据流队列下发所述第一数量与所述权重压缩倍数乘积数量的令牌。
  9. 根据权利要求6、7或8所述的装置,其中,所述装置还包括:获取模块,配置为获取所述每个数据流队列的原始权重值。
  10. 根据权利要求9所述的装置,其中,所述拥塞管理算法为加权公平排队算法。
  11. 一种计算机存储介质,所述计算机存储介质中存储有计算机可执行指令,所述计算机可执行指令用于执行权利要求1至5任一项所述的方法。
PCT/CN2015/092934 2015-05-12 2015-10-27 数据流队列整形的方法、装置及计算机存储介质 Ceased WO2016179969A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510239627.7A CN106302231B (zh) 2015-05-12 2015-05-12 数据流队列整形的方法及装置
CN201510239627.7 2015-05-12

Publications (1)

Publication Number Publication Date
WO2016179969A1 true WO2016179969A1 (zh) 2016-11-17

Family

ID=57248672

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2015/092934 Ceased WO2016179969A1 (zh) 2015-05-12 2015-10-27 数据流队列整形的方法、装置及计算机存储介质

Country Status (2)

Country Link
CN (1) CN106302231B (zh)
WO (1) WO2016179969A1 (zh)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN107204930B (zh) * 2016-03-17 2020-05-19 深圳市中兴微电子技术有限公司 令牌添加方法及装置
CN110048964B (zh) * 2018-01-15 2023-09-12 深圳市中兴微电子技术有限公司 一种业务队列的整形方法、终端及存储介质

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1620782A (zh) * 2002-02-22 2005-05-25 连宇通信有限公司 一种在无线分组数据通信中的优先级控制方法
CN101127723A (zh) * 2007-09-24 2008-02-20 中兴通讯股份有限公司 多协议标签互换三层虚拟专用网服务质量保障方法
US20090190470A1 (en) * 2008-01-30 2009-07-30 Hinosugi Hideki Traffic shaping method and device
CN102387076A (zh) * 2011-10-19 2012-03-21 烽火通信科技股份有限公司 一种结合整形的分级式队列调度方法

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101599905B (zh) * 2009-06-30 2012-01-11 中兴通讯股份有限公司 一种实现流量整形令牌添加的方法、装置及系统
CN101834786B (zh) * 2010-04-15 2012-04-25 华为技术有限公司 队列调度的方法和装置

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1620782A (zh) * 2002-02-22 2005-05-25 连宇通信有限公司 一种在无线分组数据通信中的优先级控制方法
CN101127723A (zh) * 2007-09-24 2008-02-20 中兴通讯股份有限公司 多协议标签互换三层虚拟专用网服务质量保障方法
US20090190470A1 (en) * 2008-01-30 2009-07-30 Hinosugi Hideki Traffic shaping method and device
CN102387076A (zh) * 2011-10-19 2012-03-21 烽火通信科技股份有限公司 一种结合整形的分级式队列调度方法

Also Published As

Publication number Publication date
CN106302231A (zh) 2017-01-04
CN106302231B (zh) 2019-06-28

Similar Documents

Publication Publication Date Title
CN111553484B (zh) 联邦学习的方法、装置及系统
CN104918072B (zh) 低延时实况视频流传输
CN111428899B (zh) 网点业务的排队叫号方法及装置
CN104935622B (zh) 一种用于消息分配、消费的方法及装置,用于消息处理的系统
MY194420A (en) Blockchain service acceptance and consensus method and devices
WO2018059353A1 (zh) 消息处理方法及装置
CN106341696A (zh) 一种直播视频流处理方法和装置
CN109314673A (zh) 一种客户业务传输方法和装置
CN117651169B (zh) 音视频数据的传输方法、装置、设备、介质及程序产品
US9852520B2 (en) Implementing reduced video stream bandwidth requirements when remotely rendering complex computer graphics scene
CN111641563A (zh) 基于分布式场景的流量自适应方法与系统
CN108471399B (zh) 一种反洗钱作业中数据包的生成方法、存储介质和服务器
TW202018645A (zh) 基於區塊鏈的資料處理方法、裝置和伺服器
CN113961763A (zh) 处理乱序数据的方法、设备和可读存储介质
WO2019185372A1 (en) Congestion response for timely media delivery
WO2016179969A1 (zh) 数据流队列整形的方法、装置及计算机存储介质
CN113591999A (zh) 一种端边云联邦学习模型训练系统及方法
WO2014031104A1 (en) Congestion notification in a network
CN103229465A (zh) 一种发送报文的方法和设备
WO2017157064A1 (zh) 令牌添加方法、装置及计算机存储介质
JP7001004B2 (ja) 分散深層学習システム、分散深層学習方法、およびコンピューティングインタコネクト装置
CN109558442A (zh) 一种数据实时汇聚方法及系统
CN111277542A (zh) 一种电动汽车充电网络信息安全状态确定方法及装置
CN108966160A (zh) 一种短信处理方法、装置及计算机可读存储介质
CN106303646A (zh) 一种特效匹配的方法、电子设备及服务器

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 15891668

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 15891668

Country of ref document: EP

Kind code of ref document: A1