Summary of the invention
When various application distribute bandwidth for correlation technique, can not be to the application priority allocation bandwidth of high priority, thereby so that E-Packeting, the application of high priority postpones very large problem, effective solution is not yet proposed at present, for this reason, main purpose of the present invention is to provide a kind of method and device that distributes bandwidth, to address the above problem.
To achieve these goals, according to an aspect of the present invention, a kind of method of distributing bandwidth is provided, the method comprises: the image parameter that reads distribution object, wherein, image parameter comprises: priority parameters, distribution number of times and partition size parameter, and priority parameters is used for the distribution priority of expression distribution object; Read the allocation proportion parameter corresponding with priority parameters; Partition size parameter and allocation proportion parameter are distributed token computation, distribute the token parameter to obtain; According to distributing the token parameter and distributing number of times to carry out bandwidth calculation, to obtain bandwidth parameter; The utilized bandwidth parameter is that distribution object distributes bandwidth.
Further, partition size parameter and allocation proportion parameter are distributed token computation, distribute the step of token parameter to comprise to obtain: to distribute token computation by following formula, distribute token parameter Token_quantum:Token_quantum=n*m to obtain, wherein, n is the partition size parameter, and m is the allocation proportion parameter.
Further, according to distributing the token parameter and distributing number of times to carry out bandwidth calculation, comprise with the step of obtaining bandwidth parameter: carry out bandwidth calculation by following formula, to obtain bandwidth parameter Token_deficit:
Token_deficit=Token_quantum*(j+1), wherein, j is for distributing number of times, and the initial value of j is zero.
Further, before reading the priority parameters corresponding with distribution object, method also comprises: receive distribution object is carried out the distribution request of allocated bandwidth; According to distributing the request detection bandwidth whether residue is arranged, wherein, have in the remaining situation in bandwidth, read the priority parameters corresponding with distribution object.
To achieve these goals, according to an aspect of the present invention, a kind of device that distributes bandwidth is provided, this device comprises: the first read module, be used for reading the image parameter corresponding with distribution object, wherein, image parameter comprises: priority parameters, distribution number of times and partition size parameter, and priority parameters is used for the distribution priority of expression distribution object; The second read module is used for reading the allocation proportion parameter corresponding with priority parameters; The first computing module is used for partition size parameter and allocation proportion parameter are distributed token computation, distributes the token parameter to obtain; The second computing module is used for according to distributing the token parameter and distributing number of times to carry out bandwidth calculation, to obtain bandwidth parameter; The first processing module, being used for the utilized bandwidth parameter is that distribution object distributes bandwidth.
Further, the first computing module is used for distributing token computation by following formula, distributes token parameter Token_quantum to obtain, and formula is: Token_quantum=n*m, and wherein, n is the partition size parameter, m is the allocation proportion parameter.
Further, the second computing module is used for carrying out bandwidth calculation by following formula, and to obtain bandwidth parameter Token_deficit, formula is: Token_deficit=Token_quantum*(j+1), wherein, j is for distributing number of times, and the initial value of j is zero.
Further, device comprises: receiver module is used for receiving distribution object is carried out the distribution request of allocated bandwidth; Detection module is used for according to distribution request detection bandwidth whether residue being arranged, and has in the remaining situation in bandwidth, reads the priority parameters corresponding with distribution object.
By the present invention, obtain the priority parameters of distribution object, and obtain the allocation proportion parameter corresponding with priority parameters, then according to the partition size parameter of distribution object, allocation proportion parameter and distribution number of times calculate and obtain bandwidth parameter, and utilized bandwidth parametric distribution bandwidth, thereby when distributing untapped bandwidth to solve that various application distribute bandwidth in the prior art according to the different proportion of the application of different priorities, can not be to the application priority allocation bandwidth of high priority, thereby so that E-Packeting, the application of high priority postpones very large problem, realized and to have distributed untapped bandwidth according to the priority of different application, sufficient utilized bandwidth, realize taking full advantage of of configured bandwidth, and realized the allocated bandwidth of Priority-based, thereby effectively promoted user's experience.
Embodiment
Need to prove that in the situation of not conflicting, embodiment and the feature among the embodiment among the application can make up mutually.Describe below with reference to the accompanying drawings and in conjunction with the embodiments the present invention in detail.
Fig. 1 is the structural representation according to the device of the distribution bandwidth of the embodiment of the invention.As shown in Figure 1, this device can comprise: the first read module 10, and for the image parameter that reads distribution object, wherein, image parameter comprises: priority parameters, distribution number of times and partition size parameter; The first read module 30 is used for reading the allocation proportion parameter corresponding with priority parameters; The first computing module 50 is used for partition size parameter and allocation proportion parameter are distributed token computation, distributes the token parameter to obtain; The second computing module 70 is used for according to distributing the token parameter and distributing number of times to carry out bandwidth calculation, to obtain bandwidth parameter; The first processing module 90, being used for the utilized bandwidth parameter is that distribution object distributes bandwidth.
Adopt the present invention, after the first read module reads the image parameter of distribution object, the first read module reads the allocation proportion parameter corresponding with priority parameters, then by the first computing module partition size parameter and allocation proportion parameter are distributed token computation, distribute the token parameter to obtain, and by the second computing module according to distributing the token parameter and distributing number of times to carry out bandwidth calculation, to obtain bandwidth parameter, the first processing module utilized bandwidth parameter is that distribution object distributes bandwidth.By the present invention, obtain the priority parameters of distribution object, and obtain the allocation proportion parameter corresponding with priority parameters, then according to the partition size parameter of distribution object, allocation proportion parameter and distribution number of times calculate and obtain bandwidth parameter, and utilized bandwidth parametric distribution bandwidth, thereby when distributing untapped bandwidth to solve that various application distribute bandwidth in the prior art according to the different proportion of the application of different priorities, can not be to the application priority allocation bandwidth of high priority, thereby so that E-Packeting, the application of high priority postpones very large problem, realized and to have distributed untapped bandwidth according to the priority of different application, sufficient utilized bandwidth, realize taking full advantage of of configured bandwidth, and realized the allocated bandwidth of Priority-based, thereby effectively promoted user's experience.
In the above embodiment of the present invention, the first computing module 50 can be used for distributing token computation by following formula, distributes token parameter Token_quantum to obtain, formula is: Token_quantum=n*m, wherein, n is the partition size parameter, and m is the allocation proportion parameter.
According to above-described embodiment of the application, the second computing module 70 can carry out bandwidth calculation by following formula, to obtain bandwidth parameter Token_deficit, formula is: Token_deficit=Token_quantum*(j+1), wherein, j is for distributing number of times, and the initial value of j is zero.
In the above embodiment of the present invention, this device can comprise: receiver module is used for receiving distribution object is carried out the distribution request of allocated bandwidth; Detection module is used for according to distribution request detection bandwidth whether residue being arranged, and has in the remaining situation in bandwidth, reads the priority parameters corresponding with distribution object.
Fig. 2 is that the method comprises the steps: as shown in Figure 2 according to the flow chart of the method for the distribution bandwidth of the embodiment of the invention
Step S102 reads the image parameter of distribution object, and wherein, image parameter comprises: priority parameters, distribute number of times and partition size parameter, priority parameters is used for the distribution priority of expression distribution object.
Step S104 reads the allocation proportion parameter corresponding with priority parameters.
Step S106 distributes token computation to partition size parameter and allocation proportion parameter, distributes the token parameter to obtain.
Step S108 is according to distributing the token parameter and distributing number of times to carry out bandwidth calculation, to obtain bandwidth parameter.
Step S108, the utilized bandwidth parameter is that distribution object distributes bandwidth.
Adopt the method for distribution bandwidth of the present invention, by after reading the image parameter of distribution object, read the allocation proportion parameter corresponding with the priority parameters in the image parameter, then the partition size parameter in the image parameter and allocation proportion parameter are distributed token computation, distribute the token parameter to obtain, and according to distributing the distribution number of times in token parameter and the image parameter to carry out bandwidth calculation, obtaining bandwidth parameter, and the utilized bandwidth parameter is that distribution object distributes bandwidth.By the present invention, obtain the priority parameters of distribution object, and obtain the allocation proportion parameter corresponding with priority parameters, then according to the partition size parameter of distribution object, allocation proportion parameter and distribution number of times calculate and obtain bandwidth parameter, and utilized bandwidth parametric distribution bandwidth, thereby when distributing untapped bandwidth to solve that various application distribute bandwidth in the prior art according to the different proportion of the application of different priorities, can not be to the application priority allocation bandwidth of high priority, thereby so that E-Packeting, the application of high priority postpones very large problem, realized and to have distributed untapped bandwidth according to the priority of different application, sufficient utilized bandwidth, realize taking full advantage of of configured bandwidth, and realized the allocated bandwidth of Priority-based, thereby effectively promoted user's experience.
In the above embodiment of the present invention, before reading the priority parameters corresponding with distribution object, method can also comprise: receive distribution object is carried out the distribution request of allocated bandwidth; According to distributing the request detection bandwidth whether residue is arranged, wherein, have in the remaining situation in bandwidth, read the priority parameters corresponding with distribution object.
In the above embodiment of the present invention, can be based on the distribution bandwidth of the priority of different distribution objects, if the father node of current distribution object has remaining bandwidth, the remaining bandwidth of father node will be distributed for distribution object so, when a plurality of distribution objects distribute bandwidth to the father node request simultaneously, distribute according to the allocation proportion parameter ratio of corresponding different priorities.
In the band width configuration of embodiment one as shown in Figure 3, if the flow of every kind of application in this system has all surpassed configuration, so all can be according to the traffic forwarding message of configuration, be voice and video 50M, HTTP 30M, P2P 20M, the flow of supposing the flow of present voice and video and HTTP is all very large, voice and video is 70M particularly, HTTP is 40M, and the flow that current P2P downloads only has 10M, and total bandwidth also has the 10M bandwidth left so, so in the above embodiment of the present invention, voice and video and HTTP are according to the allocated bandwidth of carrying out of the priority that disposes, if the allocation proportion parameter in the application correspondence of this system's medium priority 1 is 3, the allocation proportion parameter of the application correspondence of priority 2 is 2, and the allocation proportion parameter of the application correspondence of priority 3 is 1, then the ratio of voice and video distribution is 3/(3+2), the ratio that HTTP distributes is 2/(3+2), so the bandwidth that voice and video can distribute is 10M * 3/5=6M, the bandwidth that HTTP distributes is 10M * 2/5=4M.
According to the abovementioned embodiments of the present invention, partition size parameter and allocation proportion parameter are distributed token computation, distribute the step of token parameter to comprise to obtain: to distribute token computation by following formula, distribute token parameter Token_quantum to obtain, formula is: Token_quantum=n*m, wherein, n is the partition size parameter, and m is the allocation proportion parameter.
In the above embodiment of the present invention, according to distributing the token parameter and distributing number of times to carry out bandwidth calculation, can comprise with the step of obtaining bandwidth parameter: carry out bandwidth calculation by following formula, to obtain bandwidth parameter Token_deficit, formula is: Token_deficit=Token_quantum*(j+1), wherein, j is for distributing number of times, and the initial value of j is zero.
Particularly, distribution object for different priorities, can initialization a granularity that distributes bandwidth, and obtain corresponding partition size parameter, then calculate the distribution token parameter of corresponding different priorities by formula Token_quantum=n*m, then the distribution token parameter of different priorities is carried out bandwidth calculation, obtain bandwidth parameter.
For example, exist 0 to 7 to have 8 priority altogether in the supposing the system, corresponding different priority i allocation proportion parameter is: 8-i; It is 64K that initialization distributes the granularity of bandwidth, then corresponding partition size parameter is the token (being ms_64k) of every millisecond of 64K, then the distribution token parameter Token_quantum[i of corresponding different priority i] be: Token_quantum[i]=ms_64k*(8-i).
Then calculate respectively the bandwidth parameter Token_deficit[i of the corresponding different priorities of different distribution number of times j] [j]: Token_deficit[i] [j]=Token_quantum[i] * (j+1), the initial value of j is zero, and distribution number of times j wherein distributes Product-factor.
In the band width configuration of embodiment two as shown in Figure 4, system construction drawing for a multi-layer, nethermost node is leaf node, level is 0, and for intermediate node, level is that the maximum level of following all child nodes adds 1, in system, the priority of node is high priority since 0, and numerical value is larger, and priority is lower; We can be by the bandwidth usage of each node in the real-time monitoring system, the bandwidth usage of each node can directly be used data representation, the bandwidth usage that also can represent by the color of node each node, particularly, if the color of node is red, represent that the bandwidth of this node use is more than or equal to its maximum bandwidth limit; If the color of node is yellow, represent that the bandwidth that this node uses guarantees still less than its maximum bandwidth limit more than or equal to its minimum bandwidth; If the color of node is green, represent that the bandwidth that this node uses guarantees less than its minimum bandwidth.
Only be schematic diagram in the system shown in Fig. 4, level wherein and the child's of each level number can be expanded, and the figure that is not limited to example is described.
Use the method for distribution bandwidth of the present invention, in the process of allocated bandwidth, it is first high priority, the node of low-level distributes bandwidth, configuration as shown in Figure 4: suppose to receive the distribution request of node E, then E is distribution object, if the bandwidth of node F does not take full advantage of, node E at first uses the remaining bandwidth of node F (bandwidth that is node F has residue so, the bandwidth that shows as node C has residue, then node E uses the remaining bandwidth of node C), if in the situation that the bandwidth that satisfies distribution object E is used, the bandwidth of node C also has residue, and Node B and node D can be according to the remaining bandwidth of allocation proportion parametric distribution of correspondence so.
More specifically, suppose receive distribution object E carried out the request of allocated bandwidth after, and the father node C that monitors distribution object has in the situation of remaining bandwidth, if node F has residue, show as so node C and node A has residue, according to high priority, the principle of low-level priority allocation bandwidth, distribution object E can distribute bandwidth to node C request, the original allocation number of times of distribution object E is set to j=0, increase j, the bandwidth of distribution object E distribution is Token_deficit[0 so] [j], if node C has not had remaining bandwidth, then reduce the value of j, at this time the bandwidth of distribution object E distribution allows the bandwidth of node C just satisfy all the time.Node C in this time dynamic equilibrium between yellow and green, node A dynamic equilibrium between redness and green; If the bandwidth that distribution object E uses is also little, can not all use the remaining bandwidth of node F, show as node A and also have bandwidth left, Node B and node D remaining bandwidth of distribution node A proportionally so, the original allocation number of times j of Node B and node D is set to 0, increase to distribute number of times j, Node B and the node D bandwidth of distributing respectively is Token_deficit[2 so] [j] and Token_deficit[3] [j], at this time A dynamic equilibrium between redness and green.
In addition, use the method for distribution bandwidth of the present invention, in the band width configuration of as shown in Figure 5 embodiment three, the up total amount of user's video must not surpass 300M, in the video bandwidth of 300M, preferentially guarantee the first video, and the bandwidth maximum of the first video can be broken through 100M(and mean the bandwidth that can go to tie up the P2P download, but summation still can not surpass 300M); In the first video, preferentially ensure again the second video, maximum can break through 100M(and mean the bandwidth that can remove to tie up other P2P videos).
Need to prove, can in the computer system such as one group of computer executable instructions, carry out in the step shown in the flow chart of accompanying drawing, and, although there is shown logical order in flow process, but in some cases, can carry out step shown or that describe with the order that is different from herein.
From above description, can find out, the present invention has realized following technique effect: by the present invention, obtain the priority parameters of distribution object, and obtain the allocation proportion parameter corresponding with priority parameters, then according to the partition size parameter of distribution object, allocation proportion parameter and distribution number of times calculate and obtain bandwidth parameter, and utilized bandwidth parametric distribution bandwidth, thereby when distributing untapped bandwidth to solve that various application distribute bandwidth in the prior art according to the different proportion of the application of different priorities, can not be to the application priority allocation bandwidth of high priority, thereby so that E-Packeting, the application of high priority postpones very large problem, realized and to have distributed untapped bandwidth according to the priority of different application, sufficient utilized bandwidth, realize taking full advantage of of configured bandwidth, and realized the allocated bandwidth of Priority-based, thereby effectively promoted user's experience.
Obviously, those skilled in the art should be understood that, above-mentioned each module of the present invention or each step can realize with general calculation element, they can concentrate on the single calculation element, perhaps be distributed on the network that a plurality of calculation elements form, alternatively, they can be realized with the executable program code of calculation element, thereby, they can be stored in the storage device and be carried out by calculation element, perhaps they are made into respectively each integrated circuit modules, perhaps a plurality of modules in them or step are made into the single integrated circuit module and realize.Like this, the present invention is not restricted to any specific hardware and software combination.
The above is the preferred embodiments of the present invention only, is not limited to the present invention, and for a person skilled in the art, the present invention can have various modifications and variations.Within the spirit and principles in the present invention all, any modification of doing, be equal to replacement, improvement etc., all should be included within protection scope of the present invention.