CN107204930A - Token adding method and device - Google Patents

Token adding method and device Download PDF

Info

Publication number
CN107204930A
CN107204930A CN201610158873.4A CN201610158873A CN107204930A CN 107204930 A CN107204930 A CN 107204930A CN 201610158873 A CN201610158873 A CN 201610158873A CN 107204930 A CN107204930 A CN 107204930A
Authority
CN
China
Prior art keywords
queue
weight
compression
shaping
token
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.)
Granted
Application number
CN201610158873.4A
Other languages
Chinese (zh)
Other versions
CN107204930B (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.)
Sanechips Technology Co Ltd
Shenzhen ZTE Microelectronics Technology Co Ltd
Original Assignee
Shenzhen ZTE Microelectronics 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 Shenzhen ZTE Microelectronics Technology Co Ltd filed Critical Shenzhen ZTE Microelectronics Technology Co Ltd
Priority to CN201610158873.4A priority Critical patent/CN107204930B/en
Priority to PCT/CN2016/110045 priority patent/WO2017157064A1/en
Publication of CN107204930A publication Critical patent/CN107204930A/en
Application granted granted Critical
Publication of CN107204930B publication Critical patent/CN107204930B/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
    • 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/20Traffic policing
    • 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/215Flow control; Congestion control using token-bucket
    • 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/22Traffic shaping

Landscapes

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

Abstract

The invention discloses a kind of token adding method and device;Method includes:Shaping weight based on each queue corresponding to target port, is compressed to meeting the shaping weight of queue of preparatory condition in individual queue, determines the compression weight of individual queue;Determine to be assigned to the object queue of service opportunity in individual queue, based on the shaping weight of benchmark weight, the compression weight of individual queue and object queue, it is determined that the token number added into the corresponding token bucket of object queue and addition.Implement the present invention, the bursts of traffic of the small queue of weight under the premise of the shaping rate for ensureing queue is accurate, can be reduced, the service quality of business is improved.

Description

Token adding method and device
Technical field
The present invention relates to the Research of Congestion Control Techniques of communication technical field, more particularly to a kind of token adding method and Device.
Background technology
With continuing to develop for network application, the continuous release of new business, such as IPTV (IPTV), the non-traditional number such as the networking telephone (VoIP, Voice over Internet Protocol), video conference According to communication service, the service quality (QoS, Quality of Service) of network is proposed higher time delay, Packet loss and shake control are required;For the realization of guaranteed qos, generally in network processing unit or router Special congestion management module is set, and congestion management module is used for how control frame, cell or packet to leave one Individual equipment.
The One function of congestion management module is speed limit, and this function is completed by shaping control assembly, shaping control The object of component control processed is queue, and queuing memory storage is same type of packet;Shaping control assembly So that in the shaping rate addition token of user configuring to the token bucket of queue, the queue for having token in token bucket can Equipment is left to dispatch packet, the order in queue token bucket can be consumed when queue scheduling packet leaves equipment Board;Existing monoblock control assembly typically gives queue assignment service opportunity, weighting point using weight assignment algorithm Adjusted with algorithm, such as Weighted Fair Queuing (WFQ, Weighted Fair Queuing), or weighted round-robin Algorithm (WRR, Weighted Round Robin) is spent, every time the token of service addition certain amount, token Number can be converted into bandwidth, and the token number of single service addition is equal to weight sum/benchmark weight of all queues, The benchmark shaping value of the benchmark weight corresponding device of equipment, that is, the shaping rate of user configuring is converted into One weighted value distributes to queue, and each queue obtains the chance of token addition, power according to the weight of itself The chance that great queue obtains token addition is more, and the chance that the small queue of weight obtains token addition is few.
However, the larger queue of weight can draw high the weight sum of all queues of system in system so that single Service addition token number it is also larger, the small queue of weight a period of time in obtain token number be it is fixed, The small queue of weight during this period of time, can only obtain seldom service opportunity, and service every time obtains relatively more Token so that the acquisition token of the small queue burst type of weight, however, the small queue of weight is in system The caching that can be taken is limited, and the ability that burst is born in the small queue of weight is poor, within a period of time, If burst capability is born in the bursts of traffic queue small more than weight, will occur data packet discarding, in this way, Can traffic affecting service quality.
The content of the invention
In view of this, the embodiment of the present invention is expected to provide a kind of token adding method and device, can ensure team Under the premise of the shaping rate of row is accurate, the bursts of traffic of the small queue of weight is reduced, the service of business is improved Quality.
To reach above-mentioned purpose, the technical proposal of the invention is realized in this way:
The embodiment of the present invention provides a kind of token adding method, including:
Shaping weight based on each queue corresponding to target port, to meeting default bar in each queue The shaping weight of the queue of part is compressed, and determines the compression weight of each queue;
Determine to be assigned to the object queue of service opportunity in each queue, based on benchmark weight, each team The compression weight of row and the shaping weight of the object queue, it is determined that to the corresponding token bucket of the object queue The token number of middle addition and addition.
The embodiment of the present invention also provides a kind of token adding set, including:
Determining module, for the shaping weight based on each queue corresponding to target port, to each team The shaping weight that the queue of preparatory condition is met in row is compressed, and determines the compression weight of each queue;
The determining module, is additionally operable to the object queue for determining to be assigned to service opportunity in each queue, base In the shaping weight of benchmark weight, the compression weight of each queue and the object queue, it is determined that to described The token number added in the corresponding token bucket of object queue;
Distribution module, is determined for adding the determining module into the corresponding token bucket of the object queue The token number of addition.
In the embodiment of the present invention, it is compressed, ensures simultaneously to meeting the shaping weight of queue of preparatory condition The shaping weight of the queue of preparatory condition is unsatisfactory for, is determined to need to object queue according to the compression weight of queue The token number added in the token bucket of (queue serviced), in this way, the compression weight sum of individual queue Less than the shaping weight sum of individual queue, it is uncompressed due to being unsatisfactory for the shaping weight of queue of preparatory condition (shaping weight is equal to compression weight), therefore, the present embodiment can increase the clothes for the queue for being unsatisfactory for preparatory condition It is engaged in chance, and reduces and be unsatisfactory for the queue of preparatory condition and need to add into corresponding token bucket when obtaining service Plus token number, and then reduce be unsatisfactory for preparatory condition queue bursts of traffic, improve business Service Quality Amount.
Brief description of the drawings
Fig. 1 is an optional schematic flow sheet of token adding method in the embodiment of the present invention;
Fig. 2 is another optional schematic flow sheet of token adding method in the embodiment of the present invention;
Fig. 3 is another optional schematic flow sheet of token adding method in the embodiment of the present invention;
Fig. 4 is another optional schematic flow sheet of token adding method in the embodiment of the present invention;
Fig. 5 is an optional structural representation of token adding set in the embodiment of the present invention;
Fig. 6 is another optional structural representation of token adding set in the embodiment of the present invention.
Embodiment
Below in conjunction with drawings and Examples, technical scheme is clearly and completely described.
(it is first below that token adds in following specific embodiment to the device for implementing the embodiment of the present invention Feeder apparatus) illustrate, token adding set can be adopted in various manners to implement, such as in network processes Implement all components (such as, the token adding set of token adding set in the network equipments such as device, router In the shaping control assembly for the congestion management module that can be integrated in the above-mentioned network equipment), or, upper Implement the component in token adding set in a coupled manner in the network equipment side stated.
Token adding set based on above-mentioned record, proposes following specific embodiment.
Embodiment one
The present embodiment records a kind of token adding method, can apply to as follows to solve in congestion management techniques Problem:Wish under the premise of the shaping rate for ensureing queue is accurate, reduce the flow of the small queue of weight Burst, improves the service quality of business;The present embodiment is illustrated for the processing of this situation.
Referring to Fig. 1, the token adding method that the present embodiment is recorded comprises the following steps:
Step 101, the shaping weight based on each queue corresponding to target port, to being met in individual queue The shaping weight of the queue of preparatory condition is compressed, and determines the compression weight of individual queue.
In the present embodiment, target port can refer to one or more data-interfaces of the above-mentioned network equipment, For the message that need to be sent through data-interface, characteristic information of the scheduler based on the message of the network equipment is carried out Analysis, the message is distributed into the queue corresponding to the characteristic information of the message;User is corresponding to target Each queue of port is respectively configured shaping rate, shaping rate can for committed information rate (CIR, Committed Information Rate) or beyond information rate (EIR, Excess Information Rate); Benchmark shaping rate refers to the maximum data rate that the network equipment is allowed, and benchmark weight corresponds to benchmark shaping Speed;Shaping rate based on benchmark shaping rate, benchmark weight and queue, it may be determined that queue is in network Shaping weight in equipment;Optionally, ratio of the shaping rate with benchmark shaping rate of queue is calculated, then Calculate the product of the ratio and benchmark weight, using obtained product value as queue shaping weight.
It is at least two classes, i.e. shaping that each queue corresponding to target port is defined (division) by the present embodiment The larger queue of weight, the less queue of shaping weight;Specifically, the present embodiment is defined by preparatory condition Whether one queue belongs to the larger queue of shaping weight, and the queue that preparatory condition is met in individual queue is defined For the queue that shaping weight is larger, and the queue for being unsatisfactory for preparatory condition is defined as the less team of shaping weight Row;Here, mark at least includes first queue and second queue corresponding to each queue of target port, false If first queue is defined as belonging to the larger queue of shaping weight, second queue due to meeting preparatory condition It is defined as belonging to the less queue of shaping weight due to being unsatisfactory for preparatory condition.
The present embodiment is for the larger queue of the above-mentioned shaping weight defined and the less queue difference of shaping weight Different processing methods are taken to obtain the compression weight of individual queue:
1) for the larger queue of the above-mentioned shaping weight defined, the shaping weight to the queue is compressed, The weight that compression is obtained is defined as the compression weight of the queue;For example, the shaping weight to first queue is entered Row compression, the weight that compression is obtained is defined as the compression weight of first queue.
2) the above-mentioned less queue of shaping weight defined is directed to, the shaping weight of the queue is defined as compression Weight;For example, the shaping weight of second queue to be defined as to the compression weight of second queue.
The present embodiment is after the shaping weight of the queue to meeting preparatory condition is compressed, on the one hand, meet The compression weight of the queue of preparatory condition is less than shaping weight, is unsatisfactory for the compression weight of the queue of preparatory condition Equal to shaping weight, it is possible thereby to know, the compression weight sum of above-mentioned individual queue is less than above-mentioned individual queue Shaping weight sum;On the other hand, compression of the token adding set based on above-mentioned individual queue in the present invention is weighed The service opportunity of individual queue is determined again, and specifically, token adding set calculates the compression weight sum of individual queue, The ratio of queue and summing value is calculated again, and the ratio that calculating is obtained is defined as the service opportunity of queue, every team Row are serviced with each self-corresponding service opportunity (probability);The whole of individual queue is used compared to prior art Shape weight be individual queue distribute service opportunity, the present invention in using individual queue compression weight for individual queue distribution Service opportunity, because the compression weight sum of individual queue is less than the shaping weight sum of individual queue, and shaping is weighed The compression weight of the less queue of weight is equal to shaping weight, can improve the service of the less queue of shaping weight Chance.
Step 102, determine to be assigned to the object queue of service in individual queue, based on benchmark weight, individual queue Compression weight and object queue shaping weight, it is determined that the order added into the corresponding token bucket of object queue Board number is simultaneously added.
Token adding set determines to be assigned to after the object queue of service in individual queue, based on benchmark weight, respectively The compression weight of queue and the shaping weight of object queue, the compression weight to object queue are decompressed, According to the compression situation of the shaping weight of object queue, determine when single is serviced to the corresponding token of object queue The token number added in bucket, is added during the single service of above-mentioned determination into the corresponding token bucket of object queue Token number can ensure that the shaping rate of object queue is accurate.
In the present embodiment, the size based on shaping weight treats each queue of target port with a certain discrimination, to meeting The shaping weight of the queue of preparatory condition is compressed, while ensureing to be unsatisfactory for the shaping of the queue of preparatory condition Weight, determines to need the token bucket to object queue (queue serviced) according to the compression weight of queue The token number of middle addition, in this way, the compression weight sum of individual queue is less than the shaping weight sum of individual queue, Because the shaping weight for the queue for being unsatisfactory for preparatory condition is uncompressed (shaping weight is equal to compression weight), because This, the present embodiment can increase the service opportunity for the queue for being unsatisfactory for preparatory condition, and reduction is unsatisfactory for presetting The queue of condition needs the token number added into corresponding token bucket when obtaining service, and then reduces discontented The bursts of traffic of the queue of sufficient preparatory condition, improves the service quality of business.
Embodiment two
The present embodiment is based on embodiment one, for specifically how situation about being compressed to the shaping weight of queue Illustrate, the present embodiment is illustrated by taking any queue in above-mentioned individual queue as an example.
Referring to Fig. 2, the token adding method that the present embodiment is recorded comprises the following steps:
Step 201, the shaping weight for obtaining the queue for corresponding to target port.
Step 202, judge queue shaping weight whether be more than weight retention, if so, then going to step 203, otherwise, go to step 207.
Weight retention can be pre-set according to actual needs.
Step 203, according to the weight compressed coefficient shaping weight of queue is compressed.
The weight compressed coefficient can be pre-set according to actual needs.
Step 204, judge whether compression result is more than weight retention, it is no if so, then go to step 205 Then, step 206 is gone to.
Step 205, using compression result as queue compression weight;Jump to step 208.
Step 206, using weight retention as queue compression weight;Jump to step 208.
Step 207, using the shaping weight of queue as queue compression weight.
Step 208, determine whether that all queues corresponding to target port have determined that compression weight, if It is then to go to step 209, otherwise goes to step 201.
Step 209, determine to be assigned to the object queue of service opportunity in individual queue, based on benchmark weight, each The compression weight of queue and the shaping weight of object queue, it is determined that being added into the corresponding token bucket of object queue Token number and addition.
In the present embodiment, above-mentioned preparatory condition is:The shaping weight of queue is more than weight retention;This area Technical staff is appreciated that above-mentioned preparatory condition is not limited to the example recorded herein, as long as can will be each The condition or method that the shaping weight of queue is classified are all within protection scope of the present invention.
The present embodiment treats the big queue of shaping weight and the small queue of shaping weight, compression shaping weight with a certain discrimination The shaping weight of big queue, not few compression or the shaping weight of the small queue of compression shaping weight.
Embodiment three
The present embodiment is based on embodiment one, for specifically how to determine to the corresponding token of queue for obtaining service The situation of the token number added in bucket is illustrated, and the present embodiment is by taking any queue in above-mentioned individual queue as an example Illustrate.
Referring to Fig. 3, the token adding method that the present embodiment is recorded comprises the following steps:
Step 301, the shaping weight for obtaining the queue for corresponding to target port.
Step 302, the shaping weight based on each queue corresponding to target port, to being met in individual queue The shaping weight of the queue of preparatory condition is compressed, and determines the compression weight of individual queue.
Step 303, determine to be assigned to the object queue of service opportunity in individual queue.
Step 304, the compression weight based on benchmark weight and individual queue determine the minimum order of single service addition Board number.
Determining the implementation of the minimum token number of single service addition can include:Calculate the compression of individual queue Weight sum;The ratio of summing value and benchmark weight is calculated again;The ratio that calculating is obtained is defined as single clothes The minimum token number of business addition.
Step 305, judge object queue shaping weight whether be less than or equal to weight retention;If so, then Step 306 is gone to, step 307 is otherwise gone to.
Weight retention can be pre-set according to actual needs.
Step 306, the minimum token number that single service is added is defined as needing to the corresponding order of object queue The token number added in board bucket;Jump to step 311.
Step 307, according to the weight compressed coefficient shaping weight of object queue is compressed.
Step 308, judge whether compression result is less than or equal to weight retention, if so, then go to step 309, Otherwise step 310 is gone to.
Step 309, calculate object queue shaping weight and weight retention ratio, then ratio calculated and The product of the minimum token number of single service addition, the product value that calculating is obtained is defined as needing to target team Arrange the token number added in corresponding token bucket;Jump to step 311.
Step 310, the product for calculating the weight compressed coefficient and the minimum token number of single service addition, will be counted Obtained product value is defined as the token number for needing to add into the corresponding token bucket of object queue.
Step 311, based on identified token number, add corresponding into the corresponding token bucket of object queue Token.
The weight compressed coefficient can be pre-set according to actual needs.
Compression weight sum in the present embodiment due to individual queue is less than the shaping weight sum of individual queue, is based on The minimum token number and prior art phase for the single service addition that the compression weight and benchmark weight of individual queue are determined Reduce than, on the one hand, token adding set is to the small queue pair of the shaping weight for being assigned to service opportunity The token number added in the token bucket answered is the minimum token number that single service is added, i.e., compared with prior art It has been reduced that, and then the bursts of traffic of the small queue of shaping weight can be reduced;On the other hand, token addition dress Put and compression weight decompressed with reference to the weight compressed coefficient and weighted value, by single service add it is minimum Token number is multiplied by the weight compressed coefficient or shaping weight and the ratio of weight retention, is defined as being assigned to service The token number added in the big corresponding token bucket of queue of the shaping weight of chance so that the big team of shaping weight Arrange the token number added in corresponding token bucket to approach with number of the prior art, can so ensure queue Shaping rate it is accurate.
Example IV
Based on the various embodiments described above, the present embodiment is recorded a kind of token adding method, can apply to end Jing Zhong:During congestion management, it would be desirable under the premise of the shaping rate for ensureing queue is accurate, reduce The bursts of traffic of the small queue of weight, improves the service quality of business;The present embodiment is directed to the processing of this situation Illustrate.
In the prior art, there is the larger queue of some weights in system (such as target port), exist The weight sum of all queues of system has been drawn high in the less queue of weight, the larger queue of weight so that single Service addition token number it is larger, the small queue of weight a period of time in obtain token number be it is fixed, When the token number that single service is added is larger, the small queue of weight during this period of time, can only be obtained seldom Service opportunity, service every time obtains more tokens, can so cause the small queue burst type of weight Token is obtained, the caching that the small queue of weight can take in system is limited, and it is small that this results in weight The ability that burst is born in queue is poor, within a period of time, if bursts of traffic exceedes the small queue of weight If the ability to bear of caching, will occur data packet discarding.
The present embodiment treats the big queue of weight and the small queue of weight with a certain discrimination to solve the problem, compression The weighted value of the big queue of weight, while ensureing the weighted value of the small queue of weight, reduces all queues Weight sum, reduces single service token addition number;Bandwidth allocation is carried out according to the weight after compression;For Ensure that the shaping rate of user configuring is accurate, when queue being serviced, it is necessary to be decompressed to compression weight Contracting, calculating obtains compression multiple k, and (k is positive integer, is 2 power side, for representing that the shaping of queue is weighed The multiple that weight is compressed), the token number added into the corresponding token bucket of queue, which is equal to single service, to be added most Few token number is multiplied by compression multiple k.
Referring to Fig. 4, the token adding method that the present embodiment is recorded comprises the following steps:
Step 401, the shaping rate for obtaining the individual queue for corresponding to target port, obtain weight compressed coefficient a And weight retention b, wherein, a is positive integer, and a is 2 power side, and b is positive integer, and b is 2 Power side.
Compression the weight d, wherein d for calculating individual queue separately below are positive integer, are used when token is distributed.
Step 402, for any one queue, according to the shaping rate of queue, determine the shaping power of queue Weight c;Calculation formula is as follows:
C=(shaping rate of queue/benchmark shaping rate) * benchmark weights.
Step 403, judge queue shaping weight c whether be less than or equal to weight retention b:If so, then turning To step 406, step 404 is otherwise gone to.
Step 404, by shaping weight c divided by weight compressed coefficient a, judge ratio whether be less than or equal to weight Retention b, if so, then going to step 405, otherwise goes to step 407.
Step 405, the compression weight d of queue are equal to weight retention b;Go to step 408.
Step 406, the compression weight d of queue are equal to shaping weighted value c;Go to step 408.
Step 407, the compression weight d of queue are equal to result of calculation, i.e. shaping weight c divided by weight is compressed The ratio that coefficient a is obtained.
Step 408, determine whether that all queues corresponding to target port have determined that compression weight, if It is then to go to step 409, otherwise goes to step 402.
Step 409, the compression weight based on weighting algorithm and individual queue determine the service opportunity of individual queue.
Weighting algorithm, such as WFQ or DWRR;For any queue A, individual queue is calculated first Weight sum is compressed, then calculates queue A and the ratio of summing value, the ratio that calculating is obtained is defined as queue A service opportunity;Individual queue obtains token sorter meeting with each self-corresponding service opportunity (probability).
Step 410, the compression weight based on benchmark weight and individual queue determine the minimum order of single service addition Board number N1.
The minimum token number N1 of single service addition is equal to the compression weight sum divided by benchmark power of all queues Weight.
Step 411, the object queue for being assigned to service opportunity, judge the shaping weight c of object queue Whether weight retention b is less than or equal to;If so, then going to step 412, step 413 is otherwise gone to.
In step 412, the step, compression multiple k=1 needs to add into the corresponding token bucket of object queue Plus the service of token number n=singles addition minimum token number N1;Jump to step 416;
The ratio c/a of step 413, the shaping weight c and weight compressed coefficient a of calculating object queue, judges Whether ratio c/a is less than or equal to weight retention b, if then going to step 414, otherwise goes to step 415;
The ratio c/b of step 414, the shaping weight c and weight retention b of calculating object queue, then calculate In the product (c/b*N1) for the minimum token number N1 that ratio c/b is added with single service, the step, compression Multiple k=c/b, that is, need the token number n=c/b*N1 added into the corresponding token bucket of object queue;Redirect To step 416.
Step 415, the product for calculating weight compressed coefficient a and the minimum token number N1 of single service addition (a*N1), in the step, compression multiple k=a needs what is added into the corresponding token bucket of object queue Token number n=a*N1.
Step 416, based on identified token number n, add corresponding into the corresponding token bucket of object queue Token.
The present embodiment is under the premise of ensureing that user configuring shaping rate is accurate, shaping rate in increase a period of time The chance of less queue service, reduces the burst of the less queue of shaping rate, is not increasing shaping rate On the premise of small queue system EMS memory occupation amount, the ability that burst is born in the small queue of shaping rate is added, Reduce the possibility of the small queue packet loss of shaping rate.More preferable shaping effect is provided, the QoS of system is improved Performance.
Embodiment five
Corresponding with example IV, the present embodiment records a kind of token adding set, can be used for performing embodiment Four scheme, token adding set can be the equipment specially set to implement the embodiment of the present invention, also may be used To be built in network device internal, the network equipment can include network processing unit, router, referring to Fig. 5, The token adding set that the present embodiment is recorded includes:
Configuration module 501, shaping compression computing module 502, shaping decompression calculations module 503, token point Module 504, token consumable module 505, memory module 506 are sent out, wherein:
Configuration module 501, for configuring the whole of (acquisition) the weight compressed coefficient, weight retention and queue Shape weight, the other necessary informations of configuration;
Computing module 502 is compressed in shaping, for performing step 401 to the weight compaction algorithms of step 408, Calculate the final weight value (the compression weight of queue) for obtaining queue;
Shaping decompression calculations module 503, the weight for performing step 411 to step 415 decompresses fortune Calculate, calculating obtains token addition number;
Token distribution module 504, according to weighting algorithm and the final weight value of queue (the compression weight of queue), Token service chance is distributed to each queue, and obtained according to being calculated in shaping decompression calculations module 503 Token adds number, and corresponding token is added into the token bucket of queue.
Token consumable module 505, when queue scheduling packet leaves equipment, consumes corresponding token number.
Memory module 506, stores the letters such as the weight compressed coefficient, weight retention and the shaping weighted value of queue Breath and other necessary informations.
The present embodiment is under the premise of ensureing that user configuring shaping rate is accurate, shaping rate in increase a period of time The chance of less queue service, reduces the burst of the less queue of shaping rate, is not increasing shaping rate On the premise of small queue system EMS memory occupation amount, the ability that burst is born in the small queue of shaping rate is added, Reduce the possibility of the small queue packet loss of shaping rate.More preferable shaping effect is provided, the QoS of system is improved Performance.
Embodiment six
Corresponding with previous embodiment, the present embodiment is illustrated for foregoing token adding set, and token adds Feeder apparatus can be used for the token adding method for performing the embodiment of the present invention, and token adding set can be for reality The equipment applied the embodiment of the present invention and specially set, can also be built in network device internal, and the network equipment can With including network processing unit, router, referring to Fig. 6, the token adding set that the present embodiment is recorded includes:
Determining module 601, for the shaping weight based on each queue corresponding to target port, to every team The shaping weight that the queue of preparatory condition is met in row is compressed, and determines the compression weight of individual queue;
Determining module 601, is additionally operable to the object queue for determining to be assigned to service opportunity in individual queue, based on base The shaping weight of quasi- weight, the compression weight of individual queue and object queue, it is determined that to the corresponding order of object queue The token number added in board bucket;
Distribution module 602, for adding the addition that determining module is determined into the corresponding token bucket of object queue Token number.
In the present embodiment, the size based on shaping weight treats each queue of target port with a certain discrimination, to meeting The shaping weight of the queue of preparatory condition is compressed, while ensureing to be unsatisfactory for the shaping of the queue of preparatory condition Weight, determines to need the token bucket to object queue (queue serviced) according to the compression weight of queue The token number of middle addition, in this way, the compression weight sum of individual queue is less than the shaping weight sum of individual queue, Because the shaping weight for the queue for being unsatisfactory for preparatory condition is uncompressed (shaping weight is equal to compression weight), because This, the present embodiment can increase the service opportunity for the queue for being unsatisfactory for preparatory condition, and reduction is unsatisfactory for presetting The queue of condition needs the token number added into corresponding token bucket when obtaining service, and then reduces discontented The bursts of traffic of the queue of sufficient preparatory condition, improves the service quality of business.
Optionally, determining module 601, retain specifically for judging whether the shaping weight of queue is more than weight Value;If so, being then compressed according to the weight compressed coefficient to the shaping weight of queue, when it is determined that compression result During more than weight retention using compression result as queue compression weight, when it is determined that compression result is not more than power Weight retention when using weight retention as queue compression weight;
Otherwise, using the shaping weight of queue as queue compression weight.
Optionally, determining module 601, are additionally operable to it is determined that being assigned to the target team of service opportunity in individual queue Before row, according to the compression weight of individual queue, the service opportunity of individual queue is determined.
Optionally, determining module 601, the compression weight sum specifically for calculating individual queue;Team is calculated again Row and the ratio of summing value;The ratio that calculating is obtained is defined as the service opportunity of queue.
Optionally, determining module 601, specifically for:Compression weight based on benchmark weight and individual queue is true The minimum token number of order time service addition;Judge whether the shaping weight of object queue is not more than weight and retains Value;
If so, then the minimum token number that single service is added is defined as to need to the corresponding token of object queue The token number added in bucket;
Otherwise, the shaping weight of object queue is compressed according to the weight compressed coefficient, when it is determined that compression knot When fruit is not more than weight retention, the shaping weight of object queue and the ratio of weight retention are calculated, then count The product for the minimum token number that ratio is added with single service is calculated, the product value that calculating is obtained is defined as needs The token number added into the corresponding token bucket of object queue;When it is determined that compression result is more than weight retention, The product for the minimum token number that the weight compressed coefficient is added with single service is calculated, the product value that calculating is obtained It is defined as the token number for needing to add into the corresponding token bucket of object queue.
Optionally, determining module 601, the compression weight sum specifically for calculating individual queue;Calculate and ask again With the ratio of value and benchmark weight;The ratio that calculating is obtained is defined as the minimum token number of single service addition.
In actual applications, determining module 601, distribution module 602, can be by the center positioned at the network equipment Processor (CPU), microprocessor (MPU), digital signal processor (DSP) or field programmable gate Array (FPGA) etc. is realized.
Embodiment seven
Physical embodiment
The present embodiment records a kind of computer-readable medium, can for ROM (for example, read-only storage, FLASH memory, transfer device etc.), magnetic storage medium (for example, tape, disc driver etc.), light Learn storage medium (for example, CD-ROM, DVD-ROM, paper card, paper tape etc.) and other know class The program storage of type;Be stored with computer executable instructions in computer-readable medium, when executing an instruction, At least one computing device is caused to include following operation:
Shaping weight based on each queue corresponding to target port, to meeting preparatory condition in individual queue The shaping weight of queue is compressed, and determines the compression weight of individual queue;
Determine to be assigned to the object queue of service opportunity, the compression based on benchmark weight, individual queue in individual queue The shaping weight of weight and object queue, it is determined that the token number added into the corresponding token bucket of object queue is simultaneously Addition.
Optionally, the shaping weight based on each queue corresponding to target port, to meeting pre- in individual queue If the shaping weight of the queue of condition is compressed, the compression weight of individual queue is determined, including:Judge queue Shaping weight whether be more than weight retention;If so, then being weighed according to the weight compressed coefficient to the shaping of queue It is compressed, is weighed when it is determined that compression result is more than weight retention using compression result as the compression of queue again Weight, when it is determined that compression result is not more than weight retention using weight retention as queue compression weight;
Otherwise, using the shaping weight of queue as queue compression weight.
Optionally, determine to be assigned to before the object queue of service opportunity in individual queue, method also includes:Root According to the compression weight of individual queue, the service opportunity of individual queue is determined.
Optionally, according to the compression weight of individual queue, the service opportunity of individual queue is determined, including:Calculate each The compression weight sum of queue;The ratio of queue and summing value is calculated again;The ratio that calculating is obtained is defined as The service opportunity of queue.
Optionally, the shaping weight based on benchmark weight, the compression weight of individual queue and object queue, it is determined that The token number added into the corresponding token bucket of object queue, including:Pressure based on benchmark weight and individual queue Contracting weight determines the minimum token number of single service addition;Judge whether the shaping weight of object queue is not more than Weight retention;If so, then the minimum token number that single service is added is defined as to need to object queue pair The token number added in the token bucket answered;Otherwise, according to shaping weight of the weight compressed coefficient to object queue Be compressed, when it is determined that compression result is not more than weight retention, calculate object queue shaping weight with The ratio of weight retention, then ratio calculated and the product of the minimum token number of single service addition, will be calculated Obtained product value is defined as the token number for needing to add into the corresponding token bucket of object queue;When it is determined that pressure When sheepshank fruit is more than weight retention, the minimum token number that the weight compressed coefficient is added with single service is calculated Product, the product value that calculating is obtained is defined as the token for needing to add into the corresponding token bucket of object queue Number.
Optionally, the compression weight based on benchmark weight and individual queue determines the minimum token of single service addition Number, including:Calculate the compression weight sum of individual queue;The ratio of summing value and benchmark weight is calculated again;Will Calculate the minimum token number that obtained ratio is defined as single service addition.
To sum up, it is compressed in the embodiment of the present invention by the shaping weight of the queue to meeting preparatory condition, Simultaneously ensure be unsatisfactory for preparatory condition queue shaping weight, according to the compression weight of queue determine need to The token number added in the token bucket of object queue (queue serviced), in this way, the compression of individual queue Weight sum is less than the shaping weight sum of individual queue, the shaping weight of the queue due to being unsatisfactory for preparatory condition (shaping weight is equal to compression weight) is uncompressed, therefore, the present embodiment, which can increase, is unsatisfactory for preparatory condition The service opportunity of queue, and reduce and be unsatisfactory for the queue of preparatory condition and needed when obtaining service to corresponding order The token number added in board bucket, and then the bursts of traffic for the queue for being unsatisfactory for preparatory condition is reduced, improve business Service quality.
It should be understood by those skilled in the art that, embodiments of the invention can be provided as method, system or meter Calculation machine program product.Therefore, the present invention can using hardware embodiment, software implementation or combine software and The form of the embodiment of hardware aspect.Moreover, the present invention can be used wherein includes calculating one or more The computer-usable storage medium of machine usable program code (includes but is not limited to magnetic disk storage and optical storage Device etc.) on the form of computer program product implemented.
The present invention is with reference to method according to embodiments of the present invention, equipment (system) and computer program product Flow chart and/or block diagram describe.It should be understood that can be by computer program instructions implementation process figure and/or side Each flow and/or square frame in block diagram and flow and/or the knot of square frame in flow chart and/or block diagram Close.Can provide these computer program instructions to all-purpose computer, special-purpose computer, Embedded Processor or The processor of other programmable data processing devices is to produce a machine so that by computer or other can The instruction of the computing device of programming data processing equipment is produced for realizing in one flow or multiple of flow chart The device for the function of being specified in one square frame of flow and/or block diagram or multiple square frames.
These computer program instructions, which may be alternatively stored in, can guide computer or other programmable data processing devices In the computer-readable memory worked in a specific way so that be stored in the computer-readable memory Instruction, which is produced, includes the manufacture of command device, and the command device is realized in one flow of flow chart or multiple streams The function of being specified in one square frame of journey and/or block diagram or multiple square frames.
These computer program instructions can be also loaded into computer or other programmable data processing devices, made Obtain and series of operation steps performed on computer or other programmable devices to produce computer implemented processing, So as to which the instruction performed on computer or other programmable devices is provided for realizing in one flow of flow chart Or specified in one square frame of multiple flows and/or block diagram or multiple square frames function the step of.
The foregoing is only a preferred embodiment of the present invention, is not intended to limit the protection model of the present invention Enclose.

Claims (12)

1. a kind of token adding method, it is characterised in that methods described includes:
Shaping weight based on each queue corresponding to target port, to meeting default bar in each queue The shaping weight of the queue of part is compressed, and determines the compression weight of each queue;
Determine to be assigned to the object queue of service opportunity in each queue, based on benchmark weight, each team The compression weight of row and the shaping weight of the object queue, it is determined that to the corresponding token bucket of the object queue The token number of middle addition and addition.
2. according to the method described in claim 1, it is characterised in that described based on corresponding to target port The shaping weight of each queue, the shaping weight of the queue to meeting preparatory condition in each queue is pressed Contracting, determines the compression weight of each queue, including:
Judge whether the shaping weight of the queue is more than weight retention;
If so, being then compressed according to the weight compressed coefficient to the shaping weight of the queue, when it is determined that described Compression result be more than the weight retention when using the compression result as the queue compression weight, when Determine to regard the weight retention as the queue when compression result is not more than the weight retention Compress weight;
Otherwise, using the shaping weight of the queue as the queue compression weight.
3. according to the method described in claim 1, it is characterised in that described to determine to distribute in each queue To before the object queue of service opportunity, methods described also includes:
According to the compression weight of each queue, the service opportunity of each queue is determined.
4. method according to claim 3, it is characterised in that the compression according to each queue Weight, determines the service opportunity of each queue, including:
Calculate the compression weight sum of each queue;
The ratio of the queue and the summing value is calculated again;
The ratio that calculating is obtained is defined as the service opportunity of the queue.
5. according to the method described in claim 1, it is characterised in that it is described based on benchmark weight, it is each described The compression weight of queue and the shaping weight of the object queue, it is determined that to the corresponding token of the object queue The token number added in bucket, including:
Compression weight based on benchmark weight and each queue determines the minimum token number of single service addition;
Judge whether the shaping weight of the object queue is not more than weight retention;
If so, the minimum token number for then adding the single service is defined as needing to the object queue pair The token number added in the token bucket answered;
Otherwise, the shaping weight of the object queue is compressed according to the weight compressed coefficient, when it is determined that institute When stating compression result and being not more than the weight retention, the shaping weight and the power of the object queue are calculated The ratio of weight retention, then calculate the product for the minimum token number that the ratio and the single service are added, The product value that calculating is obtained is defined as the token number for needing to add into the corresponding token bucket of the object queue; When it is determined that the compression result is more than the weight retention, the weight compressed coefficient and the list are calculated The product of the minimum token number of secondary service addition, the product value that calculating is obtained is defined as needing to the target The token number added in the corresponding token bucket of queue.
6. method according to claim 5, it is characterised in that described based on benchmark weight and each described The compression weight of queue determines the minimum token number of single service addition, including:
Calculate the compression weight sum of each queue;
The ratio of the summing value and benchmark weight is calculated again;
The ratio that calculating is obtained is defined as the minimum token number of single service addition.
7. a kind of token adding set, it is characterised in that described device includes:
Determining module, for the shaping weight based on each queue corresponding to target port, to each team The shaping weight that the queue of preparatory condition is met in row is compressed, and determines the compression weight of each queue;
The determining module, is additionally operable to the object queue for determining to be assigned to service opportunity in each queue, base In the shaping weight of benchmark weight, the compression weight of each queue and the object queue, it is determined that to described The token number added in the corresponding token bucket of object queue;
Distribution module, is determined for adding the determining module into the corresponding token bucket of the object queue The token number of addition.
8. device according to claim 7, it is characterised in that the determining module, specifically for sentencing Whether the shaping weight of the disconnected queue is more than weight retention;
If so, being then compressed according to the weight compressed coefficient to the shaping weight of the queue, when it is determined that described Compression result be more than the weight retention when using the compression result as the queue compression weight, when Determine to regard the weight retention as the queue when compression result is not more than the weight retention Compress weight;
Otherwise, using the shaping weight of the queue as the queue compression weight.
9. device according to claim 7, it is characterised in that the determining module, is additionally operable to true It is assigned in fixed each queue before the object queue of service opportunity, according to the compression weight of each queue, Determine the service opportunity of each queue.
10. device according to claim 9, it is characterised in that the determining module, specifically for Calculate the compression weight sum of each queue;The ratio of the queue and the summing value is calculated again;Will meter Obtained ratio is defined as the service opportunity of the queue.
11. device according to claim 7, it is characterised in that the determining module, specifically for:
Compression weight based on benchmark weight and each queue determines the minimum token number of single service addition;
Judge whether the shaping weight of the object queue is not more than weight retention;
If so, the minimum token number for then adding the single service is defined as needing to the object queue pair The token number added in the token bucket answered;
Otherwise, the shaping weight of the object queue is compressed according to the weight compressed coefficient, when it is determined that institute When stating compression result and being not more than the weight retention, the shaping weight and the power of the object queue are calculated The ratio of weight retention, then calculate the product for the minimum token number that the ratio and the single service are added, The product value that calculating is obtained is defined as the token number for needing to add into the corresponding token bucket of the object queue; When it is determined that the compression result is more than the weight retention, the weight compressed coefficient and the list are calculated The product of the minimum token number of secondary service addition, the product value that calculating is obtained is defined as needing to the target The token number added in the corresponding token bucket of queue.
12. device according to claim 7, it is characterised in that the determining module, specifically for Calculate the compression weight sum of each queue;The ratio of the summing value and benchmark weight is calculated again;Will meter Obtained ratio is defined as the minimum token number of single service addition.
CN201610158873.4A 2016-03-17 2016-03-17 Token adding method and device Active CN107204930B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201610158873.4A CN107204930B (en) 2016-03-17 2016-03-17 Token adding method and device
PCT/CN2016/110045 WO2017157064A1 (en) 2016-03-17 2016-12-15 Token adding method and device, and computer storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610158873.4A CN107204930B (en) 2016-03-17 2016-03-17 Token adding method and device

Publications (2)

Publication Number Publication Date
CN107204930A true CN107204930A (en) 2017-09-26
CN107204930B CN107204930B (en) 2020-05-19

Family

ID=59851916

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610158873.4A Active CN107204930B (en) 2016-03-17 2016-03-17 Token adding method and device

Country Status (2)

Country Link
CN (1) CN107204930B (en)
WO (1) WO2017157064A1 (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110048964A (en) * 2018-01-15 2019-07-23 深圳市中兴微电子技术有限公司 A kind of shaping methods of service queue, terminal and storage medium
WO2022178872A1 (en) * 2021-02-26 2022-09-01 华为技术有限公司 Traffic shaping method and device
WO2022232976A1 (en) * 2021-05-06 2022-11-10 华为技术有限公司 Token bucket-based flow control method and network device

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113612699B (en) * 2021-08-02 2023-12-08 上海航天测控通信研究所 Method for improving transmission efficiency of IP over CCSDS

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0561563A2 (en) * 1992-03-18 1993-09-22 AT&T Corp. Methods and apparatus for studying very large sets of data
CN101599905A (en) * 2009-06-30 2009-12-09 中兴通讯股份有限公司 A kind of method, Apparatus and system of realizing that traffic shaping token adds
CN103259743A (en) * 2012-02-15 2013-08-21 中兴通讯股份有限公司 Method and device for controlling output flow based on token bucket
CN103547330A (en) * 2012-12-12 2014-01-29 华为技术有限公司 User scheduling method and device
CN104753809A (en) * 2013-12-25 2015-07-01 深圳市中兴微电子技术有限公司 Method and device for adding token into traffic shaping

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106302231B (en) * 2015-05-12 2019-06-28 深圳市中兴微电子技术有限公司 The method and device of traffic queue shaping

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0561563A2 (en) * 1992-03-18 1993-09-22 AT&T Corp. Methods and apparatus for studying very large sets of data
CN101599905A (en) * 2009-06-30 2009-12-09 中兴通讯股份有限公司 A kind of method, Apparatus and system of realizing that traffic shaping token adds
CN103259743A (en) * 2012-02-15 2013-08-21 中兴通讯股份有限公司 Method and device for controlling output flow based on token bucket
CN103547330A (en) * 2012-12-12 2014-01-29 华为技术有限公司 User scheduling method and device
CN104753809A (en) * 2013-12-25 2015-07-01 深圳市中兴微电子技术有限公司 Method and device for adding token into traffic shaping

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110048964A (en) * 2018-01-15 2019-07-23 深圳市中兴微电子技术有限公司 A kind of shaping methods of service queue, terminal and storage medium
CN110048964B (en) * 2018-01-15 2023-09-12 深圳市中兴微电子技术有限公司 Shaping method, terminal and storage medium of service queue
WO2022178872A1 (en) * 2021-02-26 2022-09-01 华为技术有限公司 Traffic shaping method and device
WO2022232976A1 (en) * 2021-05-06 2022-11-10 华为技术有限公司 Token bucket-based flow control method and network device

Also Published As

Publication number Publication date
WO2017157064A1 (en) 2017-09-21
CN107204930B (en) 2020-05-19

Similar Documents

Publication Publication Date Title
CN109905329B (en) Task type aware flow queue self-adaptive management method in virtualization environment
CN107204930A (en) Token adding method and device
CN106020777B (en) A kind of data processing method, apparatus and system
CN107483363B (en) Layered weighted polling scheduling device and method
CN104009936B (en) Queue scheduling method based on dynamic weight calculation
CN106789721A (en) A kind of intelligent QOS method and system based on token bucket
CN107431668A (en) For the queuing of packet and method, queuing system, network element and the network system of processing
WO2013128884A1 (en) Packet forwarding device and packet forwarding method, and computer program
CN109218216A (en) Chain polymerization traffic distribution method, device, equipment and storage medium
CN104394440A (en) Dispatching method and device of HTTP video stream
EP3089413A1 (en) Method and apparatus for adding token in traffic shaping
CN112148454A (en) Edge computing method supporting serial and parallel and electronic equipment
CN108600020A (en) Method for processing business, device and server
CN102724763A (en) Time domain group scheduling method on basis of two-dimensional priority level
US9319325B2 (en) Adaptive method and system of regulation of yellow traffic in a network
CN108243506B (en) L TE system service scheduling method and device
CN106789716A (en) The MAC layer array dispatching method of TDMA MANETs
CN103929374A (en) Multilevel queue scheduling method based on service type
CN106921586B (en) Data stream shaping method, data scheduling method and device
CN103858474A (en) Enhanced performance service-based profiling for transport networks
CN106899514B (en) Queue scheduling method for guaranteeing multimedia service quality
CN107404454A (en) Speech quality method of adjustment and device
CN106487713A (en) A kind of service quality multiplexing method and device
Kim et al. Self-adaptive machine learning operating systems for security applications
CN106789745A (en) A kind of bandwidth acquisition methods and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant