CN103546393B - A kind of scheduling implementation method and device based on Weighted Fair Queuing - Google Patents

A kind of scheduling implementation method and device based on Weighted Fair Queuing Download PDF

Info

Publication number
CN103546393B
CN103546393B CN201210241086.8A CN201210241086A CN103546393B CN 103546393 B CN103546393 B CN 103546393B CN 201210241086 A CN201210241086 A CN 201210241086A CN 103546393 B CN103546393 B CN 103546393B
Authority
CN
China
Prior art keywords
counter
flow
value
acc1
scheduling queue
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201210241086.8A
Other languages
Chinese (zh)
Other versions
CN103546393A (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
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 CN201210241086.8A priority Critical patent/CN103546393B/en
Publication of CN103546393A publication Critical patent/CN103546393A/en
Application granted granted Critical
Publication of CN103546393B publication Critical patent/CN103546393B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Mobile Radio Communication Systems (AREA)

Abstract

A kind of scheduling implementation method and device based on Weighted Fair Queuing, after the movable chained list being serviced of scheduling queue finishes, enter linage-counter in such a way and add up, and next scheduling queue is selected according to new Counter Value:The state of each scheduling queue chained list is represented with bitmap empty, according to the position index x of empty least significant non-zero position, draws the position index power Qn of 2 least significant non-zero position;And draw empty least significant non-zero position and its position on the left side be all 1 position index mask;According to counter current count value counter and Qn*2(t‑1)And obtain t-th of intermediate result acct;First intermediate result acc1 is verified, if acc1 is verified, selects acc1 and mask step-by-steps with operation result as new Counter Value;Otherwise, select second intermediate result acc2 and mask step-by-step and operation result as the minimum value in new Counter Value or selection acc2 to acct and mask step-by-steps and operation result as new Counter Value.This invention simplifies the operating procedure that counter adds up.

Description

A kind of scheduling implementation method and device based on Weighted Fair Queuing
Technical field
The present invention relates to data communication technology field, more particularly to a kind of scheduling implementation method based on Weighted Fair Queuing And device.
Background technology
WFQ (Weighted Fair Queuing, Weighted Fair Queuing) dispatching algorithms carry out public affairs because it has by weight Level land distributes the characteristic of group chance, the dispatching algorithm design being widely used in traffic management.Scheduling based on WFQ is one The important mechanisms of kind guaranteed qos, WFQ dispatching algorithms can carry out bandwidth allocation according to predetermined rule, will go out group fair Give each queue.
Next our brief analysis once WFQ dispatching algorithms, for 1: 4K WFQ schedulers, the minimum that can be set Weight be 1/4096, it is necessary to bit number be 12 bits, according to weight from high to low, each respectively correspond to 1/2,1/4,1/ 8...1/4096,1 scheduling queue is set for each weight ratio is special, totally 12 scheduling queues;One 12 digit counter of setting, 12 The corresponding relation of individual scheduling queue and counter is as shown in table 1 below:
The corresponding relation of the counter of table 1 and scheduling queue
Counter cnt Scheduling queue Respective weights
000000000000 It is not used /
xxxxxxxxxxx1 Q(0) 1/2
xxxxxxxxxx10 Q(1) 1/4
xxxxxxxxx100 Q(2) 1/8
xxxxxxxx1000 Q(3) 1/16
xxxxxxx10000 Q(4) 1/32
xxxxxx100000 Q(5) 1/64
xxxxx1000000 Q(6) 1/128
xxxx10000000 Q(7) 1/256
xxx100000000 Q(8) 1/512
xx1000000000 Q(9) 1/1024
x10000000000 Q(10) 1/2048
100000000000 Q(11) 1/4096
Scheduling queue Q (0) occupies the counter moment of half as can be seen from Table 1, represents 1/2 weight, Q (1) Occupy for 1/4 counter moment, represent 1/4 weight, the rest may be inferred.
Each scheduling queue includes a movable chained list and an inactive chained list, chained list by being serviced queue (or Flow) it is in series.Each Flow (stream) includes the pointer for pointing to next Flow and the pointer for pointing to a upper Flow, When taking turns to the service of some scheduling queue, the inactive chained list of the scheduling queue is changed into movable chained list, and scheduling queue is from movable chained list Owner pointer obtain first No. Flow, mandate is issued to the Flow, then according to the power of present counter value He the Flow Weight values calculate the Flow next time should being serviced the counter moment, and determine that the Flow should according to the counter moment (which scheduling queue namely calculates the Flow should be placed in) is moved in which scheduling queue, then should Flow is moved to the inactive chained list afterbody of this new scheduling queue, while updates the inactive chained list protocercal tail portion of the scheduling queue The pointer up and down of Flow pointer and related Flow.
Flow is moved between each scheduling queue, and a counter moment can be by the scheduling queue activity chain corresponding to it All Flow in table are serviced one time, and the value of counter is just added up after the movable chained list being serviced of the scheduling queue (1 may be added, it is also possible to add 2 etc.), therefore, counted at one in circulation, high weight scheduling queue is due to corresponding more meters The number device moment, can more being serviced, Flow often can finally be sent out into a scheduling queue than low weight scheduling queue A mandate is put, Flow weights are higher, will be more moved to high weight queue, so as to obtain more mandates, obtained More service opportunities, realize the distribution of bandwidth ratio.
As shown in figure 1, according to the numerical value of counter, every time by all movable Flow services one below scheduling queue Secondary, in Fig. 1, current scheduling queue is Q (0), and it is movable, each Flow bedding and clothing to have 4 Flow below the scheduling queue After business, the scheduling queue that the Flow should should be placed next time can be calculated.
Scheduling queue is formed by Flow links, and the scheduling queue deposited in the scheduler actually only needs to preserve head and the tail pointer , as shown in Figure 2, no matter scheduling queue have how long, the scheduling queue being stored on scheduler all only have head and the tail pointer. Mean that scheduling queue can be with endless, scheduler can actually connect unlimited port.Flow movement only needs to move To the tail pointer of purpose scheduling queue point to the Flow.In actual design, the scheduling queue of only current being serviced There is movable chained list and inactive chained list simultaneously, other not serviced scheduling queues only have inactive chained list, current being serviced Scheduling queue movable chained list in Flow being serviceds it is complete after, counter adds up, and is picked out according to the value of counter next The scheduling queue of being serviced.Inactive chained list is switched to movable chained list by selected scheduling queue, is originally in activity chain epitope The empty chain table put is changed into inactive chained list, and the Flow for being newly transferred to the scheduling queue afterwards will be placed in the tail of inactive chained list Portion.
Analysis more than is as can be seen that the core of WFQ dispatching algorithms is that Flow movement and tiring out for counter Add.The implementation of existing technical scheme, for Flow move, by minimum precision be 1/16 WFQ schedulers exemplified by, it is necessary to The corresponding relation of 4 digit counters, all count values and scheduling chained list is as shown in table 2 below:
The corresponding relation of the counter of table 2 and scheduling queue
Count value Scheduling queue
0000 It is not used
0001 Q(0)
0010 Q(1)
0011 Q(0)
0100 Q(2)
0101 Q(0)
0110 Q(1)
0111 Q(0)
1000 Q(3)
1001 Q(0)
1010 Q(1)
1011 Q(0)
1100 Q(2)
1101 Q(0)
1110 Q(1)
1111 Q(0)
From upper table 2 as can be seen that weight 1/2 Q (0) in count value at intervals of 2, the Q (1) of weight 1/4 is being counted Numerically at intervals of 4, by that analogy, and the counter moment occupied by the scheduling chained list of low one-level weight is always located in height The centre position at the contiguous counter moment occupied by one-level weight scheduling chained list, according to this feature, can be calculated as follows Method calculates next counter position:
1) the WFQ weight weight limits position of the flow is found out:
J=N-1-max { k, for all K ' s where Wk=1 };
Wherein, N is counter bits number, N=4, k=0,1,2,3.Weight such as flow is 0101, then j=1, such as flow Weight be 1000, then j=0;
2) the cumulative step value of counter is obtained according to weight limit position:
I=0001 < < j, (refer to and move to left j positions)
When i.e. weight limit is 1/2, step value 1, when weight limit is 1/4, step value 2, weight limit 1/8 When, step value 4, the rest may be inferred.
3) nonce counter is worth to new Counter Value plus stepping:
D=(Scurrent+I) mod (2N),
Scurrent is current count value, and I is step value, and N is counter bits number, if occurring to overflow after counter is cumulative Go out then remainder.
4) D minimum non-zero position is found out:
P=min (t, for all T ' s where Dt=1),
Such as D=xxx1, then p=0, such as D=xx10, then p=1, the rest may be inferred.
If the weighted value Wp of the flow corresponding to p is 1, flow is put into Q (p);If being somebody's turn to do corresponding to p Flow weighted value Wp is 0, then flow is put into Q (j).
After the movable chained list being serviced of current scheduling queue finishes, counter needs are added up next to service Scheduling queue.Each count value is uniquely corresponding with a scheduling queue, due to being likely to occur partial scheduling queue linked list For the situation of sky, the situation that count value corresponds to empty scheduling queue is thus had.In order to avoid the generation of such case, current Scheme selection be lowest difference is as follows away from algorithm, its specific implementation step:
Step 1:Non-NULL scheduling queue n is corresponded into the significance bit BVn of count value, and (the non-x position i.e. in table 2, n represent each non-NULL Queue) each it is compared with the corresponding significant bit CVn of current count value, if BVn is bigger than CVn, by current count value Corresponding inactive bit CEn (the x positions i.e. in table 2) as scheduling chained list n inactive bit, obtain queue n count value Snext ={ CEn, BVn };If BVn is less than or equal to CVn, queue n count value is Snext={ CEn+1, BVn };CEn+1 herein Bit wide needs increase by 1, there is provided carry, correspondingly Snext is also 13.
Step 2:Repeat step 1, obtain the respective new count value Snext of all non-NULL scheduling queues.
Step 3:The Snext combination of two of all non-NULL scheduling queues is compared, obtains less Snext, then enter The comparison of row next round, Snext minimum in all non-NULL scheduling queues is finally given, this minimum Snext is as final Snext.
As shown in figure 3, current count value is 5, by calculating, non-NULL scheduling queue Q (2) Snext is 12, Q's (3) It 8,8 is minimum value that Snext, which is, so new count value should select 8 to be used as new count value.
This lowest difference away from algorithm by the cumulative of counter, can accurately one-time positioning is to Counter Value, so as to look for To its corresponding non-NULL scheduling queue.But the algorithm needs to be added and subtracted and the comparison operation of geometry level, combinational logic scale It is larger, and as the increase of counter bit wide, expense can be exaggerated.
The content of the invention
Present invention solves the technical problem that it is to provide a kind of scheduling implementation method and device based on Weighted Fair Queuing, letter Change the cumulative operating procedure of counter, the cumulative calculating of counter can be realized quickly and with the expense of minimum.
In order to solve the above technical problems, the invention provides a kind of scheduling implementation method based on Weighted Fair Queuing,
After the movable chained list being serviced of scheduling queue finishes, enter linage-counter in such a way and add up, and according to New Counter Value selects next scheduling queue:
The state of each scheduling queue chained list is represented with bitmap empty, according to the position rope of the least significant non-zero position of the empty Draw, be designated as x, draw position index the power Qn, i.e. Qn=2 of 2 least significant non-zero positionx;And draw the least significant non-zero position of the empty And its position on the left side is all 1 position index mask;
According to counter current count value counter and Qn*2(t-1)And obtain t-th of intermediate result acct, wherein t is Positive integer;
First intermediate result acc1 is verified, if the acc1 is verified, selects the acc1 and institute Mask step-by-steps are stated with operation result as new Counter Value;Otherwise, the selection second intermediate result acc2 and mask is pressed Position and operation result as the minimum value in new Counter Value or the selection acc2 to acct and the mask step-by-steps and Operation result is as new Counter Value.
Further, the acc1 is verified in the following ways:
The acc1 and mask is subjected to step-by-step and obtains acc1 mask with computing, and draws the acc1 mask's Least significant non-zero position index, is designated as m, extracts the value of empty m positions, is designated as flag;
If the flag non-zeros, the acc1 are verified;Otherwise, if the flag is zero, the acc1 Checking does not pass through.
Further, methods described also includes, and carries out Flow movement in such a way:
1) obtain scheduled queue or flow the inverted order w ' of weight;
2) according to the minimum non-zero position of the w ', the cumulative step value I of counter is obtained;
3) new Counter Value D: D=(counter+I) mod (2N) is calculated, and finds out D least significant non-zero position p;
4) q is calculated:Judge whether w ' and p step-by-steps and result are zero, if be not zero, q=p;Otherwise q=I;
After trying to achieve q, the location index index using q as its corresponding nonzero digit, the scheduling queue or stream are added to Qindex last-of-chain.
Present invention also offers a kind of scheduling realization device based on Weighted Fair Queuing, described device includes schedule information Extraction module, flow mobile modules, and counter accumulator module are stored, wherein:
The schedule information stores extraction module, flow in the movable chained list for safeguarding WFQ schedulers and scheduling queue Link table information, activity chain heading tail pointer information and activity chain table status information;When the WFQ schedulers are toggled, The present counter value of the WFQ schedulers is read, extracts the movable chained list of scheduling queue corresponding to the present counter value Head and the tail pointer, then read the weight information of flow in the movable chained list, be sent to the flow mobile modules;
The flow mobile modules, for according to the present counter value received, selecting corresponding movable chained list, carrying The weight of flow corresponding to the activity chain heading pointer is taken, carries out the calculating of flow movements;
The counter accumulator module, after toggled, enter linage-counter and add up, draw new Counter Value, return Extraction module is stored back to the schedule information.
Further, the counter accumulator module is used for, and enters linage-counter in such a way and adds up, and draws new meter Number device value:
The state of each scheduling queue chained list is represented with bitmap empty, according to the position rope of the least significant non-zero position of the empty Draw, be designated as x, draw position index the power Qn, i.e. Qn=2 of 2 least significant non-zero positionx;And draw the least significant non-zero position of the empty And its position on the left side is all 1 position index mask;
According to counter current count value counter and Qn*2(t-1)And obtain t-th of intermediate result acct, wherein t is Positive integer;
First intermediate result acc1 is verified, if the acc1 is verified, selects the acc1 and institute Mask step-by-steps are stated with operation result as new Counter Value;Otherwise, the selection second intermediate result acc2 and mask is pressed Position and operation result as the minimum value in new Counter Value or the selection acc2 to acct and the mask step-by-steps and Operation result is as new Counter Value.
Further, the flow mobile modules are used for, and carry out Flow movement in such a way:
1) obtain scheduled queue or flow the inverted order w ' of weight;
2) according to the minimum non-zero position of the w ', the cumulative step value I of counter is obtained;
3) new Counter Value D is calculated:D=(counter+I) mod (2N), and find out D least significant non-zero position p;
4) q is calculated:Judge whether w ' and p step-by-steps and result are zero, if be not zero, q=p;Otherwise q=I;
After trying to achieve q, the location index index using q as its corresponding nonzero digit, the scheduling queue or stream are added to Qindex last-of-chain.
Further, the flow mobile modules are additionally operable to, after the calculating for completing flow movements, returning result to While stating schedule information storage extraction module, the status information of current active chained list is carried;
The schedule information storage extraction module is used for, the current active chained list sent according to the flow mobile modules Status information, the current active chain table status by active transition for it is inactive when, trigger the counter accumulator module.
Further, the schedule information storage extraction module is additionally operable to, and is returned according to the counter accumulator module New Counter Value, select next scheduling queue.
Further, the schedule information storage extraction module is additionally operable to, and is returned receiving the counter accumulator module During the new Counter Value returned, the count value of WFQ schedulers is updated, prepares next sub-authorization granting.
Using such scheme of the present invention, compared with prior art, at least have the advantages that:It significantly simplify WFQ Dispatching algorithm realizes step, optimizes in order to ensure the counter accumulation algorithm of non-NULL scheduling chained list so that the expense of realization Significantly reduced with complexity, and it is insensitive for the bit wide of counter.
Brief description of the drawings
Accompanying drawing described herein is used for providing a further understanding of the present invention, forms the part of the application, this hair Bright schematic description and description is used to explain the present invention, does not form inappropriate limitation of the present invention.In the accompanying drawings:
Fig. 1 is that the Flow of WFQ algorithms services schematic diagram;
Fig. 2 is the storage schematic diagram of Flow pointers;
Fig. 3 is lowest difference away from algorithm schematic diagram;
Fig. 4 realizes module schematic block diagram for the WFQ dispatching algorithms of the embodiment of the present invention.
Embodiment
In the WFQ dispatching algorithms applied at present, its input and output are often only focused on, and select according to its output Scheduling queue corresponding to first-in-chain(FIC)., it is necessary to think over the calculating effect that flow is moved in calculating process in the implementation process of algorithm Rate, the problems such as counter cumulative algorithms selection.For in software desk Implementation WFQ algorithms, stepping can be used completely as 1 Gradually add up, hardly failed to get or achieve what one wants problem with the selection for considering accumulator;But for hardware realizes the algorithm, it is necessary to Consider the expense and efficiency realized.Particularly with the selection of counter accumulation algorithm, even more need using can be in fixed delay Beat number under can obtain the algorithm of result, with the sequential handled before and after guarantee, be related to the disposal ability of hardware system.This Outside, the expense of hardware handles is also a main Consideration, and the lowest difference for generally using at present is counting away from algorithm Device bit wide is larger, in the case of corresponding scheduling queue is a fairly large number of, next counting corresponding to every of computing counter one by one Device value, then select effectively, then calculated two-by-two again, minimum is finally selected inside all values, this whole process Realize that expense is very big, sequential is often very poor, therefore, it is necessary to a kind of WFQ algorithms of optimization solve this problem.
Present embodiments provide for a kind of scheduling implementation method based on Weighted Fair Queuing is provided, using following scheme:
After the movable chained list being serviced of scheduling queue finishes, enter linage-counter in such a way and add up, and according to New Counter Value selects next scheduling queue:
The state of each scheduling queue chained list is represented with bitmap empty, according to the position rope of the least significant non-zero position of the empty Draw, be designated as x, draw position index the power Qn, i.e. Qn=2 of 2 least significant non-zero positionx;And draw the least significant non-zero position of the empty And its position on the left side is all 1 position index mask;
According to counter current count value counter and Qn*2(t-1)And obtain t-th of intermediate result acct, wherein t is Positive integer;
First intermediate result acc1 is verified, if the acc1 is verified, selects the acc1 and institute Mask step-by-steps are stated with operation result as new Counter Value;Otherwise, the selection second intermediate result acc2 and mask is pressed Position and operation result as the minimum value in new Counter Value or the selection acc2 to acct and the mask step-by-steps and Operation result is as new Counter Value.
Further, Flow movement specifically includes:
1st, ask scheduled queue or flow the inverted order w ' of weight;
2nd, w ' minimum non-zero position is found, tries to achieve I;
3rd, D=(counter+I) mod (2N) is made, D least significant non-zero position is found, tries to achieve p;
If the 4th, w ’s &p!=0, then q=p, otherwise q=I;
After trying to achieve q, the location index index using q as its corresponding nonzero digit, the scheduling queue or stream are added to Qindex last-of-chain.
For the ease of illustrating the present invention, make below with reference to implementation of the drawings and the specific embodiments to technical solution of the present invention It is described in further detail.It should be noted that in the case where not conflicting, the feature in embodiment and embodiment in the application Can mutually it be combined.
As shown in figure 4, the device of optimization WFQ dispatching algorithms provided in an embodiment of the present invention mainly includes following three portions Point:Schedule information stores extraction module, and flow mobile modules, counter accumulator module, three parts complete scheduler jointly And the storage extraction of link table information, the calculating of flow movements, and the calculating that counter is cumulative.
Schedule information storage extraction module is responsible for maintenance schedule device and flow link table informations and head and the tail pointer information, chain Maintenance and extraction of table status information (or status indication) and current Counter Value etc..Whenever WFQ schedulers are toggled When, the present counter value of the WFQ schedulers is read first, extracts the activity chain under scheduling queue corresponding to present counter value The head and the tail pointer of table, then the information such as flow weight in the movable chained list is read, send jointly to flow mobile modules.By After flow mobile modules are calculated, result is returned (schedule information storage extraction module).Schedule information stores extraction module Maintenance of information is completed, the triggering of linage-counter accumulator module is entered according to status indication, while return according to counter accumulator module Result carry out maintenance of information.
Flow mobile modules are responsible for redirecting calculating after current flow operations in carry out activity chained list.Believe whenever by scheduling During the mandate release information triggering of breath storage extraction module, according to present counter value, corresponding movable chained list is selected, extraction is lived Flow weight, carries out the calculating of flow movements corresponding to dynamic chained list owner pointer.After obtaining a result, schedule information storage is returned to Extraction module;In addition, after the completion of flow mobile computing, while schedule information storage extraction module is returned result to, take Status indication with a current movable chained list, dispatch the tail pointer of chained list next time for updating.
Counter accumulator module is responsible for carrying out the selection calculating at the counting moment of a service.Schedule information storage extraction mould The status information for the movable chained list that root tuber is sent according to flow mobile modules, if current activity chain table status by activity become in order to It is inactive, represent that all services at nonce counter moment are had been completed, it is necessary to select a new counter moment, then Schedule information storage extraction module will calculate new Counter Value according to this information come flip-flop number accumulator module, and Return to schedule information storage extraction module.Schedule information stores extraction module and is receiving the counter accumulator module return New Counter Value when, select next scheduling queue, and update the count value of corresponding scheduler, prepare next sub-authorization hair Put.
Wherein, counter accumulator module can fast and accurately be found next using algorithm of the present invention by optimization At the counter moment that should be serviced, schedule information storage extraction module is returned to, updates scheduler information.
The data flow and controlling stream of the present embodiment are responsible for by schedule information storage extraction module, for the optimization of WFQ algorithms Processing is mainly reflected in flow movements and counter adds up.
Flow movements realize that step is as follows:
1st, ask scheduled queue or flow the inverted order w ' of weight;
2nd, w ' minimum non-zero position is found, tries to achieve I;
3rd, D=(counter+I) mod (2N) is made, D least significant non-zero position is found, tries to achieve p;
If the 4th, w ’s &p!=0 (i.e. w ' and p step-by-steps are not zero with result), then q=p, otherwise q=I;
After trying to achieve q, q is decoded as to the position index of its corresponding nonzero digit, extraction mould is then stored by schedule information The queue or stream are added to qindex last-of-chain by the operation of block.Next the empty mark of all scheduling chained lists is extracted, is entered Linage-counter accumulation calculating, it is assumed that current count value is counter, and empty is the shape that scheduling queue chained list is represented with bitmap State, 0 is empty, 1 non-NULL.Such as the scheduler of one 8, if 0,1,4,5, No. 6 scheduling queue non-NULL, then empty is exactly 01110011.Qn is obtained according to empty least significant non-zero position index (being designated as x), Qn is the position of 2 empty least significant non-zero position Index (x) power, i.e. Qn=2x;Mask is that the position on empty least significant non-zeros position and its left side is complete 1.
What counter added up realizes that step is as follows:
1st, acc1=counter+Qn, acc2=counter+Qn*2, acct=counter+Qn*2(t-1);Wherein, t is Positive integer more than 1;
2nd, acc1 mask=acc1&mask, acc1 mask least significant non-zero position index is drawn, is designated as m, extract empty M positions value, be designated as flag;
3rd, acc1 is selected if flag non-zeros, otherwise, acc2 is selected or selects minimum value in acc2~acct as acc, Calculate new Counter Value counter new, counter new=acc&mask;
It follows that the present invention only needs three steps just to calculate new Counter Value, corresponding movable chained list is selected.
It is described in further detail below by way of the specific implementation exemplified by specific implementation to the present invention.
Assuming that currently we operate the WFQ schedulers of one 1: 256, it is assumed that present counter value 13, the scheduling of non-NULL Queue linked list has Q (0), Q (2), Q (3), Q (6), and corresponding 8bit binary system is 8 ' b00001101.According to current counter At the moment, current scheduling queue Q (0) is obtained, the weight of stream corresponding to extraction Q (0) activity chain heading pointer is 128, and it is corresponding W ' least significant non-zero position be 1, then corresponding step value I=8 ' b00000001.D=(counter+I) mod (2N) is calculated, D least significant non-zero position, D=8 ' b00001110 are found, least significant non-zero position is 1, then p=8 ' b00000010.Calculate w ’s &p knots Fruit is 8 ' b00000000, represent this flow flow be moved to scheduling queue chained list corresponding to p Rule of judgment it is invalid, also only Inactive scheduling queue chained list simply can be moved to from the scheduling queue chained list of activity, this completes current in Q (0) Activity scheduling queue linked list Q (0) flow service.
Find that tail pointer is equal with owner pointer while Q (0) owner pointer of movable chained list is extracted, represent current service Stream be last member in Q (0) movable chained list.Add up, find, it is necessary to enter linage-counter after having operated flow movements Next counter moment.According to our methods described above, current Counter Value counter is 13, empty 8bit The state for representing all scheduling chained lists is 8 ' b01001101, and empty least significant non-zero position is 0, corresponding Qn=8 ' B00000001, mask 11111111.Then try to achieve:
Acc1=8 ' b00001101+8 ' b00000001;
Acc2=8 ' b00001101+8 ' b00000010;
Continue to try to achieve:
Acc1_mask=acc1&mask=8 ' b00001110;
M=1;M_mask=8 ' b00000010
Flag=m_mask∅
It is the Counter Value that 0 value 15 for obtaining acc2 is subsequent time eventually through flag.
In summary, the invention provides a kind of mechanism of optimization WFQ algorithms, mainly in current activity chain telogenesis , it is necessary to select next counter moment after member's being serviced finishes, that is, the selection calculating of next movable chained list is carried out, Design and the handling process realized can significantly be simplified, reduce hard-wired expense.
It these are only that the present invention's is preferable to carry out case, be not intended to limit the invention, the present invention can also have other Various embodiments, in the case of without departing substantially from spirit of the invention and its essence, those skilled in the art can be according to this hair It is bright to make various corresponding changes and deformation, but these corresponding changes and deformation should all belong to appended claims of the invention Protection domain.
Obviously, those skilled in the art should be understood that above-mentioned each module of the invention or each step can be with general Computing device realize that they can be concentrated on single computing device, or be distributed in multiple computing devices and formed Network on, alternatively, they can be realized with the program code that computing device can perform, it is thus possible to they are stored Performed in the storage device by computing device, and in some cases, can be with different from shown in order execution herein The step of going out or describing, they are either fabricated to each integrated circuit modules respectively or by multiple modules in them or Step is fabricated to single integrated circuit module to realize.So, the present invention is not restricted to any specific hardware and software combination.

Claims (9)

  1. The implementation method 1. a kind of counter based on Weighted Fair Queuing adds up, it is characterised in that
    After the movable chained list being serviced of scheduling queue finishes, enter linage-counter in such a way and add up, and according to new Counter Value selects next scheduling queue:
    The state of each scheduling queue chained list is represented with bitmap empty, according to the position index of the least significant non-zero position of the empty, note For x, position index the power Qn, i.e. Qn=2 of 2 least significant non-zero position are drawnx;And draw the empty least significant non-zero position and its The position on the left side is all 1 position index mask;
    According to counter current count value counter and Qn*2(t-1)And obtain t-th of intermediate result acct, wherein t is just whole Number;
    First intermediate result acc1 is verified, if the acc1 is verified, selects the acc1 and described Mask step-by-steps are with operation result as new Counter Value;Otherwise, second intermediate result acc2 and the mask step-by-steps are selected With operation result as the minimum value in new Counter Value or the selection acc2 to acct and the mask step-by-steps and fortune Result is calculated as new Counter Value.
  2. 2. the method as described in claim 1, it is characterised in that verified in the following ways to the acc1:
    The acc1 and mask is subjected to step-by-step and obtains acc1_mask with computing, and show that the acc1_mask's is minimum Non-zero position index, is designated as m, extracts the value of empty m positions, is designated as flag;
    If the flag non-zeros, the acc1 are verified;Otherwise, if the flag is zero, the acc1 checkings Do not pass through.
  3. 3. the method as described in claim 1, it is characterised in that methods described also includes, and carries out Flow's in such a way It is mobile:
    1) obtain scheduled queue or flow the inverted order w ' of weight;
    2) according to the minimum non-zero position of the w ', the cumulative step value I of counter is obtained;
    3) new Counter Value D is calculated:D=(counter+I) mod (2N), and find out D least significant non-zero position p;Wherein, N is meter Number device bit number;
    4) q is calculated:Judge whether w ' and p step-by-steps and result are zero, if be not zero, q=p;Otherwise q=I;
    After trying to achieve q, the location index index using q as its corresponding nonzero digit, the scheduling queue or stream are added to qindex Last-of-chain.
  4. The realization device 4. a kind of counter based on Weighted Fair Queuing adds up, it is characterised in that described device includes scheduling and believed Breath storage extraction module, flow mobile modules, and counter accumulator module, wherein:
    The schedule information stores extraction module, flow chained lists in the movable chained list for safeguarding WFQ schedulers and scheduling queue Information, activity chain heading tail pointer information and activity chain table status information;When the WFQ schedulers are toggled, read The present counter value of the WFQ schedulers, extract the head of the movable chained list of scheduling queue corresponding to the present counter value Tail pointer, then the weight information of flow in the movable chained list is read, it is sent to the flow mobile modules;
    The flow mobile modules, for according to the present counter value received, selecting corresponding movable chained list, extracting institute The weight of flow corresponding to activity chain heading pointer is stated, carries out the calculating of flow movements;
    The counter accumulator module, after toggled, enter linage-counter and add up, draw new Counter Value, return to The schedule information stores extraction module.
  5. 5. device as claimed in claim 4, it is characterised in that
    The counter accumulator module is used for, and enters linage-counter in such a way and adds up, and draws new Counter Value:
    The state of each scheduling queue chained list is represented with bitmap empty, according to the position index of the least significant non-zero position of the empty, note For x, position index the power Qn, i.e. Qn=2 of 2 least significant non-zero position are drawnx;And draw the empty least significant non-zero position and its The position on the left side is all 1 position index mask;
    According to counter current count value counter and Qn*2(t-1)And obtain t-th of intermediate result acct, wherein t is just whole Number;
    First intermediate result acc1 is verified, if the acc1 is verified, selects the acc1 and described Mask step-by-steps are with operation result as new Counter Value;Otherwise, second intermediate result acc2 and the mask step-by-steps are selected With operation result as the minimum value in new Counter Value or the selection acc2 to acct and the mask step-by-steps and fortune Result is calculated as new Counter Value.
  6. 6. device as claimed in claim 4, it is characterised in that
    The flow mobile modules are used for, and carry out Flow movement in such a way:
    1) obtain scheduled queue or flow the inverted order w ' of weight;
    2) according to the minimum non-zero position of the w ', the cumulative step value I of counter is obtained;
    3) new Counter Value D is calculated:D=(counter+I) mod (2N), and find out D least significant non-zero position p;Wherein, N is meter Number device bit number;
    4) q is calculated:Judge whether w ' and p step-by-steps and result are zero, if be not zero, q=p;Otherwise q=I;
    After trying to achieve q, the location index index using q as its corresponding nonzero digit, the scheduling queue or stream are added to qindex Last-of-chain.
  7. 7. the device as described in claim 4 or 5, it is characterised in that
    The flow mobile modules are additionally operable to, and after the calculating for completing flow movements, are deposited returning result to the schedule information While storing up extraction module, the status information of current active chained list is carried;
    The schedule information storage extraction module is used for, the state of the current active chained list sent according to the flow mobile modules Information, the current active chain table status by active transition for it is inactive when, trigger the counter accumulator module.
  8. 8. the device as described in claim 4,5 or 6 are any, it is characterised in that
    The schedule information storage extraction module is additionally operable to, the new Counter Value returned according to the counter accumulator module, Select next scheduling queue.
  9. 9. device as claimed in claim 8, it is characterised in that
    The schedule information storage extraction module is additionally operable to, and is receiving the new counter of the counter accumulator module return During value, the count value of WFQ schedulers is updated, prepares next sub-authorization granting.
CN201210241086.8A 2012-07-12 2012-07-12 A kind of scheduling implementation method and device based on Weighted Fair Queuing Active CN103546393B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201210241086.8A CN103546393B (en) 2012-07-12 2012-07-12 A kind of scheduling implementation method and device based on Weighted Fair Queuing

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201210241086.8A CN103546393B (en) 2012-07-12 2012-07-12 A kind of scheduling implementation method and device based on Weighted Fair Queuing

Publications (2)

Publication Number Publication Date
CN103546393A CN103546393A (en) 2014-01-29
CN103546393B true CN103546393B (en) 2018-01-19

Family

ID=49969457

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210241086.8A Active CN103546393B (en) 2012-07-12 2012-07-12 A kind of scheduling implementation method and device based on Weighted Fair Queuing

Country Status (1)

Country Link
CN (1) CN103546393B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108259384B (en) * 2016-12-29 2020-06-02 深圳市中兴微电子技术有限公司 Queue polling selection method and device

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101621478A (en) * 2009-08-07 2010-01-06 中兴通讯股份有限公司 Method and device for array dispatch
CN101741729A (en) * 2008-11-18 2010-06-16 阿尔卡特朗讯公司 Method for scheduling packets of a plurality of flows and system for carrying out the method

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1382165A2 (en) * 2001-04-13 2004-01-21 MOTOROLA INC., A Corporation of the state of Delaware Manipulating data streams in data stream processors

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101741729A (en) * 2008-11-18 2010-06-16 阿尔卡特朗讯公司 Method for scheduling packets of a plurality of flows and system for carrying out the method
CN101621478A (en) * 2009-08-07 2010-01-06 中兴通讯股份有限公司 Method and device for array dispatch

Also Published As

Publication number Publication date
CN103546393A (en) 2014-01-29

Similar Documents

Publication Publication Date Title
CN103701934B (en) Resource optimal scheduling method and virtual machine host machine optimal selection method
CN109885397A (en) The loading commissions migration algorithm of time delay optimization in a kind of edge calculations environment
CN111047272B (en) Project scheduling method and device for multi-language collaborative development
CN101493857A (en) Semiconductor production line model building, optimizing and scheduling method based on petri net and immune arithmetic
EP3198494B1 (en) Communication for efficient re-partitioning of data
CN111382889A (en) Warehouse location recommendation method, device, equipment and medium
CN109191052A (en) A kind of multi-vehicle-type vehicle routing optimization method, server and system
CN109756424A (en) Business flow list polymerization and system
CN106559828B (en) Cell busy period management method and device and self-organizing network element
CN110990142A (en) Concurrent task processing method and device, computer equipment and storage medium
CN108600020A (en) Method for processing business, device and server
CN103546393B (en) A kind of scheduling implementation method and device based on Weighted Fair Queuing
CN108776589A (en) The dispositions method of Radar Signal Processing component software
Knapp et al. Modeling of automated storage/retrieval systems using Petri nets
CN116050540A (en) Self-adaptive federal edge learning method based on joint bi-dimensional user scheduling
Meng et al. Achieving energy efficiency through dynamic computing offloading in mobile edge-clouds
CN109784570A (en) Wisdom workshop flexible production dispatching method based on information physical emerging system
CN106487889B (en) A kind of task towards cloud data center and data aggregate dispositions method
CN105446812A (en) Multitask scheduling configuration method
CN105988443B (en) Manufacturing process processing method and processing device for being limited with time interval
CN102163163A (en) Small node operating system and implementation method thereof for wireless sensor network
CN109347764A (en) Scheduling method, system and medium for realizing bandwidth matching
CN113791595B (en) Measuring point data importing method, system, equipment and medium for distributed control system
CN109145350A (en) A kind of process analysis method based on queue logic Petri network
CN111784045B (en) Optimization method, device, equipment and storage medium for delivery vehicle

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
EE01 Entry into force of recordation of patent licensing contract

Application publication date: 20140129

Assignee: SANECHIPS TECHNOLOGY Co.,Ltd.

Assignor: ZTE Corp.

Contract record no.: 2015440020319

Denomination of invention: A kind of scheduling implementation method and device based on Weighted Fair Queuing

License type: Common License

Record date: 20151123

LICC Enforcement, change and cancellation of record of contracts on the licence for exploitation of a patent or utility model
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20221118

Address after: 518055 Zhongxing Industrial Park, Liuxian Avenue, Xili street, Nanshan District, Shenzhen City, Guangdong Province

Patentee after: SANECHIPS TECHNOLOGY Co.,Ltd.

Address before: 518057 Ministry of justice, Zhongxing building, South Science and technology road, Nanshan District hi tech Industrial Park, Shenzhen, Guangdong

Patentee before: ZTE Corp.

TR01 Transfer of patent right