CN104144134B - A kind of array dispatching method and device - Google Patents

A kind of array dispatching method and device Download PDF

Info

Publication number
CN104144134B
CN104144134B CN201410411353.0A CN201410411353A CN104144134B CN 104144134 B CN104144134 B CN 104144134B CN 201410411353 A CN201410411353 A CN 201410411353A CN 104144134 B CN104144134 B CN 104144134B
Authority
CN
China
Prior art keywords
queue
message
potential energy
binary tree
node
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
CN201410411353.0A
Other languages
Chinese (zh)
Other versions
CN104144134A (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.)
New H3C Technologies Co Ltd
Original Assignee
New H3C Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by New H3C Technologies Co Ltd filed Critical New H3C Technologies Co Ltd
Priority to CN201410411353.0A priority Critical patent/CN104144134B/en
Publication of CN104144134A publication Critical patent/CN104144134A/en
Application granted granted Critical
Publication of CN104144134B publication Critical patent/CN104144134B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Abstract

The invention discloses a kind of array dispatching method, the queue is Weight Round Robin WRR queues, and this method includes:The complete binary tree using queue potential energy as key value is set up, node and the congestion queue of the complete binary tree are corresponded;When joining the team or go out group in message, position of the corresponding node of the queue in the complete binary tree is adjusted based on queue potential energy value so that the potential energy value of all father nodes is respectively less than the potential energy value equal to child node on complete binary tree.The invention also discloses a kind of queue scheduling device.Queue scheduling can be made more fair using the present invention.

Description

A kind of array dispatching method and device
Technical field
The present invention relates to network communication technology field, more particularly to a kind of array dispatching method and device.
Background technology
Weight Round Robin (WRR, Weighted Round Robin) queue is a kind of queue shape that datacom device is supported Formula.It has following several features:1st, every group has several queues, such as 1.2 ... N;2nd, each queue can with specified quantum, generally with Byte (Byte) is unit, can also specified weight;3rd, row of forming a team may apply on interface.
Existing WRR queue schedulings are dispatched by the way of share poll, after the share of current queue runs out of, increase correspondence Share, then the scheduling of next queue is carried out, to reach the purpose by configuration share scheduling.When multiple queues configure more one large During volume, each poll share needs to run out of to carry out next round queue scheduling again, and queue may take larger timeslice alone, The interval that same queue is sent again is also larger.Queue is assessed from shorter timeslice, fairness is poor.
The content of the invention
For achieving the above object, the invention provides a kind of array dispatching method, the queue is adjusted for WRR WRR queues are spent, this method includes:
The complete binary tree using queue potential energy as key value is set up, the node of the complete binary tree and congestion queue are one by one Correspondence;
When joining the team or go out group in message, based on queue potential energy value to the corresponding node of the queue in the complete y-bend Position in tree is adjusted so that the potential energy value of all father nodes is respectively less than the potential energy equal to child node on complete binary tree Value.
For achieving the above object, present invention also offers a kind of queue scheduling device, the queue is WRR WRR queues are dispatched, the device includes:
Tree sets up module, for setting up the complete binary tree using queue potential energy as key value, the section of the complete binary tree Point is corresponded with congestion queue;
Queue scheduling module, it is corresponding to the queue based on queue potential energy value during for joining the team or go out group in message Position of the node in the complete binary tree is adjusted so that the potential energy value of all father nodes is respectively less than on complete binary tree Equal to the potential energy value of child node.
In summary, in the embodiment of the present invention, WRR queue schedulings are realized by the way of complete binary tree weighted.It is logical Cross the queue scheduling mode of the present invention so that the timeslice that queue takes alone is very short, the interval that same queue is sent again It is very short, queue is assessed from shorter timeslice, queue scheduling is more fair.
Brief description of the drawings
Fig. 1 proposes a kind of schematic flow sheet of array dispatching method for the present invention.
Fig. 2 proposes a kind of schematic flow sheet for dispatching method of joining the team for the present invention.
Fig. 3 for the present invention propose it is a kind of go out group dispatching method schematic flow sheet.
Fig. 4 is the structural representation of queue scheduling device of the embodiment of the present invention.
Embodiment
Referring to the drawings, the embodiment of the present invention is described in further detail.
For the present invention is better described, the concept about WRR queues following is a brief introduction of.
WRR has multiple queue Q, and each queue definitions is Q [1], Q [2], Q [3] ..., Q [N];
Each queue has observed value a V, V [1], V [2], V [3] ..., V [N];
Each queue has weighted value a W, W [1], W [2], W [3] ... W [N], the public constant C of WRR queues.W by Calculate gained, W [1]=C/V [1], W [2]=C/V [2], W [3]=C/V [3] ..., W [N]=C/V [N].(explanation:C value Determine C/W precision, it is proposed that C value is 100 times or more of individual queue W maximums).
Each queue has potential energy a P, P [1], P [2], P [3] ..., and P [N], P is the accumulated value of W and L product.L is represented The length of one message.Therefore, the potential energy P of queue is determined by W and L in the present invention, for the key as complete binary tree Value, when joining the team and go out group in message, the reconstruct of complete binary tree is carried out according to potential energy value.
In the prior art, WRR queue schedulings are dispatched by the way of share poll, such as, and each message length is 1000 Share 100000 and 200000 is respectively configured in individual byte, two queues, then, byte=100 of queue 1=shares 100000/1000 Message;Queue 2=200000/1000 byte=200 message.That is, it is necessary to after queue 1 distributes 100 messages, team Row 2 send out 200 messages again, it is necessary to which waiting list 2 is distributed after 200 messages, can just re-start the scheduling of queue 1.So, exist For a long time from the point of view of, two queues transmit messages text ratio be although 1:2, but in the short period of time from the point of view of, always sending out same The message of individual queue, therefore the short-term fairness of queue is difficult to embody.
The present invention realizes WRR queue schedulings to embody short-term fairness by the way of complete binary tree weighted.WRR One group of congestion queue sets up a complete binary tree by crucial (Key) value of P, also this complete binary tree can be referred to as into heap.This By message buffering a to empty queue in invention, the queue just turns into congestion queue, and each congestion queue is saved as one of heap Point, queue is schematically as follows;
Wherein, Q [1] is root node, and Q [M] is the father node of Q [2M] and Q [2M+1] two child nodes.Key values P between node Meet relation:Father node P values<Key values are limited without size between=two child node P values (condition 1), the brotgher of node.Such as meet bar Part P [1]<=P [2] and P [1]<=P [3];P[M]<=P [2M] and P [M]<=P [2M+1].
Based on described above, the present invention proposes a kind of schematic flow sheet of array dispatching method as shown in figure 1, the queue For Weight Round Robin WRR queues, this method includes:
The complete binary tree of step 11, foundation using queue potential energy as key value, the node and congestion of the complete binary tree Queue is corresponded;
Step 12, when joining the team or go out group in message, based on queue potential energy value to the corresponding node of the queue described Position in complete binary tree is adjusted so that the potential energy value of all father nodes, which is respectively less than, on complete binary tree is equal to child node Potential energy value.
Specifically, when message is joined the team, the present invention propose a kind of schematic flow sheet for dispatching method of joining the team as shown in Fig. 2 This method includes:
Step 21, by message buffering a to empty queue, so that the empty queue turns into the queue of congestion first;
Step 22, using this first congestion queue as complete binary tree a node, be added to using queue potential energy as Behind last node of the complete binary tree of key value;
In the present invention, after being set up using queue potential energy as the complete binary tree of key value, can according to from top to bottom, from a left side to Right order, each node on tree is numbered successively, the largest number of node is last on complete binary tree One node.
In the present invention message join the team potential energy value keep it is constant, that is to say, that for a queue, no matter the queue has How many messages are joined the team, and potential energy value is potential energy value corresponding when first message is joined the team all the time.
Step 23, based on queue potential energy value to the corresponding node of queue of the congestion first in the complete binary tree Position is adjusted so that the potential energy value of all father nodes is respectively less than the potential energy value equal to child node on complete binary tree.
For the clear explanation present invention, concrete scene is set forth below and illustrates.
Embodiment one
There are 7 queue nodes in current heap, it is assumed that corresponding P values arrive P [7] to queue Q [1] to Q [7] for P [1] respectively, this Shi Youyi empty queue Q [8] is because message is joined the team and adds heap, and queue P values P [8] is 150, and the process that it adds heap is as follows:
1st, initial queue is as follows, and P [8] is the P values of enqueue Q [8] to be added:
Wherein, Q [8] is added to after last node 7 by the complete binary tree of key value of queue potential energy Face.
2nd, compare P [8] and its father node P [4], be unsatisfactory for condition 1, exchange Q [8] and Q [4]
3rd, continue to compare P [4] and its father node P [2], be unsatisfactory for condition 1, exchange Q [8] and Q [2]
4th, continue to compare P [2] and its father node P [1], meet condition 1, Q [8], which adds heap process, to be terminated, that is to say, that entered Team's scheduling process terminates.Now, the corresponding potential energy values of Q [8] are P [2]Q[8]:150, illustrate Q [8] in complete binary tree second node Position.
Specifically, when message goes out group, the present invention also propose it is a kind of go out group dispatching method schematic flow sheet such as Fig. 3 institutes Show, this method includes:
Step 31, the first message of root node buffer queue gone out into team, so that the root node queue goes out team of team as first message Row;
Step 32, the weighted value for going out according to message length and first message group queue, update the potential energy that first message goes out group queue Value;
Step 33, judge that first message goes out after team, the first message goes out whether group queue is empty, when being not space-time, then, performs step Rapid 34;After first message goes out team, it is sky that the first message, which goes out group queue, and described in the empty first message is gone out when group queue is removed Complete binary tree is not space-time, then performs step 35;After first message goes out team, it is sky that the first message, which goes out group queue, and should It is also space-time that empty first message, which goes out complete binary tree when group queue is removed, then performs step 36;
Step 34, the corresponding node of group queue gone out to the first message in the complete binary tree based on queue potential energy value Position be adjusted so that on complete binary tree the potential energy value of all father nodes be respectively less than equal to child node potential energy value.
Step 35, the first message is gone out to the corresponding node of group queue removed, last node on complete binary tree is moved To the position of root node;
Position of the root node position node in the complete binary tree is moved to based on queue potential energy value to this to adjust It is whole so that the potential energy value of all father nodes is respectively less than the potential energy value equal to child node on complete binary tree.
Step 36, the first message is gone out to the corresponding node of group queue removed, it is right before group queue is removed that the first message is gone out The renewal potential energy value answered as complete binary tree initial potential energy.
Wherein, first message goes out team, and the queue potential energy value will change, so updating the potential energy value that first message goes out group queue Method include:
According to PUpdate=P+W*L, wherein, W represents that first message goes out the weighted value of group queue, and L represents the length of message, PUpdateTable Show that the potential energy value gone out with the first message before group queue updates carries out the cumulative of W and L product, with PUpdateGo out group queue to first message Potential energy value is updated.
For the clear explanation present invention, concrete scene is set forth below and illustrates.
Embodiment two
The first message of root node buffer queue goes out team, so that the root node queue goes out group queue, first message as first message Go out after team, it is not sky that the first message, which goes out group queue,:
There are 7 queue nodes in current heap, it is assumed that corresponding P values arrive P [7] to queue Q [1] to Q [7] for P [1] respectively, this When queue Q [1] message to go out after team queue be not sky, then, reconstruct heap process is as follows:
1st, initial queue is as follows, and P [1] is that first message goes out the P values recalculated after team:
2nd, compare P [1] and its child node P [2], P [3], be unsatisfactory for condition 1, by Q [1] and the less child node Q [2] of P values Exchange,
3rd, continue to compare P [2] and its child node P [4], P [5], be unsatisfactory for condition 1, by Q [1] and the less child node of P values Q [5] is exchanged
4th, P [5] is there is no child node, and restructuring procedure terminates, that is to say, that goes out group scheduling process and terminates, now queue Q [1] Corresponding potential energy value is P [5]Q[1]:800, illustrate the original queue Q [1] as root node, after first message goes out team, potential energy value Change, P values are changed into 800, be then based on the potential energy value 800 after Q [1] updates, adjustment Q [1] is in complete binary tree Position, final Q [1] is in the position of complete binary tree Section 5 point.
Embodiment three
The first message of root node buffer queue goes out team, so that the root node queue goes out group queue, first message as first message Go out after team, it is sky that the first message, which goes out group queue, and not be sky the empty first message is gone out into complete binary tree when group queue is removed:
There are 7 queue nodes in current heap, it is assumed that corresponding P values arrive P [7] to queue Q [1] to Q [7] for P [1] respectively, this When queue Q [1] message to go out after team queue be sky, then, reconstruct heap process is as follows:
1st, initial queue is as follows, and NULL is sky root queue:
2nd, last node P [7] is moved to root node as P [1],
3rd, now, situation is converted into embodiment two to go out after group message, and root node queue is not empty situation, with reference to implementation The method of example two, final result is:
In above-described embodiment three, root node queue first message goes out after team, and root node queue is sky, but by the empty root section After point queue is removed, complete binary tree is not sky, also has other nodes on complete binary tree.
If first message goes out after team, it is sky that the first message, which goes out group queue, and is removed the empty first message is gone out into group queue Shi Suoshu complete binary trees are also space-time, then the first message is gone out into the corresponding node of group queue is removed, and the first message is gone out into team of team The corresponding potential energy value that updates is as the initial potential energy of complete binary tree before row removal.
Here, root node queue first message goes out team, and the root node queue potential energy value will change, at the beginning of complete binary tree Beginning potential energy is exactly according to PUpdate=P+W*L, the renewal potential energy value that obtained root node queue first message goes out after team.In the present invention, As long as root node queue first message goes out after team, the queue is sky, then needs to remove the queue from complete binary tree, if this It is last node queue on complete binary tree, then after the queue is removed from complete binary tree, complete binary tree It is sky, exists without any queue.When there is queue to add the complete binary tree again, to add the queue of tree has one Potential energy value, the potential energy value then adds two if greater than the initial potential energy of complete binary tree still using the potential energy value as the queue Potential energy value during fork tree;The potential energy value if less than complete binary tree initial potential energy, then with the initial potential energy of complete binary tree Potential energy value during binary tree is added as the queue.Therefore, the initial potential energy of complete binary tree has been added as follow-up queue A benchmark judgment value for full binary tree, to prevent the queue potential energy value very little of tree to be added, W*L accumulated value also very little, then Always from the queue outgoing packet, the fairness of scheduling is lost.
Group dispatching method and is gone out at scheduling according to above-mentioned join the team, the present invention is specific enumerate example IV illustrate it is of the invention with it is existing The beneficial effect that technology is compared.
Example IV
Each message length is L=1000 byte, and share (observed value), V1=is respectively configured in two queue Q [1] and Q [2] 100000 and V2=200000, it is assumed that the public constant C of WRR queues is 10000000, then, the corresponding W1=C/V1=of Q [1] 10000000/100000=100;The corresponding W2=C/V2=10000000/200000=50 of Q [2].
Message enqueue Q [1], adds heap, initial potential energy P [1]:0
Message enqueue Q [2], adds heap, initial potential energy P [2]:0
It is as follows that message enters heap queue:P[1]Q[1]:0
P[2]Q[2]:0
Δ first time root node first message goes out team, and first message goes out team from Q [1], updates the potential energy value of root node queue:P [1]Q[1]=0+,W1*,L=0,+10,0*1,000,=10 ten thousand;P[2]Q[2]Remain as 0;Then, condition 1 is unsatisfactory for, P [1] and P [2] is handed over Change,
P[1]Q[2]:0
P[2]Q[1]:100000
It should be noted that after now exchanging, Q [2] is as root node, and corresponding potential energy value is 0.
Second of root node first message of Δ goes out team, and first message goes out team from Q [2], updates the potential energy value of root node queue:P[1] =0+W,2*L,=0+,50*,100,0=5 ten thousand;P [2] remains as 100,000;Then, condition 1 is met;
P[1]Q[2]:50000
P[2]Q[1]:100000
Δ third time root node first message goes out team, and first message goes out team from Q [2], updates the potential energy value of root node queue:P[1] + the 50*1000=10 ten thousand of=5 ten thousand+W2*L=5 ten thousand;P [2] remains as 100,000;Then, condition 1 is met;
P[1]Q[2]:100000
P[2]Q[1]:100000
The 4th root node first message of Δ goes out team, and first message goes out team from Q [2], updates the potential energy value of root node queue:P[1] + the 50*1000=15 ten thousand of=10 ten thousand+W2*L=10 ten thousand;P [2] remains as 100,000;Then, condition 1 is unsatisfactory for, P [1] and P [2] is handed over Change,
P[1]Q[1]:100000
P[2]Q[2]:150000
It should be noted that after now exchanging, Q [1] is as root node, and corresponding potential energy value is 100,000.
The 5th root node first message of Δ goes out team, and first message goes out team from Q [1], updates the potential energy value of root node queue:P[1] + the 100*1000=20 ten thousand of=10 ten thousand+W1*L=10 ten thousand;P [2] remains as 150,000;Then, condition 1 is unsatisfactory for, P [1] and P [2] is handed over Change,
P[1]Q[2]:150000
P[2]Q[1]:200000
It should be noted that after now exchanging, Q [2] is as root node, and corresponding potential energy value is 150,000.
The 6th root node first message of Δ goes out team, and first message goes out team from Q [2], updates the potential energy value of root node queue:P[1] + the 50*1000=20 ten thousand of=15 ten thousand+W2*L=15 ten thousand;P [2] remains as 200,000;Then, condition 1 is met;
P[1]Q[2]:200000
P[2]Q[1]:200000
The 7th root node first message of Δ goes out team, and first message goes out team from Q [2], updates the potential energy value of root node queue:P[1] + the 50*1000=25 ten thousand of=20 ten thousand+W2*L=20 ten thousand;P [2] remains as 200,000;Then, condition 1 is unsatisfactory for, P [1] and P [2] is handed over Change,
P[1]Q[1]:200000
P[2]Q[2]:250000
It should be noted that after now exchanging, Q [1] is as root node, and corresponding potential energy value is 200,000.By that analogy, As can be seen that the order of outgoing packet is Q [1] Q [2] Q [2] Q [2], Q [1] Q [2] Q [2], Q [1] Q [2] Q [2] ..., Q [1] Q [2] Q[2].That is, removing queue Q [1] at the beginning goes out a message, queue Q [2] goes out outside 3 messages, is all subsequently queue Q [1] Go out a message, queue Q [2] goes out 2 messages.With prior art, queue 1 will go out after 100 messages, and queue 2 goes out 200 reports again Text, is compared, and the timeslice that queue takes alone is very short, and the interval that same queue is sent again is also very short, from shorter timeslice To assess queue, queue scheduling of the present invention is more fair.
Secondly, when prior art is dispatched, each node queue will travel through one time, and complexity is O (N), and complexity is with gathering around Number of queues linear rise is filled in, performance is linear to be declined.Dispatching method of the present invention, using complete binary tree, complexity is O (logN).Wherein, N is the number of queue nodes.
Finally, when prior art is dispatched, because single poll is completed as standard with all queue polls, in multiple nucleus system Under, if queue poll is handled in spin lock all the time, expense is larger in lock;If queue poll can be partly concurrent, Larger (the explanation of synchronization overhead of queue poll completion status:Multinuclear can concurrently poll different queue when, it is necessary to assure epicycle Before all queue shares run out of, share can not be increased in advance by having run out of the queue of share).That is, in multiple nucleus system It is lower, it is necessary to which queue 1 distributes 100 messages after, 200 messages are sent out in queue 2 again, if which queue is not distributed, it is necessary to CPU Etc. pending, CPU synchronization overhead is added.And the method for the present invention, queue Q [1] goes out a message, and queue Q [2] goes out 2 Message, under multiple nucleus system, works, it is not necessary to wait pending simultaneously equivalent to multiple CPU, therefore, and the present invention is in multiple nucleus system Lower synchronization overhead is smaller.
To sum up, the present invention realizes WRR queue schedulings by the way of complete binary tree weighted.Complete binary tree meets bar Part:Father node P values<=two child node P values (condition 1), so the first message in which the minimum queue of which queue P value is at first Go out team.It is additionally, since PUpdate=P+W*L, the weight of which queue is small, cumulative just slow of the P values of which queue, and then the queue P values it is relatively small, the probability of the queue outgoing packet is just high.From above-described embodiment four just as can be seen that W2=50, W1= 100, so, Q [2] is small compared to Q [1] weight, therefore Q [2] higher than the probability of Q [1] outgoing packet, and queue Q [1] goes out a report Text, queue Q [2] goes out 2 messages.So as to realize more fair scheduling.
Based on same inventive concept, one embodiment of the invention also proposes a kind of queue scheduling device, is referring to Fig. 4, Fig. 4 The structural representation of queue scheduling device of the embodiment of the present invention, the device includes:
Tree sets up module 401, for setting up the complete binary tree using queue potential energy as key value, the complete binary tree Node is corresponded with congestion queue;
Queue scheduling module 402, during for joining the team or go out group in message, based on queue potential energy value to queue correspondence Position of the node in the complete binary tree be adjusted so that the potential energy value of all father nodes is small on complete binary tree In the potential energy value equal to child node.
When message is joined the team, scheduling of joining the team is carried out, the queue scheduling module 402 further comprises:
Buffer cell 4021, for by message buffering a to empty queue, so that the empty queue turns into the team of congestion first Row;
Enter heap scheduling unit 4022, for using this first congestion queue be used as complete binary tree a node, add To behind using queue potential energy as last node of the complete binary tree of key value;This is gathered around first based on queue potential energy value Position of the corresponding node of queue of plug in the complete binary tree is adjusted so that all father nodes on complete binary tree Potential energy value be respectively less than equal to child node potential energy value.
When message goes out group, team's scheduling is carried out out, the queue scheduling module 402 further comprises:
First message goes out group unit 4023, for the first message of root node buffer queue to be gone out into team, so that the root node queue Go out group queue as first message;
Queue potential energy updating block 4024, the weighted value for going out group queue according to message length and first message updates first Message goes out the potential energy value of group queue;
Confirmation unit 4025, for judging that first message goes out after team, the first message goes out whether group queue is empty;
Go out group scheduling unit 4026, for after confirmation unit judges that first message goes out team, the first message to go out group queue and is not Space-time, goes out position of the corresponding node of group queue in the complete binary tree to the first message based on queue potential energy value and adjusts It is whole so that the potential energy value of all father nodes is respectively less than the potential energy value equal to child node on complete binary tree.
It is described go out group scheduling unit 4026, be additionally operable to after confirmation unit judges that first message goes out team, the first message goes out team of team Sky is classified as, and not is space-time the empty first message is gone out into complete binary tree when group queue is removed, the first message is gone out into team The corresponding node of queue is removed, and last node on complete binary tree is moved on to the position of root node;Based on queue potential energy value Position of the root node position node in the complete binary tree is moved to this to be adjusted so that on complete binary tree own The potential energy value of father node is respectively less than the potential energy value equal to child node.
It is described go out group scheduling unit 4026, be additionally operable to after confirmation unit judges that first message goes out team, the first message goes out team of team Sky is classified as, and is also space-time the empty first message is gone out into complete binary tree when group queue is removed, the first message is gone out into team The corresponding node of queue is removed, and the first message is gone out to corresponding renewal potential energy value before group queue is removed and is used as complete binary tree Initial potential energy.
The queue potential energy updating block 4024 specifically for:
According to PUpdate=P+W*L, wherein, W represents that first message goes out the weighted value of group queue, and L represents the length of message, PUpdateTable Show that the potential energy value gone out with the first message before group queue updates carries out the cumulative of W and L product, with PUpdateGo out group queue to first message Potential energy value is updated.
The foregoing is only a preferred embodiment of the present invention, is not intended to limit the scope of the present invention.It is all Within the spirit and principles in the present invention, any modification, equivalent substitution and improvements made etc. should be included in the protection of the present invention Within the scope of.

Claims (10)

1. a kind of array dispatching method, the queue is Weight Round Robin WRR queues, it is characterised in that this method includes:
Set up the complete binary tree using queue potential energy as key value, a pair of node and the congestion queue 1 of the complete binary tree Should;
When joining the team or go out group in message, based on queue potential energy value to the corresponding node of the queue in the complete binary tree Position be adjusted so that on complete binary tree the potential energy value of all father nodes be respectively less than equal to child node potential energy value;
Wherein, when message goes out group, team's scheduling is carried out out, this method includes:
The first message of root node buffer queue is gone out into team, so that the root node queue goes out group queue as first message;
Go out the weighted value of group queue according to message length and first message, update the potential energy value that first message goes out group queue;
Judge that first message goes out after team, the first message goes out whether group queue is empty, when not being space-time,
Go out position of the corresponding node of group queue in the complete binary tree to the first message based on queue potential energy value to adjust It is whole so that the potential energy value of all father nodes is respectively less than the potential energy value equal to child node on complete binary tree.
2. the method as described in claim 1, it is characterised in that when message is joined the team, carries out scheduling of joining the team, this method includes:
By message buffering a to empty queue, so that the empty queue turns into the queue of congestion first;
Using the queue of the congestion first as a node of complete binary tree, it is added to using queue potential energy as the complete of key value Behind last node of binary tree;
Position of the corresponding node of queue of the congestion first in the complete binary tree is adjusted based on queue potential energy value It is whole so that the potential energy value of all father nodes is respectively less than the potential energy value equal to child node on complete binary tree.
3. the method as described in claim 1, it is characterised in that this method further comprises:
After first message goes out team, it is sky that the first message, which goes out group queue, and described in the empty first message is gone out when group queue is removed Complete binary tree is not space-time:
The first message is gone out into the corresponding node of group queue to remove, last node on complete binary tree is moved on to the position of root node Put;
Position of the root node position node in the complete binary tree is moved to this to be adjusted, make based on queue potential energy value The potential energy value for obtaining all father nodes on complete binary tree is respectively less than the potential energy value for being equal to child node.
4. the method as described in claim 1, it is characterised in that this method further comprises:
After first message goes out team, it is sky that the first message, which goes out group queue, and described in the empty first message is gone out when group queue is removed Complete binary tree is also space-time:
The first message is gone out into the corresponding node of group queue to remove, the first message is gone out into corresponding renewal potential energy before group queue is removed It is worth the initial potential energy as complete binary tree.
5. method as claimed in claim 4, it is characterised in that the weight for going out group queue according to message length and first message Value, updating the method for the potential energy value that first message goes out group queue includes:
According to PUpdate=P+W*L, wherein, W represents that first message goes out the weighted value of group queue, and L represents the length of message, PUpdateRepresent with The potential energy value that the first message goes out before group queue renewal carries out the cumulative of W and L product, with PUpdateGo out the potential energy of group queue to first message Value is updated.
6. a kind of queue scheduling device, the queue is Weight Round Robin WRR queues, it is characterised in that the device includes:
Tree sets up module, for setting up the complete binary tree using queue potential energy as key value, the node of the complete binary tree with Congestion queue is corresponded;
Queue scheduling module, during for joining the team or go out group in message, based on queue potential energy value to the corresponding node of the queue Position in the complete binary tree is adjusted so that the potential energy value of all father nodes, which is respectively less than, on complete binary tree is equal to The potential energy value of child node;
Wherein, when message goes out group, team's scheduling is carried out out, the queue scheduling module further comprises:
First message goes out group unit, for the first message of root node buffer queue to be gone out into team, is reported for the first time so that the root node queue turns into Text goes out group queue;
Queue potential energy updating block, the weighted value for going out group queue according to message length and first message updates first message and goes out team The potential energy value of queue;
Confirmation unit, for judging that first message goes out after team, the first message goes out whether group queue is empty;
Go out group scheduling unit, for after confirmation unit judges that first message goes out team, it to be not space-time that the first message, which goes out group queue, is based on Queue potential energy value goes out position of the corresponding node of group queue in the complete binary tree to the first message and is adjusted so that complete The potential energy value of all father nodes is respectively less than the potential energy value equal to child node on full binary tree.
7. device as claimed in claim 6, it is characterised in that when message is joined the team, carries out join the team scheduling, the queue scheduling Module further comprises:
Buffer cell, for by message buffering a to empty queue, so that the empty queue turns into the queue of congestion first;
Enter heap scheduling unit, for the queue of the congestion first, as a node of complete binary tree, to be added to queue Behind last node of potential energy for the complete binary tree of key value;Queue based on queue potential energy value to the congestion first Position of the corresponding node in the complete binary tree is adjusted so that the potential energy value of all father nodes on complete binary tree Respectively less than it is equal to the potential energy value of child node.
8. device as claimed in claim 6, it is characterised in that
It is described go out group scheduling unit, be additionally operable to after confirmation unit judges that first message goes out team, the first message go out group queue for sky, and It not is space-time the empty first message is gone out into complete binary tree when group queue is removed, the first message is gone out into group queue corresponding Node is removed, and last node on complete binary tree is moved on to the position of root node;This is moved to based on queue potential energy value Position of the root node position node in the complete binary tree is adjusted so that the gesture of all father nodes on complete binary tree The potential energy value being respectively less than equal to child node can be worth.
9. device as claimed in claim 6, it is characterised in that
It is described go out group scheduling unit, be additionally operable to after confirmation unit judges that first message goes out team, the first message go out group queue for sky, and Also it is space-time the empty first message is gone out into complete binary tree when group queue is removed, the first message is gone out into group queue corresponding Node is removed, and the first message is gone out to initial potential energy of the corresponding renewal potential energy value as complete binary tree before group queue is removed.
10. device as claimed in claim 9, it is characterised in that the queue potential energy updating block specifically for:
According to PUpdate=P+W*L, wherein, W represents that first message goes out the weighted value of group queue, and L represents the length of message, PUpdateRepresent with The potential energy value that the first message goes out before group queue renewal carries out the cumulative of W and L product, with PUpdateGo out the potential energy of group queue to first message Value is updated.
CN201410411353.0A 2014-08-20 2014-08-20 A kind of array dispatching method and device Active CN104144134B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410411353.0A CN104144134B (en) 2014-08-20 2014-08-20 A kind of array dispatching method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410411353.0A CN104144134B (en) 2014-08-20 2014-08-20 A kind of array dispatching method and device

Publications (2)

Publication Number Publication Date
CN104144134A CN104144134A (en) 2014-11-12
CN104144134B true CN104144134B (en) 2017-10-03

Family

ID=51853202

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410411353.0A Active CN104144134B (en) 2014-08-20 2014-08-20 A kind of array dispatching method and device

Country Status (1)

Country Link
CN (1) CN104144134B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108762953B (en) * 2018-05-25 2022-03-15 连云港杰瑞电子有限公司 Message queue realizing method
CN110688209B (en) * 2019-09-10 2022-09-13 无锡江南计算技术研究所 Binary tree-based large-window access flow scheduling buffer structure and method
CN111314245B (en) * 2020-01-17 2023-10-24 鹏城实验室 Message scheduling method and device, storage medium and electronic equipment

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101374109A (en) * 2008-10-07 2009-02-25 中兴通讯股份有限公司 Method and apparatus for scheduling packets
CN101521627A (en) * 2009-04-13 2009-09-02 华为技术有限公司 Method and device for inserting nodes
CN103716237A (en) * 2013-12-25 2014-04-09 广东天拓资讯科技有限公司 Path-finding method and device utilizing binary heap sorting

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101374109A (en) * 2008-10-07 2009-02-25 中兴通讯股份有限公司 Method and apparatus for scheduling packets
CN101521627A (en) * 2009-04-13 2009-09-02 华为技术有限公司 Method and device for inserting nodes
CN103716237A (en) * 2013-12-25 2014-04-09 广东天拓资讯科技有限公司 Path-finding method and device utilizing binary heap sorting

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
Implementing a Heap-Based WRR Scheduling Mechanism:Part 1;Sailesh Kumar;《EETimes》;20030827;正文第一部分:WRR概述,第四部分:WRR实现,第五部分:限制1:节点交换冲突,图1,图2 *
Implementing a Heap-Based WRR Scheduling Mechanism:Part 2;Sailesh Kumar;《EETimes》;20030828;全文 *

Also Published As

Publication number Publication date
CN104144134A (en) 2014-11-12

Similar Documents

Publication Publication Date Title
CN104144134B (en) A kind of array dispatching method and device
CN104506496B (en) The method of near-realtime data increment distribution based on Oracle Streams technologies
WO2011065746A3 (en) Method for recovering a frame that failed to be transmitted in a mu-mimo based wireless communication system
CN103748845B (en) Packet sending and receiving method, device and system
CN105429909A (en) Polychromatic color-based parallel exchange scheduling method
CN102868645A (en) Open flow switchboard system and message processing method of open flow switchboard system
CN103199968A (en) Sending method of messages and system
CN101707750B (en) Flow control method based on cross operator SMS application
CN101719876B (en) Network communication dispatching method and system
CN102970244A (en) Network message processing method of multi-CPU (Central Processing Unit) inter-core load balance
CN111193971B (en) Machine learning-oriented distributed computing interconnection network system and communication method
CN102143185B (en) Data transmission method and data transmission device
CN104270344A (en) Quintillion gatekeeper
CN103596223A (en) Cellular network mobile device energy consumption optimization method with controllable dispatch sequence
CN101582826A (en) Data transmission method based on dynamic binary tree child-nephew two-channel in internet classroom
CN203340113U (en) Source server system for through intranet-extranet long-distance data transmission and target server system
CN103905330A (en) Multi-terminal cooperative communication service distribution proportion acquiring method and server
CN103368838B (en) A kind of Delay Tolerant Network retransmission method based on weighting socialgram
CN101931585B (en) Cell order maintaining method and device
CN105184073A (en) Wave variable calculation method for variable advantage factor double teleoperation
CN107943829A (en) A kind of cross-safety zone database synchronization method
Yang et al. Modeling and performance analysis of statistical priority-based multiple access protocol
CN104270320B (en) A kind of method of distributed communication system active flow control
CN107959699A (en) A kind of WebSocket data delivery systems and method based on Stream Processing
CN105245423B (en) 1553B bus message transmission optimization methods based on maximum allocated distance algorithm

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information
CB02 Change of applicant information

Address after: 310052 Binjiang District Changhe Road, Zhejiang, China, No. 466, No.

Applicant after: Xinhua three Technology Co., Ltd.

Address before: 310052 Binjiang District Changhe Road, Zhejiang, China, No. 466, No.

Applicant before: Huasan Communication Technology Co., Ltd.

GR01 Patent grant
GR01 Patent grant