The content of the invention
Embodiments of the invention provide a kind of adjustment load balancing uneven method and device, in the uneven feelings of load balancing
Under condition, can quickly realize that load balancing is adjusted, solve the efficiency and low this problem of accuracy rate of load balancing adjustment.
To reach above-mentioned purpose, embodiments of the invention are adopted the following technical scheme that:
In a first aspect, a kind of uneven method of adjustment load balancing, including:
The flow of each load balancing item is obtained, the load balancing item represents the list item of storage service traffics outgoing interface;
Load balancing adjustment is carried out according to the flow of all described load balancing item for getting.
In the first possible implementation of first aspect, the flow for obtaining each load balancing item, including:
Service traffics are received, the service traffics are the flow of incoming interface;
According to preset algorithm, the corresponding relation of the service traffics and the load balancing item, the preset algorithm are obtained
Including Load Sharing Algorithm;
According to the service traffics and the corresponding relation of the load balancing item, the stream of each load balancing item is obtained
Amount.
With reference to the first possible implementation of first aspect, first aspect, second in first aspect may be realized
In mode, before the flow of each load balancing item of acquisition, also include:
The preset configuration ratio of outgoing interface is obtained, the outgoing interface includes the outlet of service traffics;
Determine the corresponding relation of each load balancing item and the outgoing interface.
Second of the first possible implementation, first aspect with reference to first aspect, first aspect may realization side
Formula, in the third possible implementation of first aspect, before the load balancing adjustment is carried out, also includes:
According to described each load balancing item and the corresponding relation of the outgoing interface, the flow of each outgoing interface is obtained, obtained
Ratio is currently configured to the outgoing interface;
When the outgoing interface preset configuration ratio and it is described be currently configured ratio it is different when, determine that present load is shared not
.
Second of the first possible implementation, first aspect with reference to first aspect, first aspect may realization side
Formula, the third possible implementation of first aspect, in the 4th kind of possible implementation of first aspect, it is determined that current negative
Load is shared after inequality, also includes:
The corresponding relation of the load balancing item and the outgoing interface is adjusted, the allocation ratio of rear outgoing interface is adjusted;
When the allocation ratio for adjusting outgoing interface after back loading shares uneven and described adjustment exceedes preset value, after adjustment
The allocation ratio of each outgoing interface be compared with the preset configuration ratio of each outgoing interface;
According to the comparative result on the allocation ratio of each outgoing interface and the preset configuration ratio of each outgoing interface, obtain
The outgoing interface of maximum or minimum to ratio, on the outgoing interface of or minimum maximum in the ratio, increases or decreases the load point
Load item.
A kind of second aspect, there is provided the uneven device of adjustment load balancing, including:
Acquiring unit, for obtaining the flow of each load balancing item, the load balancing item represents storage service traffics
The list item of outgoing interface;
Adjustment unit, the flow of all described load balancing item for being got according to the acquiring unit is loaded
Share adjustment.
In the first possible implementation of second aspect, the acquiring unit, including:
Receiving subelement, for receiving service traffics, the service traffics are the flow of incoming interface;
Subelement is obtained, the service traffics are corresponding with the load balancing item to close for according to preset algorithm, obtaining
System, the preset algorithm includes Load Sharing Algorithm;And the flow of each load balancing item described in obtaining.
The first possible implementation with reference to first aspect, first aspect, may realize in second of first aspect
In mode, the device also includes:
The acquiring unit, is additionally operable to obtain the preset configuration ratio of outgoing interface, and the outgoing interface includes service traffics
Outlet;
Determining unit, for determining the corresponding relation of each load balancing item and the outgoing interface.
Second of the first possible implementation, first aspect with reference to first aspect, first aspect may realization side
Formula, in the third possible implementation of first aspect, including:
The acquiring unit, was additionally operable to before the adjustment unit carries out load balancing adjustment, according to it is described each bear
Load shares item and the corresponding relation of the outgoing interface, obtains the flow of each outgoing interface, obtains being currently configured for the outgoing interface
Ratio;
The determining unit, is additionally operable to described in preset configuration ratio when the outgoing interface and the acquiring unit obtain
When being currently configured ratio difference of outgoing interface, determines that inequality is shared in present load.
Second of the first possible implementation, first aspect with reference to first aspect, first aspect may realization side
Formula, the third possible implementation of first aspect, the 4th kind of first aspect may in the side of realization, including:
The adjustment unit, is additionally operable to after it is determined that inequality is shared in present load, adjusts the load balancing item and institute
The corresponding relation of outgoing interface is stated, the allocation ratio of rear outgoing interface is adjusted;
The device also includes:
Comparing unit, for presetting when the allocation ratio for adjusting outgoing interface after back loading shares the uneven and adjustment exceedes
During value, the allocation ratio of each outgoing interface after adjustment is compared with the preset configuration ratio of each outgoing interface;
Processing unit, the allocation ratio for each outgoing interface described in being obtained according to the comparing unit goes out to connect with each
Comparative result in the preset configuration ratio of mouth, obtains the outgoing interface of ratio maximum or minimum, maximum or minimum in the ratio
Outgoing interface on, increase or decrease the load balancing item.
The uneven method and device of adjustment load balancing provided in an embodiment of the present invention, receive incoming interface flow it
Afterwards, by flow and load balancing item corresponding relation, the statistics flow of each load balancing item is obtained, and then according to each load
Sharing the statistics flow of item carries out load balancing adjustment.Technical solution of the present invention, in the case of load balancing inequality, can be fast
Speed realizes that load balancing is adjusted, and when carrying out load balancing adjustment so as to solve prior art, efficiency and low this of accuracy rate are asked
Topic.
Specific embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is carried out clear, complete
Site preparation is described, it is clear that described embodiment is only a part of embodiment of the invention, rather than the embodiment of whole.It is based on
Embodiment in the present invention, it is every other that those of ordinary skill in the art are obtained under the premise of creative work is not made
Embodiment, belongs to the scope of protection of the invention.
One embodiment of the invention provides a kind of uneven method of adjustment load balancing, as shown in figure 1, the method includes:
101st, the flow of each load balancing item is obtained.
Wherein, load balancing item represents the list item of storage service traffics outgoing interface, positioned at the veneer of each flow incoming interface
On, and the outgoing interface of several load balancing item storages is identical.
102nd, load balancing adjustment is carried out according to the flow of all load balancing items for getting.
Wherein, carrying out load balancing adjustment includes:
A, according to the corresponding relation of load balancing item and outgoing interface, obtain the current flow of each outgoing interface;
B, current allocation ratio is calculated according to present flow rate;
After current allocation ratio is got, the pre-configured ratio to being currently configured ratio and outgoing interface compares
Compared with.
C, when current allocation ratio is different with the pre-configured ratio of outgoing interface, adjust outgoing interface with load balancing item
Corresponding relation, it becomes possible to adjust the allocation ratio of outgoing interface so as to can be identical with pre-configured ratio or connect in allowed band
Closely, that is, the allocation ratio of the outgoing interface after adjusting.
What deserves to be explained is, when the allocation ratio of the outgoing interface after adjustment exceedes preset value, each after adjustment is gone out
The allocation ratio of interface is compared;The outgoing interface that ratio is maximum or ratio is minimum is obtained, and it is maximum or minimum in the ratio
A load balancing item is increased or decreased on outgoing interface.
The uneven method of adjustment load balancing provided in an embodiment of the present invention, after the flow for receiving incoming interface, leads to
Inflow-rate of water turbine and load balancing item corresponding relation, obtain the statistics flow of each load balancing item, and then according to each load balancing
The statistics flow of item carries out load balancing adjustment.Technical solution of the present invention, in the case of load balancing inequality, can be quickly real
Existing load balancing adjustment, when carrying out load balancing and adjust so as to solve prior art, efficiency and low this problem of accuracy rate.
Another embodiment of the present invention provides a kind of uneven method of adjustment load balancing, as shown in Fig. 2 the method bag
Include:
201st, service traffics are received.
Wherein, service traffics are the flow of incoming interface.
202nd, according to preset algorithm, the corresponding relation of the service traffics and the load balancing item is obtained.
Optionally, preset algorithm includes Load Sharing Algorithm, and the algorithm can be hash algorithm, can obtain from the algorithm
Obtain the corresponding relation of service traffics and load balancing item.
203rd, according to the service traffics and the corresponding relation of the load balancing item, the stream of each load balancing item is obtained
Amount.
Wherein, according to service traffics and the corresponding relation of load balancing item, the method by adding up to be added, you can obtain every
The flow of individual load balancing item.
204th, according to each load balancing item and the corresponding relation of outgoing interface, the flow of each outgoing interface is obtained, obtains institute
That states outgoing interface is currently configured ratio.
What deserves to be explained is, the flow of each outgoing interface is obtained herein, in above-mentioned 203, obtain each load balancing item
Flow it is identical, i.e., equally do addition process.And then the flow to all outgoing interfaces carries out ratio calculation, obtains factor number and goes out
Interface quantity identical, the most simple ratio of one group of data.
Further, when outgoing interface preset configuration ratio and it is described be currently configured ratio it is different when, determine present load
Share and be not performed both by following 205.
205th, load balancing adjustment is carried out.
Specifically, carrying out load balancing adjustment includes:
A, adjustment load balancing item and the corresponding relation of the outgoing interface, are adjusted the allocation ratio of rear outgoing interface.
B, when adjust back loading share inequality and adjust after outgoing interface allocation ratio exceed preset value when, after adjustment
The allocation ratio of each outgoing interface is compared with the preset configuration ratio of each outgoing interface.
C, combine b, obtain that ratio is maximum or outgoing interface of minimum, on the outgoing interface of or minimum maximum in ratio, increase or
Reduce load balancing item.
Optionally, in 205 load balancing adjustment implementation, it is including but not limited to following two:
The first implementation:Dynamic adjustment, the implementation of dynamic adjustment includes being realized by the way of permutation and combination.
Second implementation:Manually adjust, refer to what user was carried out according to the statistics flow of each load balancing item, load
Share the adjustment of item and the corresponding relation of outgoing interface.
What deserves to be explained is, adjust the corresponding relation of load balancing item and outgoing interface, that is, adjust the position of outgoing interface, adjustment
The number of outgoing interface.
The uneven method of adjustment load balancing provided in an embodiment of the present invention, after the flow for receiving incoming interface, leads to
Inflow-rate of water turbine and load balancing item corresponding relation, obtain the statistics flow of each load balancing item, and then according to each load balancing
The statistics flow of item carries out load balancing adjustment.Technical solution of the present invention, in the case of load balancing inequality, can be quickly real
Existing load balancing adjustment, when carrying out load balancing and adjust so as to solve prior art, efficiency and low this problem of accuracy rate.
Another embodiment of the present invention provides a kind of uneven method of adjustment load balancing, the method can apply with it is concrete
In example.The method to implement flow process as follows:
In the present embodiment, Load Sharing Algorithm is hash algorithm.And comprising 4 outgoing interfaces, be designated as respectively, B, C, D, and
The preset configuration ratio of outgoing interface is:A: B: C: D=3: 2: 2: 1, the number of load balancing item is outgoing interface weight sum, as
8.
And according to load balancing item and the corresponding relation of service traffics, obtain the statistics flow of each load balancing item such as
Under:
The statistics flow of load balancing item 1 is 200M;
The statistics flow of load balancing item 2 is 0M;
The statistics flow of load balancing item 3 is 250M;
The statistics flow of load balancing item 4 is 420M;
The statistics flow of load balancing item 5 is 180M;
The statistics flow of load balancing item 6 is 150M;
The statistics flow of load balancing item 7 is 50M;
The statistics flow of load balancing item 8 is 400M.
And according to hash algorithm, load balancing item is that load balancing item 1-3, correspondence goes out to connect with the corresponding relation of outgoing interface
Mouth A, load balancing item correspondence outgoing interface B, load balancing item 6,7, correspondence outgoing interface C, load balancing item 8, correspondence outgoing interface D,
The actual flow for then obtaining current outgoing interface A, B, C, D is followed successively by:450M, 600M, 200M, 400M, then corresponding outgoing interface
Current allocation ratio be 450: 600: 200: 400=2.2: 3: 1: 2, different from preset configuration ratio.Then adjustment load point
The corresponding relation of item and outgoing interface is carried on a shoulder pole, Adjustment principle is:So that the allocation ratio of the outgoing interface after adjustment is default with outgoing interface
Allocation ratio is identical or as close possible to adjustment mode includes:Dynamic adjustment is manually adjusted, adjustment now for outgoing interface
Position.
Load balancing item after adjustment is with the corresponding relation of outgoing interface:The corresponding outgoing interface D of load balancing item 1;Load point
Load item 2,8 corresponding outgoing interface C, load balancing item 3,6 corresponding outgoing interface B, load balancing item 4,5,7 corresponding outgoing interface A.Then adjust
Flow afterwards is:A=650M, B=400M, C=400M, D=200M, substantially conform to, and A: B: C: D=3: 2: 2: 1, such as the institute of table 1
Show, then it is assumed that this Adjusted Option is preferred plan, without the need for subsequently being adjusted.
Table 1
The uneven method of adjustment load balancing provided in an embodiment of the present invention, after the flow for receiving incoming interface, leads to
Inflow-rate of water turbine and load balancing item corresponding relation, obtain the statistics flow of each load balancing item, and then according to each load balancing
The statistics flow of item carries out load balancing adjustment.Technical solution of the present invention, in the case of load balancing inequality, can be quickly real
Existing load balancing adjustment, when carrying out load balancing and adjust so as to solve prior art, efficiency and low this problem of accuracy rate.
Another embodiment of the present invention provides a kind of uneven device of adjustment load balancing, as shown in figure 3, the device bag
Include:Acquiring unit 31, adjustment unit 32.
Acquiring unit 31, for obtaining the flow of each load balancing item.
Wherein, load balancing item represents the list item of storage service traffics outgoing interface, positioned at the veneer of each flow incoming interface
On, and multiple load balancing items can share an outgoing interface.
Adjustment unit 32, the flow of all load balancing items for being got according to the acquiring unit 31 is loaded
Share adjustment.
Optionally, as shown in figure 4, the acquiring unit 31, including:Receiving subelement 311, acquisition subelement 312;The dress
Putting also includes:Determining unit 33, comparing unit 34, processing unit 35.
Receiving subelement 311, for receiving service traffics.
Optionally, service traffics are the flow of incoming interface.
Subelement 312 is obtained, for according to preset algorithm, obtaining the service traffics corresponding with the load balancing item
Relation, and obtain the flow of each load balancing item.
Wherein, preset algorithm includes Load Sharing Algorithm.
Determining unit 33, for determining the corresponding relation of each load balancing item and the outgoing interface.
Optionally,
The acquiring unit 31, was additionally operable to before the adjustment unit 32 carries out load balancing adjustment, according to described every
Individual load balancing item and the corresponding relation of the outgoing interface, obtain the flow of each outgoing interface, obtain the current of the outgoing interface
Allocation ratio.
The determining unit 33, is additionally operable to what preset configuration ratio when the outgoing interface and the acquiring unit 31 were obtained
When being currently configured ratio difference of the outgoing interface, determines that inequality is shared in present load.
Optionally, the adjustment unit 32, is additionally operable to after it is determined that inequality is shared in present load, adjusts the load point
Load item and the corresponding relation of the outgoing interface, are adjusted the allocation ratio of rear outgoing interface.
Comparing unit 34, for when the adjustment unit 32, adjustment back loading to share outgoing interface after uneven and described adjustment
Allocation ratio when exceeding preset value, the preset configuration ratio to the allocation ratio of each outgoing interface after adjustment and each outgoing interface
Example is compared.
Processing unit 35, allocation ratio for each outgoing interface described in being obtained according to the comparing unit 34 and each
Comparative result in the preset configuration ratio of outgoing interface, obtains that ratio is maximum or outgoing interface of minimum, the ratio it is maximum or
On minimum outgoing interface, the load balancing item is increased or decreased.
The uneven device of adjustment load balancing provided in an embodiment of the present invention, after the flow for receiving incoming interface, leads to
Inflow-rate of water turbine and load balancing item corresponding relation, obtain the statistics flow of each load balancing item, and then according to each load balancing
The statistics flow of item carries out load balancing adjustment.Technical solution of the present invention, in the case of load balancing inequality, can be quickly real
Existing load balancing adjustment, when carrying out load balancing and adjust so as to solve prior art, efficiency and low this problem of accuracy rate.
Another embodiment of the present invention provides a kind of uneven device of adjustment load balancing, as shown in figure 5, the device bag
Include:Receptor 01, processor 02, memorizer 03.
Receptor 01, for receiving service traffics.
Optionally, the service traffics are the flow of incoming interface.
Memorizer 03, for storing the service traffics of the reception of the receptor 01.
Processor 02, for obtaining the preset configuration ratio of outgoing interface, determines that each load balancing item is right with outgoing interface
Should be related to;Further according to preset algorithm, the service traffics that the receptor 01 is received are corresponding with load balancing item to close
System;And according to the corresponding relation, obtain the flow of each load balancing item.
Optionally, the outgoing interface includes the outlet of service traffics;The processor 02, the preset algorithm for using includes negative
Carry Sharing Algorithm.
The processor 02, specifically for according to described each load balancing item and the corresponding relation of the outgoing interface, obtaining
The flow of each outgoing interface is taken, obtain the outgoing interface is currently configured ratio.When the outgoing interface preset configuration ratio with
It is described be currently configured ratio it is different when, determine that inequality is shared in present load.
The corresponding relation of the load balancing item and the outgoing interface is further adjusted, the configuration ratio of rear outgoing interface is adjusted
Example;When the allocation ratio for adjusting back loading and sharing outgoing interface after uneven and described adjustment exceedes preset value, to adjustment after it is every
The allocation ratio of individual outgoing interface is compared with the preset configuration ratio of each outgoing interface;According to the configuration of each outgoing interface
Comparative result in the preset configuration ratio of ratio and each outgoing interface, obtains the outgoing interface of ratio maximum or minimum, described
On the outgoing interface of ratio maximum or minimum, the load balancing item is increased or decreased.
The memorizer 03, for store outgoing interface ratio, preset configuration ratio, and the processor are currently configured
02, the comparative result for obtaining.
The uneven device of adjustment load balancing provided in an embodiment of the present invention, receptor receive incoming interface flow it
Afterwards, processor obtains the statistics flow of each load balancing item by flow and load balancing item corresponding relation, and then according to every
The statistics flow of individual load balancing item carries out load balancing adjustment.Technical solution of the present invention, in the case of load balancing inequality,
Can quickly realize that load balancing is adjusted, when carrying out load balancing adjustment so as to solve prior art, efficiency and accuracy rate are low
This problem.
Through the above description of the embodiments, those skilled in the art can be understood that the present invention can be borrowed
Software is helped to add the mode of required common hardware to realize, naturally it is also possible to which by hardware, but in many cases the former is more preferably
Embodiment.Based on such understanding, the portion that technical scheme substantially contributes in other words to prior art
Dividing can be embodied in the form of software product, and the computer software product is stored in the storage medium that can read, and such as be counted
The floppy disk of calculation machine, hard disk or CD etc., including some instructions are used so that computer equipment (can be personal computer,
Server, or the network equipment etc.) perform method described in each embodiment of the invention.
The above, the only specific embodiment of the present invention, but protection scope of the present invention is not limited thereto, any
Those familiar with the art the invention discloses technical scope in, change or replacement can be readily occurred in, all should contain
Cover within protection scope of the present invention.Therefore, protection scope of the present invention should be defined by the scope of the claims.