CN107493241A - A kind of token distribution method and device - Google Patents

A kind of token distribution method and device Download PDF

Info

Publication number
CN107493241A
CN107493241A CN201610416279.0A CN201610416279A CN107493241A CN 107493241 A CN107493241 A CN 107493241A CN 201610416279 A CN201610416279 A CN 201610416279A CN 107493241 A CN107493241 A CN 107493241A
Authority
CN
China
Prior art keywords
token
business
key business
key
bucket
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
CN201610416279.0A
Other languages
Chinese (zh)
Other versions
CN107493241B (en
Inventor
何页
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
ZTE Corp
Original Assignee
ZTE Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by ZTE Corp filed Critical ZTE Corp
Priority to CN201610416279.0A priority Critical patent/CN107493241B/en
Publication of CN107493241A publication Critical patent/CN107493241A/en
Application granted granted Critical
Publication of CN107493241B publication Critical patent/CN107493241B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/215Flow control; Congestion control using token-bucket

Abstract

The embodiment of the present invention provides a kind of token distribution method and device, the token number that need to be consumed by getting each business reached, business and comprises at least key business;Obtain the quantity of token in current token bucket;It is more than in the token number that key business need to consume in current token bucket in the case of the quantity of token, whole tokens in current token bucket are then distributed into key business, the part of insufficient key business consumption is then waited in token bucket to be allocated after the renewal of token quantity, and key business is forwarded by primary link, using such scheme, it can ensure that whole key businesses can be assigned to token, and key business is forwarded by primary link, key business will not be caused to lose so that Internet resources can be also reasonably utilized.

Description

A kind of token distribution method and device
Technical field
The present invention relates to the communications field, more particularly to a kind of token distribution method and device.
Background technology
In a network during transmission services data, in order to prevent network congestion, it will usually using traditional token bucket algorithm come The flow of limitation outflow network, makes flow to be sent out than more uniform speed.Fixed-size token bucket can be voluntarily with perseverance Fixed speed continuously adds token, and each token in token bucket represents a byte.If token is not disappeared Consumption, or the speed being consumed are less than caused speed, and token will constantly increase, be filled up until bucket, behind add again Token will be overflowed from bucket, the highest number of tokens that can be preserved in last bucket never exceed bucket size.For industry During business distribution flow, this controlling mechanism of traditional token bucket is to be lost for the business outside flow restriction, its way Abandon or continue to send.According to such scheme so that network resource usage obtains not reasonable, and business can be caused to pass The problem of defeated or packet loss.
In view of the above-mentioned problems, propose it is a kind of effective ensure business normal transmission, not packet loss, reasonably use Internet resources Method, be those skilled in the art's technical problem urgently to be resolved hurrily.
The content of the invention
The embodiment of the present invention mainly solving the technical problems that, there is provided a kind of token distribution method and device, solve it is existing In technology, business can not transmit or the irrational problem of packet loss, Internet usage.
In order to solve the above technical problems, the embodiment of the present invention provides a kind of token distribution method, including:
The token number that each business reached need to consume is got, business comprises at least key business;
Obtain the quantity of token in current token bucket;
It is more than in the token number that key business need to consume in current token bucket in the case of the quantity of token, then will currently makes Whole tokens distribute to key business in board bucket, and the part of insufficient key business consumption then waits token quantity in token bucket to update After be allocated, and key business is forwarded by primary link.
In order to solve the above technical problems, the embodiment of the present invention provides a kind of token distributor, including:
Acquisition module, the token number that need to be consumed for getting each business reached, business comprise at least key business;And Obtain the quantity of token in current token bucket;
Processing module, the token number for that need to be consumed in key business are more than the situation of the quantity of token in current token bucket Under, then whole tokens in current token bucket are distributed into key business, the part of insufficient key business consumption then waits token bucket It is allocated after middle token quantity renewal, and key business is forwarded by primary link.
In order to solve the above technical problems, the embodiment of the present invention also provides a kind of computer-readable storage medium, computer storage is situated between Computer executable instructions are stored with matter, computer executable instructions are used to perform foregoing token distribution method.
The beneficial effects of the invention are as follows:
The token distribution method and device provided according to embodiments of the present invention, it need to be consumed by getting each business reached Token number, business comprise at least key business;Obtain the quantity of token in current token bucket;In the token that key business need to consume Number is more than in current token bucket in the case of the quantity of token, then whole tokens in current token bucket is distributed into key business, The part of insufficient key business consumption is then waited in token bucket to be allocated after the renewal of token quantity, and key business is passed through into master Link forwards, using such scheme, it is ensured that whole key businesses can be assigned to token, and key business is passed through into main chain Road forwards, and key business will not be caused to lose so that Internet resources can be also reasonably utilized.
Brief description of the drawings
Fig. 1 is a kind of flow chart for token distribution method that the embodiment of the present invention one provides;
Fig. 2 is a kind of structural representation for token distributor that the embodiment of the present invention two provides.
Embodiment
The embodiment of the present invention is described in further detail below by embodiment combination accompanying drawing.
Embodiment one
In order to avoid business can not be transmitted or packet loss, network resource usage obtain the problem of not reasonable, the present embodiment carries For a kind of token distribution method, Fig. 1 is referred to, is comprised the following steps:
S101:The token number that each business reached need to consume is got, business comprises at least key business.
Key business includes VoIP (Voice over Internet Protocol, the networking telephone), IPTV (Internet Protocol Television, IPTV) etc. business.For business in addition to being key business, business can also be simultaneously Including key business and non-key business, non-key business includes Internet (internet) business etc..
Before the token number that each business reached need to consume is got, it can also include:The business of arrival is identified, Identify that it is key business or is to include key business and non-key business simultaneously.
S102:Obtain the quantity of token in current token bucket.
Wherein, fixed-size token bucket voluntarily can continuously add token with constant speed, in token bucket Each token represent a byte.If token is not consumed, or the speed being consumed is less than caused speed, order Board will constantly increase, and be filled up until token bucket, behind the token that adds again will be overflowed from token bucket, last token The highest number of tokens that can be preserved in bucket never exceedes the size of token bucket.
Before the quantity of token in obtaining current token bucket, in addition to:The current data packet of judgement business reaches token Whether the time of packet arrival token bucket is more than given threshold in the time gap of bucket, for example given threshold is 1 millisecond, if It is then to update the quantity of token in token bucket, the quantity of token is the current token bucket in S102 in the token bucket after renewal The quantity of middle token.Wherein it is possible to added in being determined according to the size of time difference toward token bucket token quantity number, than If time difference is 2 milliseconds, then toward 200 tokens of addition in token bucket.If it should be appreciated that current data packet and upper one When the time difference of individual packet is less than some given threshold, for example, given threshold be 1 millisecond, without when update of token bucket it is current Token number in token bucket, if the enough current data packets of token number use, token is directly distributed into current data packet.
In order to ensure that the token quantity in token bucket is enough as far as possible, the mode of token is added into token bucket including following At least one of mode:
Mode one:The current data packet of judgement business reaches a packet in the time gap of token bucket and reaches token bucket Whether the time is more than given threshold, if so, then toward adding token in token bucket;
Mode two:According to constant rate of speed toward adding token in token bucket.
S103:Whether the token number that judging key business need to consume is more than the quantity of token in current token bucket, if so, then Into S104, if it is not, then entering S105.
S104:Whole tokens in current token bucket are distributed into key business, the part of insufficient key business consumption is then etc. It is allocated after token quantity renewal in token bucket, and key business is forwarded by primary link.
Because key business belongs to the higher business of priority, it is impossible to be dropped, so the order that need to be consumed when key business When board number is more than the quantity of token in token bucket, even if current token deficiency in token bucket, can also subtract key business needs to consume Token, token bucket can deficit be negative, lower limit is the negative value of token bucket size.
Wherein, specific processing procedure is:When business is key business, token whole in current token bucket is all divided Dispensing key business.After token all distributes, token bucket deficit.The current unallocated remaining key business to token is then etc. The renewal of token quantity in token bucket is treated, the token after renewal is distributed into remaining key business;The quantity of the token of distribution It is equal with the token number that remaining key business need to consume, thereby guarantee that whole key businesses can be assigned to token, to ensure Whole key businesses can be assigned to token, so that whole key businesses can be transferred through primary link forwarding, will not cause to close Key loss of traffic, and Internet resources can be also reasonably utilized.Wherein, primary link includes DSL (Digital Subscriber Line, digital subscriber line) link.
Token bucket algorithm can enter rower color to packet according to the flow of data, no more than the sign green of speed, surpass The minute mark of commanding troops of overrunning shows red.Because DSL links typically take DSL negotiated speeds or with specified speed as primary link Rate threshold value is the reference speed rate of token bucket, using reference speed rate as sign green and red basis for estimation.
Wherein, because key business belongs to the higher business of priority, it is impossible to be dropped, so key business will not be marked Color, without tunnel encapsulation is carried out, directly forwarded by DSL links, so as to ensure that key business is not lost.
When business is includes key business and non-key business simultaneously, and the token number that key business need to consume is more than token In bucket during the quantity of token, the processing to key business is carried out according to above-mentioned processing procedure.After token all distributes, token Bucket deficit.As for non-key business, consumption token can not had to, without waiting for the renewal of token quantity in token bucket, directly will All non-key business is designated as red, and will be forwarded after non-key business progress tunnel encapsulation by auxiliary link so that net Network resource can be reasonably utilized, and auxiliary link includes LTE (Long Term Evolution, Long Term Evolution) link.
S105:Judge whether business also includes non-key business, if it is not, then entering S106, if so, then entering S107.
S106:Token is distributed into key business, the token number phase that the quantity of the token of distribution need to consume with key business Deng;And key business is forwarded by primary link.
When business is key business, and when the token number that need to consume of key business is less than the quantity of token in token bucket, then Token is distributed into key business, the quantity of the token of distribution is equal with the token number that key business need to consume.Wherein, due to closing Key business belongs to the higher business of priority, it is impossible to is dropped, so key business will not be by mark color, without carrying out tunnel envelope Dress, is directly forwarded by primary link, so as to ensure that key business is not lost.Primary link includes DSL links.
S107:Whether the token number that judging key business need to consume altogether with non-key business, which is more than in current token bucket, makes The quantity of board, if so, then entering S108, if it is not, then entering S109.
S108:The token number that preferential distribution key business need to consume is turned key business by primary link to key business Hair;Remaining token number in current token bucket is distributed into non-key business again, the non-key business for being assigned to token is passed through into master Link forwards;The part of not remaining enough non-key business consumption is then without distribution, by the unallocated non-key business to token Forwarded by auxiliary link.
When business includes key business and non-key business, the token number that key business need to consume is less than in current token bucket The quantity of token, key business have the quantity that the token number that need to be consumed is more than token in current token bucket altogether with non-key business When, because key business belongs to the higher business of priority, it is impossible to be dropped, so the order that preferentially distribution key business need to consume Board number is forwarded key business by primary link, to ensure the transmission of key business to key business.Key business will not be marked Color, without tunnel encapsulation is carried out, directly it can be forwarded by DSL links.
Because the token number that key business need to consume is less than the quantity of token in current token bucket, so being given in distribution token After key business, token also has residue.
Remaining token number in current token bucket is fully allocated to non-key business again, the non-key industry of token will be assigned to Business is designated as green, carries out tunnel encapsulation, is then forwarded by primary link, primary link includes DSL links.
After token all distributes, token bucket deficit.The part of not remaining enough non-key business consumption then without distribution, I.e. the unallocated non-key business to token then no longer carries out the distribution of token, and the unallocated non-key business to token is designated as Red, tunnel encapsulation is carried out, is then forwarded by auxiliary link, auxiliary link includes LTE links so that Internet resources can obtain It is rational to utilize.
S109:The token number that need to consume is distributed from current token bucket to key business and non-key business, and by key Business and non-key business are forwarded by primary link.
If the token number that business includes key business and non-key business, key business and need to consumed is less than in current token bucket The quantity of token, key business have the quantity that the token number that need to be consumed is less than token in current token bucket altogether with non-key business; The token number that need to consume then is distributed from current token bucket to key business and non-key business, and by key business and non-key Business is forwarded by primary link.Wherein, key business, without tunnel encapsulation is carried out, will not can directly be led to by mark color DSL links are crossed to be forwarded.Non-key business is designated as green, carries out tunnel encapsulation, is then forwarded by DSL links.
All it is the system that networking is ripe under DSL links before the key business of some operators, so key business It can not be sent from LTE links, the embodiment of the present invention ensures that key business forwards from DSL links.Solve in the prior art Key business may not be forwarded by DSL links, and by LTE links forwarding cause key business can not be sent to or The problem of person's packet loss.
The present embodiment also example illustrates for a specific example, using user multi-service as scene, wherein, IPTV, VoIP, Internet business are carried out simultaneously, and up-link includes ADSL (Asymmetric Digital Subscriber Line, Asymmetrical Digital Subscriber Line) link and LTE links be example, implementation process is described in detail.
Some information of needs preset first, token speed is added in such as being calculated according to ADSL negotiated speeds toward token bucket Rate, token translation table, preset tunnel encapsulation rule etc..Wherein, current token in token bucket is determined by ADSL negotiated speeds Quantity.Preset tunnel encapsulation rule is that Internet business is carried out into tunnel encapsulation, IPTV and VoIP business is without tunnel Encapsulation, and for Internet business, local side apparatus is in order to distinguish DSL links or LTE links, it is necessary to do tunnel encapsulation. Token translation table includes business size and the corresponding token number for needing consumption.
Then IPTV and VoIP business is enabled, IPTV is inquired about from token translation table according to the size of IPTV and VoIP business The token number that need to be consumed with VoIP business, then judge that the token number that IPTV and VoIP business need to consume is less than token in token bucket Quantity;Token in token bucket is distributed into IPTV and VoIP business, quantity and IPTV the and VoIP business of the token of distribution The token number that need to be consumed is equal, IPTV and VoIP business is forwarded by adsl link, and IPTV and VoIP business is by mark color, Not by tunnel encapsulation;The consumption of token quantity in current token bucket is detected in real time, is had consumption in token bucket, is not incurred a financial deficit.
Then increase Internet business, and gradually increase data traffic, until more than ADSL negotiated speeds, i.e. basis The size of IPTV, VoIP, Internet business inquires about IPTV, VoIP, Internet business from token translation table need to disappear altogether The token number of consumption, then judge that IPTV, VoIP, Internet business have the token number that need to consume altogether and exceeded and made in current token bucket The quantity of board, it was observed that deficit occurs in token bucket, IPTV and VoIP business still forwards from adsl link, does not mark color, and Not by tunnel encapsulation.An Internet business parts are denoted as green, are forwarded from adsl link, and be encapsulated as ADSL tunnels lattice Formula, this part of Internet business are assigned to token.Internet business another part is denoted as red, from LTE links Forwarding, is encapsulated as LTE tunnel form, this part of Internet business is not allocated to token.
Then the data traffic of Internet business is gradually reduced, it is observed that after certain time, IPTV, VoIP, Internet business have the quantity that the token number that need to be consumed is less than token in current token bucket altogether, in the absence of token The situation of bucket deficit, IPTV, VoIP, Internet business can be assigned to token, and be forwarded by adsl link, and IPTV, VoIP business non-tunnel encapsulate, and Internet business has tunnel encapsulation.
The scheme of above-described embodiment, on the premise of IPTV and VoIP business is not influenceed, Internet business is selected Road, Internet business is passed through different tunnel encapsulations, forwarded from rational link so that Internet resources obtain rationally Use.
When congestion occurs for link, the method for the present embodiment, so that the critical deficit of token bucket occurs as foundation, realize to overload Internet business datums be diverted to LTE links, Internet business data flows will not be because of DSL bandwidth when ensure that congestion Limitation and be dropped.LTE links are usually to press flow based charging, and the present embodiment is used as decision-making mark by the speed based on packet Standard, it is a kind of effective decision-making billing scheme.
The token distribution method provided according to embodiment, the token number that need to be consumed by getting each business reached, business Including at least key business;Obtain the quantity of token in current token bucket;It is more than in the token number that key business need to consume current In token bucket in the case of the quantity of token, then whole tokens in current token bucket are distributed into key business, the crucial industry of deficiency The part of business consumption is then waited in token bucket and is allocated after the renewal of token quantity, and key business is forwarded by primary link, Using such scheme, it is ensured that whole key businesses can be assigned to token, and key business is forwarded by primary link, no Key business can be caused to lose so that Internet resources can be also reasonably utilized.
Embodiment two
In order to avoid business can not be transmitted or the problem of packet loss, the present embodiment provides a kind of token distributor, please join See Fig. 2, the token distributor includes:
Acquisition module 201, the token number that need to be consumed for getting each business reached, business comprise at least key business; And obtain the quantity of token in current token bucket.
The key business business such as including VoIP, IPTV.In addition to being key business, business can also include closing business simultaneously Key business and non-key business, non-key business include Internet (internet) business etc..
Before the token number that each business reached need to consume is got, it can also include:The business of arrival is identified, Identify that it is key business or is to include key business and non-key business simultaneously.
Processing module 202, the token number for that need to be consumed in key business are more than the quantity of token in current token bucket In the case of, then whole tokens in current token bucket are distributed into key business, the part of insufficient key business consumption is then etc. standby It is allocated in board bucket after the renewal of token quantity, and key business is forwarded by primary link.
Wherein, fixed-size token bucket voluntarily can continuously add token with constant speed, in token bucket Each token represent a byte.If token is not consumed, or the speed being consumed is less than caused speed, order Board will constantly increase, and be filled up until token bucket, behind the token that adds again will be overflowed from token bucket, last token The highest number of tokens that can be preserved in bucket never exceedes the size of token bucket.
Also include:Update module 203, for being obtained in acquisition module 201 in current token bucket before the quantity of token, if The time that the current data packet of business reaches packet arrival token bucket in the time gap of token bucket is more than given threshold, than As given threshold be 1 millisecond, then update token bucket in token quantity.The quantity of token is to obtain in token bucket after renewal The quantity of token in the current token bucket that module 201 obtains.Wherein it is possible to determined according to the size of time difference toward token bucket Middle addition token quantity number, if being 2 milliseconds than time difference, then toward adding 200 tokens in token bucket.It should be understood that If current data packet and the time difference of a upper packet are less than some given threshold, for example given threshold is 1 milli Second, without when the token number in update of token bucket current token bucket, if the enough current data packets of token number use, processing module Token is directly distributed to current data packet by 202.
In order to ensure that the token quantity in token bucket is enough as far as possible, the mode of token is added into token bucket including following At least one of mode:
Mode one:The current data packet of judgement business reaches a packet in the time gap of token bucket and reaches token bucket Whether the time is more than given threshold, if so, then toward adding token in token bucket;
Mode two:According to constant rate of speed toward adding token in token bucket.
Because key business belongs to the higher business of priority, it is impossible to be dropped, so the order that need to be consumed when key business When board number is more than the quantity of token in token bucket, even if current token deficiency in token bucket, can also subtract key business needs to consume Token, token bucket can deficit be negative, lower limit is the negative value of token bucket size.
Wherein, 202 specific processing procedure of processing module is:, will be complete in current token bucket when business is key business The token in portion is distributed on key business.After token all distributes, token bucket deficit.It is current unallocated to the remaining of token Key business then waits the renewal of token quantity in token bucket, and the token after renewal is distributed into remaining key business;Distribution Token quantity it is equal with the token number that remaining key business need to consume, thereby guarantee that whole key businesses can be assigned to Token, to ensure that whole key businesses can be assigned to token, so that whole key businesses can be transferred through primary link forwarding, Key business will not be caused to lose, and Internet resources can be also reasonably utilized.Wherein, primary link includes DSL links.
Token bucket algorithm can enter rower color to packet according to the flow of data, no more than the sign green of speed, surpass The minute mark of commanding troops of overrunning shows red.Because DSL links typically take DSL negotiated speeds or with specified speed as primary link Rate threshold value is the reference speed rate of token bucket, using reference speed rate as sign green and red basis for estimation.
Wherein, because key business belongs to the higher business of priority, it is impossible to be dropped, so key business will not be marked Color, without tunnel encapsulation is carried out, directly forwarded by DSL links, so as to ensure that key business is not lost.
When business is includes key business and non-key business simultaneously, and the token number that key business need to consume is more than token In bucket during the quantity of token, processing of the processing module 202 to key business is carried out according to above-mentioned processing procedure.Token all divides After complete, token bucket deficit.As for non-key business, consumption token can not had to, without waiting for token quantity in token bucket Renewal, all non-key business are directly designated as red, and will be carried out after non-key business progress tunnel encapsulation by auxiliary link Forwarding so that Internet resources can be reasonably utilized, and auxiliary link includes LTE links.
Processing module 202 is used for:The token number that if business only includes key business, key business need to consume is less than current order The quantity of token in board bucket, then token is distributed into key business, the order that the quantity of the token of distribution and key business need to consume Board number is equal;And key business is forwarded by primary link.Wherein, because key business belongs to the higher business of priority, no It can be dropped, so key business, without tunnel encapsulation is carried out, will not directly be forwarded by mark color by primary link, from And ensure key business and do not lose.Primary link includes DSL links.
Processing module 202 is used for:If business includes the token number that key business and non-key business, key business need to consume The token number that need to be consumed is had altogether with non-key business be more than current token less than the quantity of token, key business in current token bucket The quantity of token in bucket;Because key business belongs to the higher business of priority, it is impossible to be dropped, so preferentially distributing crucial industry The token number for being engaged in consuming is forwarded key business by primary link, to ensure the transmission of key business to key business;It is crucial Business, without tunnel encapsulation is carried out, will not directly can be forwarded by mark color by DSL links.
Because the token number that key business need to consume is less than the quantity of token in current token bucket, so being given in distribution token After key business, token also has residue.Remaining token number in current token bucket is distributed into non-key business again, order will be assigned to The non-key business of board is designated as green, carries out tunnel encapsulation, is then forwarded by primary link, primary link includes DSL links.
After token all distributes, token bucket deficit.The part of not remaining enough non-key business consumption then without distribution, I.e. the unallocated non-key business to token then no longer carries out the distribution of token, and the unallocated non-key business to token is designated as Red, tunnel encapsulation is carried out, is then forwarded by auxiliary link, auxiliary link includes LTE links so that Internet resources can obtain It is rational to utilize.
Processing module 202 is used for:If business includes the token number that key business and non-key business, key business need to consume The token number that need to be consumed is had altogether with non-key business be less than current token less than the quantity of token, key business in current token bucket The quantity of token in bucket;The token number that need to be consumed then is distributed from current token bucket to key business and non-key business, and will Key business and non-key business are forwarded by primary link.Wherein, key business will not be by mark color, without carrying out tunnel Encapsulation, directly can be forwarded by DSL links.Non-key business is designated as green, carries out tunnel encapsulation, then passes through DSL Link is forwarded.
All it is the system that networking is ripe under DSL links before the key business of some operators, so key business It can not be sent from LTE links, the embodiment of the present invention ensures that key business forwards from DSL links.Solve in the prior art Key business may not be forwarded by DSL links, and by LTE links forwarding cause key business can not be sent to or The problem of person's packet loss.
The present embodiment also example illustrates for a specific example, using user multi-service as scene, wherein, IPTV, VoIP, Internet business are carried out simultaneously, and it is example that up-link, which includes adsl link and LTE links, specific as follows:
Some information of needs preset first, token speed is added in such as being calculated according to ADSL negotiated speeds toward token bucket Rate, token translation table, preset tunnel encapsulation rule etc..Wherein, current token in token bucket is determined by ADSL negotiated speeds Quantity.Preset tunnel encapsulation rule is that Internet business is carried out into tunnel encapsulation, IPTV and VoIP business is without tunnel Encapsulation, and for Internet business, local side apparatus is in order to distinguish DSL links or LTE links, it is necessary to do tunnel encapsulation. Token translation table includes business size and the corresponding token number for needing consumption.
Then IPTV and VoIP business is enabled, acquisition module 201 converts according to the size of IPTV and VoIP business from token The token number that IPTV and VoIP business need to consume is inquired about in table, if the token number that IPTV and VoIP business need to consume is less than token bucket Token in token bucket is distributed to IPTV and VoIP business, the quantity of the token of distribution by the quantity of middle token, processing module 202 It is equal with the token number that IPTV and VoIP business need to consume, IPTV and VoIP business is forwarded by adsl link, and IPTV and VoIP business is not by mark color, not by tunnel encapsulation;The consumption of token quantity in current token bucket is detected in real time, is had in token bucket and is disappeared Consumption, does not incur a financial deficit.
Then increase Internet business, and gradually increase data traffic, until more than ADSL negotiated speeds, that is, obtaining Module 201 inquires about IPTV, VoIP, Internet industry according to the size of IPTV, VoIP, Internet business from token translation table The token number that business need to consume altogether, if IPTV, VoIP, Internet business have the token number that need to be consumed altogether and exceedes current token bucket The quantity of middle token, it was observed that deficit occurs in token bucket, processing module 202 is by IPTV and VoIP business still from adsl link Forwarding, does not mark color, and not by tunnel encapsulation.An Internet business parts are denoted as green, are forwarded from adsl link, and ADSL tunnels form is encapsulated as, this part of Internet business is assigned to token.Internet business another part is marked For red, forwarded from LTE links, be encapsulated as LTE tunnel form, this part of Internet business is not allocated to token.
Then the data traffic of Internet business is gradually reduced, it is observed that after certain time, IPTV, VoIP, Internet business have the quantity that the token number that need to be consumed is less than token in current token bucket altogether, in the absence of token The situation of bucket deficit, processing module 202 distribute token and give IPTV, VoIP, Internet business, and IPTV, VoIP, Internet Business is forwarded by adsl link, and IPTV, VoIP business non-tunnel encapsulate, and Internet business has tunnel encapsulation.
The scheme of above-described embodiment, on the premise of IPTV and VoIP business is not influenceed, Internet business is selected Road, Internet business is passed through different tunnel encapsulations, forwarded from rational link so that Internet resources obtain rationally Use.
The token distributor provided according to embodiment, gets what each business reached need to consume by acquisition module 201 Token number, business comprises at least key business, and obtains the quantity of token in current token bucket;It need to be consumed in key business Token number is more than in current token bucket in the case of the quantity of token, then processing module 202 is by whole tokens in current token bucket Key business is distributed to, the part of insufficient key business consumption is then waited in token bucket to be allocated after the renewal of token quantity, and Key business is forwarded by primary link.Using such scheme, it is ensured that whole key businesses can be assigned to token, and will Key business is forwarded by primary link, key business will not be caused to lose so that Internet resources can be also reasonably utilized.
A kind of computer-readable storage medium is also provided in another embodiment, and being stored with computer in computer-readable storage medium can Execute instruction, computer executable instructions are used for the token distribution method for performing any one of embodiment one.
Obviously, those skilled in the art should be understood that each module of the embodiments of the present invention or each step can be used General computing device realizes that they can be concentrated on single computing device, or be distributed in multiple computing device institutes On the network of composition, alternatively, they can be realized with the program code that computing device can perform, it is thus possible to by they It is stored in storage medium (ROM/RAM, magnetic disc, CD) and is performed by computing device, and in some cases, can be with not The order being same as herein performs shown or described step, or they are fabricated to each integrated circuit modules respectively, or Multiple modules or step in them are fabricated to single integrated circuit module to realize by person.So the present invention is not restricted to appoint What specific hardware and software combines.
Above content is to combine the further description that specific embodiment is made to the embodiment of the present invention, it is impossible to is recognized The specific implementation of the fixed present invention is confined to these explanations.For general technical staff of the technical field of the invention, Without departing from the inventive concept of the premise, some simple deduction or replace can also be made, should all be considered as belonging to the present invention Protection domain.

Claims (10)

1. a kind of token distribution method, including:
The token number that each business reached need to consume is got, the business comprises at least key business;
Obtain the quantity of token in current token bucket;
It is more than in the token number that the key business need to consume in the current token bucket in the case of the quantity of token, then by institute State whole tokens in current token bucket and distribute to the key business, the part of the deficiency key business consumption then waits It is allocated after the renewal of token quantity described in the token bucket, and the key business is forwarded by primary link.
2. token distribution method as claimed in claim 1, it is characterised in that the number of token in the acquisition current token bucket Before amount, in addition to:
A packet in the time gap of the token bucket, which is reached, in the current data packet of the business reaches the token bucket In the case that time is more than given threshold, then the quantity of token described in the token bucket is updated.
3. token distribution method as claimed in claim 1 or 2, it is characterised in that also include:Include the pass in the business The token number that key business and non-key business, the key business need to consume be less than the current token bucket in token quantity, The key business has the quantity that the token number that need to be consumed is less than token in the current token bucket altogether with the non-key business In the case of;
The token number that need to be consumed then is distributed from the current token bucket to the key business and the non-key business, and will The key business and the non-key business are forwarded by the primary link.
4. token distribution method as claimed in claim 3, it is characterised in that also include:Include the key in the business The token number that business and non-key business, the key business need to consume is less than the quantity of token, institute in the current token bucket State key business and have the token number that need to be consumed altogether more than the quantity of token in the current token bucket with the non-key business In the case of;
Token number that the key business need to consume preferentially is distributed to the key business, the key business is passed through into the master Link forwards;
Remaining token number in the current token bucket is distributed into the non-key business again, will be assigned to described in the token Non-key business is forwarded by the primary link;
The part of not remaining enough the non-key business consumption is then without distribution, by the unallocated non-pass to the token Key business is forwarded by auxiliary link.
5. token distribution method as claimed in claim 4, it is characterised in that the primary link includes digital subscriber line chain Road, the auxiliary link include Long Term Evolution link.
6. a kind of token distributor, including:
Acquisition module, the token number that need to be consumed for getting each business reached, the business comprise at least key business;And Obtain the quantity of token in current token bucket;
Processing module, the token number for that need to be consumed in the key business are more than the quantity of token in the current token bucket In the case of, by all the token distributes to the key business, the deficiency key business consumption in the current token bucket Part then wait token quantity described in the token bucket to be allocated after updating, and the key business is passed through into primary link Forwarding.
7. token distributor as claimed in claim 6, it is characterised in that also include:
Update module, for the packet arrival in the time gap of the current data packet of the business arrival token bucket In the case that the time of the token bucket is more than given threshold, then the quantity of token described in the token bucket is updated.
8. token distributor as claimed in claims 6 or 7, it is characterised in that the processing module is used for:In the business It is less than including the token number that the key business and non-key business, the key business need to consume in the current token bucket and makes The quantity of board, the key business are less than in the current token bucket with the token number that the non-key business need to consume altogether to be made In the case of the quantity of board;The token number that need to consume then is distributed from the current token bucket to the key business and described non- Key business, and the key business and the non-key business are forwarded by the primary link.
9. token distributor as claimed in claim 8, it is characterised in that the processing module is used for:In the business packet The token number that including the key business and non-key business, the key business need to consume is less than token in the current token bucket Quantity, the key business and the non-key business have the token number that need to be consumed altogether and be more than token in the current token bucket Quantity in the case of;
Token number that the key business need to consume preferentially is distributed to the key business, the key business is passed through into the master Link forwards;
Remaining token number in the current token bucket is distributed into the non-key business again, will be assigned to described in the token Non-key business is forwarded by the primary link;
The part of not remaining enough the non-key business consumption is then without distribution, by the unallocated non-pass to the token Key business is forwarded by auxiliary link.
10. token distributor as claimed in claim 9, it is characterised in that the primary link includes digital subscriber line chain Road, the auxiliary link include Long Term Evolution link.
CN201610416279.0A 2016-06-13 2016-06-13 Token distribution method and device Active CN107493241B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610416279.0A CN107493241B (en) 2016-06-13 2016-06-13 Token distribution method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610416279.0A CN107493241B (en) 2016-06-13 2016-06-13 Token distribution method and device

Publications (2)

Publication Number Publication Date
CN107493241A true CN107493241A (en) 2017-12-19
CN107493241B CN107493241B (en) 2022-04-12

Family

ID=60642942

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610416279.0A Active CN107493241B (en) 2016-06-13 2016-06-13 Token distribution method and device

Country Status (1)

Country Link
CN (1) CN107493241B (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110545246A (en) * 2018-05-29 2019-12-06 北京京东尚科信息技术有限公司 Token bucket-based current limiting method and device
CN114095444A (en) * 2020-07-15 2022-02-25 中移物联网有限公司 Current limiting method and device and electronic equipment
CN114745682A (en) * 2022-02-28 2022-07-12 联想(北京)有限公司 Processing method and control plane network element

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20080273553A1 (en) * 2006-02-23 2008-11-06 Huawei Technologies Co., Ltd. Method And System For Bandwidth Control, Apparatus For Access Control And Apparatus For User Profile Management
US7457313B2 (en) * 2000-09-25 2008-11-25 General Instrument Corporation Hierarchical prioritized round robin (HPRR) scheduling
CN101360049A (en) * 2008-09-23 2009-02-04 福建星网锐捷网络有限公司 Packet forwarding method and apparatus
CN101621457A (en) * 2008-07-01 2010-01-06 大唐移动通信设备有限公司 Multi-service scheduling method and system
CN101959236A (en) * 2009-07-13 2011-01-26 大唐移动通信设备有限公司 Traffic control method and device
CN102843775A (en) * 2012-09-11 2012-12-26 福建星网锐捷网络有限公司 Dispatching method, dispatching device and network equipment
CN102932272A (en) * 2012-11-23 2013-02-13 迈普通信技术股份有限公司 Message forwarding method and forwarding device based on flow capacity
CN104079499A (en) * 2014-07-18 2014-10-01 福建星网锐捷网络有限公司 Message processing method and device based on token buckets
CN104125006A (en) * 2014-07-28 2014-10-29 大连大学 Satellite communication network bandwidth distributing method

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7457313B2 (en) * 2000-09-25 2008-11-25 General Instrument Corporation Hierarchical prioritized round robin (HPRR) scheduling
US20080273553A1 (en) * 2006-02-23 2008-11-06 Huawei Technologies Co., Ltd. Method And System For Bandwidth Control, Apparatus For Access Control And Apparatus For User Profile Management
CN101621457A (en) * 2008-07-01 2010-01-06 大唐移动通信设备有限公司 Multi-service scheduling method and system
CN101360049A (en) * 2008-09-23 2009-02-04 福建星网锐捷网络有限公司 Packet forwarding method and apparatus
CN101959236A (en) * 2009-07-13 2011-01-26 大唐移动通信设备有限公司 Traffic control method and device
CN102843775A (en) * 2012-09-11 2012-12-26 福建星网锐捷网络有限公司 Dispatching method, dispatching device and network equipment
CN102932272A (en) * 2012-11-23 2013-02-13 迈普通信技术股份有限公司 Message forwarding method and forwarding device based on flow capacity
CN104079499A (en) * 2014-07-18 2014-10-01 福建星网锐捷网络有限公司 Message processing method and device based on token buckets
CN104125006A (en) * 2014-07-28 2014-10-29 大连大学 Satellite communication network bandwidth distributing method

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110545246A (en) * 2018-05-29 2019-12-06 北京京东尚科信息技术有限公司 Token bucket-based current limiting method and device
CN110545246B (en) * 2018-05-29 2023-12-08 北京京东尚科信息技术有限公司 Token bucket-based current limiting method, device and computer readable medium
CN114095444A (en) * 2020-07-15 2022-02-25 中移物联网有限公司 Current limiting method and device and electronic equipment
CN114095444B (en) * 2020-07-15 2023-11-10 中移物联网有限公司 Current limiting method and device and electronic equipment
CN114745682A (en) * 2022-02-28 2022-07-12 联想(北京)有限公司 Processing method and control plane network element
CN114745682B (en) * 2022-02-28 2023-08-18 联想(北京)有限公司 Processing method and control plane network element

Also Published As

Publication number Publication date
CN107493241B (en) 2022-04-12

Similar Documents

Publication Publication Date Title
CN100384157C (en) Method for multiplexing residual bandwidth and network equipment
CN101478491B (en) Method and apparatus for implementing packet differential service
EP1974509B1 (en) Multi-priority multi-color markers for traffic metering
US8976797B2 (en) System and method for indicating classification of a communications flow
CN100550823C (en) A kind of Ethernet transfer equipment and method with quick protection and fair characteristic
CN100384156C (en) Method for multiplexing residual bandwidth and network equipment
CN101815032B (en) Method for classifying and isolating information based on integrated network security service architecture
CN101299721B (en) Method for switching message of switching network, and switching device
US10321360B2 (en) Load balancing of wireless subscriber packet processing over multiple packet processing cores on a virtual machine platform
CN107493241A (en) A kind of token distribution method and device
CN101964754A (en) Point to point (P2P) service identification-based quality of service (QoS) routing method
CA2570745A1 (en) Technique for transferring data over a packet switched network
CN105634991A (en) Method and apparatus for achieving service bandwidth allocation
CN101127723B (en) QoS guarantee method for multi-protocol tag exchange L3 virtual private network
CN101212467B (en) MPLS network service scheduling method
CN101645849A (en) QoS realization method in transitional environment and PE router
CN101237403B (en) service multiplexing method for Ethernet
CN100476790C (en) Method and system for resource bunlding in communications network
EP2767046B1 (en) Optimised packet delivery across a transport network
CN102932272B (en) Message forwarding method based on uninterrupted and forwarding unit
CN106716940A (en) Allocating capacity of a network connection to data steams based on type
JP2005184709A (en) Frame transmission apparatus
CN101729373B (en) Method and device for dispatching multipriority traffic
CN108632169A (en) A kind of method for ensuring service quality and field programmable gate array of fragment
CN101599979A (en) IP Telecommunication Network implementation method based on the tunnel

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